Chapter 23 Instructor Notes: Engine-Assisted Preparation
Chapter text · Case study 1 · Case study 2 · Exercises · Quiz · Key takeaways
This chapter turns the opening knowledge of Chapters 19–22 into a preparation routine, and it continues Anchor C: Dev's Najdorf "problem" from Chapter 20, now treated as what it really was — a frequent, hard position at his level, not a proven personal weakness. The chapter has two jobs. The first is procedural: database → engine → model games → must-know positions, always in that order. The second is critical: the engine's number has blind spots (depth, horizon, "equal but unplayable"), and preparation itself has limits. Lena's Stafford Gambit in the hook (+2.11 for White, yet club White scores 48.3%) and Dev's English Attack in 23.8 (fine after move 10, losing in the middlegame) are the two poles. Spend real time on both.
Learning objectives
From the workflow in 23.1 and the chapter's summary, students should be able to:
- Prepare a line in four steps, in order — the database question (what will actually be played?), the engine question (what does each choice lead to?), the model-game question (what is the plan?), the must-know question (where do people like me go wrong?).
- Read engine output as a ranking with error bars: gaps under about 0.2 pawns are ties; state the depth; check a second depth; say whether a ranking is multi-PV or single-line.
- Explain the horizon effect and the "engine-equal is not human-equal" gap, with the chapter's numbers.
- Compute and interpret a must-know score (reach × error rate × mean cost).
- Match preparation depth to their level using the book-exit data.
- Say what preparation can and cannot repair in their own games.
Timing plan
75-minute session
| Minutes | Activity | Notes |
|---|---|---|
| 0–8 | Hook: the Stafford after 4...dxc6 | Vote: "Who is better?" Reveal +2.11 (depth 20) and 48.3% at Lichess 1400–1799. |
| 8–20 | The four-step workflow | Steps 1 and 2 on the English Attack tabiya: 6...e5 71.5% of master games vs about 55% at Lichess 1500–1799. |
| 20–32 | Step 4: must-know positions | Productive struggle first ("where would club players go wrong?"), then 10.f3? Ne3! |
| 32–47 | 23.6 blind spots | Depth ladder; the horizon example (+1.29 → +9.18); the 331-position scatter (r = 0.09). |
| 47–60 | 23.7 how deep to prepare | Book-exit table; the cost of the first move off book. |
| 60–72 | 23.8 Dev: what preparation can and cannot fix | The 06_dev_najdorf.py output block; "what we will not claim". |
| 72–75 | Exit ticket |
3-hour block
| Minutes | Activity | Notes |
|---|---|---|
| 0–15 | Hook and Lena/Dev/Sam dialogue as role-play | |
| 15–45 | Steps 1–2 hands-on | Students query the masters explorer at the tabiya, then compare a multi-PV and a single-line search. |
| 45–70 | Step 3: Case Study 1, Polgar–Gelfand 1996 | Locate the game in the tree; five moments with the engine as referee. |
| 70–95 | Step 4: must-know | English Attack (23.5) then the Stafford (Case Study 2): contrast error rates. |
| 95–105 | Break | |
| 105–130 | 23.6 blind spots | Depth ladder, horizon, practical residual, the gambit table. |
| 130–150 | 23.7 and 23.8 | Book exit by band; Dev's two-half plan. |
| 150–175 | Workshop: build a one-page prep card | Each student picks one line from their own repertoire. |
| 175–180 | Exit ticket |
Key numbers and games
| Item | Value as quoted | Where |
|---|---|---|
| Stafford after 4...dxc6 | +2.11 (Stockfish 19, depth 20); model implies about 68.5%; club White 48.3% [42.1–54.5] (406 games, Lichess 1400–1799) | Hook; 23.6 |
| Anchor C recap | Dev's 6.Be3 as White 36.0% [24.1–49.9] over 50 games; band 44.3% (97 games) vs 49.0% across all blitz ratings (801) | Hook; 23.8 |
| English Attack tabiya, masters | 6...e5 in 71.5% of 45,847 games | 23.2 |
| OTB and Lichess shares | 6...e5 73.6% of OTB games below FIDE 2000; about 55% (55.3% of 73 games) at Lichess 1500–1799 | 23.2; summary |
| Engine at the tabiya | Four main replies +0.31 to +0.37 (depth 22, multi-PV 4); tabiya wobbles +0.25 to +0.55 from depth 6 to 26 | 23.3; 23.6 |
| After 6...Ng4 (single line, depth 22) | 7.Bc1 +0.41, 7.Bg5 +0.25, 7.Qd3 −0.08, 7.Qe2 −0.13, 7.Qf3 −0.24, 7.Bd2 −0.41, 7.Be2 −1.26 | Exercise B3; 23.8 |
| Must-know #1 | After 6...Ng4 7.Bg5 h6 8.Bh4 g5 9.Bg3 Bg7: 10.f3? (21% of the tree) Ne3! −1.71 (depth 22) | 23.5 |
| Must-know #3 | After 6...e5 7.Nb3 Be7 8.f3 Be6 9.Qd2 O-O: 10.g4 (26%) d5! −0.37; 10.O-O-O +0.31 (depth 22) | 23.5 |
| Horizon | Dev's position at move 32: +1.29 at depth 6 (32.b4) → +9.18 at depth 10 (32.Bc5+) → +9.68 at depth 24 | 23.6 |
| Shallow vs deep | 577 undecided positions: depth 6 vs 16 differ by ≥1 pawn in 73 (12.7%), ≥2 in 29; median 20 cp | 23.6 |
| Eval vs club score | 331 positions: r = 0.092; 154 engine-equal positions range 37.4%–63.9% (21 intervals exclude 50%); 11 of 32 "better" sides score below 50% | 23.6 |
| Practical gap persists | 125 positions: residual SD 4.9 (club) vs 5.5 (2000+); r(residuals) = 0.414 | 23.6 |
| Engine-equal examples | Caro-Kann 2.Nc3 d5 3.exd5 cxd5 4.d4 Nf6: +0.00, club White 37.4% (194); Göring 4...dxc3: −0.07, club White 63.9% (188), masters 48.4% (253) | 23.6 |
| Book exit (median ply) | Lichess 4–8 by band; OTB classical 7–12 | 23.7 |
| First move off book | Costs 5.21 win-% points below 1000 → 2.05 at 2400+; a mistake 11.95% → 1.51%; in-book moves about 1 | 23.7 |
| Leaving book first | Leaver scores 48.5–49.1% Lichess, 47.5–49.7% OTB | 23.7 |
| Dev's 19 move-text games | W/D/L 5/0/14; median +0.21 after move 10; first mistake Dev 7, opponent 12; losses: opening phase 6, middlegame 7; accuracy 92.8 → 82.9 | 23.8 |
| Dev's turning point | 16.Bxd5! +6.63 (depth 22); he played 16.Rhe1 (−1.36 at depth 16) | 23.8; Exercise B2 |
| Polgar–Gelfand, Novgorod 1996 | After 14.exd5 −0.44 (depth 24); after 27...Qf6: 28.Bxf5+ +3.61 (depth 18) / +6.80 (depth 24) | Case Study 1 |
| Stafford case | 837 games (weighted 3,581); 5.d3 44.6%, 5.Nc3 46.9%, 5.e5 59.2% (+0.96); after 5.Nc3 Bc5, 6.h3 +2.12 (depth 24); error rates 28–66% | Case Study 2 |
Model game in the text: Van Foreest–Giri, Tata Steel Masters 2026 (English Attack with 9...h5; 17...Bf5 the only move — Exercise B6).
Threshold concepts and likely misconceptions
Threshold concept: an engine evaluation describes perfect play; a score describes people. Once students see the 331-position scatter (r = 0.09) they stop reading "+2" as "I will win" and start asking two separate questions: what is the position worth, and how hard is it to play? The must-know score is that second question turned into a to-do list.
Misconceptions to expect:
- "Start with the engine." Step 2, never step 1. Preparing the engine's top line means preparing a tree chosen partly by noise (four replies within 0.06 of each other).
- "The masters' main line is what I'll face." At Lichess 1500–1799 about 45% of Black players avoid 6...e5; 11 of Dev's 19 opponents did not play it.
- "One number is the evaluation." The depth ladder and multi-PV vs single-line disagreements say otherwise. Exercise B4 and section 23.5 give different best moves for the must-know node at different depths (depth 22: 10.h3 +0.32, 10.Qd2 +0.28; depth 24 multi-PV 3: 10.Qd2 +0.45, 10.h3 +0.34) — use it as a teaching point, not an error.
- "Equal is fine for me." The Exchange Caro-Kann with 2.Nc3 is +0.00 and scores 37.4% for club White.
- "More theory = better preparation." At Lichess 1200–1399 the median game leaves master book at ply 5.
- "Preparation fixed Dev's Najdorf." The chapter explicitly refuses this claim. With 100 more games the interval would still be about ±10 points wide.
How the four tracks use this chapter
- ♟️ Improver: 23.1, 23.2, 23.6 and 23.7 closely; the 📋 exercises; skim code. Their takeaway is the book-exit table and "the first move you choose on your own is where points go". Exercises A1, A5, A8, B3, B4, D1.
- 🏆 Competitor: the workflow (23.1–23.5) as a routine; apply it to one line of their own; 23.7's OTB table for how deep classical opponents stay in book. Case Study 1. Exercises B4–B6, D2, E1.
- 📊 Analyst: 23.6 and 23.7 — two studies over hundreds of thousands of games. Check weighting (un-analysed Lichess games ×8), selection caveats, and the exact-sequence definition of "book". Exercises C3, C4, E2.
- 💻 Developer:
outpost/prep.py:GameBook,engine_candidates,move_cost,depth_check(flags "unstable" if the best move changes or the spread exceeds 50 cp),model_games,prep_node,must_know,book_exit,prep_card. Exercises C5–C7 (C7 builds a transposition-aware exit).
Running the code
| Script | What it shows | Runtime and data |
|---|---|---|
code/01_database_step.py |
Replies to 6.Be3 by database and band | Masters explorer cache, broadcast games, Lichess move text |
code/02_engine_step.py |
Multi-PV at depth 22, horizon scan of Dev's games, depth ladder | Engine cache; depths 6–26 |
code/03_equal_is_not_equal.py |
331 positions, eval vs club score | Lichess move text; writes a CSV of the positions |
code/04_must_know.py |
English Attack must-know tree | Broadcast + Lichess games; engine cache |
code/05_depth_by_level.py |
Book exit ply by band; cost of leaving book | Master games (1990+), Lichess sample, broadcast games |
code/06_dev_najdorf.py |
Dev's 19 move-text games at depth 16 | Persona games |
code/07_model_games.py |
Van Foreest–Giri | Broadcast games |
code/case_study_01.py, case_study_02.py |
Polgar–Gelfand; the Stafford workflow | Master games; Lichess move text |
code/project_checkpoint.py |
prep.py demo |
Each Lichess move-text pass takes about a minute per script; engine work runs through the cache with at most three worker processes, so reruns are quick. Saved outputs are in code/_out*.txt for students without the data.
Three warnings. (1) Multi-PV and single-line cache entries for the same position and depth give different numbers — after 6...e5 7.Nb3 Be6 8.f3, a single-line depth-22 search gives +0.41 with 8...Be7 first, while a multi-PV 4 search at the same depth ranks 8...Nc6 first at +0.27 (section 23.3). Students must label which they quote. (2) The "book" is exact move sequences played at least five times in PGN Mentor games from 1990 on; a transposition counts as an exit, so compare bands, not absolute depths. (3) The chapter's Lichess bands for Dev's tree are 1500–1799 (the move-text subset at this node is small); say so when students compare with Chapter 20's band.
In-class demos
Board demo
Set up the position after 1.e4 c5 2.Nf3 d6 3.d4 cxd4 4.Nxd4 Nf6 5.Nc3 a6 6.Be3 Ng4 7.Bg5 h6 8.Bh4 g5 9.Bg3 Bg7. Ask: "You play the English Attack every week. What's White's move?" Most will say 10.f3 — it is the move White plays in nearly every other line. Play it, then 10...Ne3! and walk the geometry: the bishop that guarded e3 has gone to g3, so the f2-pawn was the last guard, and f2–f3 removed it; the g7-bishop is already aimed at d4. Show −1.71 (depth 22), then the quiet alternatives (10.h3, 10.Qd2). Close with the general lesson in the chapter's words: in a sideline, the main-line reflex is the most dangerous move on the board. Then repeat with the Stafford's 6.h3 after 5.Nc3 Bc5 for contrast — the same prophylactic idea from Chapter 7.
Data demo
Project the 331-position scatter (fig-03) with the axes labelled and the correlation hidden. Ask students to guess r. Most guess 0.5 or higher. Reveal 0.09. Then show the gambit excerpt (Stafford, McConnell, Englund, Elephant) and the cross-level check: r(residuals) = 0.41 between the 1400–1799 and 2000+ bands. Ask: "Is the gap about the position, or about the players?" The chapter's answer is "both" — part travels with the position, part is selection (specialists choose gambits).
Exercise guidance
- Part A: everyone. A4 (why multi-PV and single-line differ) and A8 ("equal for the engine = equally good for me") are the conceptual traps.
- Part B: Improver and Competitor.
- B1 and B7 (horizon tactics from Dev's games): students who use a phone engine at low depth will "confirm" the wrong move — make that the point.
- B3: students rank 7.Qf3 as "fine development". It is −0.24 at depth 22 and allows ...Nxe3; 7.Be2 (−1.26) is the one Dev actually lost with.
- B4: 10.f3 is the wrong answer most students give.
- B5: students defend 10.g4 as "the English Attack plan". The problem is timing: 10...d5! with the king still on e1.
- B6: students list three "playable" moves; only 17...Bf5 holds (+0.39 vs about +5.1 for the others).
- B8: 6.Bc4 (natural development) is the common answer; 6.h3! is the must-know move.
- Part C: Analyst C1, C3, C4; Developer C2, C5–C7.
- Part D: D1 (the 1250 who wants the Najdorf to move 20) and D4 ("engines made preparation pointless below 2000") are the best written assignments; a strong D4 agrees about theory depth and disagrees about must-know positions.
- Part M: M4 revisits Anchor C with Chapter 20; check that students quote the interval, not just the 36.0%.
Assessment ideas
- One-page prep card. Students run the four steps on one line of their own and submit a single page: replies covering ~80% of games at their level with raw n, multi-PV at depth 20+ with a second depth, one model game per structure, three must-know positions. Grade on the order of the steps and the honesty of the sample sizes.
- Engine-claim audit. Give three evaluations without depth or search type; students rewrite each correctly and say whether the conclusion would survive a second depth.
- What can preparation fix? Short essay using Dev's 23.8 output: separate the six opening-phase losses from the seven middlegame losses and propose a study plan for each half. Penalise any claim that his rating or score improved.
- Quiz. 20 questions (11 multiple choice, 5 true/false, 3 short answer, 1 position). Questions 14 (the leaver's cost is one to two and a half points, not ten), 15 and 18 test the chapter's statistical reasoning.
- Developer milestone.
must_know()reproduces the English Attack top node;depth_check()flags the horizon position as unstable.