Syzygy and draw by repetition

Discussion of chess software programming and technical issues.

Moderators: hgm, Harvey Williamson, bob

User avatar
hgm
Posts: 22186
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Contact:

Re: Syzygy and draw by repetition

Post by hgm » Sat Jul 23, 2016 12:09 pm

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: 4221
Joined: Tue Feb 28, 2012 10:56 pm

Re: Syzygy and draw by repetition

Post by syzygy » Sat Jul 23, 2016 12:23 pm

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: 22186
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Contact:

Re: Syzygy and draw by repetition

Post by hgm » Sat Jul 23, 2016 12:49 pm

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: 4221
Joined: Tue Feb 28, 2012 10:56 pm

Re: Syzygy and draw by repetition

Post by syzygy » Sat Jul 23, 2016 1:49 pm

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: 3488
Joined: Fri Mar 10, 2006 4:23 am
Location: http://www.arasanchess.org

Re: Syzygy and draw by repetition

Post by jdart » Sat Jul 23, 2016 10:16 pm

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: 773
Joined: Sat Jul 01, 2006 5:11 am

Re: Syzygy and draw by repetition

Post by jwes » Sun Jul 24, 2016 1:30 am

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 9:01 pm
Location: Irvine, CA, USA

Re: Syzygy and draw by repetition

Post by Dirt » Sun Jul 24, 2016 2:21 am

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: 4221
Joined: Tue Feb 28, 2012 10:56 pm

Re: Syzygy and draw by repetition

Post by syzygy » Sun Jul 24, 2016 2:43 am

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 3:00 am, edited 1 time in total.

Dirt
Posts: 2851
Joined: Wed Mar 08, 2006 9:01 pm
Location: Irvine, CA, USA

Re: Syzygy and draw by repetition

Post by Dirt » Sun Jul 24, 2016 3:00 am

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 12:14 am

Re: Syzygy and draw by repetition

Post by basil00 » Sun Jul 24, 2016 3:34 pm

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.

Post Reply