From dabaf2220fe0c77400a5f71a91952f510e6a126b Mon Sep 17 00:00:00 2001 From: Joost VandeVondele Date: Thu, 5 Aug 2021 16:34:37 +0200 Subject: [PATCH] Revert futility pruning patches 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 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index af8ddaba..c48b74bc 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -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; -- 2.39.2