From 0365b086017da2f5b0aeae6e396a213b56673c72 Mon Sep 17 00:00:00 2001 From: Alain SAVARD Date: Fri, 20 Jul 2018 19:57:45 -0400 Subject: [PATCH] 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 --- src/evaluate.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 5ceb9ae1..95729e4a 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -557,10 +557,7 @@ namespace { 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); } -- 2.39.2