Skip to content

Commit

Permalink
Avoid truncated PV in the threaded case
Browse files Browse the repository at this point in the history
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 #4278

No functional change
  • Loading branch information
mstembera authored and vondele committed Dec 12, 2022
1 parent 955edf1 commit 310928e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/thread.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 310928e

Please sign in to comment.