7-men Syzygy attempt

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.
syzygy
Posts: 4455
Joined: Tue Feb 28, 2012 10:56 pm

Re: 7-men Syzygy attempt

Post by syzygy » Thu Apr 12, 2018 10:25 pm

koedem wrote:
syzygy wrote:
koedem wrote:On an unrelated note, I was checking some other TB position and stumbled upon this position https://syzygy-tables.info/?fen=6Q1/5NR ... _b_-_-_0_1
Why does the DTZ value of the position vs the one of the top move, down the top line look so weird? Am I missing something?
The value I see is 2, which is off by one. That is normal. The DTZ value is stored in moves unless having it in plies is critical for the 50-move rule. Converting it to plies cannot be done fully accurately.
I mean, Qb2+ is DTZ1 but when making it Whites Kd1 is DTZ2. I would think DTZ shouldn't go up when you aren't zeroing.
Yes, that is a bit strange.

Also Cfish and Stockfish give DTZ=2 ply to both
[D]6Q1/5NR1/8/8/1q6/2k5/8/2K5 b - - 0 1
and
[D]6Q1/5NR1/8/8/8/2k5/1q6/3K4 b - - 0 1

The DTZ table in this case stores DTZ values for positions with white to move. So probing the first position leads to a probe of
[D]6Q1/5NR1/8/8/8/2k5/1q6/2K5 w - - 0 1
Here the correct DTZ = 2 ply. The table stores 0/1/2 ply as 0, 3/4 as 1, 5/6 as 2, etc.(*) It converts k to 1 + 2*k, so in this case 1 + 2*0 = 1 is returned for the DTZ=2 position. The DTZ=3 ply position is therefore shown as having DTZ=2. This is by design (it reduces the size of the tables without deteriorating game ply).

In the same way, probing the second position leads to a probe of
[D]6Q1/5NR1/8/8/8/2k5/3q4/3K4 w - - 0 1
This has DTZ = 0 ply (it's mate). This is stored in the table as 0, so indeed we get back 1 + 2*0 = 1 and the second position is also shown as DTZ=2.

So everything can be explained, but it is not nice.

In Cfish it is fixed in TB_root_probe_dtz():
https://github.com/syzygy1/Cfish/blob/1 ... #L920-L924

Code: Select all

// Make sure that a mating move gets value 1.
    if (pos_checkers() && v == 2) {
      if (generate_legal(pos, (pos->st-1)->endMoves) == (pos->st-1)->endMoves)
        v = 1;
    }
If the game reaches the second position, this code detects that DTZ=2 (v == 2) really means DTZ=1 and it sets v accordingly.

But it would be better to fix this in TB_probe_dtz(), so that the "d" command returns the correct value and any other code that calls TB_probe_dtz() directly doesn't get confused.

Thanks for the bug report!


(*) If the table contains a position with DTZ = 100 plies, then it stores 0/1 as 0, 2 as 1, 3 as 2, ..., 100 as 99. So in that case the DTZ values are fully accurate (provided the mate-in-1 case is fixed).


noobpwnftw
Posts: 360
Joined: Sun Nov 08, 2015 10:10 pm

Re: 7-men Syzygy attempt

Post by noobpwnftw » Fri Apr 13, 2018 2:39 am


niklasf
Posts: 41
Joined: Sat May 16, 2015 9:41 pm

Re: 7-men Syzygy attempt

Post by niklasf » Fri Apr 13, 2018 7:11 pm

Fixed also in python-chess and on syzygy-tables.info (once your browser cache has expired).

I also downloaded some of the experimental 7 man tables to the server (with at most one pawn), in case anyone else wants to play with them. Lastly, here's a mirror of the tables that have been shared so far, thankfully provided by Lichess: http://terra.lichess.ovh/tables/standard/7/

This is an awesome initiative Bojun Guo! I didn't expect to see freely available 7-man tables anytime soon.

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

Re: 7-men Syzygy attempt

Post by syzygy » Fri Apr 13, 2018 10:00 pm

noobpwnftw wrote:First two pawn 6+1 generated, stats changed to indicate longest DTZ in 6 which I believe is correct.
ftp://112.73.74.24/pub/syzygy/7men_testing/KQQQPPvK.txt
vs
ftp://112.73.74.24/pub/syzygy/7men_bad_ ... QQPPvK.txt
ftp://112.73.74.24/pub/syzygy/7men_bad_ ... QQPPvK.txt
Yes, it is looking good now.

bhamadicharef
Posts: 31
Joined: Fri Nov 25, 2016 9:14 am
Location: Singapore
Contact:

Re: 7-men Syzygy attempt

Post by bhamadicharef » Thu Apr 19, 2018 9:29 am

Any particular tables would you someone to do over the weekend ... with a 64 cores and 1TB of RAM ... disk space is about 500GB.

Regards

Brahim

noobpwnftw
Posts: 360
Joined: Sun Nov 08, 2015 10:10 pm

Re: 7-men Syzygy attempt

Post by noobpwnftw » Mon Apr 23, 2018 5:49 pm

With quite some amazing help from Ronald, now the Syzygy generator can hopefully build all 7-piece tables.

I have now built all 6v1 tables and the table with largest DTZ (KRBNvKQN).

Please note that there had been some updates to previously uploaded files, so if anyone have already downloaded them or hosting a mirror, please check file time and make sure they are in sync.

Dann Corbit
Posts: 10128
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: 7-men Syzygy attempt

Post by Dann Corbit » Mon Apr 23, 2018 6:22 pm

noobpwnftw wrote:With quite some amazing help from Ronald, now the Syzygy generator can hopefully build all 7-piece tables.

I have now built all 6v1 tables and the table with largest DTZ (KRBNvKQN).

Please note that there had been some updates to previously uploaded files, so if anyone have already downloaded them or hosting a mirror, please check file time and make sure they are in sync.
Where do I find the modified code.
I might give a try at making a full set of 7 man files.
Also, I would like to get the statistics files for the 6v1 files if this is possible.
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.

noobpwnftw
Posts: 360
Joined: Sun Nov 08, 2015 10:10 pm

Re: 7-men Syzygy attempt

Post by noobpwnftw » Mon Apr 23, 2018 6:34 pm

Dann Corbit wrote: Where do I find the modified code.
I might give a try at making a full set of 7 man files.
Also, I would like to get the statistics files for the 6v1 files if this is possible.
They are in the original Github, refactor branch.

Building those require around 920GB RAM with "--disk" option and 1.2TB without, don't try that with swap on SSD or something, they can expire before you finish building and it will take some years.

All statistics files are available in my FTP

Dann Corbit
Posts: 10128
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: 7-men Syzygy attempt

Post by Dann Corbit » Mon Apr 23, 2018 6:44 pm

noobpwnftw wrote:
Dann Corbit wrote: Where do I find the modified code.
I might give a try at making a full set of 7 man files.
Also, I would like to get the statistics files for the 6v1 files if this is possible.
They are in the original Github, refactor branch.

Building those require around 920GB RAM with "--disk" option and 1.2TB without, don't try that with swap on SSD or something, they can expire before you finish building and it will take some years.

All statistics files are available in my FTP
I will have to buy more RAM then. My biggest machines only have 128 GB RAM installed.
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.

Post Reply