From f8c406c88030a08e8183910ad688e5066572c0ee Mon Sep 17 00:00:00 2001 From: rektdie Date: Wed, 26 Mar 2025 01:10:41 +0100 Subject: [PATCH] added soft tm | bench 902872 --- source/search.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source/search.cpp b/source/search.cpp index 88b0ca6..4730f4c 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -318,6 +318,7 @@ static SearchResults ID(Board &board, SearchParams params) { for (int depth = 1; depth <= 99; depth++) { timeToSearch = (fullTime / 20) + (inc / 2); + int softTime = timeToSearch * 0.65; SearchResults currentResults = PVS(board, depth, alpha, beta, ply); @@ -343,7 +344,14 @@ static SearchResults ID(Board &board, SearchParams params) { safeResults = currentResults; } - if (searchStopped) break; + if (searchStopped) { + break; + } else { + if (sw.GetElapsedMS() >= softTime) { + StopSearch(); + break; + } + } std::cout << "info "; std::cout << "depth " << depth;