From: Joost VandeVondele Date: Wed, 2 Jan 2019 10:09:50 +0000 (+0100) Subject: Simplify time management a bit X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=230fb6e9ad5b153aa84032ef0c7e60ff0db08416;ds=inline Simplify time management a bit The new form is likely to trigger a bit more at LTC. Given that LTC appears to be an improvement, I think that is fine. The change is not very invasive: it does the same as before, use potentially less time for moves that are very stable. Most of the time, the full bonus was given if the bonus was given, so the gradual part {3, 4, 5} didn't matter much. Whereas previously 'stable' was expressed as the last 80% of iterations are the same, now I use a fixed depth (10 iterations). For TCEC style TC, it will presumably imply some more moves that are played quicker (and thus more time on the clock when it potentially matters). Note that 10 iterations of stability means we've been proposing that move for 99.9% of search time. passed STC http://tests.stockfishchess.org/tests/view/5c30d2290ebc596a450c055b LLR: 2.95 (-2.94,2.94) [-3.00,1.00] Total: 70921 W: 15403 L: 15378 D: 40140 passed LTC http://tests.stockfishchess.org/tests/view/5c31ae240ebc596a450c1881 LLR: 2.95 (-2.94,2.94) [-3.00,1.00] Total: 17422 W: 2968 L: 2842 D: 11612 No functional change. --- diff --git a/src/search.cpp b/src/search.cpp index ea565360..933cab87 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -503,10 +503,7 @@ void Thread::search() { fallingEval = std::max(0.5, std::min(1.5, fallingEval)); // If the bestMove is stable over several iterations, reduce time accordingly - timeReduction = 1.0; - for (int i : {3, 4, 5}) - if (lastBestMoveDepth * i < completedDepth) - timeReduction *= 1.25; + timeReduction = lastBestMoveDepth + 10 * ONE_PLY < completedDepth ? 1.95 : 1.0; // Use part of the gained time from a previous stable move for the current move double bestMoveInstability = 1.0 + mainThread->bestMoveChanges;