1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-01 17:19:36 +00:00

Revert futility pruning patches

reverts 09b6d28391 and
dbd7f602d3 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
This commit is contained in:
Joost VandeVondele 2021-08-05 16:34:37 +02:00
parent a1a83f3869
commit dabaf2220f

View file

@ -779,8 +779,10 @@ namespace {
? ss->staticEval > (ss-4)->staticEval || (ss-4)->staticEval == VALUE_NONE ? ss->staticEval > (ss-4)->staticEval || (ss-4)->staticEval == VALUE_NONE
: ss->staticEval > (ss-2)->staticEval; : 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 if ( !PvNode
&& depth < 9
&& eval - futility_margin(depth, improving) >= beta && eval - futility_margin(depth, improving) >= beta
&& eval < VALUE_KNOWN_WIN) // Do not return unproven wins && eval < VALUE_KNOWN_WIN) // Do not return unproven wins
return eval; return eval;
@ -989,7 +991,7 @@ moves_loop: // When in check, search starts here
// Calculate new depth for this move // Calculate new depth for this move
newDepth = depth - 1; 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 if ( !rootNode
&& pos.non_pawn_material(us) && pos.non_pawn_material(us)
&& bestValue > VALUE_TB_LOSS_IN_MAX_PLY) && 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) // Futility pruning: parent node (~5 Elo)
if ( !ss->inCheck if ( !ss->inCheck
&& lmrDepth < 7
&& ss->staticEval + 174 + 157 * lmrDepth <= alpha) && ss->staticEval + 174 + 157 * lmrDepth <= alpha)
continue; continue;