I agree with Bob that the "time kludge" does not work.
bob wrote:(1) I gave a simple way to correctly deal with offering draws, and claiming draws, which suffer from no race condition at all. Ever.
Well, I know zillions of ways that would work if I had the freedom to design a protocol from scratch. The challenge is to find ways that work that can be used by new engines without breaking them on old GUIs, and that don't break the GUIs using the new way with old engines. If you have done that, I must have missed it in the noise you are making. The only solution I have seen you propose so far is the way it already works, except that you want to rename some of the commands. And I consider the wording of the commands a completely unrelated subject, orthogonal to what we are discussing (namely solving the race condition).
(2) I gave a simple alias to "offer draw" so that a program can use "offer draw" to offer a draw, and "draw" to claim a draw, which is more natural to a chess program. It would be possible to interchange the two commands without having any effect on the GUI since the two commands are identical.
Yes, and it did not seem to work to me. Perhaps you did not describe it completely. Suppose youre engine runs on a GUI thathas sent you
protover 2 in the beginning. What will Crafty be sending to that GUI when it wants to claim a draw after its next move?
All the GUI has to do to handle a "draw/offer-draw" command is the following. Since it can not determine whether the draw claim should be applied after the last move by this player, or before the current move by this player, due to the already explained race condition, the GUI just asks itself two questions.
(1) If I back up to right after the last move played by the side claiming a draw, is this a drawn position, by rule? If so, end the game. If I wait until we reach the point where it is this player's move again, meaning after the opponent's move, is this a drawn position, by rule? If so, end the game. If neither is true, send a draw offer to the opponent and forget about it. This works in every possible case. It lets me claim a draw before I make a move, or even without making a move, and it lets me claim a draw _after_ I make a move that meets rule requirements.
Well, so far this is exactly how the
1/2-1/2 command is implemented. And I don't see a good reason to offer an alias for the
1/2-1/2 command. (Or in fact for any command.)
Another problem is that it does not work in ICS play. The ICS would not compare my "draw" command to the previous position when the opponent won the race. So in ICS play the GUI would have to send the "draw" to the ICS before the move. It cannot do that if you claim it after the move.
It does let me offer a draw in an inopportune time, but that is OK and the GUI should be able to prevent me from offering millions of draws in succession to interfere with my opponent's search.
Indeed, and in fact current XBoard does prevent that. It has a very tight interpretation of the FIDE rule that you should not distract your opponent by spurious draw climing, namely that even a single on in the opponents time is too many. Some engines are very easily distracted.
In a normal OTB game, I make a move, tell my opponent "I offer a draw" and press the clock. The program author follows that same guideline when writing an engine, and it will work every time, without fail. It won't break old engines. It won't break old GUIs any more than they are already broken. It won't cause any problems. And it solves at least one big one, plus a couple of minor understandability issues for those that play tournament chess themselves.
Current XBoard sends draw offers together with the move, whenever it relays a draw offer. So that seems OK.