Geschrieben von:/Posted by: Dieter Bürßner at 29 March 2004 20:50:49:
Als Antwort auf:/In reply to: Re: Gothmog 0.4.7 winboard protocol problem? geschrieben von:/posted by: Fabien Letouzey at 29 March 2004 15:26:13:
Absolutely. Also the requirement to never stop the search in infinite or ponder mode makes the engine more complex than necessary; this should be a "GUI" problem.
I thought the same, when I was implementing UCI. However, if this were a GUI task, one would need to carefully think about new possible complications, possibly even races. Engine in infinite Analysis, and stops by itself (and sends bestmove). Just at the same time GUI sends stop. Engines sees stop, while it is not searching, and is confused ...
The complication of the engine seems small to me (at least for an engine, without a seperate search thread). Just doing a "busy read" (instead of polling) when it wants to finish search will be enough.
BTW. I think some of the disadvantages mentioned about the UCI-protocol will be fixed soon.
I implemented both, xboard and UCI. Both work. I would guess, for a basic start of an engine, UCI will be much easier to implement. There is no need to think of different modes (search, analyse, force), etc. It makes the "main loop" of the engine much easier. Think of all the special cases in Xboard - as white, you have to wait for go, as black not. setboard, new and moves are allowed in analyse mode, and complicate handling of the engine. It is not clear, which commands are allowed during search/ponder. Tim Mann says all. But the exact action to be taken might not always be easy to get. I remember, I had even after 2 years or so a bug, when processing "result" while pondering. IIRC, there was a subtle difference in Xboard and Winboard, and under Xboard I had to switch to force mode implicetly. Jon Dart reported a similar problem for Arasan, not too long ago (and Arasan was one of the first Xboard engines). So, it is at least not trivial. IIRC even Sune had quite some problems at the start (didn't he have the problem with the go assymetry for black/white, too).
No doubt, currently learning is more difficult under UCI. Implementation of pondering should be much easier, when the engine wants to do it in a normal way (no need to be able to parse moves during search, which may need, that you have rememberd the board at the start of the search). But more creative pondering methods may be difficult/impossible.
All in all I think, implementing UCI from scratch should be significantly easier/faster, than implementing Winboard from scratch. Especially when the goal is to reach a reliable and bugfree implementation. But, for example I never figured out, how to run the engine under a GUI inside a debugger. Is it possible? I find it useful, to have a "console mode", especially for debugging. Such a console mode will naturally be very similar (or identical) to Xboard. So many engines might want to have such a mode anyway. Or there are of course very good other reasons to support Winboard (for example, I do almost all testing under WB, it has a very reliable and stable interface to the ICSes, etc.)