Simplify away completedDepth

Recent changes to this part of the code mean that the variable `completedDepth` is no longer neeeded. The only *functional* part of this patch is the effect on the thread voting formula. Basically, compared to master this patch raises the depth weight in the formula uniformly by 1. For very, very low depths this may have a tiny effect on thread selection compared to master. But in general we expect this patch to have no effect on game play at STC and LTC.

Passed STC SMP non-reg:
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 284808 W: 72944 L: 72994 D: 138870
Ptnml(0-2): 351, 32192, 77370, 32138, 353
https://tests.stockfishchess.org/tests/view/69eddd011e5788938e86a075

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

No functional change
This commit is contained in:
Robert Nurnberg @ elitebook
2026-05-04 08:31:44 +02:00
committed by Joost VandeVondele
parent 4055a9fb27
commit 7e754e17dd
3 changed files with 7 additions and 9 deletions
+3 -5
View File
@@ -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);