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.Dann Corbit wrote: ↑Fri May 03, 2019 8: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.
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
[d]1R5K/8/8/8/8/8/7R/k7 w - - 98 1000
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.