Syzygy question

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Dann Corbit
Posts: 12540
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Syzygy question

Post by Dann Corbit »

syzygy wrote: Tue May 22, 2018 1:54 am
Dann Corbit wrote: Tue May 22, 2018 1:01 am
Sesse wrote: Tue May 22, 2018 12:04 am To be honest, not even DTM50 will always give the right answer, due to possible three-fold repetitions.
If the repetitions are avoidable, the programmer can examine every mate path calculable with the DTM50 tables.
If that were an option, you could as well directly examine every possible path and not use any tables at all.
From the current root position, you know every mating move.
From each child position, you know every mating move.
I expect that normally, this is a small fraction of the possible moves that can be ignored such as draws and losses (assuming that the root is a mate).
I also expect that you can examine the pv returned. If it contains any 3rd repetition or exceeds the half move clock then a recursive search of mate only positions would be needed. Otherwise, it can be used directly. So the auxiliary search should be very rare.

Perhaps my assumption about searching only mate positions is wrong, because we have to change the game state either by a reversible move or by choosing a move that does not lead to a 3 move repetition.

If, for instance, the 3 move repetition occurs, then we cannot use the mate from the root directly. But can't we just continue the search, using the tablebase file to search future mate positions as well?

It seems possible to me to create a smart tablebase with a TB engine (perhaps a shared library that has threads of execution if needed). It is given the game state and will know if it can simply return a mate or if it has to search. Considering that I do not intimately know how the DTM tables function, I could be wrong. But I do not yet understand why it cannot work.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
Sesse
Posts: 300
Joined: Mon Apr 30, 2018 11:51 pm

Re: Syzygy question

Post by Sesse »

syzygy wrote: Tue May 22, 2018 1:54 am If that were an option, you could as well directly examine every possible path and not use any tables at all.
Well, if nothing else, you could get the correct win/draw/loss state by doing a TB-guided search until you reset DTZ, and then use whatever tables from there (since after a DTZ move, no seen positions can have occurred before said move). Assuming, of course, you can search that far, but hopefully, the tables should at least help you prune the tree a lot. And also having the search ignoring taboo moves, ie., those that have been twice on the board already.