X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=2b901bbd166777ad311a2a691bf69538084c48fb;hp=0ee89e4d8236999815797272c92efe1c772c4c5e;hb=56a104e2e0c3ec8b156ca1bee0e26c1378459550;hpb=d42e6338ea2ac347e682475473dbc7b088b6985e 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)