Appendix J — Engines, GUIs and Online Tools
This book was built with a small, free toolset: one engine (Stockfish 19), one Python chess library (python-chess), a handful of open data sources, and the free analysis tools of the big online platforms. This appendix describes those tools and the alternatives you are likely to meet, explains the settings that change an engine's answer, lists every data source the book uses with its address, licence and polite-use rules, and ends with a reproducibility checklist.
Software changes faster than books. Anything version-specific below — release dates, feature lists, which product belongs to which company — is stated as it appeared to us at the time of writing (November 2026) and is hedged accordingly. Prices are deliberately left out: they change, they vary by country, and you should read them on the vendor's own page.
💻 Developer Track: J.2 (engine settings), J.6 (data sources) and J.7 (rate-limit etiquette, with the toolkit's code pattern) are the sections you need to rebuild or extend the book's data.
♟️ Improver Track: J.3–J.5 tell you which free tools do what. If you only read one thing, read the box "Five rules for using an engine" in J.2.
🏆 Competitor Track: J.2 on depth, multi-PV and tablebases is preparation hygiene — the difference between "the engine says" and "the engine says, at depth 24, single line, without tablebases".
J.1 Engines
Stockfish
Stockfish is a free, open-source chess engine (GNU General Public License v3), developed by a large volunteer community and distributed from its official site and GitHub repository. It speaks the UCI (Universal Chess Interface) protocol, so it runs inside almost every GUI and can be driven from Python with python-chess's chess.engine module, which is what the book's toolkit does.
Three milestones matter for reading older analysis:
| Version | What changed | Why it matters to you |
|---|---|---|
| Stockfish 12 (2020) | NNUE evaluation introduced — an efficiently updatable neural network (an idea that originated in computer shogi, Yu Nasu, 2018) used alongside the handcrafted evaluation | Analyses from before 2020 used a purely handcrafted evaluation; numbers are not comparable with today's |
| Stockfish 16 (2023) | The handcrafted evaluation was removed entirely; evaluation is network-only | Every modern Stockfish number is a neural-network output; recent versions also rescale their scores so that a given value corresponds to a fixed winning chance in the project's own testing (see the Stockfish documentation for the current definition) |
| Stockfish 19 | The version used for every evaluation in this book (identification string "Stockfish 19") | Quote it with the version, the depth and the search mode |
The project's GitHub release page listed, at the time of writing, Stockfish 16 (30 June), 16.1, 17, 17.1, 18 and 19 (5 September) as the most recent numbered releases, plus development builds — check that page for the current version rather than relying on this list.
📐 Definition — centipawn evaluation. A score in hundredths of a pawn from White's point of view: +0.83 means White is better by a little less than a pawn's worth; #5 means White mates in five, #−5 that Black does. The book always writes evaluations as +0.83 (Stockfish 19, depth 20). The book's win-percentage model (chessdata.win_pct, the Lichess curve) converts centipawns into an expected score; Appendix D has the formula.
Settings worth knowing (UCI options). Threads (CPU cores used), Hash (transposition table size in MB), MultiPV (number of best lines reported), SyzygyPath (folder containing endgame tablebase files), and strength-limiting options such as Skill Level and UCI_LimitStrength/UCI_Elo. The book's toolkit runs Stockfish 19 with 1–3 threads, 64–256 MB hash, no SyzygyPath (tablebase questions go to the tablebase directly — see J.2), and stores every result in a SQLite cache (data/cache/engine.sqlite) so that each number can be reproduced exactly.
Leela Chess Zero (Lc0)
Leela Chess Zero is the open-source (GPLv3) engine that follows the AlphaZero approach described by DeepMind (preprint December 2017; peer-reviewed in Science, December 2018): a deep neural network trained by self-play, combined with a Monte-Carlo-style tree search guided by the network's move probabilities. Lc0 searches far fewer positions per second than Stockfish but evaluates each one with a much larger network, and it runs best on a graphics card. Networks are distributed separately from the engine binary. Lc0 can report its evaluation as win/draw/loss probabilities, which some players find more intuitive than centipawns. The two engines often agree on the best move and disagree on the size of an advantage; in quiet, strategic positions their different searches can produce genuinely different recommendations, which makes Lc0 a useful second opinion.
Other engines
There are many strong engines; a few you will meet:
| Engine | Type | Notes (hedged) |
|---|---|---|
| Komodo Dragon | Commercial | A long-standing commercial engine with an NNUE-style evaluation; at the time of writing developed under Chess.com's ownership — check the vendor for the current licence and versions |
| Ethereal, Berserk, Obsidian and others | Open source | Strong UCI engines from independent authors; useful for second opinions and engine-vs-engine testing |
| Fairy-Stockfish | Open source | A Stockfish derivative supporting many chess variants (Chess960, crazyhouse, and others) — see Chapter 37 |
| Engines inside online platforms | Proprietary integrations | Chess.com and Lichess run engines (Stockfish among them) for their analysis features; the exact versions and settings are platform choices that change over time |
Independent engine rating lists and engine tournaments (for example the long-running TCEC competition, whose games appear in our broadcast data and are excluded from every "OTB" statistic in this book) are the places to look for current engine strength. Engine strength differences at the top are far beyond anything that matters for analysing human games: for that purpose, settings and interpretation matter much more than which top engine you use.
J.2 Using an engine well: depth, multi-PV and tablebases
Depth changes the number
j01_depth_and_tablebase.py evaluated three positions at five depths with Stockfish 19 (single line, 2 threads, 256 MB hash):
| Position | d8 | d12 | d16 | d20 | d24 | Best move at every depth |
|---|---|---|---|---|---|---|
| Start position | +0.25 | +0.32 | +0.39 | +0.30 | +0.19 | 1.e4 |
| Kasparov–Topalov, Wijk aan Zee 1999, before 24.Rxd4 | −0.56 | −0.46 | −0.40 | −0.33 | −0.31 | 24.Rxd4 |
| Philidor rook ending (tablebase: draw) | +0.00 | +0.28 | +0.11 | +0.09 | +0.06 | varies (Rb1, Kf8, Rh6, Rc6, Rh6) |

♟️ Position: White Kb1, Qf4, Rd1, Re1, Bh3, Na5, b2, c2, h2, a3, f3, g3, d5; Black Ka7, Qd6, Rd8, Rh8, Ba8, Nf6, d4, b5, c5, a6, g6, f7, h7 — White to move. FEN:
b2r3r/k4p1p/p2q1np1/NppP4/3p1Q2/P4PPB/1PP4P/1K1RR3 w - - 1 24

📊 Figure (described): The same three positions evaluated at depths 8 to 24. The start position wanders between +0.19 and +0.39 although 1.e4 is always the choice; the Kasparov–Topalov position climbs from −0.56 to −0.31 with 24.Rxd4 always best but never winning; the drawn Philidor position hovers just above zero with a different "best" move almost every time. Evaluations of a few tenths are not stable facts — the depth (and the hash state) is part of the number.
Three lessons follow. First, a small evaluation is a range, not a point: the starting position "is" +0.30 at depth 20 (the book's quoted value) and +0.19 at depth 24 in this run; differences of 0.1–0.2 between moves are often inside this noise. Second, the best move can be stable while the number moves: in Kasparov–Topalov the engine prefers 24.Rxd4 at every depth tested in Chapter 1 (depth 12 to 32) yet never calls it winning — a famous "engine vs legend" teaching point. Third, an engine without tablebases does not know a theoretical draw: the Philidor position is a proven draw, but Stockfish without its SyzygyPath reports small plus scores and changes its mind about the "best" move with depth. Every one of the eight tablebase-drawing moves in Appendix G draws; the engine's preference among them means nothing.

♟️ Position: White Kf5, Ra7, e5; Black Ke8, Rb6 — Black to move. FEN:
4k3/R7/1r6/4PK2/8/8/8/8 b - - 0 1
Multi-PV and single-line searches differ
With MultiPV = 3 the engine must find three good lines at once, which changes how it spends its search. The book found repeatedly that the ranking of near-equal moves, and the evaluations themselves, can differ by several tenths between a multi-PV search and a single-line search at the same depth (Chapters 19, 22 and 23); Appendix F shows one example (23.e4 in a Slav-triangle game: +0.55 as the multi-PV top move, +0.12 in a single-line search of the position after it). The rule: when you quote a ranking, say "multipv N"; when you quote an evaluation, say which search produced it.
The horizon
Shallow searches miss tactics that deeper ones see. Chapter 23 compared depth 6 with depth 16 on 577 undecided positions from one player's games: the two differed by at least a pawn in 12.7% of them (≥ 2 pawns in 29). Phone apps and quick "game review" passes often run shallow searches for speed; treat their verdicts on sharp positions as provisional.
🔍 Five rules for using an engine 1. Think first, then check. Write down your candidate moves and evaluation before you switch the engine on (Chapter 26). 2. Report the setting with the number: engine and version, depth (or time), single line or multi-PV, tablebases on or off. 3. Treat differences under about 0.15–0.20 as ties, especially in the opening. 4. Use tablebases for ≤ 7 pieces — a proven result beats any evaluation. 5. Ask "why?": play the engine's line forward until you can name the human reason (a weak square, a loose piece, a tempo). The number is a data point; the reason is the lesson.
Endgame tablebases
An endgame tablebase stores the exact result of every position with a given set of pieces, computed backwards from every checkmate. The tables the book uses are the Syzygy tables (designed by Ronald de Man), which store win/draw/loss (WDL) and distance-to-zeroing (DTZ) information for every position with up to seven pieces including the kings; the 7-piece Syzygy set was completed in 2018. Earlier, the Lomonosov tables (2012) were the first complete 7-piece tables and store distance to mate (DTM). Two consequences for practical use:
- WDL and DTZ are what an engine needs. With
SyzygyPathset, Stockfish uses the tables inside its search and reports a tablebase win or draw instead of a centipawn guess. The 5-piece Syzygy files are small enough for any computer and the 6-piece files fit on an ordinary external drive; the full 7-piece set runs to many terabytes, which is why the book (like most players) probes the 7-piece tables online instead. Check the download source for current file sizes before you start. - DTZ is not DTM. A DTZ-optimal line heads for the next capture or pawn move, which keeps the 50-move counter safe but can look strange to a human; a DTM-optimal line mates fastest. The public Lichess endpoint returns both where it can (in our probes DTM came back for positions of up to six pieces), and Appendix G prints DTZ-optimal lines.
📐 Definition — cursed win. A position that is a win with perfect play but needs more than 50 moves without a capture or pawn move, so it is a draw when the 50-move rule is claimed (or when the 75-move rule applies automatically). The book's endgame chapters count cursed wins as draws when comparing theory with practice.
Speed and hardware
How fast is "fast"? On the machine that built this book (a shared multi-core workstation, so timings are indicative), Stockfish 19 searched 448,904 positions per second on one thread from the starting position, reaching depth 30 in a 10-second search; with four threads it searched 1,447,596 positions per second, also reaching depth 30. In the Kasparov–Topalov position the figures were 385,201 (one thread, depth 29) and 1,436,596 (four threads, depth 31). For comparison, the book's pure-Python move generator counts about 390,000 leaf positions per second (perft(5) = 4,865,609 positions in 12.4 s) — but without any evaluation or search. The practical lesson for a laptop owner: depth 20 on a few cores takes seconds per position, and a whole game at depth 16 takes seconds when cached and a few seconds to a minute cold; batch analysis of thousands of games is a job for the evaluations already stored in the open databases, which is why the book leans on Lichess server evaluations and relay evaluations for population statistics (Chapter 32).
Engine settings by task
| Task | Suggested setting | Why |
|---|---|---|
| Blunder check of a finished game | Depth 16–18, single line, whole game | Catches nearly all short tactics; fast enough to run on every game |
| Deciding between two candidate moves | Depth 20–24, multipv 2–3, then a single-line check of each resulting position | Multi-PV ranks the candidates; the single-line search gives a cleaner evaluation |
| Opening preparation | Depth 22+ at the tabiya plus the masters explorer; differences under 0.15–0.20 treated as ties | Small evaluations are unstable; practical scores matter at club level (Appendix H) |
| Endgames with ≤ 7 pieces | Tablebase, not engine | Exact result and the only moves that keep it |
| Sharp positions (sacrifices, mutual attacks) | Two depths (e.g. 18 and 24), longer searches | Horizon effects; the book's convention is to quote both depths when they disagree |
| Training games against the engine | Strength-limiting options, or play out positions from your own openings | A full-strength engine teaches little by beating you |
J.3 Chess GUIs and database programs
A GUI (graphical user interface) shows the board, loads engines and manages games; a database program stores and searches large PGN collections. Many programs do both. The table describes common options neutrally; feature sets and platforms change, so check each project's own page.
| Program | Licence / cost model | What it is good for (at the time of writing) |
|---|---|---|
| Lichess analysis board and studies (browser) | Free, open source | Engine analysis in the browser, opening explorer, tablebase lookups, shared annotated studies; no installation |
| Chess.com analysis and Game Review (browser/app) | Free tier plus paid memberships | Engine analysis, game review with move classifications and Chess.com's own accuracy score, opening explorer; some features limited on the free tier |
| SCID vs. PC | Free, open source | Desktop database: large PGN collections, searches by position/material/header, opening trees, engine analysis |
| ChessX | Free, open source | Lighter cross-platform database and analysis GUI |
| En Croissant | Free, open source | Modern cross-platform GUI with database and engine management |
| Arena | Free (freeware), Windows-centred | Classic engine GUI; engine matches and tournaments |
| Cute Chess | Free, open source | Engine-vs-engine matches and testing (GUI and command line) |
| Nibbler | Free, open source | GUI designed around Leela Chess Zero's output (also runs other UCI engines) |
| Lucas Chess | Free, open source | Training-oriented GUI with many exercise modes, Windows-centred |
| ChessBase and the Fritz family | Commercial | Long-established Windows database and engine software with its own database products; widely used by professionals |
| Hiarcs Chess Explorer | Commercial | Database and analysis GUI for macOS and Windows |
Whatever you use, the book's analyses only need three things: a way to load PGN, a UCI engine with configurable depth and multi-PV, and position search. Every free option above has them.
⚠️ Common pitfall: "accuracy" percentages are not one metric. The book's accuracy is the plain mean of per-move accuracies on the Lichess win-percentage curve; Lichess's displayed number blends volatility-weighted and harmonic means and runs lower; Chess.com's Accuracy (CAPS) is proprietary. Never compare accuracies across sites or with the book's numbers (Appendix D, Chapter 32).
J.4 Lichess tools
Lichess is a free, non-profit, open-source chess server (its source code is published under the AGPL). The tools the book relies on:
- Analysis board and server analysis. In-browser Stockfish for instant analysis, plus a "request a computer analysis" button that stores an evaluation with each move of a game — those stored evaluations are the
[%eval]comments in the open database. About 11% of the games in our Lichess sample carry them, and because someone asked for the analysis they are a self-selected subset (Appendix B). - Opening explorer. Three databases: Masters (OTB master games), Lichess (games played on the site, filterable by rating and speed) and Player (one player's games). The book uses the masters database (cached with retrieval date 2026-11-20). In our runs the Lichess-games explorer answered with HTTP 401 without a login token, so the book computes Lichess opening statistics from its own 4-million-game sample instead (Appendix H).
- Tablebase. 7-piece Syzygy lookups in the analysis board and through a public HTTP endpoint (Appendix G).
- Studies, puzzles, practice and coordinates. Shareable annotated studies (the easiest way to publish a training file), the puzzle trainer built from the puzzle database the book analyses, and drill modes.
- Broadcasts. Live relays of OTB tournaments; their archive is the book's OTB database.
- The API. Documented HTTP endpoints for games, users, studies and more, plus the open database for bulk data.
J.5 Chess.com tools
Chess.com is the largest commercial chess site. Its free tier and paid memberships include game analysis and Game Review (with move classifications and the proprietary accuracy score), an opening explorer, puzzles, lessons and bots; the split between free and paid features changes over time, so check the site. The book uses only Chess.com's Published-Data API ("PubAPI"), a read-only service that repackages publicly available data such as player profiles and monthly game archives. We fetched the public archives of two public figures — Hikaru (Nakamura; 71,786 games, January 2014 → November 2026) and GothamChess (Levy Rozman; 34,410 games, March 2017 → November 2026). The MagnusCarlsen profile existed but its game-archive endpoint returned 404, so Carlsen's online games are not in the book's data. Chess.com ratings are Chess.com's own pools (separate per time control) and are never converted to Lichess or FIDE ratings in this book.
J.5b Engines and fair play
Engines are training partners, never playing partners. Over the board, FIDE's Laws of Chess forbid players from using electronic devices or any outside source of information or advice during a game; online, every major platform prohibits engine assistance in rated play and runs its own fair-play detection. Statistical methods for detecting engine use compare a player's moves with engine choices across many games and positions — Kenneth Regan's work on intrinsic ratings is the best-known public research line — and they are deliberately conservative, because a single game, or a single brilliant move, proves nothing. The book's own data show why: accuracy numbers vary widely from game to game for the same player (Chapter 32), and forced positions produce long stretches of engine-matching moves from any competent player. Two practical rules follow. When you analyse other people's games, describe what the moves and the clock show and never suggest cheating on the strength of a few numbers — Chapter 24 is the book's worked example of describing an opponent's unusual clock habits neutrally. And when you train, keep the engine off until you have finished your own analysis.
J.6 The open data sources used in this book
| Source | Address | What we used | Licence / terms (as stated or found) |
|---|---|---|---|
| Lichess open database — standard rated games | https://database.lichess.org/ (monthly files lichess_db_standard_rated_YYYY-MM.pgn.zst) |
The first 4,000,000 rated standard games of October 2026 (1 Oct 00:00 → 2 Oct 10:14 UTC), streamed without a full download; usernames replaced by salted hashes | The page states: "Database exports are released under the Creative Commons CC0 license." |
| Lichess broadcast database | same site, broadcast section | 12 monthly files, November 2025 → October 2026: 373,918 relayed games (366,653 standard and completed); engine (TCEC etc.) and online events flagged and excluded from OTB statistics | CC0 (same statement) |
| Lichess puzzle database | same site (lichess_db_puzzle.csv.zst) |
6,193,530 rated, themed puzzles (Chapters 9–11, Ch 25) | CC0 |
| Lichess evaluations database | same site (lichess_db_eval.jsonl.zst) |
Not used (listed at 417,862,375 evaluated positions when we checked) — the book runs its own Stockfish 19 | CC0 |
| Lichess opening explorer (masters) | https://explorer.lichess.ovh/masters (the toolkit's endpoint; current API documentation names the host explorer.lichess.org) |
Master-game statistics for key positions and tabiyas, cached with retrieval date | Lichess API terms; one request at a time |
| Lichess tablebase | https://tablebase.lichess.ovh/standard?fen=… (current documentation names the host tablebase.lichess.org) |
Every endgame verdict in Part III and Appendix G | Syzygy tablebases served by Lichess; one request at a time |
| PGN Mentor | https://www.pgnmentor.com/files.html |
Player collections for ~40 great players, Philidor and Morphy to Gukesh: 97,833 games after de-duplication | Free downloads; we found no explicit licence statement — use for study and check the site before redistributing |
| FIDE rating list | https://ratings.fide.com/download_lists.phtml |
Combined list, file dated 2026-11-20: 1,959,064 players (573,475 standard-rated, 223,908 active) — Chapter 39 | Published by FIDE for download; check FIDE's terms for reuse |
| Chess.com Published-Data API | https://api.chess.com/pub/player/{username}/games/archives |
Public archives of Hikaru and GothamChess | Read-only; serial access unlimited; products using it must state they are not affiliated with Chess.com |
Other free sources you may want for your own research: Lichess's player game exports (your own games through the API), The Week in Chess (a long-running weekly free PGN of recent OTB events), and national federation rating lists. The book does not use them, so we make no claims about their coverage.
⚠️ Common pitfall: the Lichess files are large. A single month of standard games is tens of gigabytes compressed. The book's build script streams the file and stops after the games it needs; do the same rather than downloading a full month to a laptop.
J.6b Inside the files: what the open data contain
Knowing a source's address is half the job; knowing what is in it, and what is not, is the other half. The notes below describe what we found when we built the book's data in October–November 2026. Appendix B documents the processed tables column by column.
Lichess monthly game files. Each game is a PGN record with headers (Event, Site — the game's URL, White, Black, Result, UTCDate, UTCTime, WhiteElo, BlackElo, rating changes, ECO, Opening, TimeControl as base+increment in seconds, Termination, and titles where players have them, including BOT) followed by the moves. Two kinds of comments may follow a move: [%clk 0:02:58], the mover's remaining clock, present in almost every recent game; and [%eval 0.32] or [%eval #-3], Lichess's stored engine evaluation after the move, present only in games someone asked the server to analyse. In our sample of the first 4,000,000 rated standard games of October 2026, 416,869 (10.4%) carry evaluations and 20,948 involve a bot account; on 1 October 2026 alone Lichess hosted 3,035,388 rated standard games. Extrapolated from that day, a month holds on the order of 90 million games and, compressed, tens of gigabytes — the reason the book's builder streams the beginning of one month instead of downloading everything, and the reason our sample covers only the first ~34 hours of the month (with the time-of-day and weekday skew that implies).
The broadcast files. The same PGN format with OTB tournament headers (event and round names, FIDE ratings and FIDE IDs, titles, team names where relevant) and, in most games, [%clk] and [%eval] comments added by the relay: in the book's human OTB set 90.3% of games carry evaluations and 96.5% carry clocks. The evaluations come from Lichess's cloud and relay analysis at varying engines and depths, so the book treats eval-based broadcast statistics as indicative. Because broadcasts include engine tournaments, online events and Chess960 events, the builder flags them (engine_game, online, variant), and every "OTB" statistic in the book excludes them. Time controls are recorded inconsistently from event to event; the book classifies OTB speed from the first clock reading plus the parsed increment.
The puzzle file. One CSV row per puzzle: an ID, the FEN before the opponent's last move, the solution in UCI notation (the first move is the opponent's set-up move), the puzzle's own Glicko-2 rating and deviation, popularity and play counts, space-separated theme tags, the source game URL and opening tags. Puzzle ratings are a separate pool from player ratings — a "1500 puzzle" and a "1500 player" are not the same thing (Chapter 9).
The explorer. JSON with the white/draw/black counts at the queried position, the most frequent continuations with their own counts and average ratings, a few top games, and the opening name. Only the top continuations are listed: a move missing from the list means "not among the most played", not "never played". The book stores each answer with its retrieval date, because the masters database grows as new games are added.
The tablebase. JSON with the category for the side to move, DTZ (and DTM where available), and every legal move with the category it leads to — exactly the fields Appendix G prints.
The FIDE list. A fixed-width text (or XML) file with one row per registered player: FIDE ID, name, federation, sex, title, women's title, standard/rapid/blitz ratings with game counts and K-factors, birth year, and an activity flag (i = inactive). It is a single monthly snapshot — the book's copy is dated 2026-11-20 — so it supports cross-sections (ratings by age, federation, sex) but not individual rating histories.
PGN Mentor files. One PGN per player (and per opening or event), mixing classical, rapid, blitz, simultaneous and blindfold games without a reliable speed tag, and with occasional transcription variants in older games. The book de-duplicates across collections (109,594 records → 97,833 games) and filters by event when speed matters.
| Source | What it is | What it is not |
|---|---|---|
| Lichess sample | Every rated standard game started in ~34 hours of October 2026, mostly fast online games, Lichess ratings | A random sample of a year, or a panel that follows players over time |
| Broadcast games | OTB tournament games strong or organised enough to be relayed, FIDE ratings | Every OTB game in the world; its median average FIDE rating is about 2040 |
| Master games | The historical record of ~40 great players | A random sample of master play |
| FIDE list | One cross-section of all FIDE-rated players | A history of anyone's rating |
| Puzzles | Positions generated from Lichess games, rated by solvers | Positions chosen for teaching, or rated on the player scale |
| Chess.com archives | Two public figures' public games | A population — no Chess.com-wide statistic can be computed from them |
J.7 Rate-limit etiquette
Free public services stay free when clients are polite. The rules the book's toolkit follows, with their sources:
| Service | Rule (as documented) | What the toolkit does |
|---|---|---|
| Lichess API, explorer, tablebase | The API documentation says to "only make one request at a time" and that on an HTTP 429 response, "in most cases, waiting one minute before retrying will be sufficient, but some limits may require longer." | One request at a time; the explorer wrapper waits 60 s after a 429 and retries; a short pause after every uncached call; every answer cached permanently (explorer as JSON with retrieval date, tablebase in SQLite) |
| Chess.com PubAPI | Chess.com's help article: "Serial access is unlimited"; parallel requests may produce "429 Too Many Requests"; endpoints refresh at most once every 12 hours, and responses carry ETag and Last-Modified headers for conditional requests. It suggests contact details in the User-Agent help resolve blocks. |
Sequential month-by-month fetches with a 0.5 s pause; cached parquet per account; a generic client name as User-Agent (we prefer not to send personal contact details to third parties — add your own if you run a heavy job) |
| Lichess database downloads | Large static files; torrents are offered for bulk download | Stream once, keep only what is needed, never re-download |
The pattern in Python (simplified from toolkit/chessdata.py):
import time, requests
def polite_get(url, params, cache):
key = url + repr(sorted(params.items()))
if key in cache: # 1. never ask twice
return cache[key]
for attempt in range(4):
r = requests.get(url, params=params, timeout=30,
headers={"User-Agent": "my-chess-study/1.0"})
if r.status_code == 429: # 2. back off a full minute
time.sleep(60)
continue
r.raise_for_status()
break
cache[key] = r.json() # 3. store with the answer
time.sleep(0.5) # 4. one request at a time, with a pause
return cache[key]
📋 Try it — Engine analysis. Re-run j01_depth_and_tablebase.py on a position from one of your own games, adding depths 28 and 32 if your machine allows. Worked answer: if the best move is the same at every depth and the evaluation moves by less than 0.2, you can quote it with confidence at any of those depths; if the best move changes, quote two depths and say so — exactly the convention the book uses ("+0.12 (d18) / +0.11 (d24)").
J.7b A complete free workflow
Everything in this book can be done with free tools. A typical review loop, using the toolkit and the project modules you built in Parts I–VI:
- Get the game. Export it from the site (both Lichess and Chess.com offer PGN downloads of your games;
outpost.gamesfrom Chapter 1 fetches public games through the APIs, with an offline fallback). - Annotate it yourself first — candidate moves, the critical moments you felt, your time use (Chapter 26).
- Run the engine pass at depth 16 for the whole game, then depth 20–24 with multi-PV at the two or three critical moments.
- Probe the tablebase for every position with seven or fewer pieces.
- Look up the opening in the masters explorer and, for club relevance, in the Lichess statistics by band (Appendix H); identify the pawn structure (Appendix F).
- Write down one lesson in human terms, and add the position to your training file.
In code, steps 3–5 take a dozen lines with the toolkit:
import chess
import chessdata as cd, engine as en
row = cd.find_game(white="Kasparov", black="Topalov", year=1999, event="Hoogovens").iloc[0]
game = cd.game_from_row(row)
df = en.analyse_game(game, depth=16) # whole game, cached
print(en.game_summary(df)) # ACPL, accuracy, error counts per side
for _, m in en.critical_moments(df, n=3).iterrows(): # the three biggest swings
b = chess.Board(m.fen_before)
print(m.move_no, m.san, en.evaluate(b.fen(), depth=22, multipv=3))
if len(b.piece_map()) <= 7:
print(cd.tablebase(b.fen())["category"])
print(cd.explorer(chess.Board().fen(), db="masters")["white"]) # cached explorer call
Every call in that snippet is cached, so running it twice costs nothing and gives identical numbers — the property that lets every evaluation in this book be checked by its readers.
J.8 Reproducibility checklist
Everything in this book can be rebuilt from the sources above. If you extend it, keep the same discipline:
- Record versions. Engine and version ("Stockfish 19"), python-chess version, and the dates of every download or API retrieval (the toolkit stores
_retrievedwith every cached answer). - Record settings. Depth, multi-PV, threads and hash for every evaluation; whether tablebases were on.
- Cache everything. A rebuilt analysis should come from the cache, not from a new search whose hash state differs.
- Name the pool and the filter of every statistic (Lichess / OTB / masters / Chess.com; speeds; balanced or not; bots excluded).
- Never type moves or numbers from memory. Load games from the data, replay lines with python-chess (an illegal move raises an error), and paste real output.
- Respect licences and people. CC0 data can be redistributed; other sources may not. Amateur players in open data stay anonymous — hash their usernames and never try to identify them.
Python libraries used by the book
| Library | Use in the book | Licence (as published by the project) |
|---|---|---|
| python-chess | Board logic, PGN parsing, UCI engine control | GPL-3.0 |
| pandas, NumPy, SciPy, scikit-learn | Data handling, statistics, models | BSD-style |
| matplotlib | Every chart and board diagram | Matplotlib licence (BSD-compatible) |
| pyarrow | Parquet files | Apache-2.0 |
| requests | HTTP calls through the cached wrappers | Apache-2.0 |
🔄 Check your understanding
- Why does the book never quote "the engine says +0.3" without a depth?
- A friend's app says your drawn rook ending was "+0.28 for White". The tablebase says draw. Which do you believe, and why does the app disagree?
- What are the two documented rules for calling the Lichess API politely?
Answer
- Because small evaluations move with depth and hash state — the start position read +0.19 to +0.39 across depths 8–24 in J.2 — so the depth is part of the number.
- The tablebase: with seven or fewer pieces it gives the proven result. An engine searching without tablebase files estimates the position with its evaluation function and cannot see that every line ends in a draw (J.2's Philidor example: +0.00 to +0.28 for a proven draw).
- One request at a time, and after an HTTP 429 response wait (in most cases one minute) before retrying.
Reproducing this appendix
Script (in appendices/code/) |
What it produces |
|---|---|
j01_depth_and_tablebase.py |
The depth table and figure in J.2, two diagrams, the tablebase check of the Philidor position |
Source pages consulted on 2026-11-20 for the statements about licences, release lists and rate limits: the Lichess database page, the Lichess API specification on GitHub, the Stockfish GitHub release page and Chess.com's help article on the Published-Data API. Where we could not verify a statement (licence terms for PGN Mentor and the FIDE list, current features of commercial products), the text says so.