X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=a46c44627d4b1677b1f4a0a11f13825d24e0e746;hp=75d388b945ea2573b211f6078ab7006c006ac4a3;hb=6b16ebc82566a69b9336cca6aa7a19ab1824b85d;hpb=881a9dfb0a8fec3b1472791e2d98415e4a9a182a diff --git a/src/search.cpp b/src/search.cpp index 75d388b9..a46c4462 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -312,9 +312,14 @@ void MainThread::search() { && rootMoves[0].pv[0] != MOVE_NONE) { for (Thread* th : Threads) - if ( th->completedDepth > bestThread->completedDepth - && th->rootMoves[0].score > bestThread->rootMoves[0].score) + { + Depth depthDiff = th->completedDepth - bestThread->completedDepth; + Value scoreDiff = th->rootMoves[0].score - bestThread->rootMoves[0].score; + + if ( (depthDiff > 0 && scoreDiff >= 0) + || (scoreDiff > 0 && depthDiff >= 0)) bestThread = th; + } } previousScore = bestThread->rootMoves[0].score; @@ -1074,13 +1079,6 @@ moves_loop: // When in check search starts from here if (value > alpha) { - // If there is an easy move for this position, clear it if unstable - if ( PvNode - && thisThread == Threads.main() - && EasyMove.get(pos.key()) - && (move != EasyMove.get(pos.key()) || moveCount > 1)) - EasyMove.clear(); - bestMove = move; if (PvNode && !rootNode) // Update pv even in fail-high case