From 7f1262c27d989722380320e8b21ab8b98fe76515 Mon Sep 17 00:00:00 2001 From: rektdie Date: Mon, 2 Jun 2025 05:13:15 +0200 Subject: [PATCH] added movestogo | bench 3975258 --- source/search.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/search.cpp b/source/search.cpp index cfb164d..a4d83f2 100644 --- a/source/search.cpp +++ b/source/search.cpp @@ -536,6 +536,7 @@ template static SearchResults ID(Board &board, SearchParams params, SearchContext& ctx) { int fullTime = board.sideToMove ? params.btime : params.wtime; int inc = board.sideToMove ? params.binc : params.winc; + int movesToGo = params.movesToGo ? params.movesToGo : 20; SearchResults safeResults; safeResults.score = -inf; @@ -553,7 +554,7 @@ static SearchResults ID(Board &board, SearchParams params, SearchContext& ctx) { ctx.sw.Restart(); for (int depth = 1; depth <= toDepth; depth++) { - ctx.timeToSearch = std::max((fullTime / 20) + (inc / 2), 4); + ctx.timeToSearch = std::max((fullTime / movesToGo) + (inc / 2), 4); int softTime = ctx.timeToSearch * 0.65; SearchResults currentResults = PVS(board, depth, aw.alpha, aw.beta, 0, ctx, false);