Questionable XBoard mate/lose score convention

Discussion of chess software programming and technical issues.

Moderators: hgm, Dann Corbit, Harvey Williamson

User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Questionable XBoard mate/lose score convention

Post by sje »

Questionable XBoard mate/lose score convention

From the documentation:
Mate scores should be indicated as 100000 + N for "mate in N moves", and -100000 - N for "mated in N moves".
The sign of N in the above should be reversed. From the viewpoint of the mover, a mate-in-4 is better than a mate-in-7 and a lose-in-3 is better than a lose-in-1.
User avatar
hgm
Posts: 27703
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Questionable XBoard mate/lose score convention

Post by hgm »

I hate having to subtract in order to get the DTM. When I see 100006 (or 1000.06 as the GUI would display it), I see that it is a mate in 6 without further ado. A GUI that supports this convention would of course just display something like M6, #6 or mate-in-6. But this convention also guarantees reasonable display on GUIs that do not support it, once you realize you "1000." is just a funny spelling for "mate in" (and -"1000." for "mated in". Note that things like "327.57" for a mate in 6 fall in the category "unreasonable display"... :o

You should not read (and compare) them as if they were numerical scores. They are just text strings. I would have chosen "mate6" and "mated6" if that would not have broken display of all thinking output on all older interfaces.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: Questionable XBoard mate/lose score convention

Post by sje »

It's really a manifestation of the dubious programming practice of overloading the semantics of a scalar making it more than just a scalar. It's a bad idea even though nearly all of us have done it, including me where in the original EPD specification I gave a mapping between mate/lose scores and centipawn evaluations.

There is no easy resolution which wouldn't break a lot of existing code.

Inside of Symbolic is the C++ class Analysis, an instance of which is used to store the result of a move selection process. There are a bunch of member variables: a PV move list, timers, usage data, authorship data, search termination identification, etc., -- and a score in micropawn units. Internally, everything gets used. Externally, most of what gets seen is just the PV and the score.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

About negative mating scores

Post by sje »

About negative mating scores

I'd like to mention that there is really no such thing as a -MateIn3 score. There is a LoseIn2 score which is sightly worse than a LoseIn3 score, but neither is the opposite of a MateIn3 score because it all depends on measuring the MateIn3 before or after it is played. The guy not on the move can't play a move, so he has no moves and therefore can't have any move evaluations.

Symbolic handles this by treating mate/lose scores relative to the direction of time. Moving forward in time (one ply deeper, passing a window), a MateIn3 score becomes a LoseIn2 score. Moving backward in time (towards the root, returning a result), a MateIn3 becomes a LoseIn3. At the bottom, a checkmated position has a score of Checkmated which is a synonym for LoseIn0.

The initial A/B window is not [-infinity..+infinity], but rather [LoseIn0..MateIn1+1]. Moving down one ply changes the window to [LoseIn1..MateIn1] then on the next ply to [LoseIn2..MateIn2], etc.

With the proper numerical mapping, faster mates are always greater than slower mates and slower loses are greater than faster loses.