Count only the most advanced passed pawn for each file.
authorVizvezdenec <Vizvezdenec@gmail.com>
Sun, 29 Mar 2020 17:04:20 +0000 (20:04 +0300)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Sun, 29 Mar 2020 17:48:01 +0000 (19:48 +0200)
This patch adjusts definition of passed pawns - if there is a pawn of our color in the same file in front of a current pawn it's no longer counts as passed.

passed STC
https://tests.stockfishchess.org/tests/view/5e802037e42a5c3b3ca2ed07
LLR: 2.94 (-2.94,2.94) {-0.50,1.50}
Total: 215296 W: 41843 L: 41341 D: 132112
Ptnml(0-2): 3688, 25313, 49304, 25495, 3848

passed LTC
https://tests.stockfishchess.org/tests/view/5e806441e42a5c3b3ca2ed2b
LLR: 2.95 (-2.94,2.94) {0.25,1.75}
Total: 74050 W: 9761 L: 9379 D: 54910
Ptnml(0-2): 510, 6838, 22025, 7064, 588

closes https://github.com/official-stockfish/Stockfish/pull/2602

bench: 4902237

src/pawns.cpp

index 560fd76b171fc80306f92aee1716ae9cbcd15997..3023021d408a853a93c2294c73f4bec74b01aa50 100644 (file)
@@ -124,6 +124,8 @@ namespace {
                 || (   stoppers == blocked && r >= RANK_5
                     && (shift<Up>(support) & ~(theirPawns | doubleAttackThem)));
 
+        passed &= !(forward_file_bb(Us, s) & ourPawns);
+
         // Passed pawns will be properly scored later in evaluation when we have
         // full attack info.
         if (passed)