Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: How to program search timeout ?

Author: Carsten Kossendey

Date: 05:12:55 02/04/98

Go up one level in this thread


On February 04, 1998 at 07:24:03, Rudolf Posch wrote:

>I have a problem in my personal chess program with handling properly
>search timeout (stopping search after an preallocated time).
>I usually dont start a new iteration when timeout has occured, but I
>have also some time management code at this place (comparing remaining
>time with spent time, spending extra time under certain conditions like
>if the search result is low,...).
>But this measure is not sufficent, it can take quite a long time until
>the search finishes one iteration. For instance when there are 5 seconds
>allocated for a computer ply, the search stops actually after e.g. 12
>seconds, because the last iteration lasted longer as expected (because
>of excessive quiescence search, deepening at chess etc.).
>
>So my problem lies in interrupting a running search.
>
>In the recursive procedure call search() I have in the move loop a point
>where I test the timeout condition.
>If timeout is true,the search may be in a node in some depth i with a
>current minmax value and current principal variations in all searched
>depths <= i. Usually not all plies at this node (and shallower nodes)
>have been searched.
>So what do to ?
>1) Exit search()in depth i at timeout=true unconditionally, returning
>the current minmax value. The search continues in depth i-1 and comes
>again to the timeout test, only 1 level shallower, ... and so on, until
>depth 0 is reached.
>A principal variation at depth null builds up, which may contain the
>wrong move.
>This plain method seemingly doesnt work.

[snip]

How about not building a PV if the search times out? Works for me. Just
place a "if (timeout) return (0);" between each call to
search()/quiescence() and the following value check. Fast and safe.



This page took 0 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.