X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=6e37fba1e524f8725d9737cab9568ea5d7081e4d;hp=12c32194eb95436726f0c484f7cdd2988a65b20e;hb=04a320666efce725ef66d1a84aaef493a880153d;hpb=3f6451eff7c62e8d4a33c5b11f055a81b3da8387 diff --git a/src/search.cpp b/src/search.cpp index 12c32194..6e37fba1 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -521,10 +521,14 @@ void Thread::search() { } double bestMoveInstability = 1 + 2 * totBestMoveChanges / Threads.size(); - double totalTime = rootMoves.size() == 1 ? 0 : - Time.optimum() * fallingEval * reduction * bestMoveInstability; + double totalTime = Time.optimum() * fallingEval * reduction * bestMoveInstability; - // Stop the search if we have exceeded the totalTime, at least 1ms search + // Cap used time in case of a single legal move for a better viewer experience in tournaments + // yielding correct scores and sufficiently fast moves. + if (rootMoves.size() == 1) + totalTime = std::min(500.0, totalTime); + + // Stop the search if we have exceeded the totalTime if (Time.elapsed() > totalTime) { // If we are allowed to ponder do not stop the search now but