]> git.sesse.net Git - stockfish/commitdiff
Simplify increaseDepth to boolean expression
authorFauziAkram <fauzi.dabat@hotmail.com>
Sat, 9 Mar 2024 16:49:59 +0000 (19:49 +0300)
committerDisservin <disservin.social@gmail.com>
Tue, 12 Mar 2024 15:43:10 +0000 (16:43 +0100)
Non-functional Simplification, maintaining the same logic as before. Big thanks
to @peregrineshahin for helping with the code.

Passed non-regression bounds:
https://tests.stockfishchess.org/tests/view/65ec93860ec64f0526c42375
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 101088 W: 26196 L: 26047 D: 48845
Ptnml(0-2): 405, 11580, 26473, 11633, 453

closes https://github.com/official-stockfish/Stockfish/pull/5103

No functional change

src/search.cpp

index f4ec8fb16dcfd219f969554e56db19f9b6ef9738..a3e53e025fad324251c6716d35bc72d7c992647c 100644 (file)
@@ -464,11 +464,10 @@ void Search::Worker::iterative_deepening() {
                 else
                     threads.stop = true;
             }
-            else if (!mainThread->ponder
-                     && mainThread->tm.elapsed(threads.nodes_searched()) > totalTime * 0.506)
-                threads.increaseDepth = false;
             else
-                threads.increaseDepth = true;
+                threads.increaseDepth =
+                  mainThread->ponder
+                  || mainThread->tm.elapsed(threads.nodes_searched()) <= totalTime * 0.506;
         }
 
         mainThread->iterValue[iterIdx] = bestValue;