hgm wrote:I don't think that such protocol extensions would be of any help:
1) None of the exsting engines would be using it
2) We have to continue to support the old way of non-atomic sending to keep these engines wrking
3) New engines that are not aware of the problem, the can and will continue to use the old way, as using the new way requires extra commands, and extra handshakng to ensure that you are working on an interface that supports these commands.
4) new engines that are aware of the problem could have solved it in a much simpler way within the existing protocol by not sending the move, or sending it after resigning.
In summary: it is very easy to design protocols that do not have these problems, when they would be strictly enforced. But then by definition they would not offer the required backward compatibility. "Optional enforcement" is an oxymoron. It is completely pointless. It is like solving the crime problem by inviting would-be criminals to report to he police station to apply for a tracker ankle bracelet.
There are enough problems with the winboard/xboard protocol (such as the race conditions, time controls, legacy commands with quirky behaviour, the complexity of dealing with both SAN and algebraic moves, etc), that I almost think it would be better to design a new protocol from scratch. Take all the good elements from both winboard/xboard protocol and UCI protocol, and make them as clear, simple, and unambiguous as possible. The protocol would be designed only for Engine-to-Engine, Engine-to-GUI or Engine-to-automated-TD type of scenarios. Specifically, it would NOT be designed for direct use by humans.
I think the first step would be to rigorously specify the new protocol, and write a standard adapter between this new protocol and the winboard/xboard protocol (and possibly UCI as well). The adapter could be open-source code so that engine and GUI authors can consult it as a reference.
New engines and new GUIs would then have a consistent, sensible protocol they could be written to use. They would not have to handle the race conditions and other crap (assuming the adapter could successfully hide it all from them; which I hope is possible but I'm not 100% convinced yet). Existing engines could either add support for the new protocol (if they already support multiple protocols) or they could just rely on the adapter.
There would be no direct backward compatibility with winboard/xboard in the new protocol, but it might end up having some "convenience" features to make it easier to port engines and GUIs to it. I think it would be important to minimize the number of features it has though.
Ideally, neither the engines nor the GUIs would have to maintain a complex amount of "protocol state" in order to communicate successfully. I vaguely recall that Winboard contains a bunch of backward compatibility hacks for certain old engines, etc. which require it to know how to support every protocol flavor that exists, some of which require it to remember detailed things about what the engine has already sent to it in order to correctly interpret the new stuff. (This may not be true anymore, I don't know.) Anyway, the new protocol should try to minimize or completely eliminate the need for that sort of stuff.
[Edit: it might be useful to consider other board games when designing the protocol. I.e. What would need to be changed, to make it also support checkers? Or chinese chess? Other than the details of what constitutes an appropriate argument for "setboard" or "move" or "time control", and when certain things like "claim draw" are allowed... there might be more similarity than difference.]