Problem with Syzygy bases

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, chrisw, Rebel

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

Re: Problem with Syzygy bases

Post by syzygy »

Joerg Oster wrote: Thu Nov 21, 2024 3:07 pm
syzygy wrote: Thu Nov 21, 2024 2:07 am The line does end in mate, but it is not the optimal line.
However, SF does not return a mate score. It return what I think is the TB win score.

So maybe this is not strictly a bug (SF does not actually find a mate), but it is strange to see the PV end in mate.
That's because of vondele's PV extension patch.
See https://github.com/official-stockfish/S ... 0bfad3b850

I think the main purpose is to show a PV line representing the TB outcome.
This was also announced in the release notes of Stockfish 17.
Improved engine lines

This release introduces principal variations (PVs) that are more informative for mate and decisive table base (TB) scores. In both cases, the PV will contain all moves up to checkmate. For mate scores, the PV shown is the best variation known to the engine at that point, while for table base wins, it follows, based on the TB, a sequence of moves that preserves the game outcome to checkmate.
Thanks, that indeed seems to explain this.
syzygy
Posts: 5654
Joined: Tue Feb 28, 2012 11:56 pm

Re: Problem with Syzygy bases

Post by syzygy »

Rebel wrote: Wed Nov 20, 2024 8:32 pm I am working to improve my NN with Syzygy bases, I have installed the 3-6 men and the 10 most used 7-men and use SF16 to reanalyze the 3-6 men and the 10 most used 7-men in my NN.

This goes well except for 1/3500 cases the bases don't return a TB score and I wonder what the reason is. I went to https://syzygy-tables.info/ and here the failed positions worked well. So maybe a false download?
How do you use Stockfish to probe the TBs?
Easiest is to use the commandline:

Code: Select all

setoption name SyzygyPath value /path/to/tbs
info string Found 145 tablebases
position fen 8/8/8/1k5p/3K3N/8/4N3/8 b - -               
d

 +---+---+---+---+---+---+---+---+
 |   |   |   |   |   |   |   |   | 8
 +---+---+---+---+---+---+---+---+
 |   |   |   |   |   |   |   |   | 7
 +---+---+---+---+---+---+---+---+
 |   |   |   |   |   |   |   |   | 6
 +---+---+---+---+---+---+---+---+
 |   | k |   |   |   |   |   | p | 5
 +---+---+---+---+---+---+---+---+
 |   |   |   | K |   |   |   | N | 4
 +---+---+---+---+---+---+---+---+
 |   |   |   |   |   |   |   |   | 3
 +---+---+---+---+---+---+---+---+
 |   |   |   |   | N |   |   |   | 2
 +---+---+---+---+---+---+---+---+
 |   |   |   |   |   |   |   |   | 1
 +---+---+---+---+---+---+---+---+
   a   b   c   d   e   f   g   h

Fen: 8/8/8/1k5p/3K3N/8/4N3/8 b - - 0 1
Key: AB5F8F7AEB7F5958
Checkers: 
Tablebases WDL: Loss (Success)
Tablebases DTZ:  -65 (Success)
User avatar
Rebel
Posts: 7231
Joined: Thu Aug 18, 2011 12:04 pm
Full name: Ed Schröder

Re: Problem with Syzygy bases

Post by Rebel »

syzygy wrote: Sat Nov 23, 2024 8:13 pm
Rebel wrote: Wed Nov 20, 2024 8:32 pm I am working to improve my NN with Syzygy bases, I have installed the 3-6 men and the 10 most used 7-men and use SF16 to reanalyze the 3-6 men and the 10 most used 7-men in my NN.

This goes well except for 1/3500 cases the bases don't return a TB score and I wonder what the reason is. I went to https://syzygy-tables.info/ and here the failed positions worked well. So maybe a false download?
How do you use Stockfish to probe the TBs?
Easiest is to use the commandline:

Code: Select all

setoption name SyzygyPath value /path/to/tbs
info string Found 145 tablebases
position fen 8/8/8/1k5p/3K3N/8/4N3/8 b - -               
d

 +---+---+---+---+---+---+---+---+
 |   |   |   |   |   |   |   |   | 8
 +---+---+---+---+---+---+---+---+
 |   |   |   |   |   |   |   |   | 7
 +---+---+---+---+---+---+---+---+
 |   |   |   |   |   |   |   |   | 6
 +---+---+---+---+---+---+---+---+
 |   | k |   |   |   |   |   | p | 5
 +---+---+---+---+---+---+---+---+
 |   |   |   | K |   |   |   | N | 4
 +---+---+---+---+---+---+---+---+
 |   |   |   |   |   |   |   |   | 3
 +---+---+---+---+---+---+---+---+
 |   |   |   |   | N |   |   |   | 2
 +---+---+---+---+---+---+---+---+
 |   |   |   |   |   |   |   |   | 1
 +---+---+---+---+---+---+---+---+
   a   b   c   d   e   f   g   h

Fen: 8/8/8/1k5p/3K3N/8/4N3/8 b - - 0 1
Key: AB5F8F7AEB7F5958
Checkers: 
Tablebases WDL: Loss (Success)
Tablebases DTZ:  -65 (Success)
2 things -

1. the 3 epds in the OP showed the output epds, whereas I should also have posted the input epds because the output epds alsways showed "0-1" instead of real fifty-move counter in the input epd. I assumed this made the difference.

2. I store 50 million epds in the SF bench and run the bench at depth=1, works like a charm.
90% of coding is debugging, the other 10% is writing bugs.
syzygy
Posts: 5654
Joined: Tue Feb 28, 2012 11:56 pm

Re: Problem with Syzygy bases

Post by syzygy »

Rebel wrote: Sat Nov 23, 2024 11:31 pm2. I store 50 million epds in the SF bench and run the bench at depth=1, works like a charm.
OK, but if you again run into something that makes you doubt that the tablebases return the right answer, then you can probe them directly (with the "d" command). Otherwise it might be SF's depth 1 search that does something funny with the TB result.