Skip to content

Endgame Tablebases

CheckAI supports Syzygy tablebase integration scaffolding in the analysis engine.

What are Syzygy Tablebases?

Syzygy tablebases contain precomputed optimal play for all positions with a small number of pieces (typically up to 6 or 7). In a full Syzygy integration, an engine can read exact game-theoretic outcomes (WDL) and distance-to-zeroing (DTZ) values from .rtbw/.rtbz files.

Current Status in CheckAI

At the moment, CheckAI does not perform binary probing of .rtbw/.rtbz files yet.

  • If a simple endgame is analytically solved by built-in rules, CheckAI returns that result (source: analytical).
  • If matching Syzygy files are present for a position, CheckAI currently logs that binary probing is not implemented, then falls back to a material-based heuristic WDL estimate (source: heuristic).
  • Heuristic fallback results are not treated as true tablebase hits (is_tablebase_position = false).

Analytical Probing

CheckAI includes built-in analytical probing for common endgames. This is applied when a tablebase path is configured (via --tablebase-path) for positions where analytical results are provably correct, even if no corresponding .rtbw/.rtbz file is present:

EndgameResult
K vs KAlways drawn
KR vs KWin for stronger side
KQ vs KWin for stronger side

To enable this analytical probing path (and table file discovery), configure a tablebase path as described below.

Setup with External Files

External Syzygy files are currently optional. Today they provide:

  • Discovery/indexing of available .rtbw/.rtbz configurations
  • Piece-count coverage/range information
  • Forward compatibility for future full binary probing

They do not yet provide exact WDL/DTZ probing in CheckAI.

To configure external files anyway (recommended for future compatibility):

  1. Download Syzygy tablebase files (.rtbw for WDL, .rtbz for DTZ)
  2. Place them in a directory, e.g. tablebase/
  3. Start the server with the --tablebase-path flag:
bash
checkai serve --tablebase-path tablebase/

Docker

yaml
volumes:
  - ./tablebase:/home/checkai/tablebase:ro
command:
  - serve
  - --tablebase-path
  - tablebase

File Formats

ExtensionPurposeDescription
.rtbwWin/Draw/LossGame-theoretic result per position
.rtbzDistance to Zeroing (DTZ)Optimal number of moves to progress

Sources

Syzygy tablebases can be downloaded from:

Size Considerations

3-4 piece tablebases are small (< 1 GB). 5-piece tablebases are ~1 GB. 6-piece tablebases are ~150 GB. 7-piece tablebases are ~140 TB. Choose what fits your storage.

Released under the MIT License.