From: Torsten Franz Date: Mon, 5 Mar 2018 13:10:13 +0000 (+0100) Subject: Remove popcount trick from space evaluation X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=56a104e2e0c3ec8b156ca1bee0e26c1378459550 Remove popcount trick from space evaluation Similar removal of superposition code trick as in the "Simplify tropism computation" patch. This simplification of the space() function will allow us to specify space masks which can reach into enemy territory. passed STC: LLR: 3.38 (-2.94,2.94) [-3.00,1.00] Total: 184630 W: 40581 L: 40758 D: 103291 http://tests.stockfishchess.org/tests/view/5a8433360ebc590297cc80c5 passed LTC: LLR: 2.95 (-2.94,2.94) [-3.00,1.00] Total: 231799 W: 37647 L: 37858 D: 156294 http://tests.stockfishchess.org/tests/view/5a96a34a0ebc590297cc8cfd No functional change. --- diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 0ee89e4d..2b901bbd 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -726,12 +726,9 @@ namespace { behind |= (Us == WHITE ? behind >> 8 : behind << 8); behind |= (Us == WHITE ? behind >> 16 : behind << 16); - // Since SpaceMask[Us] is fully on our half of the board... - assert(unsigned(safe >> (Us == WHITE ? 32 : 0)) == 0); - - // ...count safe + (behind & safe) with a single popcount. - int bonus = popcount((Us == WHITE ? safe << 32 : safe >> 32) | (behind & safe)); + int bonus = popcount(safe) + popcount(behind & safe); int weight = pos.count(Us) - 2 * pe->open_files(); + Score score = make_score(bonus * weight * weight / 16, 0); if (T)