very strange behavior with syzygy tables

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Carbec
Posts: 133
Joined: Thu Jan 20, 2022 9:42 am
Location: France
Full name: Philippe Chevalier

very strange behavior with syzygy tables

Post by Carbec »

Hi,

I recently added syzygy tables in my code (pyrrhic version from Ethereal).
I thought to gain a little elo, but in fact i lost some, and even lost games on time.
After investigating, I noticed that sometimes, it takes a long time to probe the tables.
But the most curious is that is not always true.
For example, in the position :
8/5p2/P7/1B1nkp2/1P1RbN2/4P1P1/7r/4K3 w - - 5 57

First execution :
setoption name SyzygyPath value /media/philippe/Travail/Echecs/Syzygy
info string Found 510 WDL, 0 DTM and 510 DTZ tablebase files. Largest 6-men

info score cp 393 depth 10 nodes 65.051 nps 3.423.736 time 19 pv f4d5 e4d5 b5e2 h2h1 e1d2 h1g1 b4b5 g1g3 b5b6 g3g1
info score cp 404 depth 11 nodes 99.689 nps 3.692.185 time 27 pv f4d5 e4d5 b5e2 h2h1 e1d2 h1h2 d4f4 h2g2 g3g4 d5e6 g4f5
info score cp 449 depth 12 nodes 193.059 nps 3.861.180 time 50 pv f4d5 e4d5 b5c4 d5c4 d4c4 e5d6 e1f1 h2b2 a6a7 b2a2 c4d4 d6e5
info score cp 423 depth 13 nodes 348.875 nps 745.459 time 468 pv f4d5 e4d5 b5c4 d5c4 d4c4 h2a2 b4b5 a2a5 c4c5 e5e4 e1d2 a5a2 c5c2 a2c2 d2c2
info score cp 423 depth 14 nodes 409.402 nps 769.552 time 532 pv f4d5 e4d5 b5c4 d5c4 d4c4 h2a2 b4b5 a2a5 c4c5 e5e4 e1d2 a5a2 c5c2 a2c2 d2c2 e4e3
info score cp 469 depth 15 nodes 539.529 nps 688.174 time 784 pv f4d5 e4d5 b5c4 d5c4 d4c4 h2a2 b4b5 e5d6 c4c6 d6e5 c6c7 a2b2 c7c5 e5e4 a6a7
info score cp 474 depth 16 nodes 1.186.163 nps 283.567 time 4.183 pv f4d5 e4d5 b5c4 d5c4 d4c4 h2a2 b4b5 a2a1 e1e2 a1a5 c4b4 a5a1 e2d2 a1a2 d2c3 a2g2 b5b6 g2g3

Then I quit the program, relaunch it, set the same position
info score cp 393 depth 10 nodes 65.051 nps 3.423.736 time 19 pv f4d5 e4d5 b5e2 h2h1 e1d2 h1g1 b4b5 g1g3 b5b6 g3g1
info score cp 404 depth 11 nodes 99.689 nps 3.692.185 time 27 pv f4d5 e4d5 b5e2 h2h1 e1d2 h1h2 d4f4 h2g2 g3g4 d5e6 g4f5
info score cp 449 depth 12 nodes 193.059 nps 4.022.062 time 48 pv f4d5 e4d5 b5c4 d5c4 d4c4 e5d6 e1f1 h2b2 a6a7 b2a2 c4d4 d6e5
info score cp 423 depth 13 nodes 348.875 nps 3.792.119 time 92 pv f4d5 e4d5 b5c4 d5c4 d4c4 h2a2 b4b5 a2a5 c4c5 e5e4 e1d2 a5a2 c5c2 a2c2 d2c2
info score cp 423 depth 14 nodes 409.402 nps 3.899.066 time 105 pv f4d5 e4d5 b5c4 d5c4 d4c4 h2a2 b4b5 a2a5 c4c5 e5e4 e1d2 a5a2 c5c2 a2c2 d2c2 e4e3
info score cp 469 depth 15 nodes 539.529 nps 4.056.609 time 133 pv f4d5 e4d5 b5c4 d5c4 d4c4 h2a2 b4b5 e5d6 c4c6 d6e5 c6c7 a2b2 c7c5 e5e4 a6a7
info score cp 474 depth 16 nodes 1.186.163 nps 4.176.630 time 284 pv f4d5 e4d5 b5c4 d5c4 d4c4 h2a2 b4b5 a2a1 e1e2 a1a5 c4b4 a5a1 e2d2 a1a2 d2c3 a2g2 b5b6 g2g3

Why in the second execution, time went from 4183 to 284 ?????
Syzygy tables are actives in the two executions.
Is there anything to do ?

Thanks a lot for your help
Philippe
JoAnnP38
Posts: 245
Joined: Mon Aug 26, 2019 4:34 pm
Location: Clearwater, Florida USA
Full name: JoAnn Peeler

Re: very strange behavior with syzygy tables

Post by JoAnnP38 »

In my next release of Pedantic I am going to try to implement Syzygy tb probing. I look forward to seeing if you discover the cause of you problem. However, since you are using 6 man, are your files stored on an SSD drive? I think I read that SSD is recommended for 3-5, but required for 6 or more.
Carbec
Posts: 133
Joined: Thu Jan 20, 2022 9:42 am
Location: France
Full name: Philippe Chevalier

Re: very strange behavior with syzygy tables

Post by Carbec »

Nope, I have an old machine, so I have only a hard drive.
I could understand it takes some time to probe the table, but I don't understand why the second test is so short ?? I even stop my program between the two tests.
Ras
Posts: 2488
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: very strange behavior with syzygy tables

Post by Ras »

Carbec wrote: Fri Jun 02, 2023 5:04 pmbut I don't understand why the second test is so short ??
Maybe the first time, it actually reads from HDD, which takes long, and then the file is in the file system cache of the operating system, so the second run is faster.
Rasmus Althoff
https://www.ct800.net
syzygy
Posts: 5569
Joined: Tue Feb 28, 2012 11:56 pm

Re: very strange behavior with syzygy tables

Post by syzygy »

Carbec wrote: Fri Jun 02, 2023 5:04 pm Nope, I have an old machine, so I have only a hard drive.
I could understand it takes some time to probe the table, but I don't understand why the second test is so short ?? I even stop my program between the two tests.
Disk caching by the OS.
Carbec
Posts: 133
Joined: Thu Jan 20, 2022 9:42 am
Location: France
Full name: Philippe Chevalier

Re: very strange behavior with syzygy tables

Post by Carbec »

Hi,
Thanks for the answer.
I suppose that I need to change my pc to use endgame tables!
I am looking for a new pc, based on amd 7950X (16 cores!!!).
The difficult part is to find the others components (case, motherboard, graphic board, ....)
There are simply too many.
syzygy
Posts: 5569
Joined: Tue Feb 28, 2012 11:56 pm

Re: very strange behavior with syzygy tables

Post by syzygy »

Carbec wrote: Wed Jun 07, 2023 11:27 am Hi,
Thanks for the answer.
I suppose that I need to change my pc to use endgame tables!
I am looking for a new pc, based on amd 7950X (16 cores!!!).
The difficult part is to find the others components (case, motherboard, graphic board, ....)
There are simply too many.
Get an SSD and ideally 64GB of RAM or more. (32GB might still do fine with 6-men tables.)