]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Limit the researching at same depth.
[stockfish] / src / search.cpp
index 07f18a34fe3e1e2e163fce496b6b2bf3a2f8b689..ca1d2632b531a628a8b105340982b3281d7394c0 100644 (file)
@@ -373,7 +373,9 @@ void Thread::search() {
           int failedHighCnt = 0;
           while (true)
           {
-              Depth adjustedDepth = std::max(1, rootDepth - failedHighCnt - searchAgainCounter);
+              // Adjust the effective depth searched, but ensuring at least one effective increment for every
+              // four searchAgain steps (see issue #2717).
+              Depth adjustedDepth = std::max(1, rootDepth - failedHighCnt - 3 * (searchAgainCounter + 1) / 4);
               bestValue = Stockfish::search<Root>(rootPos, ss, alpha, beta, adjustedDepth, false);
 
               // Bring the best move to the front. It is critical that sorting