From 287e2e2f74332d59dae2bd01772a74b909b87d22 Mon Sep 17 00:00:00 2001 From: IIvec Date: Sun, 15 Oct 2017 16:44:29 +0200 Subject: [PATCH 1/1] Fix premature using of all available time in x/y TC In x/y time controls there was a theoretical possibility to use all available time few moves before the clock will be updated with new time. This patch fixes that issue. Tested at 60/15 time control: LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 113963 W: 20008 L: 20042 D: 73913 The test was done without adjudication rules! Bench 5234652 --- src/timeman.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/timeman.cpp b/src/timeman.cpp index 2612fb52..0c522464 100644 --- a/src/timeman.cpp +++ b/src/timeman.cpp @@ -52,6 +52,9 @@ namespace { else ratio *= 1.5; + if (movesToGo > 1) + ratio = std::min(0.75, ratio); + ratio *= 1 + inc / (myTime * 8.5); } // Otherwise we increase usage of remaining time as the game goes on -- 2.39.2