Endgame tablebases are precomputed databases that contain perfect information about the outcome of a chess endgame for all possible positions with a small number of pieces on the board. Created using retrograde analysis, these databases determine whether a given position is a win, loss, or draw for the side to move, and specify the maximum number of moves required to achieve a forced checkmate or to force a draw under optimal play. Originally developed for chess endgames with up to five pieces (including kings), modern tablebases extend to seven pieces, providing a theoretical foundation for the game's final stages and serving as powerful tools for analysis, computer chess engines, and human study.

1 History

1.1 Early theoretical work

The concept of perfect endgame knowledge dates back to the mid‑20th century. Early researchers, such as Richard Bellman, proposed using dynamic programming to solve chess endgames. In the 1970s, Thomas Ströhlein published a thesis on rook and pawn endgames, manually computing small subsets. Ken Thompson at Bell Labs produced the first computer‑generated five‑piece tablebases in the 1980s, demonstrating that a computer could definitively solve small endgames.

1.2 Computer‑based generation (1990s)

In the 1990s, the development of faster processors and larger storage enabled systematic generation of five‑piece tablebases. Eugene Nalimov popularised the Nalimov tablebase format, which became the standard for chess engines. By 1998, all five‑piece positions (kings plus three other pieces) were available. The production required retrograde analysis, starting from known checkmate positions and working backward.

1.3 Emergence of Lomonosov and Syzygy tablebases

Around 2010, the Lomonosov Supercomputer at Moscow State University generated six‑piece tablebases, covering all positions with up to six pieces. Shortly thereafter, Ronald de Man developed the Syzygy tablebase format, which offered greater compression and faster access. Syzygy bases became the preferred choice for modern chess engines due to their smaller size and support for distance‑to‑conversion information.

1.4 Seven‑piece breakthroughs

In 2012, a team at the University of Mainz (including Vladimir Makhnychev and Victor Zakharov) completed the first seven‑piece tablebases, using a cluster of computers. The full set of 7‑piece positions (including the two kings and five additional pieces) occupied about 140 terabytes. This achievement extended the theoretical frontier, although most practical endgames remain beyond the 7‑piece limit.

2 Technical foundations

2.1 Retrograde analysis algorithm

Retrograde analysis works backward from terminal positions (checkmates and stalemates). The algorithm labels positions as wins, losses, or draws by propagating outcomes: a move to a losing position makes the current position a win; if all moves lead to winning positions for the opponent, the current position is a loss; otherwise it is a draw. The process iterates until no changes occur.

2.2 Distance‑to‑mate vs. distance‑to‑conversion

Two common metrics are stored: distance to mate (DTM) and distance to conversion (DTZ). DTM records the fewest moves to force checkmate under perfect play. DTZ records the moves until a “decisive conversion” (e.g., a pawn promotion or a capture that reduces the material count), after which a simpler tablebase can be consulted. DTZ is more memory efficient and aligns with the 50‑move rule.

2.3 Symmetry reduction and indexing

Tablebases exploit symmetries of the chessboard (mirroring, rotation, and color swaps) to reduce the number of stored positions. Each distinct position is mapped to a unique integer index via compact encoding of piece locations, using base‑64 or similar schemes. The indexing scheme must also consider the side to move.

2.4 Compression techniques

Raw tablebases are enormous. Compression methods include run‑length encoding, Huffman coding, and specialized schemes that leverage the fact that many positions share the same outcome. For example, Syzygy bases use a technique where only the WDL (win/draw/loss) values are stored, with DTZ values optionally compressed using variable‑length codes.

2.5 Formats: Nalimov, Gaviota, Syzygy

Three major formats have been used. Nalimov is the oldest, storing DTM data in a fixed‑size record per position. Gaviota, designed by Miguel Ballicora, compresses data more efficiently and supports both DTM and DTZ. Syzygy, created by Ronald de Man, offers the best compression and is the most widely used in modern engines.

2.5.1 Syzygy tablebase characteristics

Syzygy tablebases are split into two files per endgame: one for Win/Draw/Loss (WDL) and one for Distance to Zeroing (DTZ). They use a compact index that groups positions by the number of pieces and pawn structure. The bases are designed for fast random access and minimal memory footprint.

2.5.1.1 WDL and DTZ tables

The WDL table indicates whether a position is a win for White, a win for Black, or a draw, assuming optimal play. The DTZ table stores the number of moves until a zeroing move (a capture or pawn move) that reduces the total distance to a known endgame. DTZ values are crucial for adjudicating the 50‑move rule in computer chess.

3 Known results and notable endgames

3.1 Maximum DTM (distance to mate) – 5, 6, and 7 pieces

For five‑piece endgames, the longest forced checkmate is 262 moves (in the position KQRR vs. KQ, though the exact record varies by source). Six‑piece bases increased the maximum to around 517 moves (e.g., KQNKRB). Seven‑piece bases currently hold the record at around 549 moves, found in a position with kings and heavy pieces. These extreme lengths challenge the 50‑move rule in practical play (see §3.3).

3.2 Surprising discoveries in pawnless endings

Tablebases revealed many counterintuitive results. For example, the endgame KBB vs. KN (two bishops vs. knight) is a general win for the bishops, but certain positions require over 100 moves. The rook and two minor pieces vs. rook endgames often see long, non‑intuitive maneuvers. Some “theoretically drawn” positions were found to be wins for the stronger side with perfect play, overturning earlier human analysis.

3.3 The “50‑move rule” interactions

Because some tablebase wins require more than 50 moves without a capture or pawn move, they conflict with the 50‑move rule in over‑the‑board play. In standard chess, if 50 moves elapse without a capture or pawn move, the game is drawn. Many long DTM sequences are technically wins only if the 50‑move rule is waived. This has led to discussions about adjusting the rule for endgame tablebase verification.

3.4 Tablebases for other chess variants

Tablebases have been generated for variants such as chess960 (Fischer Random), where the starting position is randomized but endgames are identical. Also for “antichess” (where captures are forced) and “suicide chess”, small‑piece tablebases exist but are less common. For standard chess, tablebase methodology has been applied to “three‑check” and “atomic” chess variants in limited form.

4 Practical applications

4.1 Use in chess engines (Stockfish, Komodo, Leela Chess Zero)

Modern chess engines integrate Syzygy tablebases for perfect endgame evaluation. Stockfish uses DTZ tables to convert winning positions efficiently and to avoid losing positions. Komodo also uses tablebases to improve endgame play. Leela Chess Zero (LCZero) does not directly use tablebases in its neural network evaluations but can consult them during analysis to verify endgame outcomes.

4.2 Endgame training for human players

Tablebases serve as definitive references for human study. Players can examine optimal play in common endgames (e.g., KQ vs. K, KR vs. K) and in rare material imbalances. Numerous online tools (such as lichess’s endgame trainer) use tablebases to generate practice positions with exact solutions.

4.3 Online databases and analysis tools

Websites like the Lomonosov Endgame Tablebase (endgame.minus‑and‑plus.com) and lichess’s internal tablebase (using Syzygy) allow users to input any position with up to seven pieces and see the perfect result, best move, and distance to mate or conversion. These tools have become standard for post‑game analysis and endgame composition.

5 Limitations and controversies

5.1 Storage size and memory demands

Seven‑piece tablebases require about 140 TB of disk space. Even the six‑piece set occupies about 1 TB. For typical users, storing the entire set is impractical. Engines often use only the subset relevant to the current endgame (e.g., loading on demand). The memory‑mapped access used by Syzygy can be demanding on RAM.

5.2 Exhaustiveness – only up to seven pieces

Current tablebases are complete only for positions with seven or fewer pieces (including kings). Most positions from the opening and middlegame involve 32 pieces; tablebases cannot help there. The theoretical limit for exhaustive generation is currently eight pieces (estimated at tens of petabytes), which remains inaccessible to most institutions.

5.3 Irrelevance to most practical play

The vast majority of chess games end before the five‑piece stage. Even when tablebases are applicable, human players rarely achieve perfect play. Thus, tablebases are more valuable for engine development, composition analysis, and theoretical study than for everyday human play.

5.4 Philosophical debates on “perfect play”

The existence of tablebases raises philosophical questions: if a finite game like chess can be fully solved for a given number of pieces, could the entire game be solved by computers? Some argue that the combinatorial explosion (roughly 10^50 positions) makes a full solution impractical, while others maintain that in principle, perfect play could be computed given sufficient resources. Tablebases demonstrate that small domains can be solved completely.

6 See also

* Computer chess * Retrograde analysis * Syzygy tablebases * Fifty‑move rule * Endgame

7 References

* Nalimov, E. V., Wirth, C., & Hausmann, G. (2000). “Chess Endgame Databases.” *The Chess Player.* * de Man, R. (2014). “Syzygy Endgame Tablebases.” https://syzygy‑endgame‑tables.info. * Kåhre, P. (2012). *Generating and Using Endgame Tablebases.* Master’s thesis, Royal Institute of Technology. * Schaeffer, J., et al. (2007). “Solving the Endgame of Chess.” *Journal of the International Computer Games Association.* * Mainz Team (2012). “Seven‑Piece Endgame Tablebases.” University of Mainz.