7-men Syzygy attempt

Discussion of chess software programming and technical issues.

Moderators: hgm, chrisw, Rebel

syzygy
Posts: 5647
Joined: Tue Feb 28, 2012 11:56 pm

Re: 7-men Syzygy attempt

Post by syzygy »

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

Re: 7-men Syzygy attempt

Post by syzygy »

noobpwnftw
Posts: 693
Joined: Sun Nov 08, 2015 11:10 pm
Full name: Bojun Guo

Re: 7-men Syzygy attempt

Post by noobpwnftw »

niklasf
Posts: 42
Joined: Sat May 16, 2015 11:41 pm

Re: 7-men Syzygy attempt

Post by niklasf »

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

Re: 7-men Syzygy attempt

Post by syzygy »

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 10:14 am
Location: Singapore

Re: 7-men Syzygy attempt

Post by bhamadicharef »

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: 693
Joined: Sun Nov 08, 2015 11:10 pm
Full name: Bojun Guo

Re: 7-men Syzygy attempt

Post by noobpwnftw »

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: 12662
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: 7-men Syzygy attempt

Post by Dann Corbit »

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: 693
Joined: Sun Nov 08, 2015 11:10 pm
Full name: Bojun Guo

Re: 7-men Syzygy attempt

Post by noobpwnftw »

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: 12662
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: 7-men Syzygy attempt

Post by Dann Corbit »

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.