Gian-Carlo Pascutto wrote:jesper_nielsen wrote:
What if a second go command is received after the first search has finished? Are "position" and "go" always as a pair? Or does "go" always refer back to the latest "position" command?
These I think are very valid questions, i.e. are you allowed to destroy the current board position after you replied bestmove or not?
Code: Select all
* if the engine receives a command which is not supposed to come, for example "stop" when the engine is
not calculating, it should also just ignore it.
Which combination of commands are not supposed to happen?
AFAIK, only stop and ponderhit when the engine is not running.
When should "setoption" take effect?
As soon as possible. If the GUI has a specific requirement, it can send "isready" and know that "readyok" implies the setting took effect.
What if a "setoption name Hash value XX" is received during search? Is it ok to ignore it? Should the hash size be adjusted after the search has terminated?
I think you're supposed to handle them during the search. At the very least, MultiPV requires this. I would agree the protocol should have been more clear here, and perhaps allowed specifying what can be changed during the search and what not.
And now the question becomes:
Should all these have been specified in the UCI protocol description?
Not necessarily I think. From a pragmatic point of view.
If they were to be added, they would "bloat" the specification, sacrificing simplicity of reading. If I were to begin implementing a chess protocol, and was faced with a HUGE document, I think I would pass.
From a pratical point of view, the answer to most of these questions was found in Arena. Start the GUI you want to work in, and observe the behaviour!
Now this would of course not be acceptable, if the protocol was for some high security / nuclear powerplant / fort knox type applications.
But this is a chess playing interface! And from my perspective it is more important to be able to get started quickly than it is to have all possible details specified in the protocol.
Compare the documentation of WB to that of UCI. (At least the ones that were around about three years ago, when I started writing my engine) And there is the reason that I chose UCI over WB.
WB might be extremely simple, but that is certainly not apparent from the protocol description. (Again, at least the ones that I found when looking for them all those years ago).
And mind you, I am not talking about the value of the protocols. WB might very well be a much better protocol than UCI. But from a pure accessibility point of view, I think UCI RulZ!
Again, just my thoughts on it! YMMW!
Pragmatic regards,
Jesper