jdart wrote:The problem with Winboard pondering is that you have to monitor incoming commands both when pondering and when not, and some of them need different processing depending on what state you are in, and there are cases where just processing them one at a time in order is not correct.
Yes, but that is in the engine. So not very relevant for someone like the OP, who is only interested in building a GUI...
For example, what if you get a user move that happens to be a ponder hit, but then the opponent immediately resigns (or quits)? You have to handle this regardless of when "result" arrives. If you ponder, move, then process "result," that is not correct, because "result" must always end the game.
I don't see the latter as an incorrect implementation of WB protocol. I also don't see this problem as specific to pondering: in a ponder-off game, it can also happen that you get a move that starts you thinking, and immediately after it the 'result' because of opponent resign. The question is if you expect instant response from commands send during search. This might have been the original intention of WB protocol, but I think it has long since bowed to the reality that almost every engine will 'move first, ask questions later'. So 'ping' was introduced to solve all problems that could result from this.
The problem really is that engines that want to resign send a move before they do. This is reproachable behavior, that perhaps should be more explicitly condemned in the protocol specs.
UCI IMO has a simpler state model. You can look at Fruit's implementation, which is practically the reference one. It is not a lot of code.
Well, the model WB driver I gave the link to in the previous post does not strike me as terribly long or complex either.