1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-01 17:19:36 +00:00

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.
This commit is contained in:
Torsten Franz 2018-03-05 14:10:13 +01:00 committed by Stéphane Nicolet
parent d42e6338ea
commit 56a104e2e0

View file

@ -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<ALL_PIECES>(Us) - 2 * pe->open_files();
Score score = make_score(bonus * weight * weight / 16, 0);
if (T)