Chess Analysis
ES
Blog

How chess endgame tablebases work

A chess engine's evaluation is normally its best guess: a score in pawns, built from a search that stops at some depth and could change with more time. In a simple endgame, one with few enough pieces left on the board, it does not need to guess. A Syzygy endgame tablebase holds the result of every such position, worked out in advance, so a game review can state a fact instead of an estimate.

What can a tablebase tell you that a search cannot?

Once a position is covered, its evaluation stops being an estimate and becomes a category it can prove: win, draw or loss for the side to move. A deeper search can still be wrong about a tricky endgame; a tablebase result is not a guess and does not shift if the engine is given more time to think, because every covered position was already resolved before the game began.

What is DTZ, and what it is not

The number that comes with a win or a loss is DTZ, short for distance to zero: how many moves pass before the next capture or pawn move, the point where the fifty-move counter that would otherwise draw the game resets to zero. A low DTZ in a winning position means the stronger side needs to make progress soon or risk that clock. DTZ is not a count of moves to checkmate: that number, distance to mate, is not part of this data, so that field is always empty.

Which endgames does a tablebase cover?

Coverage depends on how many pieces remain on the board, set by how much tablebase data the server holds:

  • Five pieces, about 1 GB of data.
  • Six pieces, about 150 GB, today's starting point.
  • Seven pieces, about 18 TB, added as load on the service grows.

So a position becomes exact once it is simple enough, not simply because it is an endgame. A position where either side can still castle falls outside the tablebase too, since this data assumes castling rights are already gone.

What happens outside that coverage?

A position with more pieces than the tablebase holds, or one where castling is still possible, gets the engine's usual search-based evaluation, the best estimate in pawns rather than a proven result. As a game simplifies, usually through captures, the exact result takes over for the moves that follow, and how accuracy is calculated explains how that changes which moves in an endgame count as a mistake.

Curious whether your own endgames were a certainty or just an estimate? Review one of your games and see where the tablebase result begins.

Import a game from Lichess or Chess.com and see where it was decided.