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

Simplify the "overload" condition

This is a follow-up of the previous pull request (#1686) by Miguel.
We simplify the "Overload" bonus condition by re-using the "weak"
variable, which captures well the essence of the overload condition.
This may also be a small speed optimization because the weak variable
is in a register at this point of the code.

http://tests.stockfishchess.org/tests/view/5b527b440ebc5902bdb7f7db
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 10925 W: 2517 L: 2374 D: 6034

http://tests.stockfishchess.org/tests/view/5b527f930ebc5902bdb7f883
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 15569 W: 2697 L: 2568 D: 10304

Closes https://github.com/official-stockfish/Stockfish/pull/1687

Bench: 5010472
This commit is contained in:
Alain SAVARD 2018-07-20 19:57:45 -04:00 committed by Stéphane Nicolet
parent 41bc0d5660
commit 0365b08601

View file

@ -557,10 +557,7 @@ namespace {
score += Hanging * popcount(weak & ~attackedBy[Them][ALL_PIECES]); score += Hanging * popcount(weak & ~attackedBy[Them][ALL_PIECES]);
// Bonus for overload (non-pawn enemies attacked once or more and defended exactly once) b = weak & nonPawnEnemies & attackedBy[Them][ALL_PIECES];
b = nonPawnEnemies
& attackedBy[Us][ALL_PIECES]
& attackedBy[Them][ALL_PIECES] & ~attackedBy2[Them];
score += Overload * popcount(b); score += Overload * popcount(b);
} }