Tablebase Chess

0 views
Skip to first unread message

Magnhild Mongolo

unread,
Aug 3, 2024, 11:58:49 AM8/3/24
to ememobil

Chess.com is happy to announce the release of tablebases inside of our Analysis page, a new tool that will help you get even better in the endgame! Combined with our recently released Endgame page, this new feature is everything you need to dominate this crucial part of the game.

Tablebases are a database of precalculated endgame positions. With it, you can quickly find out if any position containing seven pieces or less is theoretically winning, losing, or drawn with perfect play from both sides. Our tool will instantly give you the game's outcome and show you how you can achieve it. Let's take a closer look at how it works!

It's easy to consult tablebases to learn how to play any specific endgame. The tablebase option will appear to you on the Analysis page every time there are seven or fewer pieces on the board.

Since this feature is part of our Analysis page, this means that you can instantly analyze your games with it. Once your game reaches an endgame with seven pieces at the most, the Tablebase tab will be available to you.

Once you're there, you can click the "Setup" option, clear the board, and add the position you want like you normally would. After you get the position you want, you simply hit "Load" and go to the Tablebase tab.

Chess.com's tablebase will instantly show you the outcome for any position displayed, with best play by both sides. Let's look at an example to understand what that means. Once you have an endgame position and go to the Tablebase tab, this is what you'll see:

As you can see, the tablebase shows that this position is a win for White. It'll also list all the moves that win, draw, or lose. White must play g5, as this is the only winning move in this position. Playing gxf5 would draw the game, while every other move would make them lose.

In chess, the endgame tablebase, or simply tablebase, is a computerised database containing precalculated evaluations of endgame positions. Tablebases are used to analyse finished games, as well as by chess engines to evaluate positions during play. Tablebases are typically exhaustive, covering every legal arrangement of a specific selection of pieces on the board, with both White and Black to move. For each position, the tablebase records the ultimate result of the game (i.e. a win for White, a win for Black, or a draw) and the number of moves required to achieve that result, both assuming perfect play. Because every legal move in a covered position results in another covered position, the tablebase acts as an oracle that always provides the optimal move.

Tablebases are generated by retrograde analysis, working backward from checkmated or drawn positions. By 2005, tablebases for all positions having up to six pieces, including the two kings, had been created.[1] By August 2012, tablebases had solved chess for almost every position with up to seven pieces, with certain subclasses omitted due to their assumed triviality;[2][3] these omitted positions were included by August 2018.[4] As of 2024[update], work is still underway to solve all eight-piece positions.

Tablebases have profoundly advanced the chess community's understanding of endgame theory. Some positions which humans had analysed as draws were proven to be winnable; in some cases, tablebase analysis found a mate in more than five hundred moves, far beyond the ability of humans, and beyond the capability of a computer during play. This caused the fifty-move rule to be called into question, since many positions were discovered that were winning for one side but drawn during play because of this rule. Initially, some exceptions to the fifty-move rule were introduced, but when more extreme cases were later discovered, these exceptions were removed. Tablebases also facilitate the composition of endgame studies.

While endgame tablebases exist for other board games, such as checkers,[5] nine men's morris,[6] and some chess variants,[7] the term endgame tablebase is usually assumed to refer to chess tablebases.

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. Strong solutions, i.e. algorithms that can produce perfect play from any position,[8] are known for some simple games such as Tic Tac Toe/Noughts and crosses (draw with perfect play) and Connect Four (first player wins). Weak solutions exist for somewhat more complex games, such as checkers (with perfect play on both sides the game is known to be a draw, but it is not known for every position created by less-than-perfect play what the perfect next move would be). Other games, such as chess and Go, have not been solved because their game complexity is far too vast for computers to evaluate all possible positions. To reduce the game complexity, researchers have modified these complex games by reducing the size of the board, or the number of pieces, or both.

In 1965, Richard Bellman proposed the creation of a database to solve chess and checkers endgames using retrograde analysis.[11][12] Instead of analyzing forward from the position currently on the board, the database would analyze backward from positions where one player was checkmated or stalemated. Thus, a chess computer would no longer need to analyze endgame positions during the game because they were solved beforehand. It would no longer make mistakes because the tablebase always played the best possible move.

In 1970, Thomas Strhlein published a doctoral thesis[13][14] with analysis of the following classes of endgame: KQK, KRK, KPK, KQKR, KRKB, and KRKN.[15] In 1977, Ken Thompson's KQKR tablebase was used in a match against Grandmaster Walter Browne.[16][17]

Thompson and others helped extend tablebases to cover all four- and five-piece endgames, including KBBKN, KQPKQ, and KRPKR.[18][19] Lewis Stiller published a thesis with research on some six-piece tablebase endgames in 1991.[20][21]

The tablebases of all endgames with up to seven pieces are available for free download, and may also be queried using web interfaces.[28] Research on creating an eight-piece tablebase started in 2021.[29] During an interview with Google in 2010, Garry Kasparov said that "maybe" the limit will be 8 pieces. Because the starting position of chess is the ultimate endgame, with 32 pieces, he claimed that chess can not be solved by computers.[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. To date, three different metrics have been used:[34]

This difference is typical of many endgames. DTC is always smaller than or equal to DTM, but the DTM metric always leads to the quickest checkmate. Incidentally, DTC = DTM in the unusual endgame of two knights versus one pawn because capturing the pawn (the only material Black has) results in a draw, unless the capture is also checkmate.

Once a metric is chosen, the first step is to generate all the positions with a given material. For example, to generate a DTM tablebase for the endgame of king and queen versus king (KQK), the computer must describe approximately 40,000 unique legal positions.

Levy and Newborn explain that the number 40,000 derives from a symmetry argument. The Black king can be placed on any of ten squares: a1, b1, c1, d1, b2, c2, d2, c3, d3, and d4 (see diagram). On any other square, its position can be considered equivalent by symmetry of rotation or reflection. Thus, there is no difference whether a Black king in a corner resides on a1, a8, h8, or h1. Multiply this number of 10 by at most 60 (legal remaining) squares for placing the White king and then by at most 62 squares for the White queen. The product 106062 = 37,200. Several hundred of these positions are illegal, impossible, or symmetrical reflections of each other, so the actual number is somewhat smaller.[36][37]

For each position, the tablebase evaluates the situation separately for White-to-move and Black-to-move. Assuming that White has the queen, almost all the positions are White wins, with checkmate forced in no more than ten moves. Some positions are draws because of stalemate or the unavoidable loss of the queen.

Endgames with one or more pawns increase the complexity because the symmetry argument is reduced. 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.[38] The best calculation of symmetry is achieved by limiting one pawn to 24 squares in the rectangle a2-a7-d7-d2. All other pieces and pawns may be located in any of the 64 squares with respect to the pawn. Thus, an endgame with pawns has a complexity of 24/10 = 2.4 times a pawnless endgame with the same number of pieces.

"The idea is that a database is made with all possible positions with a given material [note: as in the preceding section]. Then a subdatabase is made of all positions where Black is mated. Then one where White can give mate. Then one where Black cannot stop White giving mate next move. Then one where White can always reach a position where Black cannot stop him from giving mate next move. And so on, always a ply further away from mate until all positions that are thus connected to mate have been found. Then all of these positions are linked back to mate by the shortest path through the database. That means that, apart from 'equi-optimal' moves, all the moves in such a path are perfect: White's move always leads to the quickest mate, Black's move always leads to the slowest mate."[39]

Figure 3, before White's second move, is defined as "mate in one ply." Figure 2, after White's first move, is "mate in two ply," regardless of how Black plays. Finally, the initial position in Figure 1 is "mate in three ply" (i.e., two moves) because it leads directly to Figure 2, which is already defined as "mate in two ply." This process, which links a current position to another position that could have existed one ply earlier, can continue indefinitely.

c80f0f1006
Reply all
Reply to author
Forward
0 new messages