Endgame tablebase

Tablebases are typically exhaustive, covering every legal arrangement of a specific selection of pieces on the board, with both White and Black to move.

Physical limitations of computer hardware aside, in principle it is possible to solve any game under the condition that the complete state is known and there is no random chance.

[9] However, even as competent chess programs began to develop, they exhibited a glaring weakness in playing the endgame.

In 1965, Richard Bellman proposed the creation of a database to solve chess and checkers endgames using retrograde analysis.

In 1970, Thomas Ströhlein published a doctoral thesis[13][14] with analysis of the following classes of endgame: KQK, KRK, KPK, KQKR, KRKB, and KRKN.

[16][17] Thompson and others helped extend tablebases to cover all four- and five-piece endgames, including KBBKN, KQPKQ, and KRPKR.

[20][21] More recent contributors include: The tablebases of all endgames with up to seven pieces are available for free download, and may also be queried using web interfaces.

[30] Before creating a tablebase, a programmer must choose a metric of optimality which means they must define at what point a player has "won" the game.

Every position solved by the tablebase will either have a distance (i.e. the number of moves or plies) from this specific point or will get classified as a draw.

Since pawns can move forward but not sideways, rotation and vertical reflection of the board produces a fundamental change in the nature of the position.

Tim Krabbé explains the process of generating a tablebase as follows: "The idea is that a database is made with all possible positions with a given material [note: as in the preceding section].

The retrograde analysis program must account for the possibility of a capture or pawn promotion on the previous move.

An early analysis of this type was published in 1987, in the endgame KRP(a2)KBP(a3), where the Black bishop moves on the dark squares (see example position at right).

Some correspondence organizations draw a distinction in their rules between utilizing chess engines which calculate a position in real time and the use of a precomputed database stored on a computer.

A six-piece tablebase (KQQKQQ) was used to analyze the endgame that occurred in the correspondence game Kasparov versus The World.

Such a position is sometimes termed a "cursed win" (where mate can be forced, but it runs afoul of the 50-move rule), or a "blessed loss" from the perspective of the other player.

[47] In 2013, ICCF changed the rules for correspondence chess tournaments starting from 2014; a player may claim a win or draw based on six-man tablebases.

Sometimes even this data is compressed and the bitbase reveals only whether a position is won or not, making no difference between a lost and a drawn game.

Modern engines play endgames significantly better, and using tablebases only results in a very minor improvement to their performance.

[55] Syzygy tablebases were developed by Ronald de Man and released in April 2013 in a form optimized for use by a chess program during search.

The WDL tables were designed to be small enough to fit on a solid-state drive for quick access during search, whereas the DTZ form is for use at the root position to choose the game-theoretically quickest distance to resetting the 50-move rule while retaining a winning position, instead of performing a search.

Syzygy tablebases are available for all 6-piece endings, and are now supported by many top engines, including Stockfish, Leela, Dragon, and Torch.

[4] In 2020, Ronald de Man estimated that 8-man tablebases would be economically feasible within 5 to 10 years, as just 2 PB of disk space would store them in Syzygy format,[33] and they could be generated using existing code on a conventional server with 64 TB of RAM.

[57] In contexts where the fifty-move rule may be ignored, tablebases have answered longstanding questions about whether certain combinations of material are wins or draws.

The following interesting results have emerged: For some years, a "mate-in-200" position (first diagram below) held the record for the longest computer-generated forced mate.

[34] Assuming this projection holds true, Haworth’s Law (which states that the number of moves roughly doubles for each piece added) breaks down at this point.

In 2003, the endgame composer and expert John Roycroft summarized the debate: [N]ot only do opinions diverge widely, but they are frequently adhered to strongly, even vehemently: at one extreme is the view that since we can never be certain that a computer has been used it is pointless to attempt a distinction, so we should simply evaluate a 'study' on its content, without reference to its origins; at the other extreme is the view that using a 'mouse' to lift an interesting position from a ready-made computer-generated list is in no sense composing, so we should outlaw every such position.

He was commenting in 2006 on a study by Harold van der Heijden, published in 2001, which reached the position at right after three introductory moves.

Thus: miracles, based upon complex computer analysis rather than on their content of sharp ideas, are probably of interest only to certain aesthetes.

Regarding Stiller's long wins, Tim Krabbé struck a similar note: Playing over these moves is an eerie experience.

A typical interface for querying a tablebase