From: protonspring Date: Thu, 25 Jul 2019 22:27:46 +0000 (-0600) Subject: Simplify weak lever X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=d980d7c0d4b2efe7abe26bdd094859f6d888ee60;ds=sidebyside Simplify weak lever STC LLR: 2.95 (-2.94,2.94) [-3.00,1.00] Total: 14844 W: 3347 L: 3212 D: 8285 http://tests.stockfishchess.org/tests/view/5d3a2d7b0ebc5925cf0f1632 LTC LLR: 2.95 (-2.94,2.94) [-3.00,1.00] Total: 55261 W: 9374 L: 9309 D: 36578 http://tests.stockfishchess.org/tests/view/5d3a3d9e0ebc5925cf0f1786 Closes https://github.com/official-stockfish/Stockfish/pull/2257 bench: 3484124 --- diff --git a/src/pawns.cpp b/src/pawns.cpp index 9755c2ec..86c4b8ef 100644 --- a/src/pawns.cpp +++ b/src/pawns.cpp @@ -70,7 +70,7 @@ namespace { constexpr Color Them = (Us == WHITE ? BLACK : WHITE); constexpr Direction Up = (Us == WHITE ? NORTH : SOUTH); - Bitboard b, neighbours, stoppers, doubled, support, phalanx; + Bitboard neighbours, stoppers, doubled, support, phalanx; Bitboard lever, leverPush; Square s; bool opposed, backward, passed; @@ -145,11 +145,10 @@ namespace { score -= Doubled; } - // Penalize the unsupported and non passed pawns attacked twice by the enemy - b = ourPawns - & doubleAttackThem - & ~(e->pawnAttacks[Us] | e->passedPawns[Us]); - score -= WeakLever * popcount(b); + // Penalize our unsupported pawns attacked twice by enemy pawns + score -= WeakLever * popcount( ourPawns + & doubleAttackThem + & ~e->pawnAttacks[Us]); return score; }