Chapter 32 Instructor Notes: Engine Analysis at Scale

Chapter text · Case study 1 · Case study 2 · Exercises · Quiz · Key takeaways

This is the methodological heart of Part VI. It treats ACPL, accuracy and move labels as measurements with a setup — engine, depth, clip, formula, window — and asks how stable they are. Its centrepiece is a small, fully reproducible agreement study (80 games, Stockfish 19 at depth 16 against stored evaluations), which works beautifully as a lab. Run it that way: students should produce the agreement statistics, not just read them.

The chapter opens with a fair-play question ("is 97% suspicious?") and returns to it in 32.7 and Case Study 2. Treat this material with care. The chapter names no player as a suspect, anonymises the Olympiad field, describes Kenneth Regan's published approach only in general terms, and ends with a rule: never from one game, never from raw thresholds, never as a verdict. Your classroom should follow the same rule (see "Fair-play norms" below).

Dev's games in the Project Checkpoint are composites:

🎭 Dev's games are real Lichess games played by anonymous players at his rating, assembled into one "player" so the method can be shown. His ACPL of 64.6 ± 4.3 describes that collection, not a person.

Learning objectives

The chapter frames its job as learning how the metrics "behave as measurements". By the end, students should be able to:

  1. Compute CPL, ACPL, book accuracy and the win-% labels, and explain why the same centipawn loss gets different labels at different evaluations.
  2. Run and interpret an agreement study: correlation, bias, Bland–Altman limits, Cohen's kappa.
  3. Choose a depth for a job, using measured stability and cost.
  4. Explain why ACPL depends on the opponent and on position difficulty (safe moves), not only on the player.
  5. Describe the principles of statistical fair-play screening and explain why single-game thresholds fail (base rates, multiple testing, calibration).
  6. Plan engine work at scale: stored evaluations first, parallel workers, the cache, a cost model.

Timing plan

75-minute session

Minutes Activity Notes
0–8 Hook: "Is 97 suspicious?" Vote, then reveal 8.6% of FIDE 2000–2199 OTB player-games.
8–20 32.1 one loss, many prices 200 cp at 0.00 is a blunder (17.6); at +5.00 a mistake (11.2). 47.8% of centipawns lost in decided positions.
20–28 32.2 Anchor B twice Missed win charged like a blunder; alive ACPL 11.8 vs 70.5.
28–50 32.4 the agreement study (mini-lab) Project the three result tables; students fill in the worksheet below.
50–60 32.5 depth Data demo: the depth-flip position; cost per position.
60–70 32.6–32.7 opponent, difficulty, fair play Only-move positions; 7 of 107 honest player-games matched ≥ 70%.
70–75 Exit ticket

3-hour block (lab format)

Minutes Activity Notes
0–15 Hook and vote
15–40 32.1–32.3 Students compute two rows of the price table by hand from the win-% formula.
40–95 Agreement lab Protocol below. Pairs work; each pair owns one statistic.
95–105 Break
105–125 32.5 depth One position, ten depths; the cost table.
125–145 32.6 difficulty Productive struggle (18.Nd4 vs 18.Nxf6+), then the safe-move table.
145–170 Case Study 2: screening a tournament Base-rate arithmetic in groups (discussion question 2).
170–180 Decision checklist; exit ticket

Key numbers and games

Item Value as quoted Where
Hook: OTB classical player-games ≥ 97 book accuracy FIDE 2000–2199 5,706 of 66,367 (8.6%); 1800–1999 3,527 of 63,652 (5.5%); 2400+ 25.9% Hook
Price of a loss 200 cp at 0.00: drop 17.6 (blunder); at +5.00: 11.2 (mistake); 300 cp at −3.00: 15.0 §32.1
Two labelling rules (2,000 blitz games) 47.8% of all centipawns lost at |eval| > 3.00; 24.9% of cp-blunders made at ≥ +5.00; 35.0% of book blunders under 300 cp §32.1
Anchor B White ACPL 69.2 stored / 70.5 SF19 d16; accuracy 88.7 / 88.9; 10.O-O = 18.2% of White's centipawns; alive ACPL 11.8 on 12 of 36 moves §32.2
Anchor B endgame 29.f3 +9.05 → +5.97 (308 cp, 6.5 win-% pts, inaccuracy); 31.Kf2 +5.92 → 0.00 (561 cp, 38.8) §32.2
ACPL by pool (≈1000 / 1500 / 2000 / 2500) Lichess blitz 85.7 / 69.3 / 56.9 / 43.6; OTB 49.3 / 40.5 / 28.5 / 16.6 §32.3
Speed (Lichess 1600–1799) Bullet 73.1, blitz 64.8, rapid 62.4, classical 58.4 §32.3
Overlap 29.0% of 1200–1399 blitz player-games beat the 2000–2199 median §32.3
Agreement: positions Lichess r 0.993, median |diff| 12 cp, 84.4% within 50 cp, 1.8% > 200 cp; broadcast r 0.969 §32.4
Agreement: labels Blunders 313 stored / 322 SF19 / 288 both; kappa 0.90; broadcast 0.71 §32.4
Agreement: player-games (Lichess) ACPL r 0.964, bias +3.2, limits [−16.9, +23.4], mean |diff| 7.2 cp; accuracy mean |diff| 0.8, limits [−2.3, +2.0] §32.4
Largest disagreement After 35.Ng5+: stored +2.32, d16 +0.20, d18 +0.51, d24 +5.58 §32.4; quiz 6
Depth Accuracy 84.55–84.82 across d8–d20; d16 vs d18: same label 91.6%, blunder kappa 0.90, same best move 81.8%; d8 kappa 0.63 §32.5
Cost per position (one thread) d8 0.024 s, d12 0.067, d16 0.41, d18 1.57, d20 3.27 §32.5, §32.8
Depth-flip position d12 prefers 29.Rxd8+ (+0.78); d14–d26 prefer 29.Ne4 (+1.86 to +2.54) §32.5
Opponent effect Same-game ACPL r 0.631 (0.590 after ratings) vs own rating −0.328; champions 10.5 / 21.1 / 29.0 vs precise / middle / error-prone opponents §32.6
Difficulty Only-move positions 26.6%; error rate 24.8% (1 safe) / 15.5% (2) / 8.5% (3+); top-move match 64.6% / 48.5% / 29.3% §32.6
Matching sketch 7 of 107 honest player-games ≥ 70% match; z mean 0.00, SD 1.16; top three z all OTB classical §32.7
Sample size +10-point match excess: z = 1.0 over 25 moves, z = 4.0 over 400 §32.7
Scaling 3 workers 1.98× faster than 1; cached rerun 2.2 s for 540 positions; 10,000 games at d20 ≈ 242 hours §32.8
Dev (composite) 241 blitz games, ACPL 64.6 ± 4.3 vs band 64.8; phases 33.2 / 87.7 / 57.4 Project Checkpoint
Hou Yifan–Tan Zhongyi, Chinese League 2026 White ACPL 10.1 relay / 9.0 d16 / 5.6 d20; median |relay − d20| 45 cp; White match 86.7% (d16) / 93.3% (d20) Case Study 1
Olympiad 2026 Open screen 485 of 735 players (66.0%) had a ≥ 97 game; band z mean −0.68, SD 1.28; 5 with z ≥ 2 vs 16.7 expected Case Study 2

Threshold concepts and likely misconceptions

Threshold concept: a metric is a measurement with a setup. A number without its engine, depth, clip, formula and window is not comparable with anything. Students who cross this threshold ask "measured how?" before "is that good?".

Second threshold: correlation is not agreement. Two sources can rank players identically (r 0.96–0.98) and still differ by twenty centipawns on one player-game.

Misconceptions to expect:

  • "ACPL is the objective one; accuracy is a gimmick." Across sources, accuracy is the more stable (0.8 points mean difference vs 7.2 cp).
  • "Deeper is always better, so analyse everything at depth 20+." For averages, depth barely matters; cost rises about eight times from d16 to d20.
  • "The engine's best move is a fixed fact." Depths 16 and 18 agree on it in only 81.8% of positions.
  • "Low ACPL means a strong player." It also means a quiet opponent and easy positions (champions: 10.5 vs 29.0).
  • "Missing a win isn't a blunder." Every metric charges it like one; humans must tell "allowed" from "missed".
  • "A high match rate means engine use." Matching measures how forced the positions were (64.6% in only-move positions).
  • "The cache makes results correct." It makes them reproducible; it freezes the first answer.

Fair-play norms for your classroom

The chapter's caution is a teaching standard, not a disclaimer. Adopt these rules before 32.7:

  1. No names. Students do not analyse, screen or discuss named individuals — classmates, club opponents or famous players — for engine use. The Olympiad screen in Case Study 2 is anonymised; keep any extension anonymised too.
  2. Method, not suspects. Every fair-play exercise asks what a method would flag by chance, never who is guilty.
  3. Describe Regan's work generally. The chapter describes its principles and points to his own papers; do not attribute specific thresholds or cases to him in class.
  4. Base rates first. Before any z-score is discussed, compute how many honest flags a field produces (Case Study 2, question 2: about 1.7 flags with roughly 60% honest players, even with a perfect detector at z ≥ 3).
  5. If a real case comes up, say that fair-play decisions belong to arbiters and platforms with far more evidence than a game score, and move on.

How the four tracks use this chapter

  • ♟️ Improver: 32.1–32.3 and 32.6: what the numbers measure, why missed wins count, why your ACPL depends on your opponent. Exercises A1, A2, A5, A7, B1–B6, D1, D2.
  • 📊 Analyst: 32.4–32.6 and the lab: correlation, Bland–Altman, kappa, z-scores (Appendix E). Exercises A4, A6, A9, C1–C5, M2, M5, E1–E3; Case Study 2.
  • 🏆 Competitor: not routed in the chapter, but Case Study 1 (elite numbers at the top) and Part B's only-move positions suit tournament players.
  • 💻 Developer: 32.8 and outpost/accuracy.py: stored_moves, analyse_batch, multipv_batch, safe_moves, player_games, agreement, cohen_kappa, margin_of_error, games_needed, match_z, cost_estimate, time_it. Exercises C2, C6, D3.

Running the code

Script What it shows Notes
code/01_metric_definitions.py Price table, Anchor B scored twice, cp vs win-% labels on 2,000 blitz games Fast
code/02_population_metrics.py Hook table, ACPL spread, opponent effect, champions Stored evaluations only
code/03_agreement_study.py The 80-game study; writes code/ch32_agreement_plies.csv.gz (0.21 MB, every position's FEN) 730 s uncached on 3 workers; about a minute cached
code/04_depth_effects.py d8/12/16/18 on 16 games, d20 on 6; timings in ch32_depth_timing.json About 15 min uncached
code/05_difficulty_and_matching.py d12 multi-PV 3 on 2,259 positions; logistic sketch About 3 min uncached
code/06_scaling.py Workers, cache, cost model Timings in ch32_scaling_timing.json
code/07_exercise_positions.py, case_study_01.py, case_study_02.py, project_checkpoint.py Exercises, case studies, module demo Outputs in code/out_*.txt

Expect 7 board diagrams and 7 charts in the chapter text. On Windows, parallel scripts must run under if __name__ == "__main__":. engine.analyse_games_parallel prints a harmless pandas FutureWarning. Timings were measured on a shared machine; students' numbers will differ, which is itself a lesson (32.8: "measure throughput on your own machine").

The agreement lab (55 minutes)

  1. Predict (5 min). Each pair writes guesses for: position r, ACPL mean absolute difference, accuracy mean absolute difference, blunder kappa.
  2. Run (5 min). python code/03_agreement_study.py from the chapter directory (cached), or open code/out_03.txt.
  3. Positions (10 min). From ch32_agreement_plies.csv.gz, compute r and the share of positions within 50 cp for one band. Compare with 0.993 and 84.4%.
  4. Labels (10 min). Build the 4 × 4 label table for your band; compute blunder kappa with accuracy.cohen_kappa. Find a disagreement that jumps two categories (there are almost none).
  5. Player-games (10 min). Compute bias and Bland–Altman limits for ACPL and accuracy with accuracy.agreement. Explain why accuracy agrees better.
  6. Investigate (10 min). Take your band's largest disagreement and evaluate it at depth 24. Which source was closer?
  7. Write-up (5 min). Three sentences: what is interchangeable, what is not, and one rule for comparing your number with a table.

A fresh, uncached run can differ by a few centipawns (hash state); that is expected and worth a sentence in the write-up.

In-class demos

Board demo

Set up the productive-struggle position 2r1r1k1/pp2bpp1/2qp1n1p/3N4/4P1n1/1N6/PPP2BPP/1R1Q1RK1 w - - 2 18. Ask: "How many moves keep the balance?" Take guesses, then candidate moves. Many choose 18.Nxf6+. Reveal: the only move is 18.Nd4 (+0.01 at depth 20, multipv 3); 18.Nxf6+ opens the c6–e4 diagonal and loses the e4-pawn. Then show the many-safe-moves position (12...Nxg4 −0.66, 12...Bxd5 −0.58, 12...Nbd7 −0.41) and ask: "Should a player be blamed for not matching the engine here?"

Data demo

Project the depth-flip position (3r3k/ppq3pp/n1p2n2/2P5/2BR4/P1N1Q2P/1P4P1/6K1 w - - 5 29) and its ten-depth output. Ask students to predict before revealing each line. Depth 12 alone prefers 29.Rxd8+ (+0.78); every depth from 14 to 26 prefers 29.Ne4, wobbling between +1.86 and +2.54. Then project the cost table and ask: "You have 10,000 games. What depth, and why?"

Exercise guidance

  • Part A: everyone. A2 contains a nice trap (at +5.00 the printed 5.0 is really 4.96, so the label is "ok"). A4 (correlation vs agreement) is essential for the lab.
  • Part B: six only-move positions; demand the reason the alternatives fail. B2 (36.Qe4, 0.00; everything else about −6.5) and B6 (13.Qh6, the pinned f7-pawn) are the clearest.
  • Part C: C2 (a bullet agreement study at depth 12) is the natural lab extension; C3 shows labels rarely jump two categories.
  • Part D: D4 ("my opponent played 96%…") is the fair-play writing task — grade it on numbers used and on tone.
  • Part M/E: M2 ranks metrics by fragility; E2 (intrinsic performance, small scale) is a strong term project.

Quiz question 20 uses the same position as Exercise B4 (14...exd4!); don't assign both in the same assessment.

Assessment ideas

  1. Lab report. The seven-step agreement lab, graded on predictions vs results, correct use of limits of agreement, and the closing rule.
  2. Depth decision memo. Given a budget (for example, four hours on three workers), students choose depths for three jobs, citing the cost table and stability results.
  3. Base-rate problem. A field of 400 players, an assumed cheating rate and a z ≥ 3 test: expected flags and the share that are honest players.
  4. Quiz. 20 questions fit a 25-minute slot.
  5. Developer milestone. accuracy.player_games on the student's own games, with margin_of_error, a stored-vs-engine comparison on five games, and a stated setup.