UCI Controller Obligations

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Ras
Posts: 2487
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: UCI Controller Obligations

Post by Ras »

Joerg Oster wrote: Wed Jan 27, 2021 10:24 amBut a null move is not a 'no move'.
Well strictly seen, it means the engine says "I don't move and let the move turn pass", and it does the job for that situation.
Stockfish outputs 'none' in this case.
That's invalid output because it doesn't conform to the specified move format.
However, I wonder why any GUI would send a position with no moves to search.
Makes no sense to me.
Could be a GUI bug, and at least, that shouldn't crash the engine. It could also be an engine bug, and having a defined way to refuse its turn simplifies troubleshooting because you can easily see from the logs why the engine doesn't want to move.
Rasmus Althoff
https://www.ct800.net
User avatar
hgm
Posts: 27790
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: UCI Controller Obligations

Post by hgm »

Joerg Oster wrote: Wed Jan 27, 2021 10:24 amBut a null move is not a 'no move'.
Stockfish outputs 'none' in this case.
Sending 'none' is non-compliant for sure. Sending 0000 is at least a move format defined in the specs. I don't really see the logic that a null move is not a 'no move'. It is certainly not a move; it doesn't move anything.
This is another corner case which is not really specified by the specs.
However, I wonder why any GUI would send a position with no moves to search.
Makes no sense to me.
It makes perfect sense when the GUI doesn't know the rules of the game. You cannot expect a GUI to know the rules of every possible chess variant, and requiring it to know these rules would mean its use would be limited to the very small fraction of variants it does happen to know the rules of. An engine, OTOH, must always be completely aware of all rules of the game, or it would not be able to play it.
Ras
Posts: 2487
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: UCI Controller Obligations

Post by Ras »

Btw., this is what Shredder 12 gives for positions that are already mate or stalemate, or with only illegal searchmoves (upon go depth 4):

Code: Select all

info depth 1 seldepth 1
info time 0 nodes 0
info depth 2 seldepth 2
info time 0 nodes 0
info depth 3 seldepth 3
info time 0 nodes 0
info depth 4 seldepth 4
info time 0 nodes 0
bestmove a1a1
Not what I'd call a reference UCI implementation. :?
Rasmus Althoff
https://www.ct800.net
Joerg Oster
Posts: 937
Joined: Fri Mar 10, 2006 4:29 pm
Location: Germany

Re: UCI Controller Obligations

Post by Joerg Oster »

hgm wrote: Wed Jan 27, 2021 1:24 pm
Joerg Oster wrote: Wed Jan 27, 2021 10:24 amBut a null move is not a 'no move'.
Stockfish outputs 'none' in this case.
Sending 'none' is non-compliant for sure. Sending 0000 is at least a move format defined in the specs. I don't really see the logic that a null move is not a 'no move'. It is certainly not a move; it doesn't move anything.
This is another corner case which is not really specified by the specs.
However, I wonder why any GUI would send a position with no moves to search.
Makes no sense to me.
It makes perfect sense when the GUI doesn't know the rules of the game. You cannot expect a GUI to know the rules of every possible chess variant, and requiring it to know these rules would mean its use would be limited to the very small fraction of variants it does happen to know the rules of. An engine, OTOH, must always be completely aware of all rules of the game, or it would not be able to play it.
That's funny. :lol:
Jörg Oster
User avatar
jshriver
Posts: 1342
Joined: Wed Mar 08, 2006 9:41 pm
Location: Morgantown, WV, USA

Re: UCI Controller Obligations

Post by jshriver »

Joerg Oster wrote: Wed Jan 27, 2021 10:24 am However, I wonder why any GUI would send a position with no moves to search.
Makes no sense to me.
In my case, I wrote a very simple python script that runs the engine starting from standard chess position and go depth X, get bestmove, make best move, go depth X, etc.

So it has no chess logic, just does uci controls to basically tell an engine to play itself. But this causes problems as I mentioned in my initial post. When it gets to a K k scenario, it just keeps going since my only check right now is mate in the info block. Not sure how to over come this unless I write my own fen parser and add check to determine if the position is a stalemate.