Daily Archives: 22 November 2022

Endgame tablebases

I’m going to start this post by quoting an extract from the Wikipedia entry, since it says what I want to say and I don’t see the point of paraphrasing it.

An endgame tablebase is a computerized database that contains precalculated exhaustive analysis of chess endgame positions. It is typically used by a computer chess engine during play, or by a human or computer that is retrospectively analysing a game that has already been played.

The tablebase contains the game-theoretical value (win, loss, or draw) in each possible position, and how many moves it would take to achieve that result with perfect play. Thus, the tablebase acts as an oracle, always providing the optimal moves. Typically the database records each possible position with certain pieces remaining on the board, and the best moves with White to move and with Black to move.

Tablebases are generated by retrograde analysis, working backward from a checkmated position. By 2005, all chess positions with up to six pieces, including the two kings, had been solved. By August 2012, tablebases had solved chess for almost every position with up to seven pieces, but the positions with a lone king versus a king and five pieces were omitted because they were considered to be “rather obvious.”[1][2] These positions were included by August 2018.[3] As of 2022, work is still underway to solve all eight-piece positions.

Tablebases sometimes come with a name as a prefix, e.g. Nalimov, Lomonosov, Syzygy. Eugene Nalimov is a computer programmer who generated the first tablebases in the 1990s. Lomonosov is the name of a Russian supercomputer. Syzygy is an astronomical term describing the occurrence of three celestial bodies in a straight line. No, I don’t know what that has to do with chess either. Syzygy 7-piece tablebases are the most recent. These are used by the International Correspondence Chess Federation.

What is the practical use of a tablebase in correspondence chess? In my experience the tablebase is a means of bringing a game to an end quickly and so achieving a draw or a win, when your opponent cannot or will not see this, and particularly when he or she has slowed the game down in order to delay the inevitable. The ICCF rules allow you to claim a win or draw by reference to a tablebase where there are no more than seven pieces on the board. Here’s an example from one of Barking’s games earlier this year.

White: Maurizio Mangiarotti (1958), Black: Rodney Barking (1915).
D45: QGD Semi-Slav.

Yes, I know there are more than seven pieces… This was the position after White’s 41st move. Earlier I had given up my queen for a rook and bishop. As all the pieces are on one side of the board, and there are no passed pawns, Black can hold the draw easily enough and in fact the evaluation of one of the chess engines I use is 0.00. However, White can continue the game for quite a long time just by probing with the queen.

As I’m not winning this position, there’s no advantage to me in prolonging it. What’s the quickest way out? Answer: sacrifice some material…
41…Bxh4! 42.gxh4 Rxg4+ 43.Kh3 h5

Despite the material difference, this position is actually drawn. Black has constructed a fortress. There is no way the white king can penetrate Black’s defences. I offered a draw, which my opponent accepted.

The point that’s relevant to this post, and obviously I checked this before going nuclear, is that the position is a tablebase draw as well. I would have claimed a draw by reference to the ICCF tablebase if my opponent had not co-operated. This is what the tablebase evaluation looks like:

Interestingly, the various engines I use all evaluate this position differently. The strongest of them has White at +0.81 (approaching a clear advantage, but not yet winning). The weakest has White at +4.21 (a trivial win). I guess none of the engines has the 7-piece tablebase programmed in. Maybe that should not be a surprise as the storage size you need for a tablebase is absolutely huge.

I was going to give a further example, another game against my Austrian opponent Herr Wiesinger. We have reached a rook and pawn ending where the Austrian is totally lost. He knows this and has slowed the game down to a funereal pace. Unfortunately there are still eight pieces on the board so we are just out of tablebase range. I expect one of his pawns to drop off very soon (when he finally gets round to moving) and then it will be Goodnight Vienna.

So much for correspondence chess. What about tablebases in OTB chess? Now here’s a thing. Chess leagues are increasingly using incremental time controls. These carry the risk that a game may still be going on at the end of the playing session. Back in the day, if the two players couldn’t agree on the outcome, these games were resolved either by adjournment to a later date or by adjudication. Neither of these is ideal. Adjournments simply add to fixture congestion. Adjudications take the result of the game out of the hands of the players and transfer it to a third party (in Barking’s eyes this is a detestable practice).

The London League used to rely solely on adjournments, following a playing session of 30 moves in 90 minutes. Those days have gone. At some point in the past decade, the League introduced an incremental time control of G75 + 15. So far, there have been no documented cases of games being unresolved at the end of the playing session. But adjudication is available as a backup if needed.

This season, and as far as I know this is the first time this has happened in English league chess, tablebase decision-making has been introduced. If a game is unfinished, and there are no more than seven pieces on the board, the outcome is determined by reference to a tablebase rather than adjudication. This has the advantage of determining the outcome by objective rather subjective means since you know with certainty what will happen with perfect play on both sides, rather than relying on the human (no doubt computer-assisted) determination of the adjudicator. The relevant London League rule is as follows:

C8. UNFINISHED GAMES
C8.1 If any game is unfinished at the end of the session, both players and both captains shall record the position on the board. If the two sides cannot agree a result, then –

(a)  if no more than 7 pieces remain on the board, the result shall be determined by reference to a tablebase such as the Syzygy endgame tablebase at
https://syzygy-tables.info/?fen=4k3/8/8/8/8/8/8/4K3_w_-_-_0_1;

(b)  In other cases, both sides shall submit an adjudication claim to the league secretary together with a fee of £10. If only one claim is made, it shall be upheld without adjudication. Either side may appeal against an adjudication decision, providing supporting evidence, and on payment of a further fee of £10. The fees shall be returned to the relevant side if no adjudication is needed or if an appeal succeeds.

Whoever thought of this deserves a medal. Who says space can’t be conquered?!