Scale factor tweak
authorUnai Corzo <corzounai@gmail.com>
Mon, 12 Oct 2020 07:03:49 +0000 (09:03 +0200)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Wed, 14 Oct 2020 17:32:12 +0000 (19:32 +0200)
Add !pawnsOnBothFlanks heuristic to scale factor.

STC https://tests.stockfishchess.org/tests/view/5f8080575b3847b5d41f9134
LLR: 2.94 (-2.94,2.94) {-0.25,1.25}
Total: 250960 W: 49779 L: 49168 D: 152013
Ptnml(0-2): 4224, 28822, 58802, 29383, 4249

LTC https://tests.stockfishchess.org/tests/view/5f832f498ea73fb8ddf83ddb
LLR: 2.95 (-2.94,2.94) {0.25,1.25}
Total: 88584 W: 11827 L: 11388 D: 65369
Ptnml(0-2): 585, 8079, 26578, 8412, 638

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

bench: 3834252

src/evaluate.cpp

index c68577a3e0e9f492a6243302404f72f55247c2ae..425ba6f8faead8b61e22d6713d815c5d3624b962 100644 (file)
@@ -905,7 +905,9 @@ namespace {
             sf = 37 + 3 * (pos.count<QUEEN>(WHITE) == 1 ? pos.count<BISHOP>(BLACK) + pos.count<KNIGHT>(BLACK)
                                                         : pos.count<BISHOP>(WHITE) + pos.count<KNIGHT>(WHITE));
         else
-            sf = std::min(sf, 36 + 7 * pos.count<PAWN>(strongSide));
+            sf = std::min(sf, 36 + 7 * pos.count<PAWN>(strongSide)) - 4 * !pawnsOnBothFlanks;
+      
+        sf -= 4 * !pawnsOnBothFlanks;
     }
 
     // Interpolate between the middlegame and (scaled by 'sf') endgame score