Page 1 of 1

Reporting a draw in UCI

Posted: Fri May 05, 2017 11:36 pm
by MOBMAT
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?

Re: Reporting a draw in UCI

Posted: Fri May 05, 2017 11:41 pm
by Evert
No.
Under UCI the GUI is supposed to adjudicate the game, so the situation you describe should not occur.

Re: Reporting a draw in UCI

Posted: Sat May 06, 2017 8:10 am
by hgm
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.

Re: Reporting a draw in UCI

Posted: Sat May 06, 2017 8:20 am
by Evert
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.

Re: Reporting a draw in UCI

Posted: Sat May 06, 2017 9:11 am
by hgm
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).

Re: Reporting a draw in UCI

Posted: Wed May 10, 2017 2:53 pm
by tpetzke
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...

Re: Reporting a draw in UCI

Posted: Wed May 10, 2017 4:48 pm
by hgm
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!