diff --git a/src/search.cpp b/src/search.cpp index b6c63f3c2..d0f8d55c7 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -461,8 +461,6 @@ bool Search::Worker::iterative_deepening() { if (!threads.stop) { - completedDepth = rootDepth; - if (lastIterationPV.empty() || rootMoves[0].pv[0] != lastIterationPV[0]) lastBestMoveDepth = rootDepth; @@ -525,9 +523,9 @@ bool Search::Worker::iterative_deepening() { fallingEval = std::clamp(fallingEval, 0.581, 1.655); // If the bestMove is stable over several iterations, reduce time accordingly - timeReduction = std::clamp( - interpolate(double(completedDepth - lastBestMoveDepth), 5.0, 18.0, 0.65, 1.55), 0.65, - 1.55); + timeReduction = + std::clamp(interpolate(double(rootDepth - lastBestMoveDepth), 5.0, 18.0, 0.65, 1.55), + 0.65, 1.55); double reduction = (1.5 + mainThread->previousTimeReduction) / (2.255 * timeReduction); diff --git a/src/search.h b/src/search.h index 3bdf3c783..50aef6aa9 100644 --- a/src/search.h +++ b/src/search.h @@ -380,7 +380,7 @@ class Worker { Position rootPos; StateInfo rootState; RootMoves rootMoves; - Depth rootDepth, completedDepth; + Depth rootDepth; Value rootDelta; PVMoves lastIterationPV; diff --git a/src/thread.cpp b/src/thread.cpp index fce27cc50..6c3c6487b 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -332,8 +332,8 @@ void ThreadPool::start_thinking(const OptionsMap& options, th->worker->limits = limits; th->worker->nodes = th->worker->tbHits = th->worker->bestMoveChanges = 0; th->worker->nmpMinPly = 0; - th->worker->rootDepth = th->worker->completedDepth = 0; - th->worker->rootMoves = rootMoves; + th->worker->rootDepth = 0; + th->worker->rootMoves = rootMoves; th->worker->rootPos.set(pos.fen(), pos.is_chess960(), &th->worker->rootState); th->worker->rootState = setupStates->back(); th->worker->tbConfig = tbConfig; @@ -360,7 +360,7 @@ Thread* ThreadPool::get_best_thread() const { // Vote according to score and depth, and select the best thread auto thread_voting_value = [minScore](Thread* th) { - return (th->worker->rootMoves[0].score - minScore + 14) * int(th->worker->completedDepth); + return (th->worker->rootMoves[0].score - minScore + 14) * int(th->worker->rootDepth); }; for (auto&& th : threads)