From ce73441f2013e0b8fd3eb7a0c9fd391d52adde70 Mon Sep 17 00:00:00 2001 From: FauziAkram Date: Sat, 14 Jun 2025 16:10:59 +0300 Subject: [PATCH] Simplify sudden death time optimization Passed Sudden Death STC: https://tests.stockfishchess.org/tests/view/68455fe5375c2b77d9855351 LLR: 2.91 (-2.94,2.94) <-1.75,0.25> Total: 49248 W: 13008 L: 12798 D: 23442 Ptnml(0-2): 309, 5491, 12821, 5687, 316 Passed Sudden Death LTC: https://tests.stockfishchess.org/tests/view/6845a392375c2b77d98553cf LLR: 3.01 (-2.94,2.94) <-1.75,0.25> Total: 551070 W: 141699 L: 142031 D: 267340 Ptnml(0-2): 1923, 60608, 150916, 60054, 2034 Passed Standard STC: https://tests.stockfishchess.org/tests/view/683c5ebb6ec7634154f9d989 LLR: 2.95 (-2.94,2.94) <-1.75,0.25> Total: 142624 W: 36808 L: 36709 D: 69107 Ptnml(0-2): 302, 15448, 39745, 15483, 334 Passed Standard LTC: https://tests.stockfishchess.org/tests/view/683f1a4f6ec7634154f9dc5a LLR: 2.95 (-2.94,2.94) <-1.75,0.25> Total: 146922 W: 37381 L: 37296 D: 72245 Ptnml(0-2): 69, 13552, 46117, 13671, 52 closes https://github.com/official-stockfish/Stockfish/pull/6132 Bench: 2249459 --- src/timeman.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/timeman.cpp b/src/timeman.cpp index 29ebffca..5840e255 100644 --- a/src/timeman.cpp +++ b/src/timeman.cpp @@ -85,16 +85,13 @@ void TimeManagement::init(Search::LimitsType& limits, // with constants are involved. const int64_t scaleFactor = useNodesTime ? npmsec : 1; const TimePoint scaledTime = limits.time[us] / scaleFactor; - const TimePoint scaledInc = limits.inc[us] / scaleFactor; // Maximum move horizon int centiMTG = limits.movestogo ? std::min(limits.movestogo * 100, 5000) : 5051; // If less than one second, gradually reduce mtg - if (scaledTime < 1000 && double(centiMTG) / scaledInc > 5.051) - { + if (scaledTime < 1000) centiMTG = scaledTime * 5.051; - } // Make sure timeLeft is > 0 since we may use it as a divisor TimePoint timeLeft =