"ping" and pondering

Discussions about the WinBoard protocol. Here you can also report bugs and request new features.

Moderators: hgm, Andres Valverde

"ping" and pondering

Postby jdart » 18 Nov 2018, 23:13

The CEGT protocol description says re "ping":

In this command, N is a decimal number. When you receive the command, reply by sending the string pong N, where N is the same number you received. Important: You must not reply to a "ping" command until you have finished executing all commands that you received before it. Pondering does not count; if you receive a ping while pondering, you should reply immediately and continue pondering. Because of the way xboard uses the ping command, if you implement the other commands in this protocol, you should never see a "ping" command when it is your move; however, if you do, you must not send the "pong" reply to xboard until after you send your move. For example, xboard may send "?" immediately followed by "ping". If you implement the "?" command, you will have moved by the time you see the subsequent ping command. Similarly, xboard may send a sequence like "force", "new", "ping". You must not send the pong response until after you have finished executing the "new" command and are ready for the new game to start.


I have been interpreting this as meaning ping during ponder always should be immediately responded to. However, I am encountering an issue when the UI sends a "result" command, due to an adjudicated draw for example. Here (the UI is cutechess-cli) I see "force", "result" and then "ping" sent to the engine. The engine currently sends "pong" right away if it was pondering. However, it appears this is incorrect: what happens is it then gets a bunch of commands to start a new game, most of which arrive while the ponder search is still happening (because "result" began the process of terminating the search but it is not terminated yet). And it really isn't ready to process those. So it seems to me it should terminate the search when force and/or result are received, and then send the "pong" command after search termination. So in other words, "reply immediately and continue pondering" doesn't apply if you have already received a ponder-terminating command prior to "ping."
User avatar
jdart
 
Posts: 105
Joined: 26 Sep 2004, 21:11
Location: San Jose, CA

Re: "ping" and pondering

Postby Brian Richardson » 19 Nov 2018, 22:40

Not sure if this helps, but Tinker stops searching (including pondering) on any "force", "stop", or "exit" command.
Brian
Brian Richardson
 
Posts: 42
Joined: 01 Oct 2004, 05:22

Re: "ping" and pondering

Postby jdart » 20 Nov 2018, 15:40

stops searching (including pondering) on any "force", "stop", or "exit" command


I do too but with mulithreading especially there can be a delay between determining to stop searching and actually stopping all threads and finishing up the search.

--Jon
User avatar
jdart
 
Posts: 105
Joined: 26 Sep 2004, 21:11
Location: San Jose, CA

Re: "ping" and pondering

Postby H.G.Muller » 24 Nov 2018, 11:50

I guess the description is a bit ambiguous: "while pondering" here means "when according to all commands it has received so far it should be pondering". In the mentioned case the "force" command terminates the pondering, so the "ping" is not received "while pondering".

The purpose of "ping" is to inform the GUI whether all commands received before have been processed. This can be done by queuing "ping" just like any other command. The remark in the specs just intends to point out that pondering should not be considered processing of any previous command (e.g. "hard"), but is basically just something the engine does as a passtime when it is waiting for the next command.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL


Return to WinBoard development and bugfixing

Who is online

Users browsing this forum: No registered users and 10 guests