Fix nodestime

1. The current time management system utilizes limits.inc and
limits.time, which can represent either milliseconds or node count,
depending on whether the nodestime option is active. There have been
several modifications which brought Elo gain for typical uses (i.e.
real-time matches), however some of these changes overlooked such
distinction. This patch adjusts constants and multiplication/division to
more accurately simulate real TC conditions when nodestime is used.

2. The advance_nodes_time function has a bug that can extend the time
limit when availableNodes reaches exact zero. This patch fixes the bug
by initializing the variable to -1 and make sure it does not go below
zero.

3. elapsed_time function is newly introduced to print PV in the UCI
output based on real time. This makes PV output more consistent with the
behavior of trivial use cases.

closes https://github.com/official-stockfish/Stockfish/pull/5186

No functional changes
This commit is contained in:
MinetaS
2024-05-08 03:26:09 +09:00
committed by Joost VandeVondele
parent db147fe258
commit 2dbb44e28d
4 changed files with 47 additions and 27 deletions
+1
View File
@@ -276,6 +276,7 @@ class Worker {
}
TimePoint elapsed() const;
TimePoint elapsed_time() const;
LimitsType limits;