H.G.Muller wrote:Jim Ablett wrote:I think this problem shows Winboard is very fussy in what it accepts.
It will refuse to show any pv line at all if one element of the line is slightly incorrect or doesn't use an integer.
Maybe this could be improved.
I doubt if this is desirable. The WB protocol specs are very explicit in how the thinking output should be sent (centi-seconds and centi-Pawns). It is important that engines respect that, as the output is not merely for display, but WinBoard should actually understand it. (For the purpose of adjudication, or decrementing the clock in NPS mode.) The fact that engines use a floating-point format here is likely to be more than a problem of using a wrong format: with centi-Pawns there hardly would be need for any decimal places. So they probably use some wrong kind of unit, but which one?
I think it is in general much better to keep a tight standard, than accepting as much non-compliant output as possible. The latter just invites chaos.
Actually, in the two cases of Alibaba and MsKcp it was only the wrong formatting of output that caused the problem, internally both programs are book-keeping correctly. So it was easy to fix once the offending lines of code were all detected.
I agree that the PV output requirements of the WB protocol should be kept strong. One could possibly think of a small change that would allow for getting the PV itself printed at least, even if some of the numbers are "unknown": the format of a PV output line could be compatibly changed into
- Code: Select all
<plyString><spaces><scoreString><spaces><timeString><spaces><nodesString> <spaces><pvString>
with the constraint that each of the first four strings must be numeric in order to be accepted, but if one of them isn't, it is replaced by a zero value. "Division by zero" should be checked then (hopefully already done since an engine could send "0" already now, e.g. as "time").
The change could never break an existing engine since it would still accept output that is accepted now but would also "partially accept" more output. So this should be a good example of a compatible change; correct me if I'm wrong here.
It could be implemented with sscanf() using five times %s and then checking the first four strings with atoi() or similar functions. A few more (trivial) code lines, the price for slightly more flexibility.
Just as an idea. Not a very important one, but maybe also not unimportant for some people.
A disadvantage could be that PV output problems of some engines could be missed more likely than now.
A further problem could arise if one of the numbers were missing completely. In this case, possibly some of the other numbers inbetween would be shifted and get a different meaning, and the first token (move string) of the PV would be cut off and taken as "nodes", but immediately set to zero for not being numeric.
So I'm not sure what is better. Harm, what do you think? A "/strictPV" option with default=yes, really??
Sven