uci question, receive stop before pondering starts

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

uci question, receive stop before pondering starts

Post by xr_a_y »

I have a bug in Minic. It is as follow :
- "go ponder" is received
- "stop" is received even before ID loop has started.

So I have no move to return... and thus write nothing to standard output (no bestmove)
It seems the GUI is waiting for something to be written in this case.
What are you doing ?
Is this the solution ?

Code: Select all

bestmove 0000
User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

Re: uci question, receive stop before pondering starts

Post by xr_a_y »

At least it works.

So I conclude that, even when engine is pondering, GUI are expecting a "bestmove" line even if there is no best move.

This looks fair anyway. My bad.
User avatar
Werner Taelemans
Posts: 119
Joined: Mon Feb 03, 2014 11:57 am
Location: Belgium
Full name: Werner Taelemans

Re: uci question, receive stop before pondering starts

Post by Werner Taelemans »

xr_a_y wrote: Tue Jul 06, 2021 3:19 pm What are you doing ?
Is this the solution ?

Code: Select all

bestmove 0000
UCI says:

Code: Select all

  * stop 
        stop calculating as soon as possible,
        don't forget the "bestmove" and possibly the "ponder" token when finishing the search
 
So, you don't have to stop immediately. You can complete the first iteration and return the best move. That's what I do.
User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

Re: uci question, receive stop before pondering starts

Post by xr_a_y »

Werner Taelemans wrote: Tue Jul 06, 2021 4:21 pm UCI says:

Code: Select all

  * stop 
        stop calculating as soon as possible,
        don't forget the "bestmove" and possibly the "ponder" token when finishing the search
 
So, you don't have to stop immediately. You can complete the first iteration and return the best move. That's what I do.
That seems like a good advice !

It seems just sending bestmove 0000 is doing the trick while receivin stop during pondering but it looks clean to at least finish depth 1.
User avatar
hgm
Posts: 27796
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: uci question, receive stop before pondering starts

Post by hgm »

The GUI will not look at the move when it interrupts a ponder search, because the move is useless (not made from the current position). Otherwise it would have sent 'ponderhit'.
User avatar
Werner Taelemans
Posts: 119
Joined: Mon Feb 03, 2014 11:57 am
Location: Belgium
Full name: Werner Taelemans

Re: uci question, receive stop before pondering starts

Post by Werner Taelemans »

hgm wrote: Tue Jul 06, 2021 7:45 pm The GUI will not look at the move when it interrupts a ponder search, because the move is useless (not made from the current position). Otherwise it would have sent 'ponderhit'.
Yes.
I forgot that UCI also accepts nullmoves:

Code: Select all

 A nullmove from the Engine to the GUI should be sent as 0000. 
So, yes, "bestmove 0000" is a perfect solution.