]> git.sesse.net Git - stockfish/commitdiff
More aggressive post-futility pruning
authorJoona Kiiski <joona.kiiski@gmail.com>
Sun, 21 Apr 2013 13:53:27 +0000 (14:53 +0100)
committerJoona Kiiski <joona.kiiski@gmail.com>
Sun, 21 Apr 2013 13:53:27 +0000 (14:53 +0100)
src/search.cpp
src/search.h

index 1fe895d3cf576e66e622a3767decd3eceac138a5..80ac9b20b26f351b196e8f55cc09c28d9b05c199 100644 (file)
@@ -643,10 +643,10 @@ namespace {
         && !ss->skipNullMove
         &&  depth < 4 * ONE_PLY
         && !inCheck
-        &&  eval - FutilityMargins[depth][0] >= beta
+        &&  eval - FutilityMargins[depth][(ss-1)->futMc] >= beta
         &&  abs(beta) < VALUE_MATE_IN_MAX_PLY
         &&  pos.non_pawn_material(pos.side_to_move()))
-        return eval - FutilityMargins[depth][0];
+        return eval - FutilityMargins[depth][(ss-1)->futMc];
 
     // Step 8. Null move search with verification search (is omitted in PV nodes)
     if (   !PvNode
@@ -852,6 +852,8 @@ split_point_start: // At split points actual search starts from here
       // Update current move (this must be done after singular extension search)
       newDepth = depth - ONE_PLY + ext;
 
+      ss->futMc = 0;
+
       // Step 13. Futility pruning (is omitted in PV nodes)
       if (   !PvNode
           && !captureOrPromotion
@@ -874,6 +876,8 @@ split_point_start: // At split points actual search starts from here
           // Value based pruning
           // We illogically ignore reduction condition depth >= 3*ONE_PLY for predicted depth,
           // but fixing this made program slightly weaker.
+          ss->futMc = moveCount;
+
           Depth predictedDepth = newDepth - reduction<PvNode>(depth, moveCount);
           futilityValue =  ss->staticEval + ss->evalMargin + futility_margin(predictedDepth, moveCount)
                          + Gain[pos.piece_moved(move)][to_sq(move)];
index bd21023747f53d2e480003933566c86fbd844bf8..2300c76271cc7c85a0d9d7e8bda732b9ba353e20 100644 (file)
@@ -47,6 +47,7 @@ struct Stack {
   Value staticEval;
   Value evalMargin;
   int skipNullMove;
+  int futMc;
 };