Thursday night at the Hartwell library. The chess club has the back room; Dev Raman has the corner
In This Chapter
- 20.1 A Repertoire Is a Decision Tree, Not a List of Openings
- 20.2 The Database Method: Frequency, Score, Level, Masters
- 20.3 Sample-Size Discipline: Confidence Intervals Before Conclusions
- 20.4 Engine Analysis: Where Do the Games Actually Go Wrong?
- 20.5 Model Games: Learning the Plans of a Branch
- 20.6 Style Fit and Practicality
- 20.7 Building Dev's Repertoire, Step by Step
- 20.8 At Different Levels — and Grace's Over-the-Board Repertoire
- Spaced Review
- Project Checkpoint: repertoire.py
- Chapter Summary
- What's Next
Chapter 20 — Building an Opening Repertoire: Database Research, Engine Analysis, and Choosing Lines That Fit Your Style
Thursday night at the Hartwell library. The chess club has the back room; Dev Raman has the corner table, a laptop, and the look of someone who has just found a bug in production.
Dev: I ran my White games through a script. Look at this. Italian Game: sixty-seven and a half percent. Najdorf with 6.Be3: thirty-six. Thirty-six! That's a thirty-point gap. I'm dropping the English Attack tonight.
Grace: Thirty-six out of how many?
Dev: Fifty games. That's a lot of games.
Sam: In 1985 I gave up the King's Gambit after losing three in a row to the same man. Turned out he was just better than me.
🎭 Composite data: Dev's games are real Lichess games played by anonymous players at his rating, assembled into one "player" so we can demonstrate the method on your own games.
Dev's numbers are real — they come straight out of code/02_dev_query.py, run against his 300 games as
White in Lichess blitz (his side rated 1550–1750):
line n W D L score lo hi elo_exp db_n db_score verdict_vs_db verdict_vs_elo
Italian Game 80 53 2 25 67.5% 56.6% 76.8% 50.1% 16713 51.6% above above
Najdorf 6.Be3 50 18 0 32 36.0% 24.1% 49.9% 46.2% 47 53.2% cannot tell cannot tell
Here are the two positions he is comparing. On the left of his spreadsheet, the Italian Game after 3.Bc4; on the right, the Najdorf Sicilian after 6.Be3, the English Attack.

♟️ Position: White Ke1, Qd1, Ra1, Rh1, Bc1, Bc4, Nb1, Nf3, a2, b2, c2, d2, f2, g2, h2, e4; Black Ke8, Qd8, Ra8, Rh8, Bc8, Bf8, Nc6, Ng8, e5, a7, b7, c7, d7, f7, g7, h7 — Black to move. FEN:
r1bqkbnr/pppp1ppp/2n5/4p3/2B1P3/5N2/PPPP1PPP/RNBQK2R b KQkq - 3 3

♟️ Position: White Ke1, Qd1, Ra1, Rh1, Bf1, Be3, Nc3, Nd4, a2, b2, c2, f2, g2, h2, e4; Black Ke8, Qd8, Ra8, Rh8, Bc8, Bf8, Nf6, Nb8, a6, d6, b7, e7, f7, g7, h7 — Black to move. FEN:
rnbqkb1r/1p2pppp/p2p1n2/8/3NP3/2N1B3/PPP2PPP/R2QKB1R b KQkq - 1 6
Neither position is bad for White. Stockfish 19 rates the Italian tabiya at +0.08 (depth 18) and +0.11 (depth 24), the English Attack at +0.32 (depth 18) and +0.40 (depth 24). If anything, the engine likes Dev's "losing" opening more. So whatever is going on in Dev's spreadsheet, it is not that 6.Be3 is refuted.
Grace asked the right question, and Sam told the right story. Fifty games sounds like a lot. It is not.
The two columns Dev skipped — lo and hi, the edges of a 95% confidence interval — say his true
Najdorf score could be anywhere from about 24% to 50%. His own rating-based expectation in those games
(46.2%) sits inside that range. So does the database's figure for players at his level. The data cannot
tell a "Najdorf problem" from a bad run of luck. His Italian, on the other hand, clears the database
expectation even at the bottom of its interval.
This chapter is about building an opening repertoire the way a careful analyst would: as a decision tree you can draw, with a database expectation at every branch, an engine check of the key positions, an honest confidence interval on every number about you, and a choice of lines that fits the way you actually play. Dev's query is our running example — Anchor C of this book — and by the end of the chapter he will still study the Najdorf. Just not for the reason he thinks.
♟️ Improver Track: Read 20.1 (the tree), 20.3 (why fifty games is not many), 20.5 (model games) and 20.7 (the step-by-step recipe). Skip the code blocks; the diagrams and the tables carry the argument. Your takeaway is a one-page repertoire built around plans, not move lists.
📊 Analyst Track: 20.2–20.4 and 20.6 are yours: database expectations by rating band, Wilson intervals, a null simulation of "forking paths", coverage curves and the prep-load metric. Case Study 2 applies the method to Grace's over-the-board defence.
🏆 Competitor Track: 20.5 (model games — Polgar–Gelfand 1996 and Vachier-Lagrave–Tabatabaei 2026), 20.8 (what changes for classical OTB play) and Case Study 1 (Topalov–Kasparov 1994). Treat the exercises in Part B as preparation drills.
💻 Developer Track: The Project Checkpoint builds
outpost/repertoire.py: a repertoire tree from your games, a database expectation and a confidence interval at every node, coverage, prep load and a shrinkage-based study list.
20.1 A Repertoire Is a Decision Tree, Not a List of Openings
Ask a club player for their repertoire and you usually get a list: "Italian with White, Caro-Kann and King's Indian with Black." That list leaves out most of what matters. What do you play when Black answers 1.e4 with 1...c5? With 1...d5? What if, after 1.e4 c5 2.Nf3, Black plays 2...d6 and you planned for 2...Nc6? A repertoire is not a set of names. It is a set of answers.
📐 Definition — opening repertoire: the set of moves you intend to play in the opening, for both colours, organised as a repertoire tree: each node is a position; at your nodes you have chosen one move (occasionally two); at your opponent's nodes you have an answer ready for every reply that occurs often enough at your level to matter. A repertoire is complete to depth d when every opponent reply above your chosen frequency threshold has an answer down to ply d.
The asymmetry in that definition is the most important idea in this chapter. At your nodes the tree does not branch: you pick one move and the other legal moves vanish from your preparation. At your opponent's nodes it branches as widely as your opponents do. That is why "pick a system" openings (the London, the King's Indian Attack, the Hedgehog) are popular with busy players — they try to make your own nodes as uniform as possible — and why defences against 1.e4 feel heavier than anything you play as White: as Black you meet White's choices on move 2, 3 and 4, before you have made many of your own.
Dev's tree, drawn from his own games
We can read a repertoire tree directly from your games. outpost.repertoire.build_tree walks every game
move by move and accumulates, at every node, how many games passed through it and how many points the
repertoire side scored. Here is Dev's White tree (games with recorded moves — 269 of his 300), with the
database at his level beside each node:
* 1.e4 n=268 100% score 55.6% [49.6%-61.4%] db 50.8% (n=44,747)
1...e5 n=130 49% score 65.4% [56.9%-73.0%] db 52.0% (n=16,600)
* 2.Nf3 n=104 80% score 65.4% [55.8%-73.8%] db 52.0% (n=10,201)
2...Nc6 n=89 86% score 65.2% [54.8%-74.3%] db 52.5% (n=6,719)
* 3.Bc4 n=68 76% score 66.9% [55.1%-76.9%] db 52.7% (n=2,798)
* 3.d4 n=12 13% score 58.3% [32.0%-80.7%] db 54.4% (n=1,543)
* 2.Bc4 n=12 9% score 66.7% [39.1%-86.2%] db 50.8% (n=1,732)
1...c5 n=53 20% score 46.2% [33.5%-59.4%] db 49.9% (n=8,452)
* 2.Nf3 n=37 70% score 44.6% [29.8%-60.4%] db 49.9% (n=4,336)
2...d6 n=21 57% score 33.3% [17.2%-54.6%] db 53.9% (n=1,159)
* 3.d4 n=19 90% score 36.8% [19.1%-59.0%] db 53.1% (n=559)
2...Nc6 n=10 27% score 60.0% [31.3%-83.2%] db 49.7% (n=2,105)
Lines marked * are Dev's own decisions; the others are his opponents'. The percentage after n= is
the share of the parent's games that took this branch. The database column ("db") is the score White
achieved at the same node in every other blitz game in our Lichess sample with White rated 1550–1750 —
74,220 games with recorded moves, weighted to stand for 373,995 (because most un-analysed games were
kept one-in-eight, as Chapter 1 explained).

📊 Figure (described): Dev's White repertoire tree to ply 5, drawn from his 269 games with moves. Node size is the number of games, the label gives games and score, and the colour shows Dev's score minus the database score at the same node (purple above, orange below). The 1...e5/Italian trunk is big and purple; the 1...c5 2.Nf3 d6 branch is small and orange.
Three things jump out. First, the tree is lopsided: half of Dev's opponents answer 1.e4 with 1...e5, a fifth with 1...c5, and the rest scatter. Second, the orange branch — 1.e4 c5 2.Nf3 d6, the road to the Najdorf — is only 21 games. Third, Dev has made decisions he never consciously took: after 1.e4 e5 he plays 2.Bc4 in 9% of games and 2.Nf3 in 80%; after 2...Nc6 he plays 3.d4 (the Scotch) in 13%. A repertoire you have never written down is still a repertoire. It is just one you have not checked.
What you will face depends on your level
A repertoire is built for the opponents you actually meet, so the opponent nodes must be weighted by
your rating band. Our Lichess sample makes the point brutally. Here is what Black plays against 1.e4 in
balanced blitz games, by the average rating of the two players (code/03_repertoire_tree.py):
reply e5 c5 d5 e6 c6 d6 g6 other n
band
<1000 57.7 5.8 12.0 6.2 5.9 3.2 1.7 7.5 12182
1000-1199 54.6 8.0 11.7 7.1 7.1 3.6 2.2 5.7 20717
1200-1399 49.4 10.8 11.0 8.6 8.1 3.6 2.9 5.6 30228
1400-1599 43.5 14.7 10.7 9.7 8.8 3.6 3.1 5.9 38666
1600-1799 36.7 18.6 11.1 10.9 9.7 3.9 3.5 5.6 39157
1800-1999 28.6 24.0 10.4 12.1 10.8 4.6 3.5 6.0 30405
2000-2199 22.8 28.8 7.8 13.1 11.9 5.5 3.4 6.7 16256
2200-2399 20.6 34.1 5.6 12.6 12.3 5.8 2.5 6.5 6500

📊 Figure (described): Share of each Black reply to 1.e4 in Lichess blitz, balanced games, by average-rating band (weighted shares). 1...e5 falls from 57.7% below 1000 to 20.6% at 2200–2399, while 1...c5 rises from 5.8% to 34.1%; the French and Caro-Kann climb more gently and the Scandinavian (1...d5) fades above 2000.
Below 1000, a 1.e4 player meets 1...e5 in well over half the games and the Sicilian in one game in seventeen. At 2200, the Sicilian is the single most common reply. The book's opening-family tables tell the same story from a different angle: the Sicilian is 4.8% of all balanced Lichess games below 1200 and 12.9% at 2200–2399. If you are 1200 and spending your evenings on Najdorf theory, you are preparing for a game you will rarely get. If you are 2000 and have nothing against 1...c5, you are unprepared for your most common opponent.
🔍 Why this works: A repertoire tree is the right shape because chess alternates choices. At your node, the value of the position is the value of your best move — you control which branch happens, so only one branch needs preparing. At your opponent's node, the value to you is a weighted average over their replies, weighted by how often each one is actually played at your level. Preparation effort should follow the same arithmetic: deep and narrow under your own moves, wide and frequency-weighted under theirs.
🔄 Check your understanding 1. Why does a Black repertoire against 1.e4 usually need more prepared positions than a White repertoire starting with 1.e4? 2. In Dev's tree, 2...d6 accounts for 57% of the games after 1.e4 c5 2.Nf3. What share of all of Dev's White games reach 1.e4 c5 2.Nf3 d6?
Answer
- As Black you face White's choices at move 1, 2, 3… before you have made many choices of your own; every White option at a node you reach must be answered. As White you choose at ply 1, 3, 5… and each choice removes all the alternatives from your preparation.
- Multiply the shares down the path: 1...c5 is 20% of 1.e4 games and 2.Nf3 is 70% of those, then 2...d6 is 57%: 0.20 × 0.70 × 0.57 ≈ 8%. The study table in 20.7 confirms it: 21 of 269 games (7.8%).
20.2 The Database Method: Frequency, Score, Level, Masters
At every node of a repertoire tree, a database answers four questions. Ask them in this order.
- How often? What share of games at my level reach this node, and what share of those continue with each reply? (Frequency decides what to prepare.)
- How does it score — and on how many games? Score from your side, with the sample size beside it. (Score is a weak signal; the sample size tells you how weak.)
- At which level? The same node can score differently for 1200s and 2200s, because the typical mistakes differ. (Use your band, then check one band above.)
- What do masters do? The masters' moves tell you which replies are serious; the club database tells you which ones are common. You need both lists.
Four databases, four answers
For key positions, the book's data snapshot gives us three pools and the Lichess masters explorer a fourth. From the book's opening-statistics tables, the Italian position after 1.e4 e5 2.Nf3 Nc6 3.Bc4 looks like this from White's side:
| Pool | Games | White score | Draw rate |
|---|---|---|---|
| Masters explorer (OTB master games) | 51,257 | 53.0% [52.6–53.5] | 47.4% |
| Lichess sample (all speeds, weighted) | 30,375 | 51.6% [50.9–52.3] | 3.6% |
| Broadcast OTB (balanced, FIDE ratings) | 3,823 | 54.3% [52.7–55.9] | 32.2% |
Three pools, three draw rates — 47.4%, 3.6% and 32.2% — and three scores within about three points of each other. The draw rate tells you more about the pool than about the opening: fast online games almost never end in agreed draws, master games often do. The score barely moves. That is typical. An opening's database score is a small number sitting on top of large differences between players.
⚠️ Common pitfall: Choosing an opening because it "scores 54%". Opening scores are confounded by who chooses the opening — stronger or better-prepared players gravitate to some lines, aggressive blitz players to others. In our Lichess data, differences of 1–2 points between opening families are within what that selection alone can produce. Use scores to spot large problems (a line that scores 40% at your level), never to rank sound openings against each other.
The English Attack, four ways
Now Dev's line. What does Black play after 6.Be3, and how does it score? code/05_model_games.py asks the
masters explorer (cached, retrieved 2026-11-20) and our Lichess blitz games:
Masters explorer after 6.Be3 (retrieved 2026-11-20): 45,847 games, White 53.7%, draws 60.1%
6...e5 32,783 (71.5%) White 53.2%
6...e6 8,115 (17.7%) White 55.2%
6...Ng4 4,246 (9.3%) White 54.6%
Lichess blitz, White 1550-1750: games reaching 6.Be3 with moves 20 (weighted 90); White 37.8%
Lichess blitz, all ratings: games reaching 6.Be3 with moves 234 (weighted 703); White 48.2%
6...e5 145 games share 57.5% White 40.6% [29.6%-52.6%]
6...e6 42 games share 18.9% White 65.4% [44.0%-82.0%]
6...Ng4 21 games share 11.0% White 63.6% [35.7%-84.7%]
Look at the sizes. Masters have played the English Attack 45,847 times. Our Lichess sample — every rated standard game in 34 hours, four million in all — contains only 20 blitz games with recorded moves that reach 6.Be3 by this exact move order with White rated 1550–1750. (The broader count by opening name, which catches transpositions and games without recorded moves, is 97.) The Najdorf is a famous opening; at Dev's level it is a rare one. The frequency answer is clear — at every level, about seven Black players in ten who reach 6.Be3 continue 6...e5 among masters, a little under six in ten in Lichess blitz, with 6...e6 and 6...Ng4 sharing most of the rest. The score answer at Dev's level is essentially "we do not know" — twenty games cannot tell us.
📐 Definition — database expectation: the score a typical player at your level achieves from a node, measured on games that do not include yours: same speed, same colour, the repertoire side's rating in your band. It is the yardstick for your own score at that node. When it rests on thousands of games it can be treated as fixed; when it rests on dozens, it is itself an estimate with an interval.
What White plays against the Sicilian, by level
The same logic applies from the other side of the board. If Dev were a Sicilian player, what would he
face? code/07_grace_black.py splits White's second move after 1.e4 c5 by band, and counts how often the
game reaches an Open Sicilian (2.Nf3, then ...d6, ...Nc6 or ...e6, then 3.d4 cxd4 4.Nxd4) by ply 7:
w2 Nf3 Bc4 Nc3 d4 c3 f4 open_sicilian_by_ply7 n
band
<1000 35.5 15.8 12.3 14.1 2.7 1.7 3.9 739
1000-1199 43.4 16.4 7.4 11.9 4.0 3.1 5.9 1877
1200-1399 47.0 16.5 8.7 9.3 4.1 4.5 11.1 3652
1400-1599 48.2 14.7 7.8 8.0 5.9 5.2 13.2 6155
1600-1799 51.1 9.9 8.5 7.7 7.8 6.8 18.6 7613
1800-1999 52.6 6.3 10.1 7.8 8.6 6.6 22.0 7592
2000-2199 56.3 2.8 12.5 8.5 8.5 3.5 25.3 4831
2200-2399 60.9 0.5 14.0 7.5 7.7 1.6 29.8 2312
At 1000–1199, a Sicilian player sees 2.Bc4 in 16.4% of games and reaches a main-line Open Sicilian in 5.9%. At 2200–2399, 2.Bc4 has all but disappeared (0.5%) and three games in ten are Open Sicilians by move 4. A Sicilian repertoire for a 1200 must handle 2.Bc4, 2.d4 and 2.Nc3 first; the Najdorf main lines can wait. That is not a judgment about which moves are good. It is a judgment about where the games are.
📋 Try it — Database research: Using the band table above, estimate how many of 100 Sicilian games a 1400–1599 player would reach via 2.Nf3, and how many would be Open Sicilians by ply 7. Then decide: should their first study session be on an Open Sicilian main line or on 2.Bc4, 2.d4 and 2.Nc3?
Answer
About 48 of 100 begin 2.Nf3 (48.2%), but only about 13 reach an Open Sicilian by ply 7 (13.2%) — many 2.Nf3 games branch into other third moves or other second moves for Black. Meanwhile 2.Bc4 (14.7%), 2.d4 (8.0%) and 2.Nc3 (7.8%) together account for about 30 games in 100. The first session belongs to those three replies: a short, sound plan against each covers more than twice as many games as the Open Sicilian does at this level.
🔄 Check your understanding 1. The Italian's draw rate is 47.4% among masters and 3.6% on Lichess. What does that difference tell you about the opening? 2. Only 20 Lichess blitz games with recorded moves reach 6.Be3 with White rated 1550–1750. Where should a 1600 player get the frequency of Black's sixth-move replies from, and where the seriousness?
Answer
- Very little: draw rates mostly reflect the pool and the speed (fast online games rarely end in agreed draws). The scores in the three pools differ by only about three points.
- Frequency from the broadest club-level sample that is still close to their level (here Lichess blitz at all ratings, 234 games: 6...e5 57.5%, 6...e6 18.9%, 6...Ng4 11.0%); seriousness from master games (6...e5 71.5%, 6...e6 17.7%, 6...Ng4 9.3% of 45,847). Both lists agree on the three replies to prepare.
20.3 Sample-Size Discipline: Confidence Intervals Before Conclusions
🧩 Productive struggle: Before reading on, decide for yourself. Dev scored 36.0% in 50 English Attack games (18 wins, 0 draws, 32 losses). In those games his rating-based expectation was 46.2%. White players at his level who reach 6.Be3 score 44.3% across all 97 such games in the sample — and 50 of those 97 games are Dev's. Is the Najdorf a weakness of Dev's? Write down your answer and how many games you think it would take to be sure.
The question "is my 36% different from 46%?" is a question about noise. A 50-game sample of a coin that lands heads 46% of the time will not land on exactly 46%; it will wander, and the amount it wanders is predictable.
📐 Definition — Wilson 95% interval for a score: for n games and score p (wins + ½ draws, as a fraction), the interval centre = (p + z²/2n) / (1 + z²/n), half-width = z·√(p(1−p)/n + z²/4n²) / (1 + z²/n), with z = 1.96. It is better behaved than the textbook "p ± 1.96√(p(1−p)/n)" when n is small or p is near 0 or 1, which is exactly where opening statistics live. With draws it is an approximation (a draw is half a point, not a coin flip), but a good one at club level, where draws are rare.
Our module implements it in nine lines:
def wilson_interval(points: float, n: float, z: float = Z95) -> tuple[float, float]:
"""Wilson score interval for a score points/n (draws count half). Returns (lo, hi) in [0, 1]."""
if n <= 0:
return (math.nan, math.nan)
p = min(max(points / n, 0.0), 1.0)
den = 1 + z * z / n
centre = (p + z * z / (2 * n)) / den
half = z * math.sqrt(p * (1 - p) / n + z * z / (4 * n * n)) / den
return (max(0.0, centre - half), min(1.0, centre + half))
Dev's whole White repertoire, with intervals
Here is every line Dev played at least ten times as White, with the database at his level (his own
games removed) beside it (code/02_dev_query.py):
line n W D L score lo hi elo_exp db_n db_score verdict_vs_db verdict_vs_elo
Italian Game 80 53 2 25 67.5% 56.6% 76.8% 50.1% 16713 51.6% above above
Najdorf 6.Be3 50 18 0 32 36.0% 24.1% 49.9% 46.2% 47 53.2% cannot tell cannot tell
Sicilian Defense 36 19 2 15 55.6% 39.6% 70.5% 48.7% 41683 49.5% cannot tell cannot tell
French Defense 20 8 2 10 45.0% 25.8% 65.8% 46.7% 25242 49.5% cannot tell cannot tell
Scandinavian Defense 18 7 3 8 47.2% 26.8% 68.7% 50.6% 21300 50.0% cannot tell cannot tell
Caro-Kann Defense 17 8 1 8 50.0% 28.5% 71.5% 52.3% 22337 49.3% cannot tell cannot tell
Scotch Game 12 9 0 3 75.0% 46.8% 91.1% 54.6% 8901 53.9% cannot tell cannot tell
("Sicilian Defense" here means Dev's other Sicilians — the English Attack games are split out.)

📊 Figure (described): A forest plot of Dev's White lines with ten or more games: his score (blue dot), its 95% interval (blue bar) and the database score at his level (orange diamond). Only the Italian's bar lies clear of its diamond. Every other bar, including the Najdorf's, contains or nearly touches the database value; the short lines (Scotch, Caro-Kann, Scandinavian) have bars spanning 40 points or more.
Read the forest plot line by line, and the "verdict" column explains itself:
- Italian: above. 67.5% over 80 games, interval 56.6–76.8%. The database at Dev's level is 51.6% over 16,713 games and his own Elo expectation in those games is 50.1%. Both sit below the bottom of his interval. This is the one result in the table that survives the test — the most plausible reading is a genuine strength, though its size is uncertain: anything from about +5 to +25 points above the database fits the data.
- Najdorf 6.Be3: cannot tell. 36.0%, interval 24.1–49.9%. His Elo expectation (46.2%) is inside it. The band census — all 97 games at his level, 44.3% [34.8–54.2] — is inside it. White at any blitz rating, 49.0% [45.6–52.5] over 801 games, is inside it by a whisker.
- Everything else: cannot tell, mostly by a mile. With 12 games, the Scotch's interval runs from 46.8% to 91.1%: the data are compatible with "Dev is a Scotch genius" and with "Dev is a perfectly ordinary Scotch player who had a good week."
The trap inside the Najdorf comparison
The Najdorf row hides a subtle problem. The "database at Dev's level" for this line is tiny, and half of it is Dev:
Najdorf 6.Be3 (English Attack, incl. 6...Ng4) references - White's score
blitz, White 1550-1750, ALL games incl. Dev's (band census) n= 97 44.3% [34.8%-54.2%] Elo-expected 47.3%
blitz, White 1550-1750, Dev's games removed n= 47 53.2% [39.2%-66.7%] Elo-expected 48.5%
blitz, White any rating n= 801 49.0% [45.6%-52.5%] Elo-expected 49.4%
Dev's Najdorf minus the other 47 band games: -17.2 pts, 95% CI [-36.7, +2.3]
Compare Dev with the census of 97 and you compare him partly with himself — the census is dragged toward
his 36%. Remove his games and the yardstick becomes 47 games, whose own interval (39.2–66.7%) is as wide
as Dev's. When the reference is thin, the right test is the interval for the difference: Dev minus the
other players, −17.2 points, with a 95% interval from −36.7 to +2.3. It includes zero. Our module's
verdict function switches to this two-sample test automatically when the reference has fewer than 1,000
effective games.
⚠️ Common pitfall: Comparing your score with a reference that contains your own games, or with a reference so small it is noisier than you are. Remove yourself from the yardstick, and when the yardstick is thin, test the difference, not your score against a fixed number.
The population fact behind Anchor C is more interesting than Dev's own number. White players at Dev's level score 44.3% with 6.Be3 (n=97), against 49.0% across all blitz ratings (n=801) and 50.5% across all speeds and ratings (n=1,543). The English Attack — opposite-side castling, pawn storms, a race in which one tempo decides — appears to be hard for 1600s, not just for Dev. That sentence too rests on a thin sample (97 games), so hold it lightly; but it points to the right question. Not "is my Najdorf number bad?" but "what goes wrong for players like me in this structure?"
How many games is enough?
The width of an interval shrinks with the square root of the number of games. At a score near 50%:
95% interval half-width at a 50% score:
n= 10: +/- 26.3 pts
n= 20: +/- 20.1 pts
n= 30: +/- 16.8 pts
n= 50: +/- 13.4 pts
n= 80: +/- 10.7 pts
n= 100: +/- 9.6 pts
n= 200: +/- 6.9 pts
n= 385: +/- 5.0 pts
n= 1000: +/- 3.1 pts
games needed for +/-5 pts: 385; +/-10 pts: 97; +/-3 pts: 1068

📊 Figure (described): The 95% interval half-width for a score near 50% as the number of games grows (log scale). Dev's 19 Najdorf games with recorded moves sit at about ±20 points, his 50 Najdorf games at ±13, his 80 Italian games at ±11; it takes 385 games to get to ±5.
The table is the most useful thing in this chapter to memorise. Ten games: ±26 points — you have learned almost nothing. Fifty: ±13 — you can detect a disaster, not a weakness. A hundred: ±10. To tell a 5-point weakness from noise you need several hundred games in that one line. Most club players will never play several hundred games in any single sideline. That is not a reason to ignore your results; it is a reason to combine them with things that are not noisy — engine checks of the key positions, and the quality of your play in the line (20.4).
Forking paths: when you look at seven lines, one will look terrible
Dev did not ask "is my Najdorf below expectation?" He asked "which of my openings is worst?" — and that is
a different question with a different answer. Run a simulation (code/02_dev_query.py): give a player
Dev's exact games, ratings and opponents across his seven most-played lines, but make every result a
pure coin flip weighted by the Elo expectation of that game. The player has, by construction, no opening
strengths or weaknesses at all. Play 10,000 such seasons and look at the best and worst line each time:
Null simulation (10,000 seasons; every game scored at its Elo expectation; 7 lines, 233 games):
P(some line >= 10 pts BELOW expectation) = 72.3%
P(some line >= 17 pts ABOVE expectation) = 31.3%
P(both at once) = 20.5%
median worst line -12.9 pts, median best line +12.4 pts

📊 Figure (described): For a simulated player with no opening strengths or weaknesses (Dev's 233 games in seven lines, results drawn at their Elo expectation), the share of seasons in which at least one line falls x points below expectation (orange) or rises x points above it (blue). Dev's Najdorf gap (−10.2) is matched or exceeded in 72% of seasons; his Italian gap (+17.4) in 31%.
In almost three seasons out of four, a player with no weak opening has at least one line that looks 10 or more points below expectation. Dev's Najdorf sits 10.2 points below his. In the typical season the worst line is 12.9 points below and the best 12.4 above. Even Dev's Italian, the result that passed the single-line test, is the kind of gap pure luck produces in about one season in three when you scan seven lines for the best. That does not make the Italian strength imaginary — it passed a test the Najdorf failed — but it is a reason to describe it as "probably real, size uncertain".
The question changes the statistics. "Is this line different from expectation?" and "Is any of my lines different?" are different questions. Scanning many lines, nodes or openings and reporting the most extreme one guarantees that something will look remarkable. The defence is to decide what you are testing before you look, to widen your threshold when you test many things at once, and to confirm surprising results with evidence that is not the same noisy score.
One more comparison closes the loop. The gap between Dev's two openings is large and clear: Italian minus Najdorf = +31.5 points, 95% interval [+14.6, +48.4]. His two openings really do score differently. But that does not say which of them is unusual, and the forest plot answers that: it is the Italian that sits far from its database value. In the database itself the same gap is only +7.3 points at Dev's level and +2.7 at all blitz ratings.
🔄 Check your understanding 1. Dev's Scotch score is 75.0% over 12 games, interval 46.8–91.1%. Why is the verdict "cannot tell" even though 75% is 21 points above the database? 2. Roughly how many games would Dev need in the English Attack for a ±10-point interval? 3. Why is it a mistake to compare Dev's 36.0% with the band census of 44.3%?
Answer
- The interval is 44 points wide; the database value (53.9%) lies inside it. With 12 games, 75% is compatible with a true score near the database's.
- About 97 games (from
games_needed(0.10)), roughly twice what he has — and for ±5 points, 385.- Fifty of the census's 97 games are Dev's own, so the "reference" is half Dev. Remove his games and the reference is 47 games with an interval as wide as his; the proper test is the difference (−17.2 points, interval −36.7 to +2.3), which includes zero.
20.4 Engine Analysis: Where Do the Games Actually Go Wrong?
Scores tell you whether something is wrong, noisily. An engine pass over your own games tells you where. This is the step most players skip, and it is the one that most often changes the plan.
The method is simple. Take every game you played in the line. Run Stockfish over it. For each game record three things: the evaluation when the opening ends (we use ply 20 — move 10 — the book's definition of the end of the opening phase), your accuracy before and after that point, and the ply of your first real error (a mistake or blunder: a drop of 10 or more win-percentage points, the Lichess convention used throughout the book). Then ask: did I leave the opening worse, or did I lose a playable position later?
code/04_where_games_go_wrong.py does this for the 19 English Attack games that have recorded moves
and for all 80 of Dev's Italian games, with Stockfish 19 at depth 14 in three worker processes:
res = engine.analyse_games_parallel(sel.movetext.tolist(), depth=DEPTH, workers=3, progress=False)
for gi, df in res.groupby("game_index"):
dw = df[df.side == "white"] # Dev's moves
bad = dw[dw.classification.isin(["mistake", "blunder"])]
at20 = df[df.ply == 20]
rows.append({"eval20": at20.eval_after.iloc[0] if len(at20) else np.nan,
"acc_open": dw[dw.ply <= 20].accuracy.mean(), "acc_later": dw[dw.ply > 20].accuracy.mean(),
"first_err_ply": int(bad.ply.iloc[0]) if len(bad) else np.nan,
"first_err_phase": bad.phase.iloc[0] if len(bad) else "none"}) # (abridged)
Per line (Dev = White; Stockfish 19 depth 14; eval20 = eval after ply 20, White POV, clipped ±1000 cp):
Italian games 80 score 67.5% eval after move 10: median +0.41, mean +0.77; worse than -1.00 in 12%, better than +1.00 in 37%
Dev accuracy (book) opening 90.5, later 85.2; first Dev mistake: median ply 19; phase counts {'opening': 42, 'middlegame': 28, 'none': 9, 'endgame': 1}
losses 25: first Dev mistake in the opening phase in 48%; eval after move 10 in the losses: median -0.04
Najdorf 6.Be3 games 19 score 26.3% eval after move 10: median +0.30, mean +0.24; worse than -1.00 in 5%, better than +1.00 in 16%
Dev accuracy (book) opening 94.4, later 79.3; first Dev mistake: median ply 25; phase counts {'middlegame': 10, 'opening': 7, 'none': 2}
losses 14: first Dev mistake in the opening phase in 43%; eval after move 10 in the losses: median +0.32
(These 19 games score 26.3%, lower than the 36.0% of all 50 — another reminder of how much a handful of games can move.)

📊 Figure (described): Left: the Stockfish 19 evaluation after move 10 (White = Dev, clipped at ±5) for every Italian and English Attack game, with the median marked. The Najdorf games cluster just above zero, with only one clearly bad opening. Right: the ply of Dev's first mistake or blunder. In the English Attack most first errors come after ply 20 — after the opening is over.
Here is the surprise. In the English Attack, Dev comes out of the opening fine: a median evaluation of +0.30 after move 10, worse than −1.00 in only one game in twenty, and an opening accuracy (94.4) higher than in his Italian (90.5). In the 14 losses the median evaluation after move 10 is +0.32 — he reached the middlegame with an edge and lost anyway. His accuracy then collapses to 79.3, against 85.2 after the opening in the Italian. Fewer than half of his Najdorf losses (43%) contain an error during the opening phase at all.
That changes what "studying the Najdorf" should mean. Memorising more theory would polish the part of the game Dev already handles. His points disappear in the middlegame the English Attack produces: kings on opposite wings, pawn storms, tactics around the c-file and the g-file. That is a structure-and-plans problem — the subject of Chapter 12 on attack and defence and Chapter 4 on king safety — far more than a memory problem.
Two moments from Dev's games
The one bad opening in the sample is instructive precisely because it is not about theory.

♟️ Position: White Ke1, Qd2, Ra1, Rh1, Bf1, Be3, Nb3, Na4, a2, b2, c2, g2, h2, f3, e4; Black Ke8, Qd8, Ra8, Rh8, Be6, Be7, Nf6, Nd7, b5, e5, a6, d6, f7, g7, h7 — White to move. FEN:
r2qk2r/3nbppp/p2pbn2/1p2p3/N3P3/1N2BP2/PPPQ2PP/R3KB1R w KQkq - 0 11
The game (Dev 1708 vs 1841, 3-minute blitz) went 1.e4 c5 2.Nf3 d6 3.d4 cxd4 4.Nxd4 Nf6 5.Nc3 a6 6.Be3 e5 7.Nb3 Be6 8.f3 Be7 9.Na4 Nbd7 10.Qd2 b5. Dev had already drifted — 9.Na4 sends a knight to the rim, and Stockfish rates the position before move 11 at −0.80 (depth 24), −0.87 at depth 20. Now 10...b5 attacks the knight on a4, and Dev played 11.f4??, an attacking move in the spirit of the English Attack that simply leaves the knight to be taken: −7.99 (Stockfish 19, depth 24). Retreating with 11.Nc3 keeps the game going at −0.63 (depth 24). The game was over one move later.
🤖 Engine check: before 11.f4, −0.80 (depth 24); after 11.f4, −7.99; after 11.Nc3, −0.63. The engine's line after 11.Nc3 (11...Nb6 12.a4 Nc4 13.Bxc4 bxc4 14.Nc1) shows Black taking the bishop pair and pressing on the c-file — uncomfortable, not lost. The human lesson is not about the English Attack at all: before every "plan" move, ask what the opponent's last move attacked. That is Chapter 7's question, and blitz is where it gets skipped.
The second moment is more typical — and more painful.

♟️ Position: White Kb1, Rd1, Re1, Nd3, a2, c2, b3, h4, g5, d7; Black Kf7, Rd8, Rh8, Be7, c3, a6, f6, g7, h7 — White to move. FEN:
3r3r/3Pbkpp/p4p2/6P1/7P/1PpN4/P1P5/1K1RR3 w - - 2 34
Dev (1748, against 1786, 3+2) played the English Attack exactly as the books recommend: 7.Nb3, 8.Qd2, 9.f3, 10.O-O-O, 12.g4, 15.h4, 16.g5, then a central break with 17.f4 and 19.Nd5. By move 34 he had a pawn on d7 and a winning position: +6.09 (Stockfish 19, depth 24). Then 34.Nc5?? simply drops the knight to 34...Bxc5, and the evaluation swings to −4.01 (depth 24). 34.gxf6 would have kept +5.96. The game ended in a loss on move 48.
That is the English Attack problem at Dev's level in one game. The opening worked. The middlegame worked. The point was lost to a one-move oversight in a sharp position with the clock running. If you want to know which part of your game to train, this kind of evidence is worth more than any opening score.
⚠️ Common pitfall: Blaming the opening for losses that happen on move 34. Before you change a line, run your games through an engine and look at the evaluation when the opening ends. If you usually leave the opening equal or better, the fix is middlegame and tactical training in that structure, not new opening moves.
Checking the key positions themselves
The other job for the engine is soundness: confirming that each tabiya in your tree is objectively playable, so that you never build on a refuted line. Every main position in this chapter was checked with Stockfish 19 at two depths. Both of Dev's tabiyas are healthy (Italian +0.08/+0.11, English Attack +0.32/+0.40 at depths 18/24). In the hook we already saw that the engine likes the English Attack a little more than the Italian — and the database, at all ratings, finds White scoring close to 50% in both. Soundness is a floor, not a ranking: once a line is sound, practical factors decide.
🤖 Engine check — depth matters: In Case Study 1, the position after 1.e4 c5 2.Nf3 d6 3.d4 cxd4 4.Nxd4 Nf6 5.Nc3 a6 6.Be3 e6 7.g4 reads −0.13 at depth 20 and +0.34 at depth 24 — a sign flip, and the depth-20 MultiPV run on the same position puts its best line at +0.49. Numbers this close to zero, in sharp positions, are not stable. Treat any opening evaluation within about ±0.3 as "equal, with play for both sides" and spend your time on the plans, which do not change with depth.
🔄 Check your understanding 1. Dev's Najdorf losses have a median evaluation of +0.32 after move 10. What does that suggest about where to spend his study time? 2. Why is the 11.f4?? example not evidence that Dev needs more English Attack theory?
Answer
- He typically reaches the middlegame with a small edge and loses later, so the training should be in the middlegame of this structure: opposite-side attacks, defending against ...b5–b4 and the c-file, and tactical alertness under time pressure.
- The losing move ignored a direct attack on a piece (10...b5 hit the knight on a4). That is a board-vision error that would happen in any opening; the remedy is the "what did the last move attack?" habit, not more memorised moves.
20.5 Model Games: Learning the Plans of a Branch
If the problem is the middlegame of the structure, the best study material is not a theory file but a small set of model games — strong games in your branch, played through slowly, with the engine used afterward to check what you think you have understood. A model game teaches what no move list can: which pieces go where, which pawn break is the point, and what the opponent's counterplay looks like.
📐 Definition — model game: a game, played by strong players, that reaches one of your repertoire's tabiyas and shows the typical plans for both sides clearly. Choose model games by structure (does it reach your pawn skeleton?), not by result alone; a model game lost by your side is often the more useful one.
Classic: Polgar–Gelfand, Novgorod 1996
Judit Polgar — widely regarded as the strongest woman player in history, and one of the great attacking players of the 1990s — had White against Boris Gelfand in Novgorod, 1996. It reached the 6...e5 English Attack, the branch Black chooses in about seven master games out of ten. The game, from the data:
1.e4 c5 2.Nf3 d6 3.d4 cxd4 4.Nxd4 Nf6 5.Nc3 a6 6.Be3 e5 7.Nb3 Be6 8.f3 Nbd7 9.Qd2 b5 10.g4 Nb6
11.g5 Nfd7 12.Nd5 Rc8 13.O-O-O Bxd5 14.exd5 Nc4 15.Qf2 Be7 16.h4 h6 17.gxh6 gxh6 18.Kb1 Bxh4
19.Qe2 Nxe3 20.Qxe3 Bg5 21.Qe1 O-O 22.Bd3 f5 23.Qg1 Kh7 24.Rh5 Nc5 25.f4 exf4 26.Nd4 Kg6 27.Qh2 Qf6
28.Bxf5+ Qxf5 29.Nxf5 Rxf5 30.Rh1 Rh8 31.Rxg5+ Rxg5 32.Qxf4 Rd8 33.a3 Kg7 34.Rf1 Kh7 35.b4 Na4
36.Qe4+ Kh8 37.Qe7 Rdg8 38.Qxd6 Kh7 39.Qe7+ R8g7 40.Qe4+ Kg8 41.Qe8+ Kh7 42.d6 1-0

♟️ Position: White Ke1, Qd1, Ra1, Rh1, Bf1, Be3, Nb3, Nc3, a2, b2, c2, g2, h2, f3, e4; Black Ke8, Qd8, Ra8, Rh8, Be6, Bf8, Nf6, Nd7, e5, a6, d6, b7, f7, g7, h7 — White to move. FEN:
r2qkb1r/1p1n1ppp/p2pbn2/4p3/4P3/1NN1BP2/PPP3PP/R2QKB1R w KQkq - 1 9
The set-up (after 8...Nbd7). This is the English Attack's skeleton: White's knight has retreated to b3, the f-pawn guards e4 and g4, the queen goes to d2 and the king will go long. Black's pawn on e5 gives up the d5 square in return for space and a solid centre. Stockfish 19 rates the position at +0.41 (depth 20) and +0.33 (depth 24), and its main line at depth 24 is the plan in miniature: 9.g4 Be7 10.Qd2 O-O 11.O-O-O b5. Polgar played the same moves in a different order (9.Qd2 b5 10.g4). The order matters less than the plan: f3, Qd2, O-O-O, g4–g5, and fight for d5.

♟️ Position: White Kc1, Qd2, Rd1, Rh1, Bf1, Be3, Nb3, a2, b2, c2, h2, f3, d5, g5; Black Ke8, Qd8, Rc8, Rh8, Bf8, Nb6, Nd7, b5, e5, a6, d6, f7, g7, h7 — Black to move. FEN:
2rqkb1r/3n1ppp/pn1p4/1p1Pp1P1/8/1N2BP2/PPPQ3P/2KR1B1R b k - 0 14
The d5 wedge (after 14.exd5). The g-pawn advanced to g5 to drive the f6 knight away from d5; 12.Nd5 occupied the square, and after 13.O-O-O Bxd5 14.exd5 White has a pawn wedge on d5 that cramps Black's queenside. But the engine has a warning here: the depth-16 pass over the whole game flags 13.O-O-O as the moment White's edge slipped, and after 14.exd5 Stockfish gives −0.54 (depth 20) and −0.44 (depth 24) — Black is slightly better, with 14...Nc4 hitting the e3 bishop. Even a model game by a world-class player is not a perfect game. That is fine. We are studying the plans, and the engine tells us where the execution was loose.
📋 Try it — Analyze this position: In the same game, after 16.h4, Black must choose a 16th move. Gelfand played 16...h6. What would you play, and why?
♟️ Position: White Kc1, Qf2, Rd1, Rh1, Bf1, Be3, Nb3, a2, b2, c2, f3, h4, d5, g5; Black Ke8, Qd8, Rc8, Rh8, Be7, Nc4, Nd7, b5, e5, a6, d6, f7, g7, h7 — Black to move. FEN:
2rqk2r/3nbppp/p2p4/1p1Pp1P1/2n4P/1N2BP2/PPP2Q2/2KR1B1R b k - 0 16
Answer
Stockfish 19 (MultiPV, depth 20) prefers 16...Nxe3 (−0.53), then 16...Qc7 (−0.27) and 16...O-O (+0.24); at depth 24, 16...Nxe3 is −0.48 with the line 17.Qxe3 h6 18.gxh6 Rxh6 19.f4. The game's 16...h6 is +0.60 (depth 20) / +0.58 (depth 24) — about a pawn's swing. The idea: take the e3 bishop first, removing White's best minor piece and the defender of the dark squares, and only then open the h-file with ...h6. Gelfand's move order let White recapture on h6 with a pawn and keep the bishop for the attack. In opposite-side races, which piece you exchange before you open lines is often the whole game.

♟️ Position: White Kb1, Qh2, Rd1, Rh5, Bd3, Nd4, a2, b2, c2, d5; Black Kg6, Qf6, Rc8, Rf8, Bg5, Nc5, f4, b5, f5, a6, d6, h6 — White to move. FEN:
2r2r2/8/p2p1qkp/1pnP1pbR/3N1p2/3B4/PPP4Q/1K1R4 w - - 4 28
The combination (after 27...Qf6). Twenty moves of manoeuvring around Black's exposed king end in tactics: 28.Bxf5+! Qxf5 29.Nxf5 Rxf5 30.Rh1, and White's rooks and queen collect the loose black pieces. Stockfish 19: +5.03 (depth 20), +6.80 (depth 24); the depth-16 pass marks 27...Qf6 as Black's decisive error. Strategy created the tactic — the open g- and h-files, the d5 wedge and the stranded black king were all products of the English Attack plan.

♟️ Position: White Kb1, Qe8, Rf1, c2, a3, b4, d6; Black Kh7, Rg5, Rg7, Na4, b5, a6, h6 — Black to move. FEN:
4Q3/6rk/p2P3p/1p4r1/nP6/P7/2P5/1K3R2 b - - 0 42
The finish. The d5 pawn that 14.exd5 created becomes a passed pawn on d6: +7.28 (depth 20), +8.17 (depth 24), and the game ended there, 1-0. Over the whole game, Stockfish 19 at depth 16 gives Polgar a book accuracy of 95.5 (ACPL 25.9) and Gelfand 92.8 (ACPL 35.7).
Modern: Vachier-Lagrave–Tabatabaei, Chess Olympiad 2026
A repertoire tree is only as good as its small branches. In our data 6...Ng4 is about one English Attack game in ten (9.3% among masters, 11.0% in Lichess blitz), and it carries a special danger: after 7.Bc1 Nf6 8.Be3 Ng4, Black is offering to repeat moves. A White repertoire must decide in advance whether to accept the draw or avoid it, and how. Maxime Vachier-Lagrave (FIDE 2718) showed one way against M. Amin Tabatabaei (2737) in the open section of the 2026 Chess Olympiad (broadcast data, September 2026):
1.e4 c5 2.Nf3 d6 3.d4 cxd4 4.Nxd4 Nf6 5.Nc3 a6 6.Be3 Ng4 7.Bc1 Nf6 8.Be3 Ng4 9.Bg5 h6 10.Bh4 g5
11.Bg3 Bg7 12.Be2 h5 13.h4 gxh4 14.Bxh4 Nc6 15.Nb3 Bxc3+ 16.bxc3 f6 17.Bg3 Qc7 18.f3 Nge5 19.f4 Ng4
20.Bxg4 Bxg4 21.Qxg4 hxg4 22.Rxh8+ Kf7 23.Rxa8 Na5 24.O-O-O Qxc3 25.Rd3 Nxb3+ 26.axb3 Qa1+ 27.Kd2 Qf1
28.e5 dxe5 29.fxe5 f5 30.e6+ Kxe6 31.Rf8 Qxg2+ 32.Kc3 Qe4 33.Kb2 a5 34.Rd1 Qf3 35.Re1+ Kd7 36.Bh4 e6
37.Rd8+ Kc7 38.Rd3 1-0

♟️ Position: White Ke1, Qd1, Ra1, Rh1, Bf1, Be3, Nc3, Nd4, a2, b2, c2, f2, g2, h2, e4; Black Ke8, Qd8, Ra8, Rh8, Bc8, Bf8, Ng4, Nb8, a6, d6, b7, e7, f7, g7, h7 — White to move. FEN:
rnbqkb1r/1p2pppp/p2p4/8/3NP1n1/2N1B3/PPP2PPP/R2QKB1R w KQkq - 2 7
The sideline (after 6...Ng4). The knight hits the e3 bishop, which has no comfortable square: Stockfish 19 rates the position +0.27 (depth 20) / +0.23 (depth 24), with 7.Bc1 as its first choice. After 7.Bc1 Nf6 8.Be3 Ng4 the position has repeated once; MVL sidestepped with 9.Bg5, which leads to a completely different game: Black's ...h6 and ...g5 chase the bishop to g3, and both sides' kingside pawns are committed by move 13.

♟️ Position: White Ke1, Qd1, Ra1, Rh1, Be2, Bh4, Nc3, Nd4, a2, b2, c2, f2, g2, e4; Black Ke8, Qd8, Ra8, Rh8, Bg7, Bc8, Ng4, Nb8, h5, a6, d6, b7, e7, f7 — Black to move. FEN:
rnbqk2r/1p2ppb1/p2p4/7p/3NP1nB/2N5/PPP1BPP1/R2QK2R b KQkq - 0 14
Open lines, uncastled kings (after 14.Bxh4). The engine calls it level — +0.15 (depth 20), +0.17 (depth 24) — but practically it is a minefield: the h-file is half-open for White's rook, and Black's king has no safe home on either wing. The depth-16 pass finds three Black inaccuracies in four moves: 16...f6 (+0.14 → +0.81), 17...Qc7 (+0.69 → +1.29) and the decisive one, 19...Ng4 (+0.96 → +2.80).
📋 Try it — Find the tactic: Black to play move 19. The game went 19...Ng4. Why is that the losing mistake, and what should Black play instead?
♟️ Position: White Ke1, Qd1, Ra1, Rh1, Be2, Bg3, Nb3, a2, c2, g2, c3, e4, f4; Black Ke8, Qc7, Ra8, Rh8, Bc8, Ne5, Nc6, h5, a6, d6, f6, b7, e7 — Black to move. FEN:
r1b1k2r/1pq1p3/p1np1p2/4n2p/4PP2/1NP3B1/P1P1B1P1/R2QK2R b KQkq - 0 19
Answer
After 19...Ng4? White plays 20.Bxg4 Bxg4 21.Qxg4! hxg4 22.Rxh8+: the queen "sacrifice" is really an exchange of queen for queen-plus-rook, because the h-file rook takes h8 with check and then a8. Stockfish 19 scores 19...Ng4 at +3.43 (depth 20) / +3.78 (depth 24). The engine's choice is 19...Nf7 (+1.16 at depth 24; MultiPV depth 20: Nf7 +1.16, Rg8 +1.87, Ng4 +3.52), keeping the h8 rook defended and the knight near the king. The pattern — a rook on an open file facing an undefended rook on the same file, behind a queen trade — is the kind of tactic that grows out of the English Attack's open h-file.

♟️ Position: White Ke1, Ra1, Rh1, Bg3, Nb3, a2, c2, g2, c3, e4, f4; Black Ke8, Qc7, Ra8, Rh8, Nc6, g4, a6, d6, f6, b7, e7 — White to move. FEN:
r3k2r/1pq1p3/p1np1p2/8/4PPp1/1NP3B1/P1P3P1/R3K2R w KQkq - 0 22
The point (after 21...hxg4). 22.Rxh8+ Kf7 23.Rxa8, and White has collected both black rooks and a knight in return for the queen: +3.21 (depth 20), +3.43 (depth 24). Vachier-Lagrave converted with remarkable precision — the depth-16 pass gives him a book accuracy of 98.6 (ACPL 3.9) against 95.5 (ACPL 18.1). For a repertoire builder, the lesson is the branch itself: a 10% sideline that can end in a forced draw by repetition needs a prepared decision, and a model game showing how White keeps the game going.
🤖 Engine check: Both model games show the same thing from different directions. Stockfish rates the opening positions within half a pawn of equality (+0.33 and +0.23 at depth 24), yet both games are decided by the middlegame: an attack on an exposed king in one, a tactic on an open file in the other. Opening theory got both players to a playable middlegame; understanding of the structure decided who won it.
🔄 Check your understanding 1. In Polgar–Gelfand, the engine flags 13.O-O-O and then 16...h6. What does that teach about using model games? 2. Why does the 6...Ng4 sideline need a decision in a White repertoire, not just a move?
Answer
- Model games teach plans, not perfect moves: even world-class players loosen their grip (after 14.exd5 Black was slightly better, −0.44 at depth 24) and their opponents give it back (16...h6, +0.58, instead of 16...Nxe3, −0.48). Play through the plans, then use the engine to mark where the execution was loose.
- After 7.Bc1 Nf6 8.Be3 Ng4 Black is offering a repetition. White must decide in advance whether a draw is acceptable in that event and, if not, which deviation to play (Vachier-Lagrave chose 9.Bg5).
20.6 Style Fit and Practicality
The classical advice on choosing openings is that tactical players should play sharp openings and positional players strategic ones. It is sound advice with a measurement problem: what makes an opening "sharp", and what makes you "tactical"? We can measure the first and test the second.
What kind of game does each opening produce?
Take the per-game feature table for Lichess blitz games at Dev's level (average rating 1600–1799,
balanced, bots excluded, weighted) and ask two questions of every game: did the players castle on
opposite wings (both castled, different sides — the classic racing-attack signature)? And were the
queens off by ply 30 (a sign of early simplification)? code/06_style_map.py:
Lichess blitz, avg 1600-1799, balanced, no bots: 65,131 rows (weighted 336,773)
family games weighted opp_castle q_off30 median_plies white_score first_blunder_ply_median n_eval share
Sicilian Defense 7818 38,940 11.8% 9.0% 64 50.7% 26 3261 11.6%
Queen's Pawn Game 5999 31,724 15.6% 7.6% 68 54.4% 27 2246 9.4%
French Defense 4480 23,331 14.8% 7.8% 66 50.6% 26 1731 6.9%
Caro-Kann Defense 4449 20,465 11.0% 8.6% 66 49.9% 27 2093 6.1%
Scandinavian Defense 3567 19,499 26.9% 15.3% 64 49.1% 24 1254 5.8%
Italian Game 2715 13,796 13.6% 11.4% 63 54.0% 23 1107 4.1%
Queen's Gambit Declined 2203 11,002 8.9% 11.7% 65 51.9% 27 905 3.3%
English Opening 2077 10,302 10.0% 7.6% 67 52.6% 27 876 3.1%
Philidor Defense 1529 8,473 21.4% 15.3% 67 54.6% 24 515 2.5%
Modern Defense 1474 8,152 18.8% 8.7% 68 50.2% 24 509 2.4%
Scotch Game 1523 7,620 20.7% 19.9% 59 54.2% 21 619 2.3%
...
all families at this level: opposite castling 15.9%, queens off by ply 30 10.5%

📊 Figure (described): The 16 most common opening families in Lichess blitz at 1600–1799, placed by how often the queens are off by ply 30 (x-axis) and how often the players castle on opposite wings (y-axis); bubble size is the family's share of games, colour the median game length. The Scandinavian, Pirc, Philidor and Scotch sit high (racing positions); the Queen's Gambit Declined, English and Caro-Kann sit low; the Scotch is far to the right (early queen trades) and produces the shortest games.
A few readings. The Scandinavian produces opposite-side castling in 26.9% of games at this level — more than any other common family — plausibly because Black's early queen moves and quick ...O-O-O set-ups invite it. The Queen's Gambit Declined is the calmest (8.9%). The Scotch trades queens by ply 30 in one game in five (19.9%) and ends soonest (median 59 plies), while its first blunder comes earliest (median ply 21, analysed games only). The Sicilian family as a whole is not especially sharp by these measures (11.8%) — it is a collection of very different systems, and the family average hides the English Attack's racing positions inside it. Style maps work best at the level of branches, not names.
These are descriptions of what happens, at one level and one speed, not of what an opening "is". The same opening played by 2200s or in classical games may look quite different on the map.
Does Dev actually play better in sharp positions?
Dev says he is an attacking player. His games can be split by the same two features
(code/06_style_map.py, all 569 of his games with moves, both colours):
opposite-side castling n= 90 score 48.9% [38.8%-59.0%] Elo-expected 48.0% actual-expected +0.9
not opposite-side castling n=479 score 53.1% [48.7%-57.6%] Elo-expected 50.4% actual-expected +2.7
queens off by ply 30 n= 59 score 55.1% [42.5%-67.1%] Elo-expected 53.4% actual-expected +1.7
queens still on at ply 30 n=510 score 52.2% [47.8%-56.5%] Elo-expected 49.6% actual-expected +2.5
Every interval overlaps every other. On this evidence Dev is neither better nor worse in racing positions than in quiet ones — which is what you find for most players once you put intervals on it. So "style fit" cannot be read off your results with any precision. It has to come from somewhere else: which positions you enjoy and understand, which plans you can explain, which games you remember. The data's job is to stop you from fooling yourself in either direction.
⚠️ Common pitfall: Labelling yourself "tactical" or "positional" from memory and choosing openings to match. Most players remember their brilliant wins and forget their quiet ones. If you want a style label, measure it — opposite-castling share, early queen trades, your score in each with intervals — and expect the result to be "not clearly different".
Practicality: coverage and prep load
The fourth classical criterion — practical to learn — is the easiest to measure, because it is a property of the tree. Two metrics:
📐 Definition — coverage: given your choices at your own nodes and a number k of prepared replies at each opponent node, the share of games at your level still inside your prepared tree after ply d. Prep load: the number of opponent replies you must prepare so that at every opponent node you reach, the prepared replies cover at least 80% of that node's games, down to ply 10 (nodes with fewer than 30 games in the reference are not expanded).
Coverage decays fast. Here is Dev's White repertoire against his band (code/03_repertoire_tree.py):
Coverage of Dev's White tree vs his band (share of games still inside after ply N):
ply k=1 k=2 k=3 k=5
2 38.3% 56.4% 67.2% 86.9%
4 24.3% 44.5% 61.6% 83.8%
6 8.5% 31.4% 50.6% 78.8%
8 4.7% 22.8% 42.3% 74.8%
10 1.9% 19.3% 38.6% 73.0%
12 1.5% 17.7% 37.5% 72.2%

📊 Figure (described): The share of Dev's band's games still inside a prepared tree after each ply, for 1, 2, 3 or 5 prepared replies per opponent node. With two replies per node, fewer than one game in five is still "in book" after move 5; even five replies per node leave a quarter of games outside by ply 8.
Preparing the top two replies at every node — already a lot of work — keeps only 19.3% of games in your preparation after ply 10. Five replies per node keeps 73.0%, at the cost of a tree with thousands of leaves. This is the arithmetic behind the oldest advice in this book: at club level, memorised theory beyond move six or seven pays off in a small minority of games. Plans and structures pay off in all of them, because they travel to the positions your tree never reached.
Prep load turns the same idea into a number you can compare across choices:
Prep load: opponent replies to prepare so every reached node is >= 80% covered, to ply 10
(reference: Lichess blitz, the repertoire side rated 1550-1750; nodes with < 30 games not expanded)
1.e4 (most popular White moves) 144 positions by ply {2: 5, 4: 11, 6: 25, 8: 45, 10: 58}
1.e4 with Dev's own choices 135 positions by ply {2: 5, 4: 11, 6: 26, 8: 43, 10: 50}
1.d4 (most popular White moves) 107 positions by ply {2: 5, 4: 18, 6: 48, 8: 31, 10: 5}
Black: 1...c5 vs 1.e4 53 positions by ply {3: 5, 5: 17, 7: 23, 9: 8}
Black: 1...e5 vs 1.e4 75 positions by ply {3: 4, 5: 13, 7: 33, 9: 25}
Black: 1...c6 vs 1.e4 65 positions by ply {3: 3, 5: 8, 7: 18, 9: 36}
Black: 1...e6 vs 1.e4 65 positions by ply {3: 4, 5: 10, 7: 17, 9: 34}
Black: 1...d5 vs 1.e4 25 positions by ply {3: 2, 5: 4, 7: 8, 9: 11}
Two readings. At this level, 1...e5 is a heavier defence to prepare than 1...c5 (75 positions against 53): 1600-rated White players scatter after 1.e4 e5 into many second and third moves — in Dev's own Black games alone we meet 2.f4, 2.Bc4, 3.Bc4, 3.d4, 3.Bb5 and 3.Nc3 — while after 1.e4 c5 the games funnel into fewer branches, and the extra Black positions sit mostly at plies 7 and 9. And the Scandinavian (1...d5) is by far the lightest (25), because after 2.exd5 White's options are narrow — a plausible part of its popularity below 2000. The 1.d4 figure deserves suspicion: its tree stops expanding sharply after ply 8 (only 5 positions at ply 10), a sign that the reference games at those nodes fall below the 30-game threshold sooner than in the 1.e4 tree. Prep load compares fairly only when the trees rest on similar numbers of games.
🔄 Check your understanding 1. With two prepared replies per node, what share of Dev's band's games is still inside his prepared tree after ply 10? What does that imply about memorising long lines? 2. Why can't Dev's results tell us whether he is a "tactical" player?
Answer
- 19.3%. Fewer than one game in five reaches move 6 within the prepared lines, so long memorised lines pay off rarely at this level; plans and typical structures cover the other 80%.
- His scores in opposite-castling games (48.9%, n=90) and other games (53.1%, n=479) have overlapping intervals, and both are close to his Elo expectation. The difference is not distinguishable from noise with this many games.
20.7 Building Dev's Repertoire, Step by Step
Put the pieces together and you have a procedure. It works for any player with a few hundred games online; the numbers below are Dev's.
- Draw your tree from your last few hundred games, separately for White and Black. Mark your own decisions — including the ones you never consciously made.
- Attach the database expectation at your level to every node: same speed, same colour, your band, your games removed.
- Put an interval on every number about you. Mark each node "above", "below" or "cannot tell" — and remember that if you test thirty nodes, one or two will cross the line by chance.
- Prioritise by how often you reach a node times how much you lose there after shrinking small samples toward the database.
- Engine-check the tabiyas (soundness) and run the engine over your games in the top-priority branches (where do they go wrong?).
- Choose model games for each priority branch — one classic, one modern — and write a one-page sheet: the tabiya, the plans for both sides, the typical tactics, how often you reach it.
- Re-measure later, with intervals, and with the engine pass rather than the score as your main evidence.
Step 4 needs one more definition.
📐 Definition — shrinkage toward the database (a "prior worth K games"): for a node where you have n games and points points, and the database expectation at your level is e, the shrunk score is (points + K·e) / (n + K). With K = 30, a node with 10 games is pulled most of the way to the database and a node with 300 games barely moves. Study priority = (share of your games reaching the node) × max(0, e − shrunk score). A node rises to the top only if you reach it often and lose there believably.
Dev's White study list (code/03_repertoire_tree.py, nodes where it is his move, at least five games,
to ply 8):
Study priorities, Dev as white: 30 nodes tested (>= 5 games, his move to make); verdicts {'cannot tell': 26, 'above': 3, 'below': 1}
line games reach score lo hi db_score db_games shrunk verdict priority
1.e4 c5 2.Nf3 d6 21 7.8% 33.3% 17.2% 54.6% 53.9% 1159 45.4% below 0.0066
1.e4 c5 2.Nf3 d6 3.d4 cxd4 4.Nxd4 Nf6 17 6.3% 35.3% 17.3% 58.7% 57.1% 285 49.2% cannot tell 0.0050
1.e4 c5 53 19.7% 46.2% 33.5% 59.4% 49.9% 8452 47.6% cannot tell 0.0047
1.e4 c5 2.Nf3 d6 3.d4 cxd4 19 7.1% 36.8% 19.1% 59.0% 52.1% 537 46.2% cannot tell 0.0042
1.e4 e6 20 7.4% 45.0% 25.8% 65.8% 49.9% 4680 47.9% cannot tell 0.0014
Read it carefully, because it is easy to over-read. Thirty nodes were tested; one came out "below" and three "above". At a 5% false-alarm rate per test, thirty tests produce about one and a half false alarms on average even for a player with no real strengths or weaknesses. The single "below" node — 1.e4 c5 2.Nf3 d6, where Dev has 21 games at 33.3% — crosses the line by a hair (the upper end of the difference's interval is just below zero) and overlaps heavily with the same 19 Najdorf games we have already examined. It is not new evidence.
What the list does show is useful. The top four priorities all sit on one branch: 1.e4 c5 and the road to the Najdorf. Dev reaches it in about one White game in five (1...c5) and about one in thirteen (2...d6). After shrinkage, his deficit there is a few points, not thirty. That is the honest version of Dev's story: study the Najdorf because you reach it often and it is hard at your level — not because one number looked bad. And the engine pass in 20.4 says what to study: the middlegame, not move 12 of the theory.
His Black list is quieter still: 25 nodes, one "below" and one "above". The top priority is the Scandinavian (1.e4 d5 2.exd5: 13 games, 34.6% [15.1–61.1], shrunk 45.5% against a database 50.3%) — a branch he reaches in about one Black game in twenty-three. It goes on the list, low down.
Dev: So my "Najdorf problem" is a middlegame problem that happens to start in the Najdorf.
Grace: And a three-minute-clock problem. You were winning that game on move 34.
Sam: We used to call that playing the opening by heart and the middlegame by ear.
Dev: Fine. I keep 6.Be3. Three model games, one sheet per branch, and I run the engine over every Najdorf game I play for the next two months.
We add one condition: he checks whether his evaluation after move 10 stays positive and his first mistake comes later — not whether his score goes up. Fifty games will not show him that, and we will not pretend otherwise.
📋 Try it — Build the plan: Here is the main 6...e5 tabiya after 7.Nb3 Be6, the branch Dev reaches most often. White to move. Write down White's plan in one sentence (no moves), then the first three moves that start it.
♟️ Position: White Ke1, Qd1, Ra1, Rh1, Bf1, Be3, Nb3, Nc3, a2, b2, c2, f2, g2, h2, e4; Black Ke8, Qd8, Ra8, Rh8, Be6, Bf8, Nf6, Nb8, e5, a6, d6, b7, f7, g7, h7 — White to move. FEN:
rn1qkb1r/1p3ppp/p2pbn2/4p3/4P3/1NN1B3/PPP2PPP/R2QKB1R w KQkq - 2 8
Answer
Plan: secure e4 with f3, connect with Qd2 and castle long, then advance the g- and h-pawns to drive the f6 knight away from d5 and attack Black's king; Black will answer with ...b5–b4 and play on the c-file. Stockfish 19's top choices at depth 20 are 8.f3 (+0.31), 8.Qd2 (+0.29) and 8.h3 (+0.21). Evaluating each resulting position at depth 24: 8.f3 +0.34, 8.Qd2 +0.24, 8.Be2 +0.21, and 8.f4 only +0.06 — the f4 push, which Dev likes, releases the tension early (the engine's line 8...exf4 9.Bxf4 Nc6 10.Qd2 d5 shows Black freeing the position at once). The order of f3, Qd2, O-O-O and g4 can vary; the plan does not.
🔄 Check your understanding 1. Why does the shrunk score for 1.e4 c5 2.Nf3 d6 (45.4%) sit so much closer to the database (53.9%) than Dev's raw score (33.3%)? 2. Thirty nodes are tested and one is "below". Why is that weak evidence of a real weakness?
Answer
- The node has only 21 games; with a prior worth 30 games, the database expectation carries more weight than Dev's own results: (7 + 30 × 0.539) / (21 + 30) ≈ 45%.
- Each test has about a 5% chance of a false alarm, so thirty tests are expected to produce about 1.5 false alarms even with no real effects. One "below" is exactly what chance alone would give.
20.8 At Different Levels — and Grace's Over-the-Board Repertoire
The method does not change with rating. What it recommends does.
At 1200 (Lichess blitz). About half of your 1.e4 games meet 1...e5, and Sicilian players meet 2.Bc4 and 2.d4 more often than an Open Sicilian. A White repertoire is one main line against 1...e5, short sound answers to 1...d5, 1...c5, 1...e6 and 1...c6, and nothing deeper than move 6 or 7 — the coverage curve says the games leave your tree by then anyway. The engine pass over your games will mostly find tactical errors in the first 15 moves; the principles of Chapter 19 do most of the work.
At 1600 (Dev). The Sicilian rises to about one 1.e4 game in five; real branches appear. This is where the tree, the database expectation and the interval discipline start to pay — and where model games for the two or three branches you reach most often are worth more than any amount of memorisation.
At 2000 and above. The Sicilian is the most common answer to 1.e4, Open Sicilians are a quarter or more of Sicilian games by move 4, and opponents prepare. Theory starts to matter in the main branches, and preparation becomes opponent-specific — the subject of Chapter 24.
Grace: one long game a round
Grace Mbeki (FIDE about 1850) plays classical over-the-board tournaments: one game a day, no second
chances, opponents who may have looked at her games. Her repertoire question is the opposite of Dev's
blitz problem. She needs a defence to 1.e4 that holds up in long games against FIDE-rated players around
her level — and our broadcast data is exactly that pool. Rating pools are not interchangeable: these
are FIDE ratings from over-the-board events, not Lichess ratings, and nothing below should be compared
with Dev's numbers. code/07_grace_black.py takes classical OTB games with Black rated FIDE 1750–1950
(engine and online events excluded, her own composite games removed):
OTB classical, Black FIDE 1750-1950 (Grace's games removed): 42,563 games; after 1.e4: 22,813; median White rating 1887, Black 1858
reply games share black_score lo hi draws elo_expected adj
1...c5 9742 42.7% 45.1% 44.1% 46.1% 24.4% 47.2% -2.1
1...e5 4697 20.6% 45.4% 43.9% 46.8% 24.1% 46.9% -1.5
1...c6 3111 13.6% 43.2% 41.5% 45.0% 25.4% 46.0% -2.7
1...e6 2909 12.8% 42.2% 40.4% 44.0% 25.5% 46.1% -3.9
1...d6 882 3.9% 41.6% 38.4% 44.9% 23.1% 46.8% -5.2
1...d5 668 2.9% 39.2% 35.6% 43.0% 26.3% 48.3% -9.1

📊 Figure (described): Black's score with 95% intervals (blue) and the Elo expectation in the same games (orange) for each reply to 1.e4, OTB classical, Black rated FIDE 1750–1950. The four main defences (1...c5, 1...e5, 1...c6, 1...e6) all score 42–46% with overlapping or adjacent intervals, each a few points below its Elo expectation; 1...d5 is the one clear underperformer.
Black scores below expectation with every common reply, and the four main defences sit within about 2.5 points of each other once you subtract the Elo expectation (adjusted −1.5 to −3.9). The outlier is the Scandinavian, 9.1 points below its expectation over 668 games: the defence that is lightest to prepare and among the most popular in Lichess blitz is the weakest performer in classical OTB games at this level (in these games; selection — who chooses it — is part of any such number). Draw rates are about a quarter of games for every main defence.
What the table cannot tell Grace is which defence fits her. Her own composite record as Black against 1.e4 is 60 games, 31 of them Sicilians at 41.9% [26.4–59.2] — another interval too wide to decide anything. Case Study 2 works through her decision with prep load, branch-by-branch results and engine checks.
🔄 Check your understanding 1. Grace's four main defences span −1.5 to −3.9 points relative to Elo expectation. Why does the chapter treat them as practically equivalent? 2. Name one thing the Scandinavian's −9.1 might partly reflect besides the opening itself.
Answer
- The spread (2.4 points) is about the size that selection — who chooses each defence — can produce on its own, and the Elo correction does not remove style or preparation; all four tabiyas are also sound (+0.19 to +0.43 at depths 20/24, Case Study 2).
- Selection: at this level it may attract players looking to avoid theory, or players who are weaker than their rating in long games. The opening is not the only thing that differs between groups.
🪞 Learning check-in: Take a minute with three questions. Can you draw the first three plies of your own repertoire tree, for both colours, from memory — including the moves you play without thinking? When you last changed an opening after a bad run, how many games was that decision based on, and would it have survived a 95% interval? And which part of your games in your main opening — the first ten moves or the next twenty — have you actually checked with an engine?
Spaced Review
Answer each question before opening the hint.
- Chapter 19 — opening principles. In the English Attack White often castles on move 10 or later, after f3, Qd2 and sometimes g4. Does that break the "castle early" principle, and what does the data say about how much early castling matters?
Hint
Principles are reasons, not rules: White delays castling because the centre is stable (the d4 knight has gone to b3, Black's e-pawn is fixed) and the king's destination depends on the plan. In the book's opening-behaviour tables, castling by move 10 is associated with only +0.7 rating-adjusted score points on Lichess (48.7% of side-games castle that early) and +0.6 over the board — a small effect next to playing a coherent plan.- Chapter 8 — plans as directions. Restate White's plan in the 6...e5 English Attack as a direction (target, wing, pieces), not a move list.
Hint
"Play on the kingside, where my pawns can advance without exposing my own king: g4–g5 to remove the f6 knight from d5, then occupy d5 or open the g-file toward the black king, with the queen and rooks behind the pawns." The moves come one at a time, each checked against ...b5–b4 and the c-file.- Chapter 13 — practical decisions under time pressure. Dev's 34.Nc5?? came in a three-minute game in a winning position. What habit from Chapter 13 would most likely have caught it?
Hint
The blunder check before every move — "what does this move leave undefended, and what can my opponent capture?" — is the habit that time pressure erodes first. Dev's composite record shows his own clock below 10% of base time in 19.9% of his games, close to his reference pool (22.7%); sharp openings in blitz punish exactly that moment.Project Checkpoint: repertoire.py
Dev's Outpost already reads games, assesses structures and plans, and finds tactics. This week it learns what he plays — and how far his own results can be trusted.
Dev: Every opening tool I've used shows me percentages. None of them shows me how wide the interval is. That's the feature.
The module is project/outpost/repertoire.py. It depends on python-chess and pandas, and on
outpost.games for the GameRecord input:
| Function | Returns |
|---|---|
build_tree(games, color, max_ply=12) |
the repertoire tree from (sans, score_white, weight) triples; points stored from color's side |
from_records(recs, player, color) / from_frame(df) |
triples from Outpost game records or a DataFrame with a SAN column |
node_at(root, moves), replies_table(node, color) |
a node, and its continuations with share, score and Wilson interval |
render(root, color, max_ply, min_share, min_games, reference) |
the indented text tree, with the database score beside each node |
wilson_interval(points, n), games_needed(half_width) |
the interval, and the games needed for a given precision |
gap_interval(...), verdict(points, n, expected, expected_n=None) |
"above" / "below" / "cannot tell", with a two-sample test when the reference is thin |
compare(personal, reference), shrink(...) |
node vs database, including the shrunk score |
study_priorities(personal, reference, color) |
the ranked study list (reach × shrunk deficit) |
my_moves(root, color), coverage(...), prep_load(...) |
your implied choices, how fast games leave your tree, how many positions to prepare |
The core of the tree is a short loop — every game walks down from the root, adding its weight and points to each node it passes:
for sans, score_white, weight in games:
pts = score_white if color == "white" else 1.0 - score_white
node = root
node.games += 1
node.weight += weight
node.weight_sq += weight * weight
node.points += pts * weight
for i, san in enumerate(list(sans)[:max_ply]):
nxt = node.children.get(san)
if nxt is None:
nxt = Node(moves=node.moves + (san,))
node.children[san] = nxt
node = nxt
node.games += 1
node.weight += weight
node.weight_sq += weight * weight
node.points += pts * weight
code/project_checkpoint.py builds Dev's tree from games.book_persona_games("dev"), compares it with
the chapter's cached reference table, and prints (excerpt):
node 1.e4 c5 2.Nf3 d6 3.d4 cxd4 4.Nxd4 Nf6: Dev 35.3% [17.3%-58.7%] over 17 games; database 57.1% (n=285); verdict: cannot tell; shrunk 49.2%
games needed for a +/-10-point interval: 97
games needed for a +/-5-point interval: 385
study list (top 5):
1.e4 c5 2.Nf3 d6 reach 7.8% Dev 33.3% (n=21) db 53.9% (n=1159) shrunk 45.4% below
1.e4 c5 2.Nf3 d6 3.d4 cxd4 4.Nxd4 Nf6 5.Nc3 a6 reach 5.6% Dev 33.3% (n=15) db 62.5% (n=125) shrunk 52.8% below
1.e4 c5 2.Nf3 d6 3.d4 cxd4 4.Nxd4 Nf6 reach 6.3% Dev 35.3% (n=17) db 57.1% (n=285) shrunk 49.2% cannot tell
1.e4 c5 reach 19.7% Dev 46.2% (n=53) db 49.9% (n=8452) shrunk 47.6% cannot tell
1.e4 c5 2.Nf3 d6 3.d4 cxd4 reach 7.1% Dev 36.8% (n=19) db 52.1% (n=537) shrunk 46.2% cannot tell
coverage with 2 prepared replies per node: ply 2: 56%, ply 4: 44%, ply 6: 31%, ply 8: 23%, ply 10: 19%
prep load to ply 10 (80% per node): 135 positions {2: 5, 4: 11, 6: 26, 8: 43, 10: 50}
The checkpoint scans two plies deeper than the study list in 20.7, so a fifth-move node appears — again on the same Najdorf branch, and again resting on 15 games, with a reference of only 125. Notice how the database's own figure jumps around as the branch thins (53.9% → 57.1% → 62.5%): deep nodes are noisy on both sides of the comparison.
How it plugs in. Chapter 23's prep.py takes
the priority nodes from study_priorities and runs the engine-and-database workflow on them;
Chapter 24's scout.py builds the same tree for an
opponent's games, where replies_table becomes "what will they play against me?";
Chapter 31's database.py will
supply larger reference trees; and the capstone report in Chapter 40 prints the tree and the study list
on the front page of a player's dossier.
Chapter Summary
| Principle | What it means in practice | The number to remember |
|---|---|---|
| A repertoire is a tree | One move at your nodes; every common reply at your opponent's | Dev's 1.e4: 1...e5 49%, 1...c5 20% of his games |
| Prepare for your level | Reply frequencies change completely with rating | 1...c5 vs 1.e4: 5.8% below 1000, 34.1% at 2200–2399 (Lichess blitz) |
| Scores need intervals | 50 games = ±13 points; 385 games = ±5 | Dev's Najdorf 36.0% [24.1–49.9] — cannot tell |
| Beware forking paths | Scan many lines and one will look bad by chance | 72.3% of luck-only seasons have a line ≥10 points below expectation |
| Find where games go wrong | Engine over your games: eval at move 10, first error | Dev's Najdorf losses: median +0.32 after move 10 |
| Soundness is a floor | Check tabiyas at two depths; treat ±0.3 as "equal" | English Attack +0.32 / +0.40 (depths 18 / 24) |
| Learn plans from model games | Classic + modern per branch, checked with the engine | Polgar–Gelfand 1996; Vachier-Lagrave–Tabatabaei 2026 |
| Practicality is measurable | Coverage decays fast; prep load differs by defence | 2 replies per node: 19.3% still in book at ply 10 |
Decision checklist — before you change an opening:
- How many games is this based on? Look up the interval half-width (10 games ±26, 50 ±13, 100 ±10).
- Is the comparison against a database at your level, with your games removed — and is that database itself large enough?
- How many lines did you look at before this one stood out?
- Do you leave the opening worse? (Engine: median evaluation after move 10.) If not, the problem is later in the game.
- Is the line sound? (Two depths; ignore differences inside ±0.3.)
- How often do you reach it, and how much preparation does the alternative need?
- Can you name the plans for both sides without naming moves?
What's Next
Dev's tree tells him where to study; the next chapters supply the what. Chapter 21 and Chapter 22 organise the main openings for both colours by structure and plan, with the same database-and-engine treatment at every level, and Chapter 23 takes Dev's Najdorf branch through a full engine-assisted preparation workflow.


