likeawizard wrote: ↑Wed Nov 16, 2022 4:58 pm
I would like to clarify the exact ponder protocol with uci.
Say my engine was told to search a move and we have something like this: (with lines > indicating this is sent to the gui and < is sent from the gui to the engine)
Code: Select all
>bestmove e2e4 ponder e7e5
<position fen XXXX moves .... e2e4 d7e5 (sets up the position to ponder)
< go ponder wtime xx btime ....
At this point there can be two options either 'ponderhit' e7e5 was played or 'stop'. Another move was played.
So if ponderhit was sent to my understanding the gui will now wait for the engine to stop pondering and return a bestmove command...
Is it correct so far?
Correct!
likeawizard wrote: ↑Wed Nov 16, 2022 4:58 pm
What if stop is called? Should the engine still emit 'bestmove' that it found pondering, that is kinda useless for the gui as the game did not progress that way or should it supress the bestmove on stop when pondering? stop silently and wait from the gui to feed it a new position and go command.
Your engine must return a bestmove ASAP. That is a rule by UCI protocol.
Once a chess GUI flags that it is waiting for a bestmove, it may ignore other commands from and postpone sending other tasks to your engine. It may consider your engine as being crashed without bestmove responding after a while.
If your engine can't produce the best move, you may use '0000' (as a null move) but using any legal move is much better.
In the case of BanksiaGUI, it may send "stop" to your engine when it is pondering if:
- The game is over: timeout for your engine; the rival crashed or resigned; users finished/closed/reset the game. The move of your bestmove is not important and will be ignored
- The user pressed the button "Move Now" (he doesn't want to wait any longer and wants the engine to make a move immediately). The move of your bestmove is useful and will be used