Exercises — Chapter 32: Engine Analysis at Scale
Difficulty: ⭐ concept check · ⭐⭐ apply to a position or a small dataset · ⭐⭐⭐ judgement and extension · ⭐⭐⭐⭐ open-ended project.
All numbers you need are in the chapter; all code extends the chapter's scripts in code/. Evaluations are
Stockfish 19, White's point of view, with the depth stated.
Part A — Concepts ⭐
A1. Write the book's definitions of CPL, ACPL, book game accuracy, and the inaccuracy / mistake / blunder thresholds. Which of them depend on the win-% curve and which do not?
Answer
CPL = max(0, eval before − eval after) from the mover's view, evals clipped at ±1000 (mate = ±1000); ACPL = mean CPL over a player's moves. Book game accuracy = arithmetic mean of per-move accuracies, where move accuracy = 103.1668·e^(−0.04354·Δ) − 3.1669 and Δ is the mover's win-% drop. Inaccuracy / mistake / blunder = win-% drop ≥ 5 / 10 / 15. CPL and ACPL do not use the win-% curve; accuracy and the three labels do.
A2. A move loses 100 centipawns. Using the chapter's table, give its win-% drop and label when the mover was at 0.00, at +5.00 and at −3.00 before the move.
Answer
At 0.00: drop 9.1 → inaccuracy (move accuracy 66.2). At +5.00: the table prints 5.0, but the unrounded drop is 4.96 — just under the threshold — so the label is "ok" (move accuracy 80.0). At −3.00: drop 6.2 → inaccuracy (75.5). The centipawn rule calls all three a "mistake". Boundary cases like the second one are a reminder that labels are thresholds on a continuous quantity.
A3. Why does Lichess's displayed accuracy for a game usually come out lower than the book's accuracy for the same game, and why is Chess.com's accuracy not comparable to either?
Answer
Lichess uses the same per-move formula but combines moves with volatility weighting and a harmonic mean; harmonic means are pulled down by a few low values, so one bad move costs more. The book uses the plain arithmetic mean. Chess.com's "Accuracy" (CAPS) is a proprietary model with its own engine settings and scaling. Different definitions produce different numbers for identical moves.
A4. What is the difference between correlation and agreement when we compare ACPL from two engines? Give an example where the correlation is high but the agreement is poor.
Answer
Correlation measures whether the two sources rank or move together; agreement measures whether they give the same number. If one engine always reported exactly twice the other's ACPL, r would be 1.0 but every value would differ — a Bland–Altman plot would show a large, growing bias. For comparing players within one source, correlation matters; for comparing your number with a table built by a different source, agreement matters.
A5. Define an "alive" move. Why does the book report ACPL on alive moves next to ACPL on all moves?
Answer
An alive move is one made while the mover's evaluation before it was within ±3.00. In decided positions, evaluations swing close to the ±10-pawn clip and large centipawn losses rarely change the result; in our 2,000 blitz games 47.8% of all centipawns were lost in decided positions. Alive-move ACPL measures play while the result was still open.
A6. In one sentence each: what does Cohen's kappa add to "the two engines agreed on 90% of the labels"?
Answer
Kappa corrects for the agreement you would get by chance: if 85% of all moves are "ok" in both sources, two labellers who agree on almost nothing else still agree on most moves. Kappa asks how much better than chance the agreement is on the labels that matter (for example, blunder yes/no).
A7. Name three reasons why ACPL is not a pure measure of a player's skill.
Answer
(1) It depends on the positions the player faced — sharp positions with few safe moves produce more error; (2) it depends on the opponent — your opponent's mistakes put you in decided or chaotic positions and your ACPL rises with theirs; (3) it depends on the measurement — engine, depth, clip, time control, and which moves are counted (book moves, decided positions). Also: the result itself (losing inflates ACPL) and sample size.
A8. What does a "top-move match" rate measure, and why is a high match rate in one game not evidence of engine use?
Answer
The share of scoreable moves on which the player chose the engine's first choice. It depends heavily on how forced the positions were: in a position with one safe move, strong humans find the engine's move most of the time. A single game has few moves, so the match rate has a large random spread; a high value is expected in some games for every honest player. Only a comparison with the expected rate for those positions, over many moves, can carry weight.
A9. What is a Bland–Altman plot, and what do its two horizontal limit lines tell you?
Answer
It plots, for each object measured twice, the difference between the two measurements against their mean. The central line is the bias (mean difference); the two limit lines (bias ± 1.96 × SD of the differences) contain about 95% of individual differences. For player-game ACPL on Lichess games, our depth-16 run and the server evaluations gave a bias of +3.2 cp and limits of −16.9 to +23.4 cp: a single player-game can differ by twenty centipawns between two sound analyses.
Part B — Positions ⭐⭐
Six real positions from the chapter's agreement sample, chosen by a fixed rule (code/07_exercise_positions.py):
in each, the depth-12 multi-PV search finds exactly one safe move (every alternative loses at least 15
win-% points more), and the player in the game went wrong. All solutions are verified with Stockfish 19 at
depths 18 and 22 (multipv 3). For each: find the only move, then say why the alternatives fail.
B1. Find the tactic. OTB classical, FIDE 1800–2599 sample, Black to move (move 20).

♟️ Position: White Ke1, Qe2, Ra1, Rg1, Bb2, Bg2, a2, c2, f4, c6; Black Ke8, Qb6, Ra8, Rh8, Bf8, b5, a6, d6, g6, e7, f7 — Black to move. FEN:
r3kb1r/4pp2/pqPp2p1/1p6/5P2/8/PBP1Q1B1/R3K1R1 b Qkq - 0 20
Solution
20...Qxg1+! (+1.99 at depth 18, +2.13 at depth 22: 21.Kd2 Qc5 22.Bxh8). Two things are hanging at once: White's g1-rook (the b6–g1 diagonal is open) and Black's own h8-rook (attacked by the b2-bishop along the long diagonal). Taking the rook with check gains the tempo to deal with the second problem afterwards. The game's 20...Rh4 saved the rook but missed the capture: +5.53 at depth 22 after 21.O-O-O. Alternatives at depth 22: 20...Qa5+ +4.67, 20...Rh2 +5.61. White is still better after the best move — the exercise is about not making things worse.
B2. Analyze this position. OTB classical, White to move (move 36). White's king has walked to g4.

♟️ Position: White Kg4, Qf5, Rd5, Re6, a2, b2, c3, h3, d4, h5; Black Kg7, Qh2, Rh6, Re8, g5, a6, f6, b7, e7 — White to move. FEN:
4r3/1p2p1k1/p3Rp1r/3R1QpP/3P2K1/2P4P/PP5q/8 w - - 1 36
Solution
36.Qe4! is the only move that holds: 0.00 at depths 18 and 22. Everything else loses on the spot — 36.Qf3 −6.50 (36...f5+! 37.Rxf5 Rxe6), 36.Qf1 −6.58, 36.Re3 −6.73 (depth 22). The king on g4 is exposed to ...f5+ and to Black's heavy pieces on the h-file; on e4 the queen keeps the f5-square under control and the e6-rook protected. The game's 36.Qf3 walked into 36...f5+, and Stockfish 19 gives −6.76 at depth 22. A pure only-move position: one move draws, the rest lose.
B3. Find the move. Lichess blitz, 2200+ sample, Black to move (move 14). White has just played d5.

♟️ Position: White Kg1, Qc2, Ra1, Re1, Bc1, Bg2, Nf1, Nf3, b2, f2, h2, c3, d3, g3, d5; Black Kg8, Qd8, Rb8, Rf8, Bg7, Bc8, Nc6, Ne7, b5, c5, f5, e6, g6, h7 — Black to move. FEN:
1rbq1rk1/4n1bp/2n1p1p1/1ppP1p2/8/2PP1NP1/1PQ2PBP/R1B1RNK1 b - - 0 14
Solution
14...Nxd5! (+0.54 at depth 18, +0.45 at depth 22). Recapture with the e7-knight. The pawn recapture 14...exd5 (played) gives +2.65 / +2.91 (the line goes 15.Be3 c4 16.Qd2 cxd3): opening the e-file against the knight on e7 and leaving the c5-pawn loose to Be3 costs Black more than two pawns of evaluation. 14...Qxd5 is worse still (+3.78 / +4.66; 15.Bf4 hits the b8-rook). Human rule: when several pieces can recapture, ask what each recapture leaves undefended.
B4. Find the tactic. Lichess blitz, 2200+ sample, Black to move (move 14). White has castled queenside.

♟️ Position: White Kc1, Qd3, Rd1, Rh1, Bf1, Be3, Ne2, a2, b2, g2, h2, f3, d4; Black Kg8, Qd5, Ra8, Rf8, Bg7, Nh6, c5, e5, g6, a7, b7, f7, h7 — Black to move. FEN:
r4rk1/pp3pbp/6pn/2pqp3/3P4/3QBP2/PP2N1PP/2KR1B1R b - - 0 14
Solution
14...exd4! (+0.21 at depth 18, −0.12 at depth 22). The point is the reply 15.Bxh6 — after which 15...Bxh6+ recaptures with check along the h6–c1 diagonal, now cleared of the e3-bishop. The game's 14...Qxa2 grabbed a pawn and left the queen offside: +4.08 at depth 22 after 15.Nc3 Qa5 16.dxe5. 14...cxd4 (+3.06 / +3.32) and 14...Nf5 (+3.19 / +3.35) also fail. The geometry to remember: a bishop on g7 looks through h6 at a king on c1.
B5. Build the plan. Lichess blitz, 1800–1999 sample, Black to move (move 21).

♟️ Position: White Kg2, Qd2, Ra1, Rc1, Be3, Ne2, Nc3, a3, f3, b4, e4, d5; Black Kg8, Qh4, Rc8, Rf8, Bb7, Nh7, e5, b6, d6, h6, a7, f7, g7 — Black to move. FEN:
2r2rk1/pb3ppn/1p1p3p/3Pp3/1P2P2q/P1N1BP2/3QN1K1/R1R5 b - - 1 21
Solution
21...f5! (+1.79 at depth 18, +1.93 at depth 22: 22.exf5 Rxf5 23.Ng3 Rff8). Black's queen on h4 is short of squares and White's rook is about to arrive on h1; the only way to stay in the game is to strike at the centre at once and bring the f8-rook into play along the f-file. Every quiet move loses about two more pawns: 21...Rc7 +3.88 (d18), 21...Rc4 +3.90 and 21...Rb8 +4.46 (d22). The game's 21...Qf6 gave +4.91 at depth 22 after 22.Rh1. White is better in every line — this is a "limit the damage" only move, the kind that is invisible to a player who is looking for a winning move rather than a surviving one.
B6. Find the tactic. Lichess blitz, 1400–1599 sample, White to move (move 13).

♟️ Position: White Ke1, Qe3, Ra1, Rh1, Bc4, Ng1, a2, b2, f2, g2, c3, d3, e4, h4; Black Kg8, Qd8, Ra8, Rf8, Bf6, Bc8, c5, e5, h5, d6, g6, a7, b7, f7 — White to move. FEN:
r1bq1rk1/pp3p2/3p1bp1/2p1p2p/2B1P2P/2PPQ3/PP3PP1/R3K1NR w KQ - 0 13
Solution
13.Qh6! (+2.95 at depth 18, +3.26 at depth 22: 13...Bg7 14.Qxg6 Bg4). The f7-pawn is pinned against the king by the c4-bishop, so it cannot defend g6, and the queen on h6 threatens Qxg6+. Everything else throws the advantage away: 13.Nf3 0.00 and 13.a4 −0.01 at depth 22. The game's 13.f3?? lost the h4-pawn with check (13...Bxh4+) and the evaluation dropped to −2.04 (depth 22). Notice how the safe-moves count captures the position's character: one attacking move, and no "comfortable" alternative.
Part C — Data & Code ⭐⭐–⭐⭐⭐
C1. Database research ⭐⭐ — the 97% table for your pool. Extend code/02_population_metrics.py (part A)
to Lichess rapid and classical analysed games. Input: game_features (Lichess, has_eval, no
bots), player-games with ≥ 30 moves. Output: a table with one row per own-rating band and columns
player_games, median_acc, acc_ge_97, acc_ge_98, zero_blunders. Question: at which speed is a 97
most common at 1600–1799, and why might that be?
C2. Engine analysis ⭐⭐⭐ — a second agreement study. Copy code/03_agreement_study.py and change the
sample to bullet games (same four bands, 8 games each) at depth 12. Output: the three agreement tables
(positions, labels, player-games). Question: is agreement with the server evaluations better or worse than
at depth 16 on blitz/rapid, and is the difference caused by the depth or by the type of game? (Hint: run the
same bullet games at depth 16 too; the cache keeps it cheap.)
C3. Engine analysis ⭐⭐⭐ — label stability. With the depth-study runs in code/04_depth_effects.py, build
a 4 × 4 confusion matrix of labels (ok / inaccuracy / mistake / blunder) between depth 12 and depth 18.
Output: the matrix and the share of moves whose label changes by two or more categories. Expected
shape: most changes are between neighbouring categories.
C4. Database research ⭐⭐ — ACPL without decided positions. For Lichess blitz 1600–1799 player-games,
recompute ACPL on alive moves only (mover's eval within ±3.00) from the stored evaluations (use
accuracy.stored_moves on a seeded sample of 2,000 games). Output: mean ACPL all moves vs alive moves,
split by the player's result. Question: how much of the gap between winners' and losers' ACPL survives?
C5. Engine analysis ⭐⭐⭐ — difficulty by phase. Using the multi-PV results of
code/05_difficulty_and_matching.py (they are cached: re-request with engine.evaluate(fen, depth=12,
multipv=3)), compute the share of only-move positions by phase (opening/middlegame/endgame, column
phase). Output: a table phase × safe-move category with error rates. Question: are endgames "harder"
than middlegames by this measure?
C6. Code ⭐⭐ — a per-player report. Write player_report(movetexts, colours) on top of
outpost.accuracy that returns, for one player: games, ACPL (all and alive) with a 95% margin of error,
book accuracy, blunders per 100 moves, and ACPL by phase. Test it on Lena's or Grace's composite games
(data/reference/persona_lena.parquet, persona_grace.parquet).
Hints for C1–C6
C1: filter speed in game_features; reuse the pg frame built by load(). C2: change LI_BANDS and
speed.isin([...]) in pick_samples(); keep random_state fixed. C3: pd.crosstab(a.classification,
b.classification) after joining on (game_index, ply). C4: alive = (eval_before * sign).abs() <= 300.
C5: phase is already in the saved CSV. C6: reuse player_games, margin_of_error and the phase grouping
from project_checkpoint.py.
Part D — Judgement & Transfer ⭐⭐⭐
D1. 1200 vs 2000. Lena (Lichess rapid ~1400) and Grace (FIDE ~1850) both want to "improve their accuracy". Using the chapter's findings — the phase tables, the share of centipawns lost in decided positions, and the difficulty results — write a short paragraph for each on what their accuracy number is mostly measuring and what they should track instead.
Model answer
For Lena, a large part of her ACPL comes from decided positions and from the middlegame (in Lichess rapid at 1400–1599 the reference table gives 42.1 opening / 91.8 middlegame / 61.0 endgame); her accuracy mostly measures how often she blunders material in complicated middlegames. She should track blunders per 100 moves on alive moves and review the positions with one safe move where she went wrong. For Grace, playing OTB classical, errors are rarer (FIDE 1800–1999: 11.9 / 36.6 / 38.0 by phase) and her endgame ACPL is as high as her middlegame's; a single game's accuracy is very noisy at her level. She should track mistakes in "only-move" positions and endgame technique across many games, not the headline number.
D2. Engine vs human. In the Anchor B game, 10.O-O and 31.Kf2 both lost more than 450 centipawns. Explain to a sceptical club player (Sam) why one of them is "a missed chance" and the other "a blunder", and why the engine's numbers do not make that distinction for you.
Model answer
10.O-O was a sound developing move in a position where a hidden sacrifice (10.Nxf7) won outright; White was still clearly better after castling (+1.78 at depth 18). 31.Kf2 turned a winning ending (+5.92 d18) into a draw (0.00) by letting the a-pawn run. Both are large losses against the best move, so CPL and the win-% drop treat them alike — the engine measures distance from its best move, not what kind of error was made. Telling a missed chance from a blunder needs a human question: what did the move allow, and what did it miss? (Chapter 26's error types do exactly this.)
D3. Which depth for which job? You have three jobs: (a) a one-off review of your own tournament game, (b) ACPL trends over your last 300 online games, (c) a study comparing ACPL across rating bands with 10,000 games. Recommend a depth (or the use of stored evaluations) for each, citing the chapter's cost and stability results.
Model answer
(a) Depth 20 or more on the critical moments, with multi-PV — one game is cheap and labels at the boundary matter. (b) Stored server evaluations if available, otherwise depth 12–16: trends depend on consistency, and book accuracy barely changes between sources and depths. (c) Stored evaluations first (they are free and agree closely with depth 16 on accuracy); if you must compute, depth 12–16 with the cache and parallel workers; depth 20 would take days at this machine's measured speed. In every case state the source and depth.
D4. The screenshot. A club-mate posts a screenshot: "my opponent played 96% and matched the engine on 85% of moves — obvious". Write the reply you would want an arbiter to read, using at least three numbers from the chapter.
Model answer
At FIDE 2000–2199, 8.6% of OTB classical player-games (≥ 30 moves) in our broadcast data reach book accuracy ≥ 97; in a strong Olympiad field 66% of players had at least one ≥ 97 game. Top-move match depends on how forced the positions were: in our sample players matched the engine far more often when there was only one safe move. And one game is a tiny sample — our honest-sample z-scores spread widely from one player-game to the next. A single game's accuracy or match rate is not evidence; a serious analysis needs many games, an expectation based on the actual positions, and other evidence.
Part M — Mixed / Interleaved ⭐⭐–⭐⭐⭐
M1. (with Chapter 13 — Practical Decision-Making) Chapter 13 found that critical moments are rarer at higher levels and that errors cluster where only one safe move exists. Using this chapter's safe-moves measure, design a "time budget" rule: in which positions should a player spend extra clock? Test it on the agreement sample by comparing error rates (d16) in one-safe-move positions vs others, split by band.
Answer sketch
A workable rule: spend extra time when (a) the position is still alive and (b) the obvious candidate moves look clearly worse than one specific move — the only-move signature. In the agreement sample, only-move positions produced errors in 24.8% of moves against 8.5% in positions with three or more safe moves, and the gradient appears in every band (Lichess <1200: 45.2% vs 22.6%; OTB 1800–2599: 7.4% vs 1.8%). Since about a quarter of positions are only-move positions, a player who could recognise them would know where to invest the clock. The difficulty: the player has to sense scarcity without an engine — Chapter 13's "how many safe moves do I have?" question is the human version.
M2. (with Chapter 23 — Engine-Assisted Preparation) Chapter 23 showed that single-PV and multi-PV searches can rank near-equal moves differently and that depth 6 vs 16 disagree by ≥ 1 pawn in 12.7% of positions. Which of this chapter's metrics would that instability affect most — ACPL, book accuracy, blunder labels or top-move match? Rank them and justify the ranking with this chapter's agreement and depth results.
Answer
Most affected: top-move match (a near-tie between two moves flips the "best move" without changing any evaluation much). Then blunder labels at the boundary. Then ACPL (evaluation differences add up, especially in decided positions). Least: book accuracy (win-% compression; 0.8-point mean difference across sources).
M3. (with Chapter 30 — The Elo Rating System) The win-% curve and the Elo expected-score curve are both logistic. Explain why a 100-cp loss "costs" more near equality and why a 100-point rating gap "costs" more expected score near equal ratings — and why neither statement makes ACPL a rating.
Answer
Both curves are steepest in the middle: near 0.00 (or near equal ratings) a small change moves the expected result most; at the extremes the curve is flat and the same change barely matters. ACPL is not a rating because it measures distance from an engine's choices, not results against opponents; it depends on the positions and opponents faced (section 32.6) and on the measurement setup, and its relation to rating is loose for single games (r about −0.33 between a Lichess blitz player's single-game ACPL and their rating).
M4. (with Chapter 1 — How to Think About Chess and Chapter 26 — Game Analysis) Take one of your own games
(or a persona game). Run the human pass first (Chapter 26), mark the three moves you think were critical, then
score the game with outpost.accuracy from stored evaluations and with Stockfish 19 at depth 16. Did the
two sources agree on your critical moves? Did your human pass find them?
M5. (with Chapter 29 — History of Chess Strategy) The champions' sample shows r = −0.70 between ACPL and the year of the games, and this chapter shows a champion's ACPL rises with the opponent's (r = 0.58 within games). Propose one adjustment that would make an era comparison fairer, and say what data you would need.
Answer sketch
Options: compare champions only within difficulty classes (error rate in only-move positions vs others, from a multi-PV run); regress the champion's ACPL on the opponent's ACPL in the same game and compare residuals; or model expected choices per position (the intrinsic-performance idea). All need multi-PV analysis of every position in the sampled games, at a stated depth, and enough games per champion for intervals that do not overlap.
Part E — Research & Extension ⭐⭐⭐⭐
E1. A better difficulty model. Replace the "safe moves" count with a richer position-difficulty model: multi-PV 5 at depth 16, features such as the win-% gaps between the first five moves, the number of legal moves, whether the best move is a capture or check, and material on the board. Fit P(error) on the Lichess part of the agreement sample and test it on the broadcast part. Report calibration (predicted vs observed error rates in deciles).
E2. Intrinsic performance, small scale. Following the logic of section 32.7, build a model that predicts each played move's probability from the multi-PV evaluations of all candidate moves (a softmax over win-% losses with a skill parameter). Fit the skill parameter per rating band on a reference set and estimate an "intrinsic rating" for each player-game in a held-out set. How wide is the uncertainty for one game? For twenty?
E3. Depth and era. Re-analyse 10 games each of two champions from different eras at depths 12, 16 and 20. Does the gap between them shrink, grow or stay the same as depth rises? What does that say about comparing eras at a fixed shallow depth?