Syzygy and draw by repetition

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

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

Re: Syzygy and draw by repetition

Post by hgm »

What I had in mind was building a DTM table starting from all winning conversions / zeroings, doing 50 retrograde cycles. That would at least guarantee every position marked as DTM=N would have a move leading to a won position with DTM=N-1 two ply later. It could indeed be that there are also other moves to DTM=N-1, which are not won if you go there because the ply counter is too high. But DTZ50 probing would enable you to avoid those.
syzygy
Posts: 5557
Joined: Tue Feb 28, 2012 11:56 pm

Re: Syzygy and draw by repetition

Post by syzygy »

hgm wrote:What I had in mind was building a DTM table starting from all winning conversions / zeroings, doing 50 retrograde cycles.
Yes, and as I pointed out such a table has far more limitations than what you were suggesting.

If you're using DTZ50 anyway as a safeguard, there seems to be no good reason for using DTM50 over DTM. The DTM table will deliver sensible moves and the DTZ50 table can be used to check for the relatively rare case where a different move saves the win (or achieves the draw).
User avatar
hgm
Posts: 27787
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Syzygy and draw by repetition

Post by hgm »

I wasn't suggesting anything, other than that a position is a win when the table says it is a win and the ply counter is zero. Normal DTM does not have that property.

I would expect DTM tables that avoid conversion to cursed wins to lead to somewhat more natural play in combination with DTZ50 than DTM tables that don't avoid such conversions.
syzygy
Posts: 5557
Joined: Tue Feb 28, 2012 11:56 pm

Re: Syzygy and draw by repetition

Post by syzygy »

hgm wrote:I wasn't suggesting anything, other than that a position is a win when the table says it is a win and the ply counter is zero. Normal DTM does not have that property.
hgm wrote:Apart from artificially set-up positions, the relevant case where this occurs is when you swindle a fallible opponent in a drawn situation.
Ok, not a suggestion. Just wrong information.
jdart
Posts: 4366
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Re: Syzygy and draw by repetition

Post by jdart »

I am doing 2. but not with the addition "But if a repetition occurs then fall-back to DTZ-optimal mode.". So that is likely the problem.

Btw.: I have a pull request pending against Fathom, for a different issue (problems compiling on a non-x86 architecture).

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

Re: Syzygy and draw by repetition

Post by jwes »

What would happen if you used standard DTM tables and always made the move with the shortest DTM that is also a win in the WLD table?
Dirt
Posts: 2851
Joined: Wed Mar 08, 2006 10:01 pm
Location: Irvine, CA, USA

Re: Syzygy and draw by repetition

Post by Dirt »

jwes wrote:What would happen if you used standard DTM tables and always made the move with the shortest DTM that is also a win in the WLD table?
That could work, but the only publicly available six piece DTM files I am aware of (Nalimov) are huge. Gaviota tablebases, since they are only five piece, are of reasonable size, but cover only a small part of the problem. You still wouldn't know for certain how far you are from mate, either.

I'm not seeing sufficient benefit to make it worth the trouble.
Deasil is the right way to go.
syzygy
Posts: 5557
Joined: Tue Feb 28, 2012 11:56 pm

Re: Syzygy and draw by repetition

Post by syzygy »

jwes wrote:What would happen if you used standard DTM tables and always made the move with the shortest DTM that is also a win in the WLD table?
Does not work, because WDL only gives accurate 50-move information if the 50-move counter was just reset.

The solution is to check the DTM move against the DTZ50 table as described above.

DTZ50 = n means:
- if 50-move counter <= 100 - n, then win;
- if 50-move counter > 100 -n, then draw.

See the comments in tbprobe.c for a more precise formulation.
Last edited by syzygy on Sun Jul 24, 2016 5:00 am, edited 1 time in total.
Dirt
Posts: 2851
Joined: Wed Mar 08, 2006 10:01 pm
Location: Irvine, CA, USA

Re: Syzygy and draw by repetition

Post by Dirt »

syzygy wrote:
jwes wrote:What would happen if you used standard DTM tables and always made the move with the shortest DTM that is also a win in the WLD table?
Does not work, because WDL only gives accurate 50-move information if the 50-move counter was just reset.

The solution is to check the DTZ50 table instead as described above.
Sorry, I just assumed he had said DTZ table. I think using the DTZ table in combination with DTM would sometimes get you shorter mates, but the 'cost' seems exorbitant.
Deasil is the right way to go.
basil00
Posts: 55
Joined: Thu Oct 22, 2015 2:14 am

Re: Syzygy and draw by repetition

Post by basil00 »

jdart wrote:I am doing 2. but not with the addition "But if a repetition occurs then fall-back to DTZ-optimal mode.". So that is likely the problem.
Yes. Although this problem is not mentioned in the Fathom documentation so this should probably be fixed.
Btw.: I have a pull request pending against Fathom, for a different issue (problems compiling on a non-x86 architecture).
Yes thanks, I should merge it sometime this week. Haven't had a chance to work on hobby projects recently.