Syzygy question

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

jwes
Posts: 778
Joined: Sat Jul 01, 2006 7:11 am

Syzygy question

Post by jwes »

Would it be possible to mix dtm and dtz50 tables in syzygy? For those endgames where the 50 move rule does not come into play, say max dtz of 35 moves on the mate path, it would seem to make more sense to have mate scores. This would also eliminate the unnecessary sacrifices that reset the dtz counter in most cases. It would be possible to have the probe code choose between namilov and syzygy bases, but it would be much better if it were all done by the syzygy generating code, particularly because of the much better compression.
User avatar
yurikvelo
Posts: 710
Joined: Sat Dec 06, 2014 1:53 pm

Re: Syzygy question

Post by yurikvelo »

DTM is always speed penalty over DTZ50, so it always will be ELO loss.
When game is already won (eval >6.50) it is adjudicated.

If you need EG-solving - Stockfish Matefinder finds short mates pretty well

P.S. 6-men DTM is >1000 Gb. impractical even for EG-solving miniatures
User avatar
hgm
Posts: 27796
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Syzygy question

Post by hgm »

One important reason that the compression is better is that you store DTZ info, rather than DTM info...

Even in end-games where DTM is at most 35, you can still reach a won position with the ply counter at 95. E.g. because that was the time you had to wait before your opponent finally blundered away the draw. Zeroing the counter is then your first priority, no matter how much it would delay the mate.

If you go for points / Elo, there is no reason to use anything else than DTZ50. If you want short mates, just probe both Nalimov and Syzygy, and take the move to the position with lowest DTM that DTZ50 + ply counter say is won.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Syzygy question

Post by bob »

yurikvelo wrote:DTM is always speed penalty over DTZ50, so it always will be ELO loss.
When game is already won (eval >6.50) it is adjudicated.

If you need EG-solving - Stockfish Matefinder finds short mates pretty well

P.S. 6-men DTM is >1000 Gb. impractical even for EG-solving miniatures
Not quite. You can use DTZ until you actually get into a TB position, and then you can switch to DTM but when you decide which move to actually play, you can use DTZ to confirm that it is a win and won't violate the 50 move rule. There is no measurable cost when you are only having to access DTM files at the root position.
jwes
Posts: 778
Joined: Sat Jul 01, 2006 7:11 am

Re: Syzygy question

Post by jwes »

hgm wrote:One important reason that the compression is better is that you store DTZ info, rather than DTM info...
Is it that much better, especially for relatively short mates? I assume the difference is mostly compression schemes.
hgm wrote:Even in end-games where DTM is at most 35, you can still reach a won position with the ply counter at 95. E.g. because that was the time you had to wait before your opponent finally blundered away the draw. Zeroing the counter is then your first priority, no matter how much it would delay the mate.
If your opponent finally blundered away the draw, then either it reset the 50 move counter or this table should be dtz.
hgm wrote:If you go for points / Elo, there is no reason to use anything else than DTZ50. If you want short mates, just probe both Nalimov and Syzygy, and take the move to the position with lowest DTM that DTZ50 + ply counter say is won.
I see no disadvantage in using dtm for shorter mates.
User avatar
hgm
Posts: 27796
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Syzygy question

Post by hgm »

jwes wrote:If your opponent finally blundered away the draw, then either it reset the 50 move counter or this table should be dtz.
No, why? Even ignoring the 50-move rule most end-games contain both won and drawn positions, so you can gofrom one to the other with a non-converting move. E.g.a drawn position in KQKR is

[d]6k1/6r1/6K1/8/8/8/8/5Q2 w

Black can keep checking as long as he wants (or capture the Queen), but at any value of the ply counter he can also fail to check, after which the Queen moves from the f-file, and the game is lost. But at that point capturing the Rook could be closer than the nearest checkmate, but delay the checkmate even further. If you then play according to DTM, you could hit the 50-move barrier.

Similar things could happen in a KQKBN fortress, where you might have arbitrary few moves left after the opponent is stupid enough to break the fortress:

[d]8/8/8/4K3/3n4/7Q/1b6/k7 w
jwes
Posts: 778
Joined: Sat Jul 01, 2006 7:11 am

Re: Syzygy question

Post by jwes »

hgm wrote:
jwes wrote:If your opponent finally blundered away the draw, then either it reset the 50 move counter or this table should be dtz.
No, why? Even ignoring the 50-move rule most end-games contain both won and drawn positions, so you can gofrom one to the other with a non-converting move. E.g.a drawn position in KQKR is

[d]6k1/6r1/6K1/8/8/8/8/5Q2 w

Black can keep checking as long as he wants (or capture the Queen), but at any value of the ply counter he can also fail to check, after which the Queen moves from the f-file, and the game is lost. But at that point capturing the Rook could be closer than the nearest checkmate, but delay the checkmate even further. If you then play according to DTM, you could hit the 50-move barrier.

Similar things could happen in a KQKBN fortress, where you might have arbitrary few moves left after the opponent is stupid enough to break the fortress:

[d]8/8/8/4K3/3n4/7Q/1b6/k7 w
Can you show me a position that also has a shorter mate with a longer dtz?
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Syzygy question

Post by bob »

jwes wrote:
hgm wrote:
jwes wrote:If your opponent finally blundered away the draw, then either it reset the 50 move counter or this table should be dtz.
No, why? Even ignoring the 50-move rule most end-games contain both won and drawn positions, so you can gofrom one to the other with a non-converting move. E.g.a drawn position in KQKR is

[d]6k1/6r1/6K1/8/8/8/8/5Q2 w

Black can keep checking as long as he wants (or capture the Queen), but at any value of the ply counter he can also fail to check, after which the Queen moves from the f-file, and the game is lost. But at that point capturing the Rook could be closer than the nearest checkmate, but delay the checkmate even further. If you then play according to DTM, you could hit the 50-move barrier.

Similar things could happen in a KQKBN fortress, where you might have arbitrary few moves left after the opponent is stupid enough to break the fortress:

[d]8/8/8/4K3/3n4/7Q/1b6/k7 w
Can you show me a position that also has a shorter mate with a longer dtz?
That's not a problem position. A longer mate with a shorter DTZ is the problem. IE lots of KNN vs KP positions where the shortest mate violates the 50 move rule, but DTZ saves the day. You can create one of these pretty easily with black king at a8, which pieces fairly close by, and then adjust the black pawn on the h-file to produce a "cursed win" where DTM says "mate in N" but violates the 50 move rule.

I don't think you can find a position with a shorter DTM than DTZ and I would presume that the DTZ table would consider mate as a "conversion" otherwise there would be chaos.
syzygy
Posts: 5563
Joined: Tue Feb 28, 2012 11:56 pm

Re: Syzygy question

Post by syzygy »

bob wrote:I don't think you can find a position with a shorter DTM than DTZ and I would presume that the DTZ table would consider mate as a "conversion" otherwise there would be chaos.
Indeed, mate counts as a conversion. So DTZ is really shortest distance to mate or a zeroing move.
User avatar
hgm
Posts: 27796
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Syzygy question

Post by hgm »

jwes wrote:Can you show me a position that also has a shorter mate with a longer dtz?
[d]6k1/8/6K1/8/8/7r/8/5Q2 w - - 99 130

mate: 1. Qf7+ Kh8 2. Qg7#
dtz: 1. Qxh3 Kf8 2. Qe3 (2. Qc8+ Ke7) Kg8 3. Qf8#