Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: question about fixing the time management of movei

Author: Gerd Isenberg

Date: 11:01:52 07/26/04

Go up one level in this thread


On July 25, 2004 at 21:16:11, Uri Blass wrote:

>I still do not know the reason for the bug in the time management against
>isichess when movei used about half of it's time for move 61 (time control was 2
>hours/60 moves+ 30 minutes/rest of the game)

Your "trick" was not bad ;-)

I was very afraid as IsiChess played so fast after thinking more than 15 minutes
on the wrong ponder move. I guess that is an important fact, to consider
previous thinking time of the opponent in case of a ponder miss.

With sudden death i use something like 30..40 moves as remaining moves.
May be it is smarter to consider state of the game too, like already decisive
score, equal score, about constant score over the last N moves, (difficult)
ending or still middlegame. Maybe with rather equal or constant score, exceeding
move 60 one may expect playing to move 120 or so.

I calculate the average time and a worst case time (about the half of the
remaining time). Then there are some root heuristics based on eval and search so
far, to consider a move as (very) obvious. Statically i look for obvious
singular (re)captures combined with no safe checks. Dynamically i look at the
relative duration of the best move and changes of best move in PV, as well for
score and trend of score of previous iterations (as well oscillating and steady
growing) and of course fail low situations as well as single move replies

Another idea to look for singularity may be a research at some depth, all moves
except the best pv-one with a reduced nullwindow like alpha-someThreshold of two
pawns or so...

Before starting a new iteration i compare elapsed time with X*averageTime, where
X is about 1/8...1/4...1/2...2/3 (default) up to 2/3 of worst case time for huge
fail lows. After worst case time exceeds the seach got interrupted.

Im not sure about the latter, after seeing Shredder's huge timeouts against Diep
and Falcon. May be it is smarter to use
   worst case time = N*remainingTime / (N+1)
with an N > 1.

In case of pondering, i use about the same heuristics, but set some "that is
easy"-flags instead of terminating the search. If a ponder hit occurs with such
set flags the best move is played immediatly.

>
>I suspect that a possible reason for bugs in my time management may be that
>movei simply did not update the remaining moves immediatly before it started to
>ponder and the result is that it assumes wrong number of moves to the time
>control and wrong time when it starts to ponder(I know that it is assuming wrong
>time when it starts to ponder but usually it is not a big problem because the
>target time is nearly the same and it is changed as soon as movei get the time
>command from winboard).
>
>I am not sure if the problem was assuming wrong number of moves and movei is
>supposed to update the remaining number of moves after  every make move but I
>think that it may be better simply to get rid of global varaibles like
>num_moves(number of moves to the next time control, num_moves_1(number of moves
>to the first time control),num_moves_2 number of moves to the second time
>control and.
>have some function with static local varaibles that movei is going to call when
>it needs the information.
>
>Note that I do not plan to get rid of the compliacated formula that I use to
>decide about time management but I plan to have function to calculate relevant
>data instead of updating it in many places when I may forget to update it.

Yes, it is important to have one central instance for time management.


>
>I basically try to calculate number of expected moves to finish the game or the
>next time control and use this information to decide about target time and I
>also use the time of the last iteration to decide if to do another iteration(I
>usually try to finish iteration in most cases with the idea that after finishing
>an iteration there is a smaller chance to change my mind when the main exception
>are cases when the program pondered enough time).
>
>I think that the main problem is not with the formulas but with global varaibles
>when I have global varaibles for number of moves to the next time control or the
>time for the next time control when it is better to have a special file with
>functions that update the time information in static local varaibles so I can
>use the information later when I call them again.
>
>What is your opinion?

A good class design, proper, consistent interfaces, central coding.

Gerd

>
>Uri



This page took 0.01 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.