hgm wrote: ↑Wed Dec 02, 2020 7:31 pmThat is a kludge, and formally wrong.
I'd prefer to call it "clever implementation".
That assumes you can just send anything to an engine without ill effects.
The protocol should define a debug enable command in the first place, and also that the engine has to cope with commands that it doesn't implement. CECP has an engine error response for the latter, in particular for "unknown command", from which I conclude that CECP requires engines to cope, or else that error response wouldn't make sense.
It also doesn't say the opposit.
It does say that the position upon go has to be the one transmitted with the previous position command. It does not mandate that the position command has to be right before the go command. So there may be other commands in between, which also also includes a go command. Though I agree that it could have worded that more clearly.
Even if it would be true that the game state after 'go' is defined, it would still be undefined before the first 'position' command is received.
If there has been no go command at all, the engine is free to implement what the author wants. The easiest way is to initialise the engine to the start position because then you don't need special treatment for a missing position command. You can introduce a dedicated state for that, but the protocol doesn't mandate it.
In the search you should not recognize a repeat of a position that only occurred once in the game history as a draw.
I'm doing exactly that, but yeah, that would be an issue if the engine reaches a position, makes a move that doesn't win, and would need to reach exactly that position again, but then continue with a different move. But I also remember at which depth within that array my search even started so that I can score mate distances in the search tree. So I could discern between positions before and after root.
However, the underlying problem is that the engine has a winning position, but doesn't know how to win. Hoping that it would stumble over the right move by luck is unlikely to gain Elo, I think.