what is the importance of the ping command?

Archive of the old Parsimony forum. Some messages couldn't be restored. Limitations: Search for authors does not work, Parsimony specific formats do not work, threaded view does not work properly. Posting is disabled.

what is the importance of the ping command?

Postby Uri Blass » 24 Sep 2002, 09:56

Geschrieben von: / Posted by: Uri Blass at 24 September 2002 10:56:55:

In the explanation I read:
"Its purpose is to allow several race conditions that could occur in previous versions of the protocol to be fixed, so it is highly recommended that you implement it."
Sorry but I do not understand.
They claim that it is needed in all the engines.
I think that giving a simple example for a case that this command may be productive.
I am not interested in some old interface of winboard that does not support protocol version 2 because I do not expect people to use it so I need an example when supporting ping can help engines.
Uri
Uri Blass
 

Re: what is the importance of the ping command?

Postby Andreas Herrmann » 24 Sep 2002, 10:09

Geschrieben von: / Posted by: Andreas Herrmann at 24 September 2002 11:09:54:
Als Antwort auf: / In reply to: what is the importance of the ping command? geschrieben von: / posted by: Uri Blass at 24 September 2002 10:56:55:
In the explanation I read:
"Its purpose is to allow several race conditions that could occur in previous versions of the protocol to be fixed, so it is highly recommended that you implement it."
Sorry but I do not understand.
They claim that it is needed in all the engines.
I think that giving a simple example for a case that this command may be productive.
I am not interested in some old interface of winboard that does not support protocol version 2 because I do not expect people to use it so I need an example when supporting ping can help engines.
Uri
Hi Uri,
i haven't implemented "ping" yet, but i think it's only useful for the GUI to check if the engine is alive. So if the engine answers to ping the GUI knows all is ok. But i'm not sure with my thoughts.

have a nice day
Andreas
Andreas Herrmann
 

Re: what is the importance of the ping command?

Postby Sune Fischer » 24 Sep 2002, 10:21

Geschrieben von: / Posted by: Sune Fischer at 24 September 2002 11:21:58:
Als Antwort auf: / In reply to: Re: what is the importance of the ping command? geschrieben von: / posted by: Andreas Herrmann at 24 September 2002 11:09:54:
In the explanation I read:
"Its purpose is to allow several race conditions that could occur in previous versions of the protocol to be fixed, so it is highly recommended that you implement it."
Sorry but I do not understand.
They claim that it is needed in all the engines.
I think that giving a simple example for a case that this command may be productive.
I am not interested in some old interface of winboard that does not support protocol version 2 because I do not expect people to use it so I need an example when supporting ping can help engines.
Uri
Hi Uri,
i haven't implemented "ping" yet, but i think it's only useful for the GUI to check if the engine is alive. So if the engine answers to ping the GUI knows all is ok. But i'm not sure with my thoughts.

have a nice day
Andreas
Mine is doing fine without it, the problem is the command is a little special and requires some modification to the code. You shouldn't abort search and you shouldn't execute it right a way, that is a very special command, I don't see an easy fix to this without major surgery on the code.
-S.
Sune Fischer
 

Re: what is the importance of the ping command?

Postby Vladimir Medvedev » 24 Sep 2002, 10:25

Geschrieben von: / Posted by: Vladimir Medvedev at 24 September 2002 11:25:10:
Als Antwort auf: / In reply to: what is the importance of the ping command? geschrieben von: / posted by: Uri Blass at 24 September 2002 10:56:55:

I had the same question some time ago (look at thread http://f11.parsimony.net/forum16635/messages/33883.htm)
After I implemented ping/pong in GreKo, it became more stable in games on FICS and under WBTM - hanging on move 1 more less now.
But I can't write example scenarios...
Vladimir Medvedev
 

Re: what is the importance of the ping command?

Postby Uri Blass » 24 Sep 2002, 10:47

Geschrieben von: / Posted by: Uri Blass at 24 September 2002 11:47:03:
Als Antwort auf: / In reply to: Re: what is the importance of the ping command? geschrieben von: / posted by: Sune Fischer at 24 September 2002 11:21:58:
In the explanation I read:
"Its purpose is to allow several race conditions that could occur in previous versions of the protocol to be fixed, so it is highly recommended that you implement it."
Sorry but I do not understand.
They claim that it is needed in all the engines.
I think that giving a simple example for a case that this command may be productive.
I am not interested in some old interface of winboard that does not support protocol version 2 because I do not expect people to use it so I need an example when supporting ping can help engines.
Uri
Hi Uri,
i haven't implemented "ping" yet, but i think it's only useful for the GUI to check if the engine is alive. So if the engine answers to ping the GUI knows all is ok. But i'm not sure with my thoughts.

have a nice day
Andreas
Mine is doing fine without it, the problem is the command is a little special and requires some modification to the code. You shouldn't abort search and you shouldn't execute it right a way, that is a very special command, I don't see an easy fix to this without major surgery on the code.
-S.
I do not understand what is the problem?
You can declare a global varaible
ping_flag
When you start to calculate and it is your move you can have
ping_flag=0;
When you get ping and it is your move you can change the value of ping_flag to 1.
After you play your move you can reply pong N only if ping_flag=1
You can remember N also in a global variable.

What I do not understand is what is the meaning of pondering does not count.
Do you get a special command from winboard to ponder?
I know that you get easy and hard but these are only commands to allow or not allow pondering.
After you get a move you ponder without a special command so I do not think that pondering is a winboard command.
Uri
Uri Blass
 

Re: what is the importance of the ping command?

Postby Odd Gunnar Malin » 24 Sep 2002, 10:53

Geschrieben von: / Posted by: Odd Gunnar Malin at 24 September 2002 11:53:53:
Als Antwort auf: / In reply to: Re: what is the importance of the ping command? geschrieben von: / posted by: Sune Fischer at 24 September 2002 11:21:58:
In the explanation I read:
"Its purpose is to allow several race conditions that could occur in previous versions of the protocol to be fixed, so it is highly recommended that you implement it."
Sorry but I do not understand.
They claim that it is needed in all the engines.
I think that giving a simple example for a case that this command may be productive.
I am not interested in some old interface of winboard that does not support protocol version 2 because I do not expect people to use it so I need an example when supporting ping can help engines.
Uri
Hi Uri,
i haven't implemented "ping" yet, but i think it's only useful for the GUI to check if the engine is alive. So if the engine answers to ping the GUI knows all is ok. But i'm not sure with my thoughts.

have a nice day
Andreas
Mine is doing fine without it, the problem is the command is a little special and requires some modification to the code. You shouldn't abort search and you shouldn't execute it right a way, that is a very special command, I don't see an easy fix to this without major surgery on the code.
-S.
Just put it in a linked-list with int's (pingnumber) and empty this list when the search return with a move.
But you can also disable it with the feature command.
I added later a command que where I put all command that could not be done when engine searches. Currently it is only 'hash' and 'set ' I put in there. I have keept the linked-list (in real it is the std::vector) for ping. For draw offer I just use a variable.
I think the ping is most useful between games if you do some sort of processing here, update tables etc. Especially when a rematch request comes from a remote opponent, Winboard have to know if you are ready yet.
Odd Gunnar
Odd Gunnar Malin
 

Re: what is the importance of the ping command?

Postby Uri Blass » 24 Sep 2002, 11:16

Geschrieben von: / Posted by: Uri Blass at 24 September 2002 12:16:44:
Als Antwort auf: / In reply to: Re: what is the importance of the ping command? geschrieben von: / posted by: Odd Gunnar Malin at 24 September 2002 11:53:53:
In the explanation I read:
"Its purpose is to allow several race conditions that could occur in previous versions of the protocol to be fixed, so it is highly recommended that you implement it."
Sorry but I do not understand.
They claim that it is needed in all the engines.
I think that giving a simple example for a case that this command may be productive.
I am not interested in some old interface of winboard that does not support protocol version 2 because I do not expect people to use it so I need an example when supporting ping can help engines.
Uri
Hi Uri,
i haven't implemented "ping" yet, but i think it's only useful for the GUI to check if the engine is alive. So if the engine answers to ping the GUI knows all is ok. But i'm not sure with my thoughts.

have a nice day
Andreas
Mine is doing fine without it, the problem is the command is a little special and requires some modification to the code. You shouldn't abort search and you shouldn't execute it right a way, that is a very special command, I don't see an easy fix to this without major surgery on the code.
-S.
Just put it in a linked-list with int's (pingnumber) and empty this list when the search return with a move.
If I need a list then it means that if
I get ping 5 and ping 7 then I need to respond pong 5 and later pong 7 when only pong 7 is not enough.
It is not clear from the explanation.
If the target is only to know that the engine is alive then pong for the last ping is enough.
Uri
Uri Blass
 

Re: what is the importance of the ping command?

Postby Odd Gunnar Malin » 24 Sep 2002, 11:30

Geschrieben von: / Posted by: Odd Gunnar Malin at 24 September 2002 12:30:02:
Als Antwort auf: / In reply to: Re: what is the importance of the ping command? geschrieben von: / posted by: Uri Blass at 24 September 2002 12:16:44:
In the explanation I read:
"Its purpose is to allow several race conditions that could occur in previous versions of the protocol to be fixed, so it is highly recommended that you implement it."
Sorry but I do not understand.
They claim that it is needed in all the engines.
I think that giving a simple example for a case that this command may be productive.
I am not interested in some old interface of winboard that does not support protocol version 2 because I do not expect people to use it so I need an example when supporting ping can help engines.
Uri
Hi Uri,
i haven't implemented "ping" yet, but i think it's only useful for the GUI to check if the engine is alive. So if the engine answers to ping the GUI knows all is ok. But i'm not sure with my thoughts.

have a nice day
Andreas
Mine is doing fine without it, the problem is the command is a little special and requires some modification to the code. You shouldn't abort search and you shouldn't execute it right a way, that is a very special command, I don't see an easy fix to this without major surgery on the code.
-S.
Just put it in a linked-list with int's (pingnumber) and empty this list when the search return with a move.
If I need a list then it means that if
I get ping 5 and ping 7 then I need to respond pong 5 and later pong 7 when only pong 7 is not enough.
It is not clear from the explanation.
If the target is only to know that the engine is alive then pong for the last ping is enough.
Uri
I would guess it's enough to send the last pong but who knows how the future is.
If it is a vectorpinging or int pinging doesn't add to much.
Saving ping:
pinging.push_back(atoi(input.c_str()));
Answer ping:
int i=0;
while (i
Odd Gunnar Malin
 

Re: what is the importance of the ping command?

Postby Sune Fischer » 24 Sep 2002, 11:33

Geschrieben von: / Posted by: Sune Fischer at 24 September 2002 12:33:42:
Als Antwort auf: / In reply to: Re: what is the importance of the ping command? geschrieben von: / posted by: Uri Blass at 24 September 2002 11:47:03:
In the explanation I read:
"Its purpose is to allow several race conditions that could occur in previous versions of the protocol to be fixed, so it is highly recommended that you implement it."
Sorry but I do not understand.
They claim that it is needed in all the engines.
I think that giving a simple example for a case that this command may be productive.
I am not interested in some old interface of winboard that does not support protocol version 2 because I do not expect people to use it so I need an example when supporting ping can help engines.
Uri
Hi Uri,
i haven't implemented "ping" yet, but i think it's only useful for the GUI to check if the engine is alive. So if the engine answers to ping the GUI knows all is ok. But i'm not sure with my thoughts.

have a nice day
Andreas
Mine is doing fine without it, the problem is the command is a little special and requires some modification to the code. You shouldn't abort search and you shouldn't execute it right a way, that is a very special command, I don't see an easy fix to this without major surgery on the code.
-S.
I do not understand what is the problem?
You can declare a global varaible
ping_flag
When you start to calculate and it is your move you can have
ping_flag=0;
When you get ping and it is your move you can change the value of ping_flag to 1.
After you play your move you can reply pong N only if ping_flag=1
You can remember N also in a global variable.
What I do not understand is what is the meaning of pondering does not count.
Do you get a special command from winboard to ponder?
I know that you get easy and hard but these are only commands to allow or not allow pondering.
After you get a move you ponder without a special command so I do not think that pondering is a winboard command.
Uri
No this wouldn't work, because you may get ping first and then usermove later if you are pondering for instance. So you have to get that ping out of the way (out of the pipe) and be ready for the next command.
But you idea is close, only the ping_flag should be N and not 1, then I can simply check if (ping_flag!=0) printf("pong %d\n",ping_flag).
However, _where_ do I do this check?
I can't put it in the if else if structure of my other commands, and some commands are done sequentially without peeking. It's not clear to me where this fits in with the others...
yes and no, you get "easy" or "hard" sometime (probably in the beginning, but expect them at any time), so you should ponder if you are in GO_MODE and ponder is on (which means you received 'hard'). This is the state machine approach of WB, UCI is different here.
Basicly you can do this check after you delivered a move to winboard, then go straight to the pondering search.
Right, you can say that. WB only turns pondering on and off, it doesn't tell you when to do it.
-S.
Sune Fischer
 

Re: what is the importance of the ping command?

Postby Peter Fendrich » 24 Sep 2002, 11:34

Geschrieben von: / Posted by: Peter Fendrich at 24 September 2002 12:34:02:
Als Antwort auf: / In reply to: what is the importance of the ping command? geschrieben von: / posted by: Uri Blass at 24 September 2002 10:56:55:
In the explanation I read:
"Its purpose is to allow several race conditions that could occur in previous versions of the protocol to be fixed, so it is highly recommended that you implement it."
Sorry but I do not understand.
They claim that it is needed in all the engines.
I think that giving a simple example for a case that this command may be productive.
I am not interested in some old interface of winboard that does not support protocol version 2 because I do not expect people to use it so I need an example when supporting ping can help engines.
Uri
That is the way WinBoard secure that the engine has reached some required state before sending next command. Sometimes if WinBoard and the engine is not synchronised there is risk for receving and sending commands in the wrong order.
When WinBoard receive the pong x, he knows that the engine has consumed all commands and is ready to get the next one. When the engine is pondering that doesn't apply and the engine should return pong x immidiately.
If it takes very long time before the pong commands is returned, WinBoard assumes that the engine is dead.
Peter
Peter Fendrich
 

Re: what is the importance of the ping command?

Postby Odd Gunnar Malin » 24 Sep 2002, 11:38

Geschrieben von: / Posted by: Odd Gunnar Malin at 24 September 2002 12:38:03:
Als Antwort auf: / In reply to: Re: what is the importance of the ping command? geschrieben von: / posted by: Odd Gunnar Malin at 24 September 2002 12:30:02:
In the explanation I read:
"Its purpose is to allow several race conditions that could occur in previous versions of the protocol to be fixed, so it is highly recommended that you implement it."
Sorry but I do not understand.
They claim that it is needed in all the engines.
I think that giving a simple example for a case that this command may be productive.
I am not interested in some old interface of winboard that does not support protocol version 2 because I do not expect people to use it so I need an example when supporting ping can help engines.
Uri
Hi Uri,
i haven't implemented "ping" yet, but i think it's only useful for the GUI to check if the engine is alive. So if the engine answers to ping the GUI knows all is ok. But i'm not sure with my thoughts.

have a nice day
Andreas
Mine is doing fine without it, the problem is the command is a little special and requires some modification to the code. You shouldn't abort search and you shouldn't execute it right a way, that is a very special command, I don't see an easy fix to this without major surgery on the code.
-S.
Just put it in a linked-list with int's (pingnumber) and empty this list when the search return with a move.
If I need a list then it means that if
I get ping 5 and ping 7 then I need to respond pong 5 and later pong 7 when only pong 7 is not enough.
It is not clear from the explanation.
If the target is only to know that the engine is alive then pong for the last ping is enough.
Uri
I would guess it's enough to send the last pong but who knows how the future is.
This is C++. If you use C I guess you have allready made this standard containers many times.
Odd Gunnar
Fooled for the second time in an hour. Hmmm

>If it is a vector<int>pinging or int pinging doesn't add to much.
>Saving ping:
>pinging.push_back(atoi(input.c_str()))&#59;
>Answer ping:
>int i=0&#59;
>while (i<pinging.size())
>  cout "pong " << pinging[i++]&#59;
>pinging.clear()&#59;

The first time was earlier in this thread:
"Currently it is only 'hash' and 'set <evaluation term>' I put in there."
Odd G
Odd Gunnar Malin
 

Re: what is the importance of the ping command?

Postby Sune Fischer » 24 Sep 2002, 11:39

Geschrieben von: / Posted by: Sune Fischer at 24 September 2002 12:39:51:
Als Antwort auf: / In reply to: Re: what is the importance of the ping command? geschrieben von: / posted by: Peter Fendrich at 24 September 2002 12:34:02:
In the explanation I read:
"Its purpose is to allow several race conditions that could occur in previous versions of the protocol to be fixed, so it is highly recommended that you implement it."
Sorry but I do not understand.
They claim that it is needed in all the engines.
I think that giving a simple example for a case that this command may be productive.
I am not interested in some old interface of winboard that does not support protocol version 2 because I do not expect people to use it so I need an example when supporting ping can help engines.
Uri
That is the way WinBoard secure that the engine has reached some required state before sending next command. Sometimes if WinBoard and the engine is not synchronised there is risk for receving and sending commands in the wrong order.
When WinBoard receive the pong x, he knows that the engine has consumed all commands and is ready to get the next one. When the engine is pondering that doesn't apply and the engine should return pong x immidiately.
If it takes very long time before the pong commands is returned, WinBoard assumes that the engine is dead.
Peter
Ahh yes, it seems pondering is an exception!
What about analysis?
-S.
Sune Fischer
 

Re: what is the importance of the ping command?

Postby Alessandro Damiani » 24 Sep 2002, 11:40

Geschrieben von: / Posted by: Alessandro Damiani at 24 September 2002 12:40:38:
Als Antwort auf: / In reply to: what is the importance of the ping command? geschrieben von: / posted by: Uri Blass at 24 September 2002 10:56:55:
In the explanation I read:
"Its purpose is to allow several race conditions that could occur in previous versions of the protocol to be fixed, so it is highly recommended that you implement it."
Sorry but I do not understand.
They claim that it is needed in all the engines.
I think that giving a simple example for a case that this command may be productive.
I am not interested in some old interface of winboard that does not support protocol version 2 because I do not expect people to use it so I need an example when supporting ping can help engines.
Uri
The command "ping" is used to synchronize communication between the GUI and the engine. If communication gets out of sync in a _critical_situation_ wrong behaviour of one of both objects could be the consequence.
Alessandro
Alessandro Damiani
 

Re: what is the importance of the ping command?

Postby Uri Blass » 24 Sep 2002, 11:45

Geschrieben von: / Posted by: Uri Blass at 24 September 2002 12:45:30:
Als Antwort auf: / In reply to: Re: what is the importance of the ping command? geschrieben von: / posted by: Sune Fischer at 24 September 2002 12:33:42:
In the explanation I read:
"Its purpose is to allow several race conditions that could occur in previous versions of the protocol to be fixed, so it is highly recommended that you implement it."
Sorry but I do not understand.
They claim that it is needed in all the engines.
I think that giving a simple example for a case that this command may be productive.
I am not interested in some old interface of winboard that does not support protocol version 2 because I do not expect people to use it so I need an example when supporting ping can help engines.
Uri
Hi Uri,
i haven't implemented "ping" yet, but i think it's only useful for the GUI to check if the engine is alive. So if the engine answers to ping the GUI knows all is ok. But i'm not sure with my thoughts.

have a nice day
Andreas
Mine is doing fine without it, the problem is the command is a little special and requires some modification to the code. You shouldn't abort search and you shouldn't execute it right a way, that is a very special command, I don't see an easy fix to this without major surgery on the code.
-S.
I do not understand what is the problem?
You can declare a global varaible
ping_flag
When you start to calculate and it is your move you can have
ping_flag=0;
When you get ping and it is your move you can change the value of ping_flag to 1.
After you play your move you can reply pong N only if ping_flag=1
You can remember N also in a global variable.
No this wouldn't work, because you may get ping first and then usermove later if you are pondering for instance.
So you have to get that ping out of the way (out of the pipe) and be ready >for the next command.
But you idea is close, only the ping_flag should be N and not 1, then I can simply check if (ping_flag!=0) printf("pong %d\n",ping_flag).
However, _where_ do I do this check?
If I ponder then I need to reply immediatly to ping by pong.
I was afraid that I may get ping 0 and this is the reason that I thought that I need to varaible(ping_flag and ping_N).
You do that check immediatly after you stop the search.
Uri
Uri Blass
 

Re: what is the importance of the ping command?

Postby Sune Fischer » 24 Sep 2002, 11:50

Geschrieben von: / Posted by: Sune Fischer at 24 September 2002 12:50:43:
Als Antwort auf: / In reply to: Re: what is the importance of the ping command? geschrieben von: / posted by: Uri Blass at 24 September 2002 12:45:30:
However, _where_ do I do this check?
You do that check immediatly after you stop the search.
Uri
And what if I get ping after "new" ?
Checking for ping only after search isn't enough, the protocol even says that I shouldn't get ping while searching (while it's my move), so that makes little sense.
-S.
Sune Fischer
 

Re: what is the importance of the ping command?

Postby Alessandro Damiani » 24 Sep 2002, 11:57

Geschrieben von: / Posted by: Alessandro Damiani at 24 September 2002 12:57:24:
Als Antwort auf: / In reply to: Re: what is the importance of the ping command? geschrieben von: / posted by: Sune Fischer at 24 September 2002 12:50:43:
However, _where_ do I do this check?
You do that check immediatly after you stop the search.
Uri
And what if I get ping after "new" ?
Checking for ping only after search isn't enough, the protocol even says that I shouldn't get ping while searching (while it's my move), so that makes little sense.
-S.
One should respond to a "ping" as soon as possible.
Since testing the engine for being alive is part of synchronization the "ping" command should be processed also during search.
Alessandro
Alessandro Damiani
 

Re: what is the importance of the ping command?

Postby Uri Blass » 24 Sep 2002, 11:59

Geschrieben von: / Posted by: Uri Blass at 24 September 2002 12:59:30:
Als Antwort auf: / In reply to: Re: what is the importance of the ping command? geschrieben von: / posted by: Sune Fischer at 24 September 2002 12:50:43:
However, _where_ do I do this check?
You do that check immediatly after you stop the search.
Uri
And what if I get ping after "new" ?
Checking for ping only after search isn't enough, the protocol even says that I shouldn't get ping while searching (while it's my move), so that makes little sense.
-S.
Of course you need to check for ping command also in other cases but in other cases you reply immediately by pong so you do not need to change the ping_flag
varaible.
The point is that you have too loops to search for commands.
passive loop and active loop when your program analyze.
In the passive loop you always reply to ping by pong.
In the active loop you also reply to ping by pong except the case when you are pondering or analyzing but if the flags tell you that you search because it is your move to play then you need to wait and remember ping N in order to reply it by pong N when you get out of search.
Uri
Uri Blass
 

Re: what is the importance of the ping command?

Postby Peter Fendrich » 24 Sep 2002, 12:03

Geschrieben von: / Posted by: Peter Fendrich at 24 September 2002 13:03:39:
Als Antwort auf: / In reply to: Re: what is the importance of the ping command? geschrieben von: / posted by: Sune Fischer at 24 September 2002 12:39:51:
In the explanation I read:
"Its purpose is to allow several race conditions that could occur in previous versions of the protocol to be fixed, so it is highly recommended that you implement it."
Sorry but I do not understand.
They claim that it is needed in all the engines.
I think that giving a simple example for a case that this command may be productive.
I am not interested in some old interface of winboard that does not support protocol version 2 because I do not expect people to use it so I need an example when supporting ping can help engines.
Uri
That is the way WinBoard secure that the engine has reached some required state before sending next command. Sometimes if WinBoard and the engine is not synchronised there is risk for receving and sending commands in the wrong order.
When WinBoard receive the pong x, he knows that the engine has consumed all commands and is ready to get the next one. When the engine is pondering that doesn't apply and the engine should return pong x immidiately.
If it takes very long time before the pong commands is returned, WinBoard assumes that the engine is dead.
Peter
Ahh yes, it seems pondering is an exception!
What about analysis?
-S.
I've always handled pondering and analysis the same way, except for what to do when the pondered move or undo is coming. During analysis it seems to be natural to respond pong immediatley after a ping. WinBoard wont send anything except for single commands like ., a move, undo, new etc. which shouldn't cause any race problems.
Peter
Peter Fendrich
 

Re: what is the importance of the ping command?

Postby Sune Fischer » 24 Sep 2002, 12:03

Geschrieben von: / Posted by: Sune Fischer at 24 September 2002 13:03:43:
Als Antwort auf: / In reply to: Re: what is the importance of the ping command? geschrieben von: / posted by: Alessandro Damiani at 24 September 2002 12:57:24:
However, _where_ do I do this check?
You do that check immediatly after you stop the search.
Uri
And what if I get ping after "new" ?
Checking for ping only after search isn't enough, the protocol even says that I shouldn't get ping while searching (while it's my move), so that makes little sense.
-S.
One should respond to a "ping" as soon as possible.
Since testing the engine for being alive is part of synchronization the "ping" command should be processed also during search.
Alessandro
You should wait until you are ready:
"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."
I assume analysis also does not count?
-S.
Sune Fischer
 

Re: what is the importance of the ping command?

Postby Sune Fischer » 24 Sep 2002, 12:05

Geschrieben von: / Posted by: Sune Fischer at 24 September 2002 13:05:23:
Als Antwort auf: / In reply to: Re: what is the importance of the ping command? geschrieben von: / posted by: Peter Fendrich at 24 September 2002 13:03:39:
In the explanation I read:
"Its purpose is to allow several race conditions that could occur in previous versions of the protocol to be fixed, so it is highly recommended that you implement it."
Sorry but I do not understand.
They claim that it is needed in all the engines.
I think that giving a simple example for a case that this command may be productive.
I am not interested in some old interface of winboard that does not support protocol version 2 because I do not expect people to use it so I need an example when supporting ping can help engines.
Uri
That is the way WinBoard secure that the engine has reached some required state before sending next command. Sometimes if WinBoard and the engine is not synchronised there is risk for receving and sending commands in the wrong order.
When WinBoard receive the pong x, he knows that the engine has consumed all commands and is ready to get the next one. When the engine is pondering that doesn't apply and the engine should return pong x immidiately.
If it takes very long time before the pong commands is returned, WinBoard assumes that the engine is dead.
Peter
Ahh yes, it seems pondering is an exception!
What about analysis?
-S.
I've always handled pondering and analysis the same way, except for what to do when the pondered move or undo is coming. During analysis it seems to be natural to respond pong immediatley after a ping. WinBoard wont send anything except for single commands like ., a move, undo, new etc. which shouldn't cause any race problems.
Peter
This is good to know, the protocol doesn't mention how to handle ping while in analysis, but if you are right it solve a large part of the problems.
-S.
Sune Fischer
 

Next

Return to Archive (Old Parsimony Forum)

Who is online

Users browsing this forum: Majestic-12 [Bot], MSN [Bot] and 6 guests

cron