From 310928e985a6d87bdd73542e2109f93c31e2cc41 Mon Sep 17 00:00:00 2001 From: mstembera Date: Fri, 9 Dec 2022 18:50:06 -0800 Subject: [PATCH] Avoid truncated PV in the threaded case strongly prefer to pick as bestThread those threads with a longer PV, among those threads that all found the same bestmove. extended discussion in #4244 closes https://github.com/official-stockfish/Stockfish/pull/4278 No functional change --- src/thread.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/thread.cpp b/src/thread.cpp index b7471f60..e8723eb7 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -239,7 +239,8 @@ Thread* ThreadPool::get_best_thread() const { || ( 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]] - && thread_value(th) > thread_value(bestThread))))) + && thread_value(th) * int(th->rootMoves[0].pv.size() > 2) + > thread_value(bestThread) * int(bestThread->rootMoves[0].pv.size() > 2))))) bestThread = th; return bestThread;