Simplify weak lever
authorprotonspring <mike@whiteley.org>
Thu, 25 Jul 2019 22:27:46 +0000 (16:27 -0600)
committerSt├ęphane Nicolet <stephanenicoletsuriphone@gmail.com>
Sun, 28 Jul 2019 17:48:57 +0000 (19:48 +0200)
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

src/pawns.cpp

index 9755c2ec2e0e20258f046610797efb40a40c65e7..86c4b8ef2520eba9a1b64bf231ca93e5f2aadc16 100644 (file)
@@ -70,7 +70,7 @@ namespace {
     constexpr Color     Them = (Us == WHITE ? BLACK : WHITE);
     constexpr Direction Up   = (Us == WHITE ? NORTH : SOUTH);
 
     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;
     Bitboard lever, leverPush;
     Square s;
     bool opposed, backward, passed;
@@ -145,11 +145,10 @@ namespace {
             score -= Doubled;
     }
 
             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;
   }
 
     return score;
   }