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
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 = nonPawnEnemies
- & attackedBy[Us][ALL_PIECES]
- & attackedBy[Them][ALL_PIECES] & ~attackedBy2[Them];
+ b = weak & nonPawnEnemies & attackedBy[Them][ALL_PIECES];
score += Overload * popcount(b);
}
score += Overload * popcount(b);
}