From 578bb4d77719a53cdf45739f9e9fc545c92fb32c Mon Sep 17 00:00:00 2001 From: FauziAkram Date: Fri, 20 Dec 2024 13:25:52 +0300 Subject: [PATCH 1/5] Update search.cpp --- src/search.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index e352c96e33e..adcca295423 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -155,8 +155,7 @@ void Search::Worker::start_searching() { return; } - main_manager()->tm.init(limits, rootPos.side_to_move(), rootPos.game_ply(), options, - main_manager()->originalTimeAdjust); + main_manager()->tm.init(limits, rootPos.side_to_move(), rootPos.game_ply(), options); tt.new_search(); if (rootMoves.empty()) From 0101f5911582a7d038a3707e225bb59cc732a2ae Mon Sep 17 00:00:00 2001 From: FauziAkram Date: Fri, 20 Dec 2024 13:26:19 +0300 Subject: [PATCH 2/5] Update search.h --- src/search.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/search.h b/src/search.h index b618855b9fc..0410fd3304f 100644 --- a/src/search.h +++ b/src/search.h @@ -238,7 +238,6 @@ class SearchManager: public ISearchManager { Depth depth); Stockfish::TimeManagement tm; - double originalTimeAdjust; int callsCnt; std::atomic_bool ponder; From f0338945f5f01be075e19f81e7146a52513d5520 Mon Sep 17 00:00:00 2001 From: FauziAkram Date: Fri, 20 Dec 2024 13:26:41 +0300 Subject: [PATCH 3/5] Update thread.cpp --- src/thread.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/thread.cpp b/src/thread.cpp index 5f73771effa..a6932e86870 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -218,7 +218,6 @@ void ThreadPool::clear() { main_manager()->callsCnt = 0; main_manager()->bestPreviousScore = VALUE_INFINITE; - main_manager()->originalTimeAdjust = -1; main_manager()->tm.clear(); } From e223f370ec9e6f50d7081c5cdf24a7fb409cebfe Mon Sep 17 00:00:00 2001 From: FauziAkram Date: Fri, 20 Dec 2024 13:27:34 +0300 Subject: [PATCH 4/5] Update timeman.cpp --- src/timeman.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/timeman.cpp b/src/timeman.cpp index 9de70fdc613..6c8778367f9 100644 --- a/src/timeman.cpp +++ b/src/timeman.cpp @@ -47,8 +47,7 @@ void TimeManagement::advance_nodes_time(std::int64_t nodes) { void TimeManagement::init(Search::LimitsType& limits, Color us, int ply, - const OptionsMap& options, - double& originalTimeAdjust) { + const OptionsMap& options) { TimePoint npmsec = TimePoint(options["nodestime"]); // If we have no time, we don't need to fully initialize TM. @@ -105,18 +104,13 @@ void TimeManagement::init(Search::LimitsType& limits, // game time for the current move, so also cap to a percentage of available game time. if (limits.movestogo == 0) { - // Extra time according to timeLeft - if (originalTimeAdjust < 0) - originalTimeAdjust = 0.3285 * std::log10(timeLeft) - 0.4830; - // Calculate time constants based on current time left. double logTimeInSec = std::log10(scaledTime / 1000.0); double optConstant = std::min(0.00308 + 0.000319 * logTimeInSec, 0.00506); double maxConstant = std::max(3.39 + 3.01 * logTimeInSec, 2.93); optScale = std::min(0.0122 + std::pow(ply + 2.95, 0.462) * optConstant, - 0.213 * limits.time[us] / timeLeft) - * originalTimeAdjust; + 0.213 * limits.time[us] / timeLeft); maxScale = std::min(6.64, maxConstant + ply / 12.0); } From e341d137a5415467d4645628006c4038fa92aebb Mon Sep 17 00:00:00 2001 From: FauziAkram Date: Fri, 20 Dec 2024 13:28:09 +0300 Subject: [PATCH 5/5] bench: 934447 bench: 934447 --- src/timeman.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/timeman.h b/src/timeman.h index 10207a8a730..7cb2a6335be 100644 --- a/src/timeman.h +++ b/src/timeman.h @@ -39,8 +39,7 @@ class TimeManagement { void init(Search::LimitsType& limits, Color us, int ply, - const OptionsMap& options, - double& originalTimeAdjust); + const OptionsMap& options); TimePoint optimum() const; TimePoint maximum() const;