1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-06-28 00:19:50 +00:00

Report longest PV lines for multithreaded search

In case several threads find the same bestmove,
report the longest PV line found.

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

No functional change.
This commit is contained in:
mstembera 2022-08-08 21:33:59 -07:00 committed by Joost VandeVondele
parent 1054a483ca
commit 4568f6369b

View file

@ -237,7 +237,9 @@ Thread* ThreadPool::get_best_thread() const {
}
else if ( th->rootMoves[0].score >= VALUE_TB_WIN_IN_MAX_PLY
|| ( th->rootMoves[0].score > VALUE_TB_LOSS_IN_MAX_PLY
&& votes[th->rootMoves[0].pv[0]] > votes[bestThread->rootMoves[0].pv[0]]))
&& ( votes[th->rootMoves[0].pv[0]] > votes[bestThread->rootMoves[0].pv[0]]
|| ( votes[th->rootMoves[0].pv[0]] == votes[bestThread->rootMoves[0].pv[0]]
&& th->rootMoves[0].pv.size() > bestThread->rootMoves[0].pv.size()))))
bestThread = th;
}