How to recognize draw by repetition ?

Programming Topics (Computer Chess) and technical aspects as test techniques, book building, program tuning etc

Moderator: Andres Valverde

How to recognize draw by repetition ?

Postby Joerg Nowak » 18 Jun 2006, 10:07

Hello all,


in our first test games we phase a first problem:

We got the first output created by parsing the uci output from the engine (played on some computers using the BOINC platform):

fen bqnnrbkr/pppppppp/8/8/8/8/PPPPPPPP/BQNNRBKR w EHeh - 0 1 moves e2e4 e7e5 b2b3 b7b6 c1d3 f7f6 f2f3 c7c6 d3f2 d7d5 e4d5 c6d5 d2d4 b6b5 d1e3 e5d4 e3f5 e8e1 b1e1 b8e5 e1e5 f6e5 f1b5 f8a3 g1h1 g8h8 f1e1 f8f5 b5d7 f5f7 d7c8 f7e7 g1f1 d8c6 c2c3 d4c3 a1c3 a3d6 f2g4 g8f7 c8a6 d5d4 c3d2 f7f8 e1c1 h7h5 g4f2 c6b4 d2b4 d6b4 c1c8 e7e8 c8c7 e8e7 c7c8 e7e8 c8c7 e8e7 c7c8 e7e8 c8c7 e8e7 c7c8 e7e8 c8c7 e8e7 c7c8 e7e8 c8c7 e8e7 c7c8 e7e8 c8c7 e8e7 c7c8 e7e8 c8c7 e8e7 c7c8 e7e8 c8c7 e8e7 c7c8 e7e8 c8c7 e8e7 c7c8 e7e8 c8c7 e8e7 c7c8 e7e8 c8c7 e8e7

The game is drawn by repitition since many moves. But because we don't have a GUI we don't recognize it. Is there a way to find out drawn by repitition using the uci output ?
Or do we need an algorithm to find it out from the moves ?

Any suggestions ?
Joerg Nowak
Joerg Nowak
 
Posts: 7
Joined: 12 Sep 2005, 12:13
Location: Schwetzingen, Germany

Re: How to recognize draw by repetition ?

Postby Gerd Isenberg » 19 Jun 2006, 06:30

Engines should consider threefold repetitions - and i guess they do according to draw score. Most already consider a twofold repetition as draw. Usually engines keep a record of zobrist-keys. As long as reversible moves are played, they compare the current zobristkey with current-4,-6,-8... If there is a match, the position already occured before.

If the engine-gui interface/protocol degrade engines stateless, the gui is responsable to terminate the game. But engines may do draw-claims. If an engine will force a threefold repetition with the next move, the engine may claim "draw-claim - i intend to repeat the position a second time by playing xxx" - or if the repetition already occured by opponent's move (who did not claim draw as descibed before) "draw-claim - the position already occured the third time". If the draw-claims are correct (they may be incorrect due to engine bugs, eg. not considering ep and castle flags correctly), the gui should accept it and declare game over due to threefold repetition.

If both engines don't claim draw, which is fine with the rules, the game should continue, with the option to transpose to another variation. To avoid "endless" repetitions, the gui may declare a draw after a four- or fivefold repetition. So the statefull gui should act like an arbiter and should therefor correctly implement repetition detection.

Hope that helps. But don't ask me how current protocols like winboard and uci implement such cases accordently.

Gerd
Gerd Isenberg
 
Posts: 285
Joined: 31 Jan 2005, 20:31
Location: Hattingen, Germany


Return to Programming and Technical Discussions

Who is online

Users browsing this forum: No registered users and 46 guests