]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Do more reductions for late quiet moves in case of consecutive fail highs.
[stockfish] / src / search.cpp
index eaa79fb92bffe836472c6382d63daac2f10aa7ab..ab58ca648cfa802777d69f54eabf644f3f01966b 100644 (file)
@@ -417,7 +417,7 @@ void Thread::search() {
           // Start with a small aspiration window and, in the case of a fail
           // high/low, re-search with a bigger window until we don't fail
           // high/low anymore.
           // Start with a small aspiration window and, in the case of a fail
           // high/low, re-search with a bigger window until we don't fail
           // high/low anymore.
-          int failedHighCnt = 0;
+          failedHighCnt = 0;
           while (true)
           {
               Depth adjustedDepth = std::max(1, rootDepth - failedHighCnt - searchAgainCounter);
           while (true)
           {
               Depth adjustedDepth = std::max(1, rootDepth - failedHighCnt - searchAgainCounter);
@@ -1177,6 +1177,9 @@ moves_loop: // When in check, search starts from here
               if (ttCapture)
                   r++;
 
               if (ttCapture)
                   r++;
 
+              // Increase reduction at root if failing high
+              r += rootNode ? thisThread->failedHighCnt * thisThread->failedHighCnt * moveCount / 512 : 0;
+
               // Increase reduction for cut nodes (~10 Elo)
               if (cutNode)
                   r += 2;
               // Increase reduction for cut nodes (~10 Elo)
               if (cutNode)
                   r += 2;