Put the black king on a8, the white rook on b1, the white king on e4 and a white pawn on h2. White to move. Sliding the rook one square left gives check. The black king has to answer it. Yet if the last capture was 99 half-moves ago and no pawn has moved since, Black can answer by claiming a draw. Pushing the pawn to h3 instead keeps the win. You can inspect both moves in the same four-piece tablebase entry. The difference explains why the open-source Syzygy generator produces two files for an ending. [1][2][3]
What the engine can look up
A tablebase stores answers calculated in advance for endings with a particular set of pieces. In Syzygy’s filenames, our little board is KRPvK, king, rook and pawn against king. Inside that material class, the pieces’ squares and the side to move matter. A rook safely across the board and a rook the enemy king can take are quite different prospects. A capture can also send the engine to another file entirely. If Black takes the pawn, the resulting position belongs to the rook-against-king table. A promotion can change files even when every piece stays on the board. [3][5]
The first file, with the suffix .rtbw, supplies a win, draw or loss classification. In the python-chess interface, the call is probe_wdl(board). Its answer assumes the fifty-move count has just been reset. It even distinguishes a “cursed win,” an ending where one side could force mate given unlimited moves but a defender can hold out long enough to claim a draw. Our opening position is a simpler case. White can force a win with a fresh count. An application that displays that verdict beside every promising rook check has lost a fact about the game in progress. [1][5]
What the scoresheet adds
The half-move clock counts turns by individual players. At 99, the rook check on a1 brings the count to 100, fifty turns apiece. Black has the move, Black has legal replies, and Black can claim the draw. Move the h-pawn instead and the count goes straight to zero. The black king is still in the corner, the rook still cuts off the b-file, and White has time to bring the king across. On the Lichess list, read each candidate move’s result from the perspective of the player who must reply. The loss beside h3 belongs to Black. [1][2]
Syzygy’s second file, ending in .rtbz, supplies distance to zeroing. A zeroing move is a capture or a pawn move. In a winning line the distance tells the engine how soon it can force such a reset, or finish the game with mate, while keeping the win. This gives a pawn push near the edge of the board a measurable consequence even if checkmate is still many moves away. The value can involve rounding, so reading it as an exact countdown to mate would give the wrong answer twice over. [3][5]
Stockfish brings the two records together when it ranks moves at the root of its search, the position actually awaiting a move. Its probing code takes account of the half-moves already spent as well as the distance available from the table. To see the point, erase just the last 99 half-moves from our example and leave all four pieces where they stand. The rook check now drives the king off a8 with plenty of time to spare. Restore the scoresheet and Black can put down the pen after that very same check. The extra information the engine needed was sitting beside the board. [1][2][6]
Sources
- Lichess tablebase service, move-by-move results for the four-piece position with the half-move clock at 99.
- Chessprogramming Wiki, “Fifty-move Rule,” including the draw claim and the half-move clock.
- Ronald de Man, Syzygy tablebase generator, file formats and material classes.
- Garry Knight, “Chess Pieces,” original photograph on Flickr, CC BY-SA 2.0.
- python-chess documentation, Syzygy probes, return values, rounding and required tables.
- Stockfish, Syzygy probing and root-move ranking implementation.