Step 3: Setting up Syzygy Endgame Table-bases

 

Syzygy table-bases store the results of every possible position with a fixed number of pieces left on the board, up to a certain limit (e.g. 7 pieces total, including both kings). For example, one table-base may contain data for all positions with a king and queen versus a king and rook. This means that the table-base contains information on whether the position is a win, draw, or loss and provides the optimal moves to achieve the best outcome. Computer engines have the ability to access these files which historically has improved their endgame play.

As chess engines have improved, however, the advantage these table-bases provide has diminished. A prominent Stockfish developer (Vizvezdenec) believes "They bring 'almost' nothing nowadays." Others (and some of my testing) suggests they still provide a small advantage in endgame play. Having these endgame table-bases can also  be useful if you do engine testing to adjudicate engine vs. engine games.

You can make your own decision, but setting up the Syzygy table-bases takes some time (for downloading) and a modest amount of money for a 2 TB SSD drive (if you choose to set up a portion of the 7-piece table-bases).  Storing the files on a fast drive is important so that file read times don't slow your chess engine.

Start With The 3-5 Piece Table-bases 

As of the time of this writing, you can quickly download the 3-4-5 piece tablebases which will use 940.4 MB of disk space.  After you download the file, navigate in a terminal to your download directory and:

Add The 6-Piece Files

The 6-piece table-base files take about 150 GB of disk space, so you will need some patience to download them. To download:

Your downloaded files will be in sub-directories /6-dtz and /6-wdl wherever you executed the wget commands.  Ideally you would do this in the same dedicated location where your 3-4-5 piece files are.  Then move all the 6-piece .rtbz and .rtbw files to the same directory that all your 3-4-5 .rtbz and .rtbw files are in.  All files with those extensions should be in the same directory so you can reference them with one simple directory path in your Stockfish (or Lc0) options.

Adding Some 7-piece Files

The size of all of the 7-man table files is a whopping 18.4 Terra-bytes. For most of us, it's not practical to download the whole 7-man set. However, it turns out you can capture most of the usefulness of the 7-piece set with a subset of those files. That's because many of the 7-piece positions (representing many Terra-bytes!) just don't occur very often in computer vs. computer games or in games played by humans.
typecomputer gamesc%human gamesh%% computer cum% h cum
KRPPvKRP116815.2455333.0115.233.0
KBPPvKBP3084.02774.619.337.6
KPPPvKPP3074.01774.623.342.2
KRPPPvKR1972.57382.2725.844.5
KQPPvKQP1932.52513.0428.447.5
KNPPvKNP1692.21633.7630.651.3
KNPPvKBP1592.08603.5832.754.9
KRBPvKRP1532382.2734.757.1
KQPPvKPP1481.9360.3636.657.5
KQPPPvKP1451.890038.557.5
KBPPvKNP1441.88593.5240.461.0
KRPPvKRB1291.68211.2542.062.3
KRPPvKPP1261.64191.1343.763.4
KBPPvKRP1221.59482.8745.366.3
KRNPvKRP1181.54362.1546.868.4
KRBPPvKR1031.3450.348.168.7
KBPPvKPP1021.33201.1949.569.9
KRPPPvKP941.2310.0650.770.0
KRBPvKRB931.21261.5551.971.5
KRPPvKRN821.07201.1953.072.7
KRNPPvKR77150.354.073.0
KBPPPvKP740.9710.0655.073.1
KNPPvKPP740.97191.1355.974.2
KQPPvKRP740.9710.0656.974.3
KPPPvKBP730.95271.6157.875.9
KPPPPvKP710.9310.0658.875.9
KNPPvKRP700.91281.6759.777.6
KRPPvKBP690.9150.960.678.5
KRNPvKRN620.81181.0761.479.6
KPPPvKRP590.77140.8462.280.4
KPPPvKNP580.76211.2562.981.7
KRBPPvKP580.760063.781.7
KRNPvKRB560.73171.0164.482.7
KRBPvKRN560.7380.4865.183.1
KQPPPvKR530.690065.883.1
KNPPPvKP510.6720.1266.583.3
KBNPvKRP490.64130.7867.184.0
KRBPvKBP480.6350.367.884.3
KRPPvKNP480.63171.0168.485.4
KQPPPvKQ450.5970.4269.085.8
KRPPvKQP440.57110.6669.686.4
KQBPPvKP410.540070.186.4
KQPPvKNP390.510070.686.4
KRPPvKRR380.540.2471.186.7
KRBPvKNP370.4820.1271.686.8
KRRPvKRP370.4840.2472.187.0
KRBPvKPP360.470072.587.0
KQPPvKBP340.4420.1273.087.2
KRPvKRRP330.4330.1873.487.3
KRBPvKRR330.4350.373.887.6
KQRPPvKP330.430074.387.6
KPPPvKQP320.4220.1274.787.8
KRBPvKQP310.430.1875.187.9
KQNPPvKP290.380075.587.9
KRBPPvKB290.3830.1875.988.1
KBPPPvKR280.3780.4876.288.6
KRNPvKBP280.3760.3676.689.0

Here is a bash script to download some of the most commonly encountered 7-piece positions. You will want to execute it on a disk drive where you have about 1.7 TB of free space. These are big files and it will take quite awhile.

Again, you will want to move all of the downloaded .rtbz and .rtbw files to the same location as your 3-6 piece tablebase files.  

Using The Files

You can now reference that directory in the configuration of your chess engine (example shown using the Scid GUI).

Now when you run your engine, you will see the number of table-base hits as your engine refers to the Syzygy files.



Comments

Popular Posts