1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-07-12 03:59:15 +00:00

Time-management fix in MultiPV mode.

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 https://github.com/official-stockfish/Stockfish/pull/3729

Bench: 5714575
This commit is contained in:
J. Oster 2021-10-05 12:02:25 +02:00 committed by Stéphane Nicolet
parent 135caee606
commit 371b522e9e

View file

@ -1314,9 +1314,11 @@ moves_loop: // When in check, search starts here
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