This article was written at the end of July 2022.
Introduction
On July 20, lichess.org tweeted twice about puzzles. Once a link to an article was given, and the other tweet contained a link to the Lichess puzzle database, which can be downloaded.
My Lichess profile notes that I have already tried 2442 puzzles. So, it is save to say that I enjoy solving puzzles there.
A big advantage of Lichess is that one can specify the topics of the puzzles. And those who've followed my focus here for the past three years won't be surprised that I'm mostly trying out
endgame puzzles.
When I saw the download tweet, I immediately thought whether accessing this database with the ChessSuite would make sense. It took only a few hours to write a
new console tool, which can import the database and makes parts thereof accessible as PGN files. Here I will sum up first experiences.
I don't want to stress the console tool any further at the moment, but there might be a puzzle mode in the Game Browser in the near future, and then I'll definitely come back to it.
(Addendum: The puzzle mode was added to the Chess Suite's game browser in August 2022 and is therefore part of the 2023 release.)
The Lichess Puzzle Database
The database consists of a single csv file with about 2.8 million lines. Each line represents one puzzle. Here is what Lichess says about how the database was build:
"Generating these chess puzzles took more than 35 years of CPU time. We went through 200,000,000 analysed games from the Lichess database, and re-analyzed interesting positions with Stockfish 12/13 NNUE at 40 meganodes. The resulting puzzles were then automatically tagged. To determine the rating, each attempt to solve is considered as a Glicko2 rated game between the player and the puzzle. Finally, player votes refine the tags and define popularity."
Every line of the csv file contains - among others - the start position as a FEN string and the moves in UCI format. When you play the corresponding puzzle at Lichess, the first move is executed automatically and then it is your task to find the winning continuation. The moves that have to be found are unique, except the position allows a mate in one. The tags mentioned above are keywords to describe the type of puzzle. Here we will mostly deal with endgame puzzle tagged with the self-explaining keys pawnEndgame, knightEndgame, ... , queenEndgame.
Now that you have a basic idea of what these puzzles are, you can put your instincts to the test. For example: do you think that the ratings of the puzzles, and hence their difficulty, differ significantly depending on the endgame type? And if so, which endgames have a higher average rating? And what about the length, i.e. the number of moves, of these endgames puzzles? Do queen endgame puzzles have more moves than rook endgame puzzles? Or is it the other way around? And does the puzzle rating depend somehow on its length?
Before answering any of these questions, you should carefully review the database creation process: Games are analyzed automatically, and if there is a certain position having a continuation with unique moves, then that position can become a puzzle. Seen from this angle, even simple questions like "How likely is a position to be a puzzle?" and "How common is this for the different endgame types?" are quite interesting.
Some stats
The Lichess download page speaks of "2,776,334 chess puzzles, rated and tagged", but the csv file has 2,834,182 lines (I counted twice!). 1,452,821 (or 51.26 %) of them are winning for White, and hence only 1,381,361 (or 48.74 %) are winning for Black.
And here are the numbers of puzzles for the different endgame types:
Rook endgame: 123,036 examples
Pawn endgame: 68,459
Bishop endgame:
29,342
Queen endgame: 22,980
Knight
endgame: 19,695.
I think these numbers are quite interesting. But be careful with the interpretation: Without knowing how often the individual endgame types occur as game positions, a comparison can easily backfire!
Well, at this point some readers will argue that there are much more endgames than these five types, and they are so right. The database offers two more tags for endgames, namely queenRookEndgame (17,606 expamles) and endgame (1,263,812(!) examples). The latter tag occurs together with the other tags and is presumably the general identification of any endgame in the database. However, already the large number indicates that the term endgame is understood much broader than, for example, in Awerbakh's textbooks.
Let's now turn to the ratings.
Endgame type | Min rating | Max rating |
Pawn | 600 | 2832 |
Knight | 593 | 2802 |
Bishop | 600 | 2799 |
Rook | 550 | 2929 |
Queen | 577 | 2830 |
So far, so good. The minimum values are all very low, the maximum values are all very high. The maximum value for rook endgames is a bit high, but that's due to a single endgame which is also more a pawn than a rook endgame.
Average values are certainly more meaningful.
Endgame type |
Rating average |
Rating median | |
Pawn | 1805 | 1867 | |
Knight | 1723 | 1734 | |
Bishop | 1766 | 1788 | |
Rook | 1480 | 1425 | |
Queen | 1558 | 1506 |
This is a surprise, right? For example, the averge rating of a pawn endgame is 325 points higher than the average rating of a rook ending. Since averages can be skewed by a small portion of the data, I've also added the values of the medians. And here the differences are even more extreme! 442 points between pawn and rook endgames!
And now some information about the number of moves.
Endgame type | Average number of moves | Max number of moves | Average* |
Pawn | 3.08 | 15 | 4.07 |
Knight | 2.68 | 13 | 3.39 |
Bishop | 2.71 | 13 | 3.50 |
Rook | 2.39 | 13 | 3.51 |
Queen | 2.34 | 11 | 3.09 |
This table shows that pawn endgames are significantly longer than the other endgames and that all values increase, when only the 5000 highest rated endgames of each type are considered (column Average*). Btw, the minimum number of moves is 1 for all types.