]> git.sesse.net Git - stockfish/commitdiff
Revert futility pruning patches
authorJoost VandeVondele <Joost.VandeVondele@gmail.com>
Thu, 5 Aug 2021 14:34:37 +0000 (16:34 +0200)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Thu, 5 Aug 2021 14:41:07 +0000 (16:41 +0200)
reverts 09b6d28391cf582d99897360b225bcbbe38dd1c6 and
dbd7f602d3c7622df294f87d7239b5aaf31f695f that significantly impact mate
finding capabilities. For example on ChestUCI_23102018.epd, at 1M nodes,
the number of mates found is nearly reduced 2x without these depth conditions:

       sf6  2091
       sf7  2093
       sf8  2107
       sf9  2062
      sf10  2208
      sf11  2552
      sf12  2563
      sf13  2509
      sf14  2427
    master  1246
   patched  2467

(script for testing at https://github.com/official-stockfish/Stockfish/files/6936412/matecheck.zip)

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

fixes https://github.com/official-stockfish/Stockfish/issues/3627

Bench: 5467570

src/search.cpp

index af8ddaba5a420887d0c5a98907b7ca975d4b802d..c48b74bcc76ddc0761cdb9c44d961dffa4b0f2c0 100644 (file)
@@ -779,8 +779,10 @@ namespace {
                ? ss->staticEval > (ss-4)->staticEval || (ss-4)->staticEval == VALUE_NONE
                : ss->staticEval > (ss-2)->staticEval;
 
-    // Step 7. Futility pruning: child node (~50 Elo)
+    // Step 7. Futility pruning: child node (~50 Elo).
+    // The depth condition is important for mate finding.
     if (   !PvNode
+        &&  depth < 9
         &&  eval - futility_margin(depth, improving) >= beta
         &&  eval < VALUE_KNOWN_WIN) // Do not return unproven wins
         return eval;
@@ -989,7 +991,7 @@ moves_loop: // When in check, search starts here
       // Calculate new depth for this move
       newDepth = depth - 1;
 
-      // Step 13. Pruning at shallow depth (~200 Elo)
+      // Step 13. Pruning at shallow depth (~200 Elo). Depth conditions are important for mate finding.
       if (  !rootNode
           && pos.non_pawn_material(us)
           && bestValue > VALUE_TB_LOSS_IN_MAX_PLY)
@@ -1023,6 +1025,7 @@ moves_loop: // When in check, search starts here
 
               // Futility pruning: parent node (~5 Elo)
               if (   !ss->inCheck
+                  && lmrDepth < 7
                   && ss->staticEval + 174 + 157 * lmrDepth <= alpha)
                   continue;