polyglot not reporting mate scores to winboard

Discussion of chess software programming and technical issues.

Moderator: Ras

mar
Posts: 2665
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

polyglot not reporting mate scores to winboard

Post by mar »

Hi, I just wanted to ask what is the reason that polyglot reports scores like 99.xx instead of true mate scores to winboard when running a UCI engine. Perhaps I'm missing something.

Thanks

Martin
User avatar
hgm
Posts: 28390
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: polyglot not reporting mate scores to winboard

Post by hgm »

WinBoard protocol does not define "mate scores". The score field must be purely numeric.

I have proposed a standard for mate scores within this restriction (mate in 6 = 100006, etc; mated in 3 = -100003), and I could let WinBoard print M6 or -M3 when it receives such scores from the engine (or Polyglot). And on interfaces that would not support this it would still show up quite readable (1000.06 or -1000.03). But as Joker seems to be the only engine using this standard, there seemed little point in doing it.
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: polyglot not reporting mate scores to winboard

Post by Sven »

hgm wrote:mate in 6 = 100006, etc; mated in 3 = -100003
One possible disadvantage of doing so would be that usually a shorter mate for the moving side should get a higher value, but with your proposal "mate in 5 = 100005" would contradict to that rule (same for "mated in ...").

Why not: "mate in N plies = 30000 - N" and "mated in N plies = -(30000 - N)"? This is easy to convert into "mate/mated in M full moves" output for the reader (mate in ... is always odd and mated in ... always even), and it is also easy to achieve for typical engines, and stays away from problems with engines using only 16 bit integer scoring.

Sven
zamar
Posts: 613
Joined: Sun Jan 18, 2009 7:03 am

Re: polyglot not reporting mate scores to winboard

Post by zamar »

hgm wrote:WinBoard protocol does not define "mate scores". The score field must be purely numeric.

I have proposed a standard for mate scores within this restriction (mate in 6 = 100006, etc; mated in 3 = -100003), and I could let WinBoard print M6 or -M3 when it receives such scores from the engine (or Polyglot). And on interfaces that would not support this it would still show up quite readable (1000.06 or -1000.03). But as Joker seems to be the only engine using this standard, there seemed little point in doing it.
Just agree on any standard with polyglot developer and you have dozens of UCI engines following it automatically. I find it likely that others will follow.

However I agree with Sven that it would be logical if shorter mate had a higher score.
Joona Kiiski
User avatar
hgm
Posts: 28390
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: polyglot not reporting mate scores to winboard

Post by hgm »

Indeed, implementing it in Polyglot would immediately get it right for all UCI engines. When I implement something, I certainly would do that at the same time.

I think Sven and I have a fundamentally different view on this. In mate scores, the highest number usually indicates the most distant mate (M3 is better than M6). And in my opinion we must never use a score in the 16-bit range, exactly because many engines internally use 16-bit scoring. "M3" or "Mate3" is not a number smaller than 32768, and in fact not a number at all. The space of mate scores must not overlap the space of centiPawn scores. You should just look upon the leading "10000" as a funny way to spell "Mate" in WB protocol.

Normally how a protocol represents something should be quite irrelevant (as long as the representation is unique), but in this case older interfaces might dislay the protocol representation like it is centiPawn, making it worth to choose something that looks good even then. Mate scores were invented because people don't like to subtract to know the DTM, but see it directly. To get it right in GUIs that don't always give two digits in the fraction, it migt be better to count in steps of 100. E.g. M6 = 100000600.
mar
Posts: 2665
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: polyglot not reporting mate scores to winboard

Post by mar »

hgm wrote:WinBoard protocol does not define "mate scores". The score field must be purely numeric.

I have proposed a standard for mate scores within this restriction (mate in 6 = 100006, etc; mated in 3 = -100003), and I could let WinBoard print M6 or -M3 when it receives such scores from the engine (or Polyglot). And on interfaces that would not support this it would still show up quite readable (1000.06 or -1000.03). But as Joker seems to be the only engine using this standard, there seemed little point in doing it.
Well sorry to say that but that's just lousy. I have scores up to +-300cp in certain positions (where i'm 100% sure the engine will win but still don't know the right mate score). In fact I noticed this problem in the latest ChessWar. UCI engines reporting +99.93 going up while I saw a WB engine reporting +500 with white (while it was -M6 or so in reality). Sorry but this is just lame... I've read many times that UCI sucks. but i'd have never thought that chess comm protocol does NOT support mate scores.
User avatar
hgm
Posts: 28390
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: polyglot not reporting mate scores to winboard

Post by hgm »

Remarkable that you consider something a "major flaw" that virtually no one complained about for nearly 30 years... :lol:
mar
Posts: 2665
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: polyglot not reporting mate scores to winboard

Post by mar »

hgm wrote:Remarkable that you consider something a "major flaw" that virtually no one complained about for nearly 30 years... :lol:
You replied sooner before I edited :) I'd still prefer to see +-M30 if an engine finds a mate in 30. I don't really care whether someone complained in the last 30 years or not. If you can change the protocol please do it. Thanks :D
EDIT: I agree however that when the protocol doesn't define mate scores that it will be difficult if not impossible to change that regarding backward compatibility...
mar
Posts: 2665
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: polyglot not reporting mate scores to winboard

Post by mar »

While this might be useless considering engine-engine play (as wb engines resign before reaching such scores), consider analysis. Should I take 100, subtract the score, divide by 2 and add one or something like that? nice numeric excercise...
User avatar
hgm
Posts: 28390
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: polyglot not reporting mate scores to winboard

Post by hgm »

Indeed, the main problem is not in the protocol, but in the engines. Every WB engine is using its own mate score, some counting DTM in ply, others in moves. Most interfaces only understand numeric scores. WinBoard itself, for instance, will completely ignore Thinking Output that has a non-digit in its score field. But there exist enough different numbers to requisition some of them to indicate mate scores,and this would provide backward compatibility with the interfaces (i.e. engines using the new standard could still run on old interfaces). Of course the old interfaces would not recognize them as mate scores, but give them the normal treatment that all scores get. But having them display "1000.06" for mate in 6 does not seem that much worse than having them display "Mate6". The "1000" is as recognizable as "Mate".

It would only take me a couple of minutes to change WinBoard such that it would print "M6" in stead of 1000.06, wherever it prints scores. And perhaps half an hour to figure out where in Polyglot I have to interfere to make it print 100006 in stead of 9989. But now I am going to bed! :wink: