mirror of
https://github.com/official-stockfish/Stockfish.git
synced 2026-07-22 20:57:10 +00:00
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:
committed by
Joost VandeVondele
parent
4055a9fb27
commit
7e754e17dd
+3
-5
@@ -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);
|
||||
|
||||
|
||||
+1
-1
@@ -380,7 +380,7 @@ class Worker {
|
||||
Position rootPos;
|
||||
StateInfo rootState;
|
||||
RootMoves rootMoves;
|
||||
Depth rootDepth, completedDepth;
|
||||
Depth rootDepth;
|
||||
Value rootDelta;
|
||||
|
||||
PVMoves lastIterationPV;
|
||||
|
||||
+3
-3
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user