mirror of
https://github.com/official-stockfish/Stockfish.git
synced 2026-07-23 05:07:14 +00:00
Extract bestMove and ponderMove after the PV.
Extracting ponderMove may have the unintentional effect of extending the PV by one move (which should not be displayed), so we need to extract it after we've extracted the PV. We still need to both before the MPI exchange, though. Patch by vondele, merely committed by me.
This commit is contained in:
+6
-6
@@ -246,12 +246,6 @@ void Search::Worker::start_searching() {
|
||||
main_manager()->bestPreviousScore = bestThread->rootMoves[0].score;
|
||||
main_manager()->bestPreviousAverageScore = bestThread->rootMoves[0].averageScore;
|
||||
|
||||
Move bestMove = bestThread->rootMoves[0].pv[0];
|
||||
Move ponderMove = Move::none();
|
||||
if (bestThread->rootMoves[0].pv.size() > 1
|
||||
|| bestThread->rootMoves[0].extract_ponder_from_tt(tt, rootPos))
|
||||
ponderMove = bestThread->rootMoves[0].pv[1];
|
||||
|
||||
// Temporarily switch out onUpdateFull to capture the PV information that we need,
|
||||
// so that we can exchange it through MPI. (We may end up not actually printing
|
||||
// it out.)
|
||||
@@ -264,6 +258,12 @@ void Search::Worker::start_searching() {
|
||||
assert(!serializedInfo.empty());
|
||||
main_manager()->updates.onUpdateFull = std::move(oldOnUpdateFull);
|
||||
|
||||
Move bestMove = bestThread->rootMoves[0].pv[0];
|
||||
Move ponderMove = Move::none();
|
||||
if (bestThread->rootMoves[0].pv.size() > 1
|
||||
|| bestThread->rootMoves[0].extract_ponder_from_tt(tt, rootPos))
|
||||
ponderMove = bestThread->rootMoves[0].pv[1];
|
||||
|
||||
// Exchange info as needed
|
||||
Distributed::MoveInfo mi{bestMove.raw(), ponderMove.raw(), bestThread->completedDepth,
|
||||
bestThread->rootMoves[0].score, Distributed::rank()};
|
||||
|
||||
Reference in New Issue
Block a user