UCI nullmove

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

UCI nullmove

Post by mcostalba »

From UCI protocol specification (http://wbec-ridderkerk.nl/html/UCIProtocol.html)

Code: Select all

Move format:
------------

The move format is in long algebraic notation.
A nullmove from the Engine to the GUI should be send as 0000.
And also

Code: Select all

"setoption name Nullmove value true\n"
What is this Nullmove option ? And what it stands for ? i don't understand when/if an engine should send nullmove to the GUI or when/if a GUI should send nullmove to the engine.

Thanks
Marco
zamar
Posts: 613
Joined: Sun Jan 18, 2009 7:03 am

Re: UCI nullmove

Post by zamar »

mcostalba wrote:

Code: Select all

"setoption name Nullmove value true\n"
What is this Nullmove option ? And what it stands for ?
Just a wild guess: to enable/disable the use of null move in search.
i don't understand when/if an engine should send nullmove to the GUI or when/if a GUI should send nullmove to the engine.
There exists some programs (fx. Fritz 7) which also do null move in PV search. Then the PV could look like "e2e4 0000 d2d4 d7d5". Or if program wants to report the line it's currently examining it can use this syntax.
Joona Kiiski
Edmund
Posts: 670
Joined: Mon Dec 03, 2007 3:01 pm
Location: Barcelona, Spain

Re: UCI nullmove

Post by Edmund »

Regarding the option I think it makes perfect sense to let the user decide whether or not the engine should do nullmove pruning. This would help anyone who wants to analyze certain zugzwang positions and is particularly relevant if the engine doesnt do any nullmove verification search.

The sending of nullmoves (0000) also sounds reasonable. Most GUIs support Nullmove input by the user. Somehow this information has to be passed over to the analyzing engine. The other way round, most engines don't do nullmoves in PVs, but there are still uci commands like "current line" which, if sent may very likely also contains nullmoves.
User avatar
Desperado
Posts: 879
Joined: Mon Dec 15, 2008 11:45 am

Re: UCI nullmove

Post by Desperado »

Maybe it is just a communication feature, that allows to tell the
gui that an engine doesnt support nullmove in any form.
So the gui will never send a fen with a move-string that contains
a nullmove (i am thinking of analyse mode for example).

Just a guess.

Michael
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: UCI nullmove

Post by Sven »

Desperado wrote:Maybe it is just a communication feature, that allows to tell the
gui that an engine doesnt support nullmove in any form.
So the gui will never send a fen with a move-string that contains
a nullmove (i am thinking of analyse mode for example).

Just a guess.

Michael
@Marco: you quoted two very different parts of the UCI protocol spec. The first one is about the move string format, the second is from the section that describes the possible ways of defining UCI options in general. In the latter part, "Nullmove" is nothing but an example for the "boolean" type of UCI options, i.e. those you can set to "true" or "false", "yes" or "no", ... But nowhere is stated that "Nullmove" is any kind of a standard UCI option from the viewpoint of the UCI spec. Even though nowadays we might have kind of "de facto standards" for UCI options, in principle these are still defined by engines, not by the protocol.

So I strongly believe that the option name "Nullmove" that is used in the UCI protocol has no special meaning whatsoever but is just an example. SMK could have used "Bluescreen" as well :-)

As to your first quote, I think it is fully unrelated to the second part of the "Nullmove" option example, and only states that if an engine wants to send a move string representing the null move in any context (which might be the "best move" - indicating the inability of the engine to send a real best move for any reason - as well as a part of the variation currently analyzed), it has to use "0000" for that purpose.

Sven
mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Re: UCI nullmove

Post by mcostalba »

Ok, thanks for the explanations.

SF does not perform nullsearch in PV, so we never could have a PV line with "0000".

So the bottom line is that this nullmove thing is nothing that we should care about ;-)
User avatar
hgm
Posts: 27814
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: UCI nullmove

Post by hgm »

You should use it in the bestmove command when there is no legal move in the loaded position (e.g. because you are mated). In other positions itcan be used to resign or claima 3-fold-rep or 50-move draw (i.e. any situation where you want to express refusal to play a legal move).

Note that it is NOT important whether Stockfish uses null move in PV itself. A GUI could send it a null move, e.g.

position startpos moves e2e4 e7e5 g1f3 0000 f3e5 d8e7
go infinite


and you don't want it to go haywire in that case
mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Re: UCI nullmove

Post by mcostalba »

hgm wrote:You should use it in the bestmove command when there is no legal move in the loaded position (e.g. because you are mated).
In this case we send MOVE_NONE that is different from MOVE_NULL.

Namely we send "bestmove (none)" to the GUI. Where is documented that in case of no legal move we should send "bestmove 0000" instead ?
hgm wrote: In other positions it can be used to resign or claim a 3-fold-rep or 50-move draw (i.e. any situation where you want to express refusal to play a legal move).
Nowhere in UCI is documented the possibility for the engine to "express refusal" or similar behaviours. Could you please point me to that part in case I've missed ?

hgm wrote: A GUI could send it a null move, e.g.

position startpos moves e2e4 e7e5 g1f3 0000 f3e5 d8e7
go infinite


and you don't want it to go haywire in that case
This is another undocumented feature. Where is written that a GUI can send a line with "0000" and what a correctly behaving engine is supposed to do upon receiving "0000" ?

Thanks
Marco
zamar
Posts: 613
Joined: Sun Jan 18, 2009 7:03 am

Re: UCI nullmove

Post by zamar »

hgm wrote:You should use it in the bestmove command when there is no legal move in the loaded position (e.g. because you are mated). In other positions itcan be used to resign or claima 3-fold-rep or 50-move draw (i.e. any situation where you want to express refusal to play a legal move).
Hi hgm!

My understanding of the specs has always been that it's the responsibility of the GUI (or polyglot) to detect mates, 3-fold reps and 50-move draw. So the behaviour of the engine is undefined in such cases.
Joona Kiiski
User avatar
hgm
Posts: 27814
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: UCI nullmove

Post by hgm »

zamar wrote:My understanding of the specs has always been that it's the responsibility of the GUI (or polyglot) to detect mates, 3-fold reps and 50-move draw. So the behaviour of the engine is undefined in such cases.
Where exactly in the specs does it say that?