Skip to content

Commit

Permalink
Time-management fix in MultiPV mode.
Browse files Browse the repository at this point in the history
When playing games in MultiPV mode we must take care to only track the
best move changing for the first PV line. Otherwise, SF will spend most
of its time for the initial moves after the book exit.

This has been observed and reported on Discord, but can also be seen in
games played in Stefan Pohl's MultiPV experiment.

Tested with MultiPV=4.

STC:
https://tests.stockfishchess.org/tests/view/615c24b59d256038a969b990
LLR: 2.95 (-2.94,2.94) <-0.50,2.50>
Total: 1744 W: 694 L: 447 D: 603
Ptnml(0-2): 32, 125, 358, 278, 79

LTC:
https://tests.stockfishchess.org/tests/view/615c31769d256038a969b993
LLR: 2.94 (-2.94,2.94) <0.50,3.50>
Total: 2048 W: 723 L: 525 D: 800
Ptnml(0-2): 10, 158, 511, 314, 31

closes #3729

Bench: 5714575
  • Loading branch information
joergoster authored and snicolet committed Oct 6, 2021
1 parent 135caee commit 371b522
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1314,9 +1314,11 @@ namespace {
for (Move* m = (ss+1)->pv; *m != MOVE_NONE; ++m)
rm.pv.push_back(*m);

// We record how often the best move has been changed in each
// iteration. This information is used for time management and LMR
if (moveCount > 1)
// We record how often the best move has been changed in each iteration.
// This information is used for time management and LMR. In MultiPV mode,
// we must take care to only do this for the first PV line.
if ( moveCount > 1
&& !thisThread->pvIdx)
++thisThread->bestMoveChanges;
}
else
Expand Down

0 comments on commit 371b522

Please sign in to comment.