From: xoto10 Date: Thu, 16 Sep 2021 07:43:53 +0000 (+0100) Subject: Increase optimumTime by 10% X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=5b47b4e6c04719e66559efe91e505569e0f7aafa Increase optimumTime by 10% STC 10+0.1 : LLR: 2.94 (-2.94,2.94) <-0.50,2.50> Total: 47032 W: 12078 L: 11841 D: 23113 Ptnml(0-2): 159, 5098, 12746, 5373, 140 https://tests.stockfishchess.org/tests/view/613f9df1f29dda16fcca8731 LTC 60+0.6 : LLR: 2.95 (-2.94,2.94) <0.50,3.50> Total: 66248 W: 16631 L: 16301 D: 33316 Ptnml(0-2): 44, 6560, 19578, 6906, 36 https://tests.stockfishchess.org/tests/view/6140603d7315e7c73204a4c1 Non-regression tests with other time control styles: Moves/Time 40/10+0 : LLR: 2.93 (-2.94,2.94) <-2.50,0.50> Total: 51640 W: 13350 L: 13254 D: 25036 Ptnml(0-2): 183, 5770, 13797, 5908, 162 https://tests.stockfishchess.org/tests/view/6141592b7315e7c73204a599 TCEC Style 10+0.01 : LLR: 2.94 (-2.94,2.94) <-2.50,0.50> Total: 20592 W: 5300 L: 5157 D: 10135 Ptnml(0-2): 81, 2240, 5544, 2317, 114 https://tests.stockfishchess.org/tests/view/61425bb27315e7c73204a6a2 Sudden death 15+0 : LLR: 2.94 (-2.94,2.94) <-2.50,0.50> Total: 127104 W: 32728 L: 32741 D: 61635 Ptnml(0-2): 735, 13973, 34149, 13960, 735 https://tests.stockfishchess.org/tests/view/614256a77315e7c73204a699 The first 3 tests were run with an initial version of the code, which was then modified to make the amount of extra time dependent on the size of increment. No increment gives no extra time, and the extra time given increases until an increment of 1% or more of remaining time gives 10% extra thinking time. closes https://github.com/official-stockfish/Stockfish/pull/3702 Bench 6658747 --- diff --git a/src/timeman.cpp b/src/timeman.cpp index f742d1e4..d3713ee4 100644 --- a/src/timeman.cpp +++ b/src/timeman.cpp @@ -68,6 +68,9 @@ void TimeManagement::init(Search::LimitsType& limits, Color us, int ply) { TimePoint timeLeft = std::max(TimePoint(1), limits.time[us] + limits.inc[us] * (mtg - 1) - moveOverhead * (2 + mtg)); + // Use extra time with larger increments + double optExtra = std::clamp(1.0 + 10.0 * limits.inc[us] / limits.time[us], 1.0, 1.1); + // A user may scale time usage by setting UCI option "Slow Mover" // Default is 100 and changing this value will probably lose elo. timeLeft = slowMover * timeLeft / 100; @@ -78,15 +81,16 @@ void TimeManagement::init(Search::LimitsType& limits, Color us, int ply) { if (limits.movestogo == 0) { optScale = std::min(0.0084 + std::pow(ply + 3.0, 0.5) * 0.0042, - 0.2 * limits.time[us] / double(timeLeft)); + 0.2 * limits.time[us] / double(timeLeft)) + * optExtra; maxScale = std::min(7.0, 4.0 + ply / 12.0); } // x moves in y seconds (+ z increment) else { - optScale = std::min((0.8 + ply / 128.0) / mtg, - 0.8 * limits.time[us] / double(timeLeft)); + optScale = std::min((0.88 + ply / 116.4) / mtg, + 0.88 * limits.time[us] / double(timeLeft)); maxScale = std::min(6.3, 1.5 + 0.11 * mtg); }