Reporting a draw in UCI

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
MOBMAT
Posts: 78
Joined: Sat Feb 04, 2017 10:57 pm
Location: USA

Reporting a draw in UCI

Post by MOBMAT » Fri May 05, 2017 9:36 pm

if my engine detects a 3-fold repetition at the root before it move, meaning that the position at the root has been "seen" three times already, is there a way to report this through the UCI interface to request a draw?
Vince S
Author of MOBMAT

"Reductions, extensions, and pruning, oh my!"

User avatar
Evert
Posts: 2923
Joined: Fri Jan 21, 2011 11:42 pm
Location: NL
Contact:

Re: Reporting a draw in UCI

Post by Evert » Fri May 05, 2017 9:41 pm

No.
Under UCI the GUI is supposed to adjudicate the game, so the situation you describe should not occur.

User avatar
hgm
Posts: 23718
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Reporting a draw in UCI

Post by hgm » Sat May 06, 2017 6:10 am

In an invalid position you could refuse to move by printing "bestmove 0000", in this case with a draw score ("info score cp 0 pv 0000"). This is compliant with the UCI standard. And in the interpretation that the GUI must prevent this situation should ever occur, (which is dubious, as FIDE rules say that repetition and 50-move draws must be claimed, and are not automatic), everything would be compliant, no matter what you print.

User avatar
Evert
Posts: 2923
Joined: Fri Jan 21, 2011 11:42 pm
Location: NL
Contact:

Re: Reporting a draw in UCI

Post by Evert » Sat May 06, 2017 6:20 am

hgm wrote:(which is dubious, as FIDE rules say that repetition and 50-move draws must be claimed, and are not automatic)
In which case the interpretation is that the GUI will claim automatically on the engine's behalf. Also debatable, but it's no different to the GUI resigning on behalf of the engine, or even playing out tablebase positions.

User avatar
hgm
Posts: 23718
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Reporting a draw in UCI

Post by hgm » Sat May 06, 2017 7:11 am

Well, in that interpretation the GUI could decide not to claim. So the situation is not illegal, (it violates neither FIDE rules nor UCI specs) and the engine should be prepared to handle it. Playing a null move would be a possible way to handle it. Arguably FIDE rules would allow you to do that in that situation (i.e. stop your clock without maing a move).

tpetzke
Posts: 686
Joined: Thu Mar 03, 2011 3:57 pm
Location: Germany
Contact:

Re: Reporting a draw in UCI

Post by tpetzke » Wed May 10, 2017 12:53 pm

Just play the move again that you played previously (that repeated the position) if you by now did still not find a better one and report a draw score.

All GUIs I know will end the match after 3fold repetition although they should wait for 5fold.

I would not report null moves, might be seen as an illegal move and lose the game.

Thomas...
Thomas...

=======
http://macechess.blogspot.com - iCE Chess Engine

User avatar
hgm
Posts: 23718
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Reporting a draw in UCI

Post by hgm » Wed May 10, 2017 2:48 pm

But who cares if you lose the game through a fault of the GUI, or a rule violation of the opponent? Never cater to bugs of others!

Post Reply