Tablebase in Chess: Endgame Databases, Syzygy and Nalimov
A tablebase is a computer database of precalculated results for endgame positions. For every position with a small number of pieces it records whether the result is a win, draw or loss with perfect play, and how many moves the result takes. An engine that consults one no longer has to calculate those endings; it simply knows.
How tablebases are made
The earliest work was theoretical. Thomas Ströhlein analysed endings such as king and queen against king in his 1970 doctoral thesis. Ken Thompson’s king and queen against king and rook table was used in a 1977 match against Walter Browne, and Thompson and others later extended coverage to every ending with four or five pieces. Tablebases are named for their authors. The Nalimov tablebases, made by Eugene Nalimov, take 7.05 GB for five pieces or fewer and 1.2 TB for six pieces. The Syzygy tablebases, written by Ronald de Man and released in April 2013, are more compact: 160.2 GB for six pieces and 18.4 TB for seven. Syzygy is the most popular set and is used by top engines. A seven-piece table was completed in 2012 on the Lomonosov supercomputers at Moscow State University and takes about 140 TB.
What the numbers mean
Two measures are common. Depth to mate, DTM, counts moves to checkmate. Depth to zeroing, DTZ, counts moves until a capture or a pawn move resets the fifty-move counter, which makes it the natural metric for applying that rule.
Many tablebases ignore the fifty-move rule, so they can label a position as won although the rule would make it a draw. Such positions are called cursed wins, and the mirror case is a blessed loss. FIDE added exceptions to the rule in 1974 and 1988 and cancelled them in 1992. In correspondence chess the ICCF later allowed six-man tablebases in 2014 and seven-man ones in 2020 to support win or draw claims.
Retrograde analysis
Tablebases are built backward. The program starts from every position in which one side is checkmated, marks the positions from which a player can reach one of them, then those from which the opponent cannot avoid it, and repeats the step one ply at a time. Positions that never become linked to a win or a loss are draws. The proposal for such a database came from Richard Bellman in 1965, long before the hardware existed.
The size of the job grows quickly. King and queen against king has roughly 40,000 positions, and each extra piece multiplies the count by about 60. A pawn adds a smaller factor of 2.4. Each table also leans on smaller ones, because a capture or a promotion leads into an ending with fewer pieces. Castling is left out by default since it depends on the history of the game, and en passant is included only when both sides have a pawn.
How large the sets are
| Pieces | Positions | Set | Size |
|---|---|---|---|
| 3 | 368,079 | Syzygy DTZ | 25.8 KB |
| 4 | 125,246,598 | Syzygy DTZ | 4.3 MB |
| 5 | 25,912,594,054 | Syzygy DTZ | 979.6 MB |
| 6 | 3,787,154,440,416 | Syzygy DTZ | 160.2 GB |
| 6 | 3,787,154,440,416 | Nalimov DTM | 1.2 TB |
| 7 | 423,836,835,667,331 | Syzygy DTZ | 18.4 TB |
| 7 | 423,836,835,667,331 | Lomonosov DTM | 140 TB |
The seven-piece Syzygy files, produced by Ronald de Man and Bojun Guo and released in August 2018, cut the storage for that size from 140 TB to 18.4 TB. Syzygy keeps two kinds of file for each ending: a small win-draw-loss table that an engine can read during search, and a larger DTZ table used to choose the move at the root. In 2021 the Lomonosov tables were hit by ransomware and have been offline since. Work on eight pieces has started. In 2025 Bourzutschky and Fiekas built a partial eight-piece set for Lichess, covering about 1.3 percent of the positions, which Lichess estimated to cover about half of the eight-piece endings that arise in practical games.
What tablebases found
The tables overturned several beliefs about endings. Horwitz and Kling suggested in 1851 that the defence could hold king, bishop and bishop against king and knight with a fortress, yet the database shows a general win, with a longest DTC of 66 and a longest DTM of 78. King and two knights against king and pawn takes at most 115 moves. In May 2006 Bourzutschky and Konoval found a win in 517 moves to conversion in king, queen and knight against king, rook, bishop and knight, later confirmed as a mate in 545. A 549-move mate found during the Lomonosov work in 2012 is the longest known for seven pieces or fewer, and in 2021 Bourzutschky found a DTC of 584 in an eight-piece ending.
Endgame composers were affected too. In a 1978 study by Pogosyants, a tablebase showed that 1.h4 also wins, so the intended solution was not the only one. John Nunn used the tables for three books: Secrets of Minor-Piece Endings (1995), Secrets of Rook Endings (1999) and Secrets of Pawnless Endings (2002).
Fifty-move rule and its variants
Because plain DTM ignores the fifty-move rule, versions that respect it exist: DTM50, DTC50 and DTZ50. Galen Huntington published DTM50 tables for endings with fewer than six pieces with Guy Haworth in 2015. DTC, depth to conversion, counts moves to mate, a winning capture or a winning promotion, and DTZ also stops at a winning pawn move. For won positions DTZ is never larger than DTC, which is never larger than DTM. Syzygy’s win-draw-loss tables take the rule into account, so a cursed win appears there as a draw.
Tablebases in play
Stockfish, Leela, Dragon and Torch all support Syzygy files, though the gain in playing strength is very small. Tablebases up to seven pieces are free to download and can also be queried through web interfaces, Lichess among them. A known drawback is that a table which ignores the fifty-move rule can lead a user to resign or play inferiorly. Garry Kasparov’s game against the World, played by correspondence, was analysed afterwards with a six-piece king and two queens against king and two queens table.
Where they appear
Tablebases are one half of the pairing described on the computer chess page, where engines handle the middlegame and tablebases the ending. The ICCF’s use of them is set out under correspondence chess. Engines also solve long forced mates by search, as in the article on the mate in 64.
Questions
What is the difference between DTM and DTZ?
Depth to mate counts moves to checkmate. Depth to zeroing counts moves until a capture or a pawn move resets the fifty-move counter, and Syzygy uses it to pick the move at the root of a position.
How big is a seven-piece tablebase?
The Syzygy seven-piece set takes 18.4 TB. The earlier Lomonosov set, which stores depth to mate, takes about 140 TB.
What is a cursed win?
A position that a tablebase scores as won, but where the winning line needs so many moves without a capture or pawn move that the fifty-move rule makes it a draw. The reverse case is called a blessed loss.
Who produced the first tablebase used in a game against a grandmaster?
Ken Thompson, whose king and queen against king and rook table was used in a 1977 match against Walter Browne. Thomas Ströhlein had analysed similar endings in his 1970 thesis.
Has anyone solved eight pieces?
Not in full. A partial eight-piece set built for Lichess in 2025 covers about 1.3 percent of positions, and the full set is estimated at around 2 petabytes.