]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
CounterMove History Pruning Tweak
[stockfish] / src / search.cpp
index 89636f23575398840559967029541bf94ad3d736..325278fbc95acab4d559b94ae7a1787d2f8b0b9b 100644 (file)
@@ -153,8 +153,7 @@ void Search::init() {
       for (int d = 1; d < 64; ++d)
           for (int mc = 1; mc < 64; ++mc)
           {
-              double slope = d > 2 ? 0.88 * d + 0.36 : d;
-              double r = log(slope) * log(mc) / 1.95;
+              double r = log(d) * log(mc) / 1.95;
 
               Reductions[NonPV][imp][d][mc] = int(std::round(r));
               Reductions[PV][imp][d][mc] = std::max(Reductions[NonPV][imp][d][mc] - 1, 0);
@@ -936,7 +935,8 @@ moves_loop: // When in check, search starts from here
               int lmrDepth = std::max(newDepth - reduction<PvNode>(improving, depth, moveCount), DEPTH_ZERO) / ONE_PLY;
 
               // Countermoves based pruning (~20 Elo)
-              if (   lmrDepth < 3
+              if (   lmrDepth < 4
+                  && (lmrDepth < 3 || ((ss - 1)->statScore > 0 && !PvNode))
                   && (*contHist[0])[movedPiece][to_sq(move)] < CounterMovePruneThreshold
                   && (*contHist[1])[movedPiece][to_sq(move)] < CounterMovePruneThreshold)
                   continue;