♔ Infographic · Perfect Endgames

Explain Chess Engine
Endgame Tablebase

When material drops low enough, search stops guessing — engines probe precomputed databases for perfect wins, draws, and losses.

📅 June 29, 2026 ⏱ 12 min read 🏷️ Syzygy · WDL · DTZ
An endgame tablebase (EGTB) is a massive precomputed lookup of every legal position with ≤N pieces on the board. For each position it stores the exact outcome under perfect play — win, loss, or draw — and often how many moves until the next capture, pawn move, or check (a zeroing event). Modern engines (Stockfish, Lc0 wrappers, etc.) probe Syzygy files at search time instead of searching deep endgames from scratch.

Concept

Search Alone vs Tablebase Probe

Tablebase probe

O(1) disk lookup returns perfect WDL/DTZ. Engine converts to search score, prunes losing moves, picks shortest wins — mathematically correct.

≤7Pieces (Syzygy standard)
WDLWin / Draw / Loss flag
DTZDistance to zeroing move
~150 GBFull 7-man Syzygy set

Coverage

How Many Pieces?

3K+Q vs K
4K+R+P vs K
5K+R+B vs K+N
6K+P endgames
7Full Syzygy max

Count includes both kings and all remaining pieces. 8+ piece positions are not in standard Syzygy — engines fall back to search + NNUE/heuristic eval.

Data

WDL — The Three Outcomes

W

Win — side to move wins with perfect play (may require many moves).

D

Draw — neither side can force a win (includes stalemate, repetition, 50-move).

L

Loss — side to move loses with perfect defense (opponent wins).

Precision

DTZ — Distance to Zeroing

WDL files (.rtbw / .rtwd)

Smaller. Answer: can I win, hold a draw, or am I lost? Enough for correct result and many cutoffs. Used heavily in fast play.

Pipeline

How an Engine Probes Tablebases

Position
≤7 pieces
Normalize
EP · castling
Hash lookup
in .rtb*
WDL / DTZ
+ best move
1
Check piece count
If total pieces > limit (e.g. 7) or files missing — skip probe, use normal search.
2
Probe WDL
Fast win/draw/loss. Losing moves can be pruned; winning side prefers moves that preserve win.
3
Probe DTZ (if available)
Among winning moves, pick lowest DTZ — shortest conversion. Handle cursed wins (win but 50-move draw) and blessed losses.
4
Convert to search score
Map WDL/DTZ to centipawn-like bounds (e.g. TB win score ≈ +199 − dtz) so alpha-beta and UCI info stay consistent.
// Simplified probe → score (Stockfish-style idea) if (pieces <= syzygyProbeLimit) { wdl = probe_wdl(pos); if (wdl == WIN) score = +20000 - dtz; // mate-ish bound if (wdl == LOSS) score = -20000 + dtz; if (wdl == DRAW) score = 0; return score; // cutoff — no subtree search }

Files

Syzygy File Types

*.rtbw

WDL tablebase (without DTZ). Most common for analysis with limited disk space.

*.rtbz

Combined WDL + DTZ in one file. Preferred when you want shortest mates.

*.rtwd / *.rtzd

Compression variants (large pages). Same data, different on-disk layout for faster probing.

KQRvK.rtbw

Named by material (Kings + pieces). One file per material signature up to 7 men.

Integration

Where Probes Hook Into Search

Root & internal nodes

Before expanding a subtree, check TB. A proven draw returns score 0 immediately; a proven loss returns a huge negative — massive node savings.

Move ordering

Winning TB moves rank first; losing moves may be skipped entirely. DTZ breaks ties among several winning moves.

50
50-move rule awareness

Syzygy stores cursed wins (win but draw under 50-move) and blessed losses. Engines adjust conversion strategy accordingly.

UCI
GUI configuration

Set SyzygyPath (or equivalent) to the folder containing .rtb* files. Option SyzygyProbeLimit caps piece count (3–7).

Reference

Formats & History

FormatEraUsed byNotes
Nalimov .emt/.emm1990s–2000sOld engines, Crafty5-man standard; replaced by Syzygy
Gaviota .gtb2000sSome hobby enginesAlternative compression; less common today
Syzygy .rtb*2013+Stockfish, Komodo, etc.6-man complete; 7-man widely available
Scorpio bitbases2010sEndgame bitbasesSome 6-man bitbase sets; Syzygy dominates

Setup & usage tips

Explore the full engine stack

Tablebases plug into search and UCI — see how the rest of a modern engine fits together.

Related: Search Algorithm · Transposition Table · UCI Protocol · All Blogs