DTM50

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
User avatar
hgm
Posts: 23774
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: DTM50

Post by hgm » Fri May 03, 2019 8:39 pm

Dann Corbit wrote:
Fri May 03, 2019 6:04 pm
I imagine that this is really ignorant, but I do not understand why a DTM50 counter is needed in the database.

If you are trying to minimize the distance to mate, then your path will be shortest.
And if you (the engine writer) are storing the move counter, the engine will know if there is a problem where the dtm50 flag is going to fall.
The database cannot find a shorter mate than the shortest one that is in there.
And if the engine writer knows that the flag is going to fall, he can abandon the planned search and consider moves that reset the counter. And if these moves cannot find a win, then there was no win to be found anyway.

So I guess that I think the EGTB's job is to find the fastest path to win, assuming the counter is reset to 0.

I suppose the current counter could be sent to the EGTB and the EGTB itself could perform the search instead of the engine. But I do not see that as an improvement. (Though an efficient, debugged implementation would prevent all the engine writers from having to do it.)

I do admit that a DTM50 tablebase that was not substantially larger than a simple DTM tablebase that assumes a reset counter would be very interesting. But I imagine it would be many times larger than a simple DTM tablebase.
The whole idea of EGT probing is that you can do it without significant search. When somewhere near the leaves you hit an EGT that says DTM=56, you don't want to search 100 ply deeper to see if the path on which the DTM was based resets the counter in time. You want to be able to go there with confidence.

A DTM50 section for a reset counter does give the guarantee that the counter will be reset in time. If your first hit on a won position there does not happen for a reset counter (which can happen because you already spent some time in the draw sector of that same table, before the opponent finally blunders the draw away) you don't have that guarantee anymore, and DTM=56 could reset the counter after 90 ply, while your counter is already at 12. But you would only know that after searching at least 88 ply. It could still be that a path of length 60 (say) leading to checkmate happens to reset the counter alreay ofter 80 ply, and thus would still be winning. But you would have to search at least 80 ply deep to find it, as it cannot be recovered from the DTM50 section for counter=0. So the knowledge of the current counter doesn't help you a great deal.

This is different with DTC; this always directs you along the fastest path to a winning reset of the counter, and if the length of that path plus the current counter is more than 100, your win is cursed (and you likely are cursing). But there is no way to force anything better, you can only hope for a swindle.

I am not sure what you don't understand that makes you ask this question, but it could be that the distance to mate is not necessarily the distance to reset of the counter. There can be many resets along the path to the mate, but a faster path to mate doesn't necessarily mean that the first reset along that path will come earlier too. You might have to take a longer path to mate because you have to handle the more pressing business of resetting the counter in time first. E.g. in the position


the DTM would be 2 if it were not for the large value of the counter. But as it is you must play Ra2 or Rb1 to force a capture within 1 move, which then forces you to do a tedious KRK mate. Only that much longer path has a fast-enough reste.

syzygy
Posts: 4458
Joined: Tue Feb 28, 2012 10:56 pm

Re: DTM50

Post by syzygy » Fri May 03, 2019 10:06 pm

hgm wrote:
Fri May 03, 2019 6:49 am
syzygy wrote:
Thu May 02, 2019 9:39 pm
As you are aware (see the top two posts), a tablebase that only lists DTM50 when entered with the ply counter at zero cannot reliably be used to find moves when the ply counter is larger than zero. So you won't be able to play perfectly.
Of course. This is why I say one should play by DTC50 when you enter the won sector of the EGT with a non-zero ply counter.
But then I see no reason to care about DTM50 at all. What point is there in knowing the length of the shortest mate respecting the 50-move rule if you can't execute that mate anyway?

Just forget about DTM50, play by DTZ50 and save disk space.
There doesn't seem much beauty in having to wait for the opponent to blunder in a drawn position, and then achieve the mate a few moves faster.
I don't see what opponent blunders have to do with this. As you seem to agree, DTM50 info restricted to ply_counter == 0 is anyway not sufficient to play out the DTM50 perfectly, whether the opponent blunders or not.

syzygy
Posts: 4458
Joined: Tue Feb 28, 2012 10:56 pm

Re: DTM50

Post by syzygy » Fri May 03, 2019 10:17 pm

jdart wrote:
Fri May 03, 2019 3:10 am
When I was studying high-school geometry, I remember I wasn't told, or at least not right away, that a short simple proof is preferable to a long, complex one. So I'd sometimes come up with a long, complex one. It wasn't incorrect but it wasn't elegant, either. This is kind of like that.
On the other hand, one could see playing by DTZ50 as the cheapest/simplest/most elegant way of reducing the problem of winning the current board position to a problem that was already solved, even though the already-solved problem is sometimes more complicated.

syzygy
Posts: 4458
Joined: Tue Feb 28, 2012 10:56 pm

Re: DTM50

Post by syzygy » Fri May 03, 2019 10:21 pm

Andrew wrote:
Fri May 03, 2019 8:13 am
I'm curious, what engine was this with? Seems quick!! :) Will check Stockfish, Fritz 14 (uses Nalimov) and a few others to see
how they compare.
That was with Cfish, which supports my DTM files.
Unfortunately, running it with 6-piece DTM files slows it down to a crawl (once the search gets into mate territory), at least with the 6-piece DTM files on HDD.

syzygy
Posts: 4458
Joined: Tue Feb 28, 2012 10:56 pm

Re: DTM50

Post by syzygy » Fri May 03, 2019 10:27 pm

hgm wrote:
Fri May 03, 2019 6:49 am
syzygy wrote:
Thu May 02, 2019 9:39 pm
As you are aware (see the top two posts), a tablebase that only lists DTM50 when entered with the ply counter at zero cannot reliably be used to find moves when the ply counter is larger than zero. So you won't be able to play perfectly.
Of course. This is why I say one should play by DTC50 when you enter the won sector of the EGT with a non-zero ply counter.
Reading your sentence again, I cannot avoid the impression that you still believe that DTM50 info only for ply counter at zero would be sufficient to play out the mate in the minimum number of moves.

So again, it does not work that way. Whether you enter the won sector with the 50-move ply counter at zero or not, DTM50 info for ply counter at zero is not sufficient. So the DTM50 metric is useless (just as useless as the DTR metric) for classical tablebases with one value per position.

Sven
Posts: 3830
Joined: Thu May 15, 2008 7:57 pm
Location: Berlin, Germany
Full name: Sven Schüle
Contact:

Re: DTM50

Post by Sven » Sun May 05, 2019 8:51 pm

syzygy wrote:
Fri May 03, 2019 10:27 pm
hgm wrote:
Fri May 03, 2019 6:49 am
syzygy wrote:
Thu May 02, 2019 9:39 pm
As you are aware (see the top two posts), a tablebase that only lists DTM50 when entered with the ply counter at zero cannot reliably be used to find moves when the ply counter is larger than zero. So you won't be able to play perfectly.
Of course. This is why I say one should play by DTC50 when you enter the won sector of the EGT with a non-zero ply counter.
Reading your sentence again, I cannot avoid the impression that you still believe that DTM50 info only for ply counter at zero would be sufficient to play out the mate in the minimum number of moves.

So again, it does not work that way. Whether you enter the won sector with the 50-move ply counter at zero or not, DTM50 info for ply counter at zero is not sufficient. So the DTM50 metric is useless (just as useless as the DTR metric) for classical tablebases with one value per position.
Since the same position can have different optimal "solutions" depending on the value of the 50-moves counter, you could simply see that counter as an additional parameter defining a position, so that a DTM50 tablebase still remains a "classical tablebase with one value per position", it just needs more space. Therefore I would not call it "useless". DTZ50 is certainly sufficient for many cases when taking a pragmatic viewpoint (which is acceptable). But DTM50 is for "perfection", and there are some applications for that. Tournament play may or may not be one of these applications, I don't know yet. If it would be possible at some day in the future to get these DTM50 tables "for free" (whatever that means) then why shouldn't we use them?
Sven Schüle (engine author: Jumbo, KnockOut, Surprise)

syzygy
Posts: 4458
Joined: Tue Feb 28, 2012 10:56 pm

Re: DTM50

Post by syzygy » Sun May 05, 2019 11:41 pm

Sven wrote:
Sun May 05, 2019 8:51 pm
syzygy wrote:
Fri May 03, 2019 10:27 pm
hgm wrote:
Fri May 03, 2019 6:49 am
syzygy wrote:
Thu May 02, 2019 9:39 pm
As you are aware (see the top two posts), a tablebase that only lists DTM50 when entered with the ply counter at zero cannot reliably be used to find moves when the ply counter is larger than zero. So you won't be able to play perfectly.
Of course. This is why I say one should play by DTC50 when you enter the won sector of the EGT with a non-zero ply counter.
Reading your sentence again, I cannot avoid the impression that you still believe that DTM50 info only for ply counter at zero would be sufficient to play out the mate in the minimum number of moves.

So again, it does not work that way. Whether you enter the won sector with the 50-move ply counter at zero or not, DTM50 info for ply counter at zero is not sufficient. So the DTM50 metric is useless (just as useless as the DTR metric) for classical tablebases with one value per position.
Since the same position can have different optimal "solutions" depending on the value of the 50-moves counter, you could simply see that counter as an additional parameter defining a position, so that a DTM50 tablebase still remains a "classical tablebase with one value per position", it just needs more space. Therefore I would not call it "useless".
Sure, but that is not what I meant by classical. I could have used more words, but I had hoped that what I wrote was clear enough for the few people interested in this.

Andrew
Posts: 119
Joined: Wed Mar 08, 2006 11:51 pm
Location: Australia

Re: DTM50

Post by Andrew » Mon May 27, 2019 5:26 am

syzygy wrote:
Fri May 03, 2019 10:21 pm
Andrew wrote:
Fri May 03, 2019 8:13 am
I'm curious, what engine was this with? Seems quick!! :) Will check Stockfish, Fritz 14 (uses Nalimov) and a few others to see
how they compare.
That was with Cfish, which supports my DTM files.
Unfortunately, running it with 6-piece DTM files slows it down to a crawl (once the search gets into mate territory), at least with the 6-piece DTM files on HDD.
Thanks again for all your comments. Do you think a release of the DTM generator and CFish for endgames up to 4 pieces might be feasible soon?

I chose 4 pieces as it will still be very useful for a lot of puzzles etc, and if you need to make changes/tweaks regenerating the files should be fairly quick for most people. Will also give us a chance to test them in a lot of different situations!

5 pieces is a different story, I'm not sure how long I'd take to generate or download them but if 4 pieces gets to a good state changes should be a lot less often.

6 piece will need a bigger flash drive :D :D

Andrew

User avatar
Nordlandia
Posts: 2476
Joined: Fri Sep 25, 2015 7:38 pm
Location: Sortland, Norway

Re: DTM50

Post by Nordlandia » Sun Jun 02, 2019 6:17 pm

It is a relief to see that the dtm50 project is not entirely abandoned. I'm also interested in dtm50 file. Especially 5-men in that format. I'm a little curious how far away a possible release is at this point.

User avatar
Nordlandia
Posts: 2476
Joined: Fri Sep 25, 2015 7:38 pm
Location: Sortland, Norway

Re: DTM50

Post by Nordlandia » Wed Jun 19, 2019 11:11 pm

After noobpawnftw told me that dtm50 is not perfect. He suggested normal DTM format which is more easy format to generate and handle. Do it make sense to generate syzygy in "nalimov" style. DTM50 is both bulky and troublesome compared to DTM.

Quick-fix - disregard DTM50, just generate DTM in syzygy format if much better than nalimov. Is there any interest for this compromise folks :?:

Post Reply