Guide › Books

Books

Add… registers an opening book (EPD, PGN or Polyglot .bin) under a name, with a description; for a PGN book the number of plies kept and Variations as lines of their own (see Openings), for a Polyglot book the depth its lines are followed to. The setup’s Openings section then offers the books of the library by name, with their number of openings (any other file can still be chosen). Remove takes a book out of the library and leaves the file alone.

Checking a book

The book chosen is read in the background, with fastchess’ own readers (so its openings are exactly those a tournament plays), and checked:

  • illegal positions: not one king of each colour, pawns on the first or last rank, the side not to move in check;
  • duplicates: the same position as an earlier opening, by transposition included;
  • colours reversed: an earlier opening with the colours swapped (a book meant to be played twice, colours reversed, does not need both);
  • games already over: no legal move, or not enough material to mate.

fastchess leaves the openings whose position cannot be played out of a tournament (a FEN or EPD line without a king or otherwise malformed, a king that could be taken, a PGN game whose FEN tag is invalid), with one warning per book; they are counted here as illegal positions. A PGN game whose moves stop parsing (a malformed or ambiguous move) keeps the moves before it. The lines of a PGN book that start with % (escape lines, which the PGN standard makes comments; the AVT books have some) are ignored, by the tournaments too, and the Books page counts them (lines starting with %, ignored). A PGN book read without its variations counts those a tournament would not play (variations not played, and in how many games); with Variations as lines of their own, they are among its openings, and checked as the others.

Its openings are listed below, every one or only those with a problem, searched by part of a FEN or by moves (a PGN book shows its moves in SAN); a click shows the position on a board. Use it for the next tournament puts it in the setup (with its variations as lines of their own if ticked, and Chess960 for a Chess960 book). Save a cleaned copy… writes an EPD book without the illegal positions, the duplicates and the finished games (and, if ticked, the positions with colours reversed), and adds it to the library. Run as a test suite… opens an EPD book in Suites.

Creating books

Create… writes books for the library (also in the command palette):

  • Generate Chess324 book: Larry Kaufman’s Chess324. The kings and the rooks stay on their usual squares, so castling is the usual one; the queen, the bishops and the knights of each side are shuffled on the other squares of its back rank (the b, c, d, f and g files), the bishops on squares of opposite colours. That makes 18 arrangements a side, White’s and Black’s chosen independently: All 324 positions, or Only the 18 symmetrical ones, where Black’s pieces stand on the same files as White’s. They are ordinary positions, written to an EPD file (offered next to the books of the library, or in books/ in the profile) and played by any engine, without Chess960.
  • Build a Polyglot book…: a Polyglot book (.bin) from the games of a PGN file, as Polyglot’s make-book does, with the conversion that turns the participants’ PGN books into Polyglot books. Its form, in place of the book’s details, takes the PGN file (the PGN book chosen in the list, if any), the depth (the plies of each game that go into the book), the minimum games a move needs in its position to be kept (Polyglot’s -min-game; the others are left out as played too rarely), the weights, by score (the points of the side that played the move: a win 2, a draw 1, a loss 0, as Polyglot counts; games without a result are left out, and so is a move whose games were all lost) or by count (the number of games that play it), and, if ticked, a rating: only the moves of a player rated at least that much count, by the game’s WhiteElo or BlackElo tag (a player without one is left out). Build… asks where to write the book (next to the PGN file by default), then reads the games in the background, with its progress and Cancel, beside the form and at the end of the list; the book, sorted by key as the format wants, is then added to the library, its options in its description. The console says how many games went into it, how many the options left out and how many could not be read.

Books from the named openings

From Lichess’s named openings…, in Create…, makes a book of starting positions from Lichess’s table of named openings, in the program already (chess-openings, CC0): nothing is downloaded. Its form, in place of the book’s details, takes the families (A flank openings, B semi-open games, C open games, D closed games, E Indian defences), the lengths of the lines kept, in plies (8 to 16 at first), One position per named variation (several lines share a name), and the number of positions, spread evenly over the ECO codes when more qualify. It says how many positions and openings it would hold; Make the book… asks where to write the EPD file, each position with its move number (hmvc, fmvn) and its opening as c0, and adds it to the library.

Books from the evaluated positions

From Lichess’s evaluated positions…, in Create…, makes a book of the positions Lichess’s players had analysed: those of the named openings’ lines and one move off them, each with its evaluation and its depth. They come from Lichess’s evaluations database (CC0, 22.5 GB and 418 million positions): its size is asked of database.lichess.org and said before anything is downloaded; Download and read reads it while it comes, and keeps only the positions found (a few megabytes, in the profile), not the file. Read a file already downloaded… reads a lichess_db_eval.jsonl.zst from the disk instead. Nothing else leaves the machine than the request for the file. The reading shows how much is read and kept; Cancel, a network cut, or the program closed keeps what was read, and Go on goes on from there (a file changed on the server since is read again from its start).

Once read, the form takes the evaluation kept, for White (+0.30 to +0.80 at first), the depth at least (30), the plies from the start (8 to 16), One position per named variation (the one on the variation’s line first, then the deepest evaluation, then the nearest the window’s middle), and the number of positions, spread evenly over the ECO codes when more qualify. It says how many positions and openings it would hold and their average evaluation; Make the book… writes the EPD file, each position with its move number, its evaluation for the side to move and its depth (ce, acd) and its opening (c0), and adds it to the library. Read again reads the database again for its newer evaluations.

CTG books

Add… also takes a book in the CTG format, the opening books of ChessBase and Fritz: a .ctg with its .ctb and .cto beside it, any of the three chosen. It is only read, never written. Its page says how many positions and moves it holds, and how many moves its author marked green (to play) and red (to avoid). For each position the book has its moves, each with its symbol (!, ?, !?, only move…), its colour, the evaluation of the position it leads to, and the games behind it: how many, how they ended, the players’ ratings.

Open it in the tree shows it in the Board page’s Tree tab, among the sources: the moves of the position shown with their games, score, average rating of the players who played them and performance, and a Book column with their colour and symbol. Green moves come first; red ones stay in the list, greyed. The years and the reference games come from the databases, not from the book.

fastchess reads no CTG book. For engines: make a Polyglot book… writes a Polyglot copy (.bin) and adds it to the library, for the setup’s Openings and the participants’ own books: its red moves are left out, and each move weighs the points its games scored (two a win, one a draw), twice that for a green move; a move that scored nothing is left out. Check the book follows its lines from the starting position and says how many positions it reached of those the book holds, and whether any move could not be read. Nothing leaves the machine.

In RookStudio, F1 opens this guide beside the page, at the section of what is under the mouse.