Moderator: Andres Valverde
The engine should be able to issue a feature request something like
feature movecounts=1
(Or whatever name makes sense.) Of course, if an older WinBoard/xboard does not understand this feature request, it will reject it, and the engine can either decide to pout and die, or it can muddle along the best it can with the existing protocol. Otherwise, WinBoard will accept the request and subsequently send all "time" and "otim" commands in this format:
time <centiseconds> <remaining_moves_in_period>
otim <centiseconds> <remaining_moves_in_period>
Kirill Kryukov wrote:I found another engine that is a victim of the plague: Mustang 4.97. Another author fell into one of the many pits of the Winboard protocol. I hope that every author choosing to implement Winboard protocol will visit this forum and see this thread as a warning. (And at the very least avoid this particular bug).
(Note that I am not checking all available engines, but simply reporting the cases when I see this bug in my own very small tournament. The real number of engines with this bug is probably much higher.)
Roger Brown wrote:Hello Kirill Kryukov,
I will uncomfortably overlook the Winboard protocol commentary as I am not sufficiently knowledgeable to address it.
I am curious about the explicit inferiority that you seem to be attributing to the Winboard protocol.
What are the sources of this inferiority and/or what are the sources of the superiority of the UCI protocol in your estimation?
What could the protocol or the gui do to encourage you to promote the Winboard protocol to all corners of the Earth?
I am well aware that you are a serious person so this is not a frivolous query at all.
Later.
Roger Brown wrote:What could the protocol or the gui do to encourage you to promote the Winboard protocol to all corners of the Earth?
Kirill Kryukov wrote:
Hi Roger,
I'm feeling free to state explicitly that I consider Winboard protocol inferior to UCI.
Kirill Kryukov wrote:The main source of the inferiority, in my view, is that Winboard protocol is stateful, while UCI is stateless. (Actually, I am not sure it is intrinsic quality of each protocol, however this is certainly the most common usage pattern of each.) The responsibility to maintain the game state is on the engine side in case of Winboard. In UCI, the engine receives a fresh new state on every move. The task of maintaining the game state looks trivial to someone writing a chess engine, and indeed is much simpler than the chess-playing logic. However, as this thread shows, there are some traps in maintaining an accurate state.
Kirill Kryukov wrote:The real tragedy is that on the first glance Winboard looks easier to implement. Just send the moves, and receive the moves, what can be simpler? Compared to parsing the whole game every move in UCI. So, many authors choose Winboard, and have bugs that can be undiscovered for years.
The particular bug this thread is about is already found in 9 different engines. Of course, one remote possibility is that everyone copied from GNU Chess, but I find it hard to believe. More likely scenario is that every author re-implemented this bug independently. I think this trap justifies a big bold red warning in the protocol specs.
Kirill Kryukov wrote:The protocol has to be stateless, in my opinion. Someone may say that Winboard allows in fact stateless operation, but that's not enough. The ideal chess protocol, IMHO, should clearly disallow any stateful mode. Perhaps this can be achieved in the Winboard GUI, without modifying the protocol, I am not sure.
Kirill Kryukov wrote:All above is just to clarify my point of view. Those who still prefer Winboard protocol are free to believe what they like.
H.G.Muller wrote:I am very skeptical to your 'statistics' on bugginess. What kind of bugs are you talking about? Are they really protocol related? (And how do you determine that?)
H.G.Muller wrote:If older engines tend to have more bugs, that would strongly bias your observation, asUCI does not exist as long as WB protocol.
H.G.Muller wrote:In my experience it is mostly UCI engines that cause protocol-related stability problems, and Polyglot contains a number of work-around options (like sync-stop) to be able to run such engines.
H.G.Muller wrote:In Xiangqi and Shogi the situation is even worse for the various UCI dialects. The UCI / UCCI / USI engines are an extremely non-compliant and buggy bunch, while the WinBoard engines in general work flawlessly. Send "go movestogo 40 wtime 60000 btime 60000" to PetitShogi, and it crashes unconditionally. Send "position startpos moves e3e4" to Cyclone, and it starts playing from the initial position. Send the time in msec to Jiaolong, which says "option usemillisec default true", and it thinks 1000x longer than you intended.
H.G.Muller wrote:You are free toprefer what you like, of course, but the reasons you give just seem plain nonsense.
H.G.Muller wrote:The bug discussed here has nothing to do with staelessness, and tiny changes to both UCI and WB protocol, not affecting the statelessness in any way, would make that UCI engines had this problem, rather than WB engines.
H.G.Muller wrote:Not that I would encourage such a change: I think it is quite reasonable to require engines to correctly update a move counter. UCI engines must count reversible moves to know the value of the 50-move counter in the loaded position. If they mess that up, they will make 50-move-draw-related blunders. Is UCI therefore a poor protocol, and would it be a good protocol if every go command was also required to contain a 'reversiblemovestogo' keyword?
Roger Brown wrote:We are probably going to depart here. I believe the essential difference between UCI and Winboard protocols is a design philosophy. Do you regard the chess playing entity as the engine or the engine plus the gui? Winboard places the responsibility for playing chess squarely on the back of the engine.
Roger Brown wrote:Is it the treatment of the game state that is directly responsible for the bug you are observing? What I mean is, are you certain that if statelessness was to be implemented that the bug would disappear? I am not questioning the fact of your observations or your statistics but the cause of the effect you are observing.
H.G.Muller wrote:(skipped)
So no matter what philosophy you prefer as a matter of taste, it is an objective fact that the way WinBoard protocol handles the move-counter issue is superior. Or, more accurately, that the UCI way of handling it is fundamentally _broken_, and not really acceptable. That counting moves proves too difficult a task for some engine authors is unfortunate, but cannot be held against the protocol. Obviously a more powerful protocol allowing you to do more, will also allow you to make new kinds of errors. But you cannot conclude from that that restricting the capabilities of a protocol is a good thing. I'd rather have a laptop than a pocket calculator, despite the fact that C programs can get trapped in infinite loops, and a pocket calculator can not. Simplicity is only a decisive factor between things of equal capability, but capability is the primary sort key. For me, at least.
Kirill Kryukov wrote:So, no, not all of them are protocol related. I also realize that correlation does not imply causation. Still my own observation is the primary factor that will determine my protocol preference.
As far as I understand, Winboard itself tolerates a lot of non-compliant input from engines. WB2UCI has a number of work-arounds too, for buggy Winboard engines. Anyway, your and mine experiences are bound to differ. I wish I had more time to invest into documenting protocol issues, notifying the authors. A lot remains to be done in this area. Ideally we would create some ACID test for engines to pass, to enable fast testing of protocol compliance.
H.G.Muller wrote:Actually this is surprising to me, because Xiangqi and Shogi are relatively recent additions to "computer board games" scene, so I would imagine it would be done right from the start with them.
I believe my tournament is a legitimate use case for a chess engine. I'm disappointed with your rudeness.
In case of UCI such problems are easier to detect, and therefore they get fixed sooner. If an engine can't parse the input correctly, it won't play properly under any conditions. In Winboard, on the other hand, a bug like this can appear only in some tournament conditions. UCI control flow is much simpler than in case of Winboard. This particular bug shows up only when an engine is playing with an external book under N/M time control. If a UCI engine did not update the move counter, the bug would show up under much wider set of conditions.
H.G.Muller wrote:A 50-move draw blunder is much less serious problem (IMHO), than being left with 5 seconds for the remaining 32 moves and subsequently lose on time every other game.
I know we discussed this before, and that in most cases the older engines can't be fixed. I am curious though. When someone writes a new engine, is there any kind of warning about the possibility of this bug in the recent Winboard protocol specs?
H.G.Muller wrote:Kirill Kryukov wrote:So, no, not all of them are protocol related. I also realize that correlation does not imply causation. Still my own observation is the primary factor that will determine my protocol preference.
That sounds very contradictory. Why would you allow bugs that are not protocol-related to contaminate your preference for a protocol? Not all time losses are bugs, some (many) engines simply are mis-tuned use too much time for the last move of a session. Both UCI and WB send the time for the last move just before the engine starts thinking on this move, so I don't see any room for protocol influence there. Crashes and illegal moves are almost never protocol related, but due to search bugs (not propery undoing moves, lack of resistance to illegal hash moves resulting from hash-key collisions).
H.G.Muller wrote:I believe my tournament is a legitimate use case for a chess engine. I'm disappointed with your rudeness.
It was not my intenstion to be rude, I am sorry you perceive it as such. I just intended to be clear. The reasoning you presented was just not sound, because you indeed presented the case like the higher fraction of buggy engines amongst your WinBoard participants could be ascribed to the fact that they were using WB protocol, while (as we now established) you count non-protocol-related bugs as well.
H.G.Muller wrote:In case of UCI such problems are easier to detect, and therefore they get fixed sooner. If an engine can't parse the input correctly, it won't play properly under any conditions. In Winboard, on the other hand, a bug like this can appear only in some tournament conditions. UCI control flow is much simpler than in case of Winboard. This particular bug shows up only when an engine is playing with an external book under N/M time control. If a UCI engine did not update the move counter, the bug would show up under much wider set of conditions.
This might happen to be true for this particular bug (because in a sense an UCI engine always plays with an external book, on every move), although even there engines sometimes have move bugs that only manifest themselves in rare conditions (e.g. underpromotions,check-detection after e.p. capture). It is not true that all UCI keywords are allways used in any game (although 'position' and 'go' obviously are). If 'go movestogo' works, it does no timply that 'winc' and 'binc' will work, that 'go infinite' will work, etc. Many UCI Xiangqi engines suffer from the problem that they crash after 128 moves, because their input buffer for the position overflows. Turns out the most popular GUI there always sends the FEN of the positon after the last irreversible move, so that the 50-move rule limits the length to always fit the buffer. This is something you would not notice so easily in UCI, and cannot hapen in WB protocol. Another example: engines are usually also hardly tested while playing from asetup postion. UCI engines are just as prone to undetected bugs in their FEN readers as WB engines.
Kirill Kryukov wrote:
[SNIP]
Yes, there are many dark corners in UCI too. This only highlights the necessity to have a protocol compliance certification. Some set of tests, which will check that the engine behaves well on many special cases. This community should have developed such certification years ago, but I guess everyone is busy working on their own projects.
Roger Brown wrote:It does not sound easy but the certification idea is certainly a sensible one. Do you have any ideas of what should be in it? Of course that is a natural question!
I take it then that an engine will be sent a stream of commands and based on the responses a user or tester or chess engine author would know where a potential - if not actual - protocol issue might reside.
Return to Winboard and related Topics
Users browsing this forum: No registered users and 37 guests