Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Detecting Draw by repetition

Author: Robert Hyatt

Date: 05:04:42 10/20/98

Go up one level in this thread


On October 20, 1998 at 04:17:35, Steve Maughan wrote:

>What is the easiest way to detect draw by repetition during a search?
>
>I have thought that setting a flag in the hash entries of the main line would
>work.  Does anyone use a similar technique?  What happens when there are no hash
>tables.
>
>Thanks in advance.
>
>Steve Maughan


There are two easy approaches.

(1) use the hash table as you suggest. When you create an active position by
making a move, you "open" the position in the hash table by storing the key if
it isn't already there, and setting the "open" bit.  When you unmake that move,
you clear the "open flag".  Now, if you get a hash hit, and "open" is set, you
can return repetition.

(2) use a list of hash signatures, one for each ply in the search, plus 1 for
each move since the last non-capture/non-pawn-push in the game history.

(2) is the most flexible because (1) will give you significantl problems if you
ever want to do a parallel search.  (2) done carefully is not expensive.  I
don't spend more than 1% of the total time in this code, usually way less...



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.