57 min read

It is the last Thursday of the season at the Hartwell library, and Dev Raman has his laptop open on the

Chapter 40 — Capstone: Your Complete Chess Analysis and Improvement Toolkit — Built, Tested, and Ready to Raise Your Rating

It is the last Thursday of the season at the Hartwell library, and Dev Raman has his laptop open on the tournament table before anyone has set up a board. For thirty-nine weeks he has been adding one Python module a week to a folder called outpost. Tonight he typed the commands that wire them together, and the terminal printed one line he has been waiting for since autumn:

report written: runs/dev/report.html

He opens the page. At the top, in a grey box, is the sentence he typed into the import command months ago, when he first started worrying about his results with White: "My Najdorf (6.Be3, the English Attack) is my weak spot." Directly underneath is the toolkit's answer, one line long:

[noise] W: Najdorf 6.Be3: 36.0% [24.1-49.9], -12.2 pts vs own average (n = 50, q = 0.254)

🎭 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.

Thirty-six per cent sounds terrible. Twelve points below his own average sounds worse. But the interval runs from 24% to 50%, and once the toolkit accounts for the thirteen opening lines it tested at the same time, the chance that a gap this size is pure luck is too high to act on. The weakness Dev felt — the one that made him dread every 1.e4 c5 2.Nf3 d6 — is, as far as fifty blitz games can tell, not distinguishable from bad luck.

The Najdorf 6.Be3 tabiya: the English Attack position Dev expected to be his weakness

♟️ 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

The position itself is not the problem either. Stockfish 19 rates this tabiya +0.32 at depth 18 and +0.40 at depth 24 — White has the normal first-move edge, no more. What the report does flag sits further down the page, in places Dev never looked: his Italian Game as White is a strength that survives the statistics, and compared with 1,500 anonymous players at his level he makes more of one particular kind of blunder — the quiet, middlegame "plans and calculation" kind — than his peers do. That second finding comes with its own warning label, and by the end of this chapter you will know exactly why.

Sam Whitaker leans over the screen. "So the machine says your problem isn't the opening you complain about. I could have told you that in 1985 for the price of a coffee."

Dev: "You'd have told me. This shows me — with an interval."

Sam: "Fair. Does it work on anyone real?"

It does. In this chapter we run the same seven commands on the public Chess.com archive of GothamChess (Levy Rozman): 31,719 rated games from March 2017 to November 2026. Dev has a guess about him too — that a streamer who plays fast blitz all day must be losing his points on the clock. The data has a different opinion.

This is the book's last chapter. It does three things. It assembles Outpost — the forty-one modules you built — into a command-line tool, an HTML report and a test suite, and tells you honestly what passed. It runs the whole pipeline on a composite player and on a real one, and asks the question every improvement plan should start with: does the data find the weakness the player expected? And it closes the book by revisiting the six themes and the ladder that every player in these pages — Morphy and Menchik, Lena and Grace, you — has been climbing.

♟️ Improver Track: Read 40.1 for the map, skip the code in 40.2, then read 40.3–40.7 as a story about two players and what their data did and did not say. Section 40.9 is your 12-week protocol.

📊 Analyst Track: The statistical heart is 40.4 (games as clusters, colour-balanced peer pools) and 40.6 (replication before belief). Case Study 1 works the full replication.

🏆 Competitor Track: Run scout on yourself (40.3): it is the report a well-prepared opponent can build on you. Then read 40.7 for how a strong player's real weaknesses look in data.

💻 Developer Track: 40.2 is the architecture — workspace, commands, verdict vocabulary, tests — and the Project Checkpoint shows the finished python -m outpost from end to end.

40.1 What we built: forty-one modules, one toolkit

Start with an inventory. Over thirty-nine chapters, Dev (and you) added one module per chapter to project/outpost/; this chapter adds the last two (cli.py and report.py) and the entry point __main__.py. The script code/01_toolkit_inventory.py imports every module, counts its public functions and classes, and runs the test suite:

Outpost modules: 41  |  public functions/classes: 628  |  lines of code: 15,327
                      modules  public  lines
part
I Strategy                  8      98   2453
II Tactics                  5      73   1757
III Endgames                5      76   2188
IV Openings                 6      88   2078
V Competition               5      66   1458
VI Data science             6     131   2856
VII Special/capstone        6      96   2537

Outpost module map: public functions per module, coloured by part

📊 Figure (described): One horizontal bar per module, in chapter order from games (Chapter 1) to cli and report (Chapter 40), coloured by the book's seven parts. The longest bars belong to the analytics modules — progress (32 public functions), tactics and style (23 each), database (21) — while the strategic modules of Part I are small and focused. The takeaway: the toolkit is not one big program but forty-one small, testable tools that each answer one chess question.

It helps to see the toolkit not by chapter but by the question each module answers. Grouped that way, the forty-one modules fall into five layers:

Layer Question Modules (chapter)
Data in Where do my games come from, and what is in them? games (1), database (31), clock (13)
The position What does this position mean? structure (2), activity (3), king_safety (4), space (5), material (6), prophylaxis (7), planner (8), tactics (9), calc (10), dynamics (12), endgame modules (14–18)
The game Where did this game turn, and why? review (26), sacrifices (11), accuracy (32)
The player What are my habits and my real weaknesses? repertoire (20), scout (24), training (25), tilt (28), progress (35), online (36), coach (38), style (33)
Context How does chess itself behave? opening_report (21), opening_compare (22), prep (23), tournament (27), history (29), ratings (30), engine_lab (34), variants (37), community (39)

The capstone pipeline lives mostly in the fourth layer — the player — because that is the question an improving player asks. But notice how it leans on everything underneath. The coach module's blunder classifier (Chapter 38) calls tactics.move_motifs (Chapter 9) to decide whether a blunder "walked into a tactic". The review module (Chapter 26) runs Stockfish through the toolkit wrapper whose depth discipline you learned in Chapter 32. The opening verdicts use the expectation formula from Chapter 30 and the "judge a line against your own average" rule from Chapter 24. The trend panel is Chapter 35's changepoint detector, run on performance rather than the rating level for the reason that chapter proved.

That is the deepest lesson of the inventory, and it is a chess lesson as much as a software one. A strong player's judgement is also layered: the structure tells you the plan (Chapter 2), the plan tells you where the tactics will come from (Chapter 9), the tactics need calculation (Chapter 10), and the whole thing is played against a clock (Chapter 13) by a person who can tilt (Chapter 28). No single number captures it. A toolkit that tried to boil you down to "your accuracy is 87.1" would be as useless as a coach who only ever said "play better".

🔄 Check your understanding 1. Which two layers of the table does a single-game review mostly use, and why can't it tell you about your habits? 2. Why do the analytics modules of Part VI have the most public functions?

Answer

  1. The game layer (review, accuracy) and the position layer (the engine's best moves, the error classifier's board geometry). One game is one sample: it can show you a mistake, but not whether you make that mistake more often than other players at your level — that needs many games (the player layer).
  2. Because measuring people is harder than measuring positions: every metric needs a definition, an interval, a comparison group and a guard against false alarms (simulation, split-half replication, multiple-testing correction). Each of those is a function.

40.2 The command line, the workspace and the tests

Seven commands

A toolkit you have to drive from a Python notebook is a toolkit you will use twice. The capstone module cli.py turns Outpost into seven commands, run from the project/ folder:

python -m outpost import     --persona dev --work runs/dev --expect "My Najdorf (6.Be3) is my weak spot"
python -m outpost import     --chesscom GothamChess --work runs/gotham
python -m outpost import     --pgn my_games.pgn --player MyName --work runs/me
python -m outpost analyze    --work runs/dev          # book accuracy, blunders, error types, peers
python -m outpost review     --work runs/dev --game 401
python -m outpost repertoire --work runs/dev          # openings vs your own average + the tree
python -m outpost scout      --work runs/dev          # the report an opponent could build on you
python -m outpost progress   --work runs/gotham       # trend, plateaus, speeds, tilt, sessions
python -m outpost report     --work runs/dev          # one self-contained HTML page

Each command reads and writes a workspace — an ordinary folder. import writes games.parquet (one row per game, always from the player's side: colour, own rating, opponent's rating, score, speed, time control, opening family, termination, moves with any clock and engine comments) and meta.json (who, which source, which rating pool, whether the player is a composite, and the expectation you typed). Every later command reads that table and writes its own outputs beside it. That design choice matters more than it looks. You can run the expensive engine step once and the cheap ones as often as you like; you can open any intermediate file in a spreadsheet; and when something looks wrong you can see which step produced it.

Here is the heart of import — the part that turns four very different sources into the same table:

def run_import(work, persona=None, chesscom=None, pgn=None, lichess=None, player=None, speed=None,
               limit=None, expect=None, offline=True, max_moves_games=1500) -> dict:
    """Load games from one source into `work`/games.parquet and write meta.json."""
    w = _work(work)
    if persona:
        g = from_persona(persona)
        name, composite = persona.capitalize(), True
        pool = PERSONAS[persona.lower()]["pool"]
    elif chesscom:
        g = from_chesscom(chesscom, speed=None, max_moves_games=max_moves_games, offline=offline)
        name, composite, pool = chesscom, False, "Chess.com (own pools per time class)"
    elif pgn:
        ...                                   # your own file: from_pgn_text(text, player=player)
    elif lichess:
        g = from_lichess(lichess, offline=offline)   # outpost.games downloads and caches it
        name, composite, pool = lichess, False, "Lichess (Glicko-2, per speed)"

Two fields in meta.json do quiet but important work. pool records which rating scale the numbers live on, because a Chess.com blitz rating, a Lichess blitz rating and a FIDE rating are different scales (Chapter 30) — so analyze refuses to compare a Chess.com player with the book's Lichess peer pool, and progress compares each time class with its own expectation, never ratings across pools. composite records whether the "player" is one of the book's assembled personas; if so, progress refuses to compute a trend, sessions or tilt, and says why — a composite drawn from many anonymous players over thirty-four hours has no history. Refusing to compute a number you cannot defend is a feature.

The verdict vocabulary

Every command also writes a findings_<command>.json file — a list of one-line conclusions — and the report collects them. To keep those conclusions honest, the toolkit uses exactly five verdicts.

📐 Definition: Outpost verdicts. Strength / weakness — the gap survives the statistics: a Benjamini–Hochberg q-value below 0.10 for opening lines judged against your own average (Chapter 35's rule), or a Bonferroni-corrected z for comparisons with a peer pool (|z| ≥ 2.73 for eight indicators, ≥ 2.77 for nine error rates). Noise — a gap was measured but does not survive. Cannot tell — an interval includes "no difference" (used for tilt and trends). Info — a description with no comparison (the phase in which you lose most, the most common blunder type).

The vocabulary forces the report to say, for each line, how sure it is. A finding that says "weakness" has passed a test that would rarely be passed by luck. A finding that says "noise" is not a clean bill of health — it means "we can't see it with this many games". The difference between those two sentences is the difference between a training plan and a superstition.

The tests

A toolkit that a reader will run on their own games has to keep working when a module changes. The suite in project/tests/ has two files. test_modules.py imports every one of the forty-one modules, checks that each documents itself, and runs a cheap known-answer check on each part of the book: the Carlsbad label on Anchor A's skeleton, a mate-in-one found by calc.mate_search, perft(3) = 8,902 from the start position, Glickman's worked Glicko-2 example (1464.05, RD 151.52), a KPK draw from the offline table, the rule of the square. test_cli.py runs every command on small cached samples — 120 of Dev's composite games, a four-game PGN in tests/data/, 400 cached GothamChess games — with shallow engine searches (depth 8–10), and checks that each writes what it promises: the right columns, a reconstructed movetext with [%eval] and [%clk] comments that the book's parser reads back exactly, a self-contained HTML page with no external scripts.

The result of the real run, from code/01_toolkit_inventory.py:

pytest (project/tests): 65 passed, 1 warning in 17.57s  [19 s wall]
exit code 0

Sixty-five tests, sixty-five passes, in under twenty seconds (the engine results are cached). The one warning is a pandas deprecation notice inside the toolkit's parallel engine wrapper — harmless today, worth fixing before pandas changes the behaviour.

Building the pipeline did turn up two real problems in the modules, and both are instructive.

The first was a skewed peer pool. Chapter 25's training.reference_sample draws anonymous Lichess players at your level by taking analysed games in which at least one side is in your rating band, and — when both sides are in the band — keeping White. Because Lichess pairs players of similar ratings, both sides are usually in the band, so the pool came out 1,177 White and 323 Black: 78% White. Any indicator that depends on colour (your win % after move 10 is the obvious one: White starts with the extra tempo) then compares a colour-balanced player with a mostly-White pool. The fix is one optional argument, both="random", which flips a seeded coin when both sides qualify; the default stays as Chapter 25 wrote it, so that chapter's printed numbers still reproduce. With balanced colours (762 White of 1,500), Dev's "own win % after move 10" went from 1.71 points worse than his peers (z = 1.24) to 0.45 points better (z = −0.36). A gap that was entirely an artefact of how the comparison group was drawn simply disappeared.

The second was a too-confident z-score. The coach.compare function from Chapter 38 treats each move as an independent chance to blunder, so it computes its z-scores as if blunder counts were Poisson. But blunders come in bunches: one bad game holds four of them, a good game none. Treating moves as independent overstates how precisely we know a player's rate. Outpost's analyze therefore keeps Chapter 38's z (as z) and adds a cluster-robust version (z_clustered) that treats games as the unit and includes the sampling noise of the peer pool too. The verdict uses the clustered version.

📐 Definition: clustered z for a rate. For a player with per-game blunder counts kᵢ and move counts mᵢ, the rate is R = Σkᵢ / Σmᵢ and its standard error (games as clusters) is √(Σ(kᵢ − R·mᵢ)² / (n(n−1))) / m̄. The clustered z for "player vs peers" is (R_player − R_peers) / √(SE²_player + SE²_peers).

On Dev's total blunder rate the two z-scores are 1.60 (Poisson) and 1.24 (clustered); on the "other" blunder type 3.65 and 3.15. Same direction, smaller certainty — exactly what clustering should do.

⚠️ Common pitfall: "the tests pass, so the analysis is right." Sixty-five green tests prove that the code runs, that each command writes what it promises and that a few known answers come out right. They do not prove that a comparison is fair — the 78%-White peer pool passed every test. Statistical bugs live in the design (who is compared with whom), not in the syntax. The only defences are the ones this book has practised since Chapter 20: state the comparison group, check its make-up, and replicate before you believe.

🔄 Check your understanding 1. Why does analyze refuse to build a Lichess peer pool for a Chess.com account? 2. Dev's "own win % after move 10" was 1.71 points worse than his peers with the original pool and 0.45 points better with the colour-balanced one. What changed — Dev, or the comparison?

Answer

  1. Because the two sites' ratings are different scales (and the evaluations come from different sources): a Chess.com 2000 and a Lichess 2000 are not the same level, so the "peers" would not be peers. The pool field in meta.json records the scale so that the command can refuse.
  2. Only the comparison. The original pool was 78% White, and White's win % after move 10 is naturally higher (the first-move edge), so a colour-balanced player looked worse against it. Balancing the pool's colours removed the artefact. Same games, same Dev, different verdict — which is why the comparison group is part of every finding.

40.3 Dev's pipeline, part one: what his games say about his openings

🧩 Productive struggle. Before you read the toolkit's output, make a prediction. Dev's composite has 600 Lichess blitz games, 300 as White (a 1.e4 repertoire, including 80 Italian Games and 50 Najdorf 6.Be3 games) and 300 as Black. His overall score is 51.9% against an Elo expectation of 49.9%. Of his thirteen opening lines with at least ten games, which — if any — will the toolkit call a weakness after correcting for testing thirteen lines at once? Write your answer down.

import prints the summary first:

600 games, 2026-10-01 to 2026-10-02
             games  score  expected  median_rating
speed color
blitz black    300   49.5      50.4         1640.0
      white    300   54.3      49.4         1657.5
with moves: 569; with stored engine evals: 241; lost on time: 67 of 277 losses

Two lines of context before the openings. The dates — 1 to 2 October 2026 — are the giveaway that this is a composite: the book's Lichess sample covers about thirty-four hours, and no human plays 600 blitz games in that time. And only 241 games carry Lichess server evaluations, because evaluations exist only where someone asked Lichess to analyse the game. Every engine-based number below therefore rests on 240 games, not 600.

Now repertoire, which judges every line with at least ten games against Dev's own average (the rule from Chapter 24: raw Elo expectation over-predicts favourites, so a line should be compared with how you score everywhere else) and controls the false-discovery rate across all the lines it tests:

REPERTOIRE - Dev (blitz, 600 games); lines with >= 10 games, judged against the player's own average (Benjamini-Hochberg q < 0.10):
                   line  n  score   lo   hi  expected  vs_baseline     q  verdict
        W: Italian Game 80   67.5 56.6 76.8      50.1         15.4 0.065 strength
       W: Najdorf 6.Be3 50   36.0 24.1 49.9      46.2        -12.2 0.254    noise
    W: Sicilian Defense 36   55.6 39.6 70.5      48.7          4.8 0.797    noise
    B: Sicilian Defense 28   50.0 32.6 67.4      52.2         -4.3 0.797    noise
   B: Caro-Kann Defense 25   70.0 50.4 84.3      45.6         22.3 0.150    noise
   B: Queen's Pawn Game 25   52.0 33.5 70.0      50.6         -0.7 0.946    noise
      W: French Defense 20   45.0 25.8 65.8      46.7         -3.7 0.797    noise
        B: Italian Game 20   62.5 40.9 80.0      52.9          7.6 0.797    noise
W: Scandinavian Defense 18   47.2 26.8 68.7      50.6         -5.4 0.797    noise
   W: Caro-Kann Defense 17   50.0 28.5 71.5      52.3         -4.4 0.797    noise
B: Scandinavian Defense 15   30.0 13.0 55.2      51.2        -23.2 0.254    noise
      B: French Defense 13   76.9 49.7 91.8      55.0         19.9 0.377    noise
         W: Scotch Game 12   75.0 46.8 91.1      54.6         18.4 0.424    noise

If you predicted "the Najdorf", you made Dev's mistake. If you predicted "nothing", you were close — the only line that survives is a strength, the Italian, at 67.5% over 80 games and 15.4 points above Dev's own average. The Najdorf's −12.2 and the Scandinavian-as-Black's −23.2 look dramatic, but their q-values (0.254 each) say that, with thirteen lines tested, gaps of this size on fifty and fifteen games turn up by chance far too often to act on.

Dev's openings against his own average, with 95% intervals

📊 Figure (described): One row per opening line — the twelve most-played, each with at least 13 games — the dot at the line's score minus Dev's own average and the bar its 95% Wilson interval. Only the Italian (blue) is called a strength after the false-discovery correction; every other dot, including the Najdorf 6.Be3 at −12 and the Scandinavian as Black at −23, is grey. The Scandinavian's bar even stops short of zero on its own — but with thirteen lines on the chart, one bar missing zero by chance is expected.

The figure's last point deserves a sentence of its own, because it is the single most common error in amateur data analysis. Each bar is a 95% interval for that line alone. Look at thirteen of them and you should expect roughly one to miss zero even if nothing is going on. The q-value is the correction for having looked thirteen times. That is also why the Italian's q is 0.065 here but 0.040 in the progress recommendations (below), which only test lines with at least twenty games: fewer tests, smaller correction. The evidence for the Italian did not change; the number of other questions asked alongside it did.

This matches what the book established when it first met Dev's Najdorf in Chapter 20: his Italian is a real strength at 67.5% [56.6–76.8], and his Najdorf at 36.0% [24.1–49.9] is "cannot tell". The capstone adds nothing new to the Najdorf numbers — and that is the point. A toolkit that gave a different answer from the careful analysis would be a broken toolkit.

repertoire also prints the tree of the games that have moves. The top of Dev's White tree:

Tree as white (269 games with moves; score from white's side):
* 1.e4       n=268   100%  score 55.6% [49.6%-61.4%]
      1...e5     n=130    49%  score 65.4% [56.9%-73.0%]
        * 2.Nf3      n=104    80%  score 65.4% [55.8%-73.8%]
              2...Nc6    n=89     86%  score 65.2% [54.8%-74.3%]
      1...c5     n=53     20%  score 46.2% [33.5%-59.4%]
        * 2.Nf3      n=37     70%  score 44.6% [29.8%-60.4%]
              2...d6     n=21     57%  score 33.3% [17.2%-54.6%]

Notice the gap between the two tables. The line table counts 50 Najdorf 6.Be3 games; the tree shows only 21 games reaching 1.e4 c5 2.Nf3 d6. Only 19 of the 50 Najdorf games have their moves in the data (the others are results with an opening name); the line table can use all 50, the tree only those 19 plus a couple of other ...d6 Sicilians. Always check what a number was computed from.

What an opponent would see

The scout command builds the report from Chapter 24 — the one a well-prepared opponent could build on you from your public games. Run on yourself, it is a mirror:

SCOUTING REPORT — Dev  (600 games)
Overall: 51.9% [47.9–55.9] vs expected 49.9%  (own average vs expectation +2.0; lines are judged against this)
As White, first move:
  e4           268 games (99.6%)  score  55.6% [49.6–61.4]  expected  49.4%  vs own average  +4.1  -> noise
As Black vs 1.e4:
  e5            85 games (47.5%)  score  47.1% [36.8–57.6]  expected  50.1%  vs own average  -5.1  -> noise
  c5            24 games (13.4%)  score  50.0% [31.4–68.6]  expected  52.7%  vs own average  -4.8  -> noise
  c6            20 games (11.2%)  score  67.5% [45.7–83.7]  expected  46.2%  vs own average +19.3  -> noise
  d5            15 games ( 8.4%)  score  30.0% [13.0–55.2]  expected  51.2%  vs own average -23.2  -> noise
Clock habits:
  blitz    567 games  median 3.0 s/move; base left at move 20 71%, move 40 30%; own clock < 10% in 19.4% of games
Predictability: White 1st move top e4 100% (0.04 bits); Black vs 1.e4 top e5 47% (2.48 bits); Black vs 1.d4 top d5 43% (2.63 bits)
Recommendations:
  - Predictable as White: e4 in 100% of games — prepare it first.
  - No line scores below expectation beyond noise: pick a sound line you know well, not a 'hole'.

The scouting report's most useful line for Dev is not about a weakness at all. As White he is perfectly predictable — 1.e4 in every game, 0.04 bits of uncertainty — while as Black he is hard to prepare for (about 2.5 bits: no reply above half his games). For an opponent preparing against him, that asymmetry is the whole story: prepare one thing against his White, nothing specific against his Black. For Dev, the lesson from Chapter 24 applies in reverse: the place where he is easiest to prepare for is the place he should know most deeply — and his deepest-scoring line, the Italian, lives exactly there.

🔄 Check your understanding 1. Dev's Scandinavian as Black scores 30.0% [13.0–55.2], 23.2 points below his own average, yet the toolkit calls it noise. Give two reasons. 2. Why does repertoire compare each line with Dev's own average rather than with the raw Elo expectation?

Answer

  1. Only 15 games — the interval is about 42 points wide — and it is one of thirteen lines tested at once, so its q-value (0.254) is far above 0.10. A gap that size on 15 games is the kind of thing thirteen lines of pure luck produce regularly.
  2. Because the Elo formula is biased for players who score above or below it overall (Chapter 24 and Chapter 30: it over-predicts favourites). Comparing a line with your own average asks the useful question — "do I do worse here than I do everywhere else?" — and is immune to a constant bias.

40.4 Dev's pipeline, part two: accuracy, blunders and a peer pool

The analyze command is where the engine comes in. For a player whose games already carry Lichess server evaluations, it uses them (they agree with our own Stockfish 19 runs to r = 0.993 at position level, as Chapter 32 measured); otherwise it runs Stockfish 19 itself on the most recent games, in parallel, with every result cached. Either way it produces the same three things: per-move metrics with the book's definitions (Chapter 32's accuracy.stored_moves), a blunder census with Chapter 38's error types (coach.analyse_movetext), and — for a Lichess-pool player — the same measurements on a pool of anonymous peers.

The heart of the command is short, because the modules do the work:

for r in sel.itertuples(index=False):
    m = acc.stored_moves(r.movetext_eval, max_ply=None)        # Ch 32: per-move CPL, win %, accuracy, phase
    m["own"] = m["side"] == r.color
    ge = coach.analyse_movetext(r.movetext_eval, base_s=r.base_s, inc_s=r.inc_s or 0.0)  # Ch 38: blunder types
    row = coach.player_game(ge, r.color, result=r.result, rating=r.own)
    ...
ref = tr.reference_sample(spec[0], spec[1], spec[2], n=n_peers, seed=seed, both="random")  # Ch 25 + fix
wp = tr.weakness_profile(tr.measure_games(own_rows), tr.measure_games(ref))                  # Ch 25 indicators
cmp_ = coach.compare(prof, ref_prof, z_crit=zc_c)                                            # Ch 38 error types
cmp_["z_clustered"] = clustered_z(per_game, ref_pg, cmp_)                                    # games as clusters

Dev's output, first his own numbers:

ANALYSIS - Dev (blitz, 240 games, evals: stored)
Book accuracy 87.1 (opening 90.2, middlegame 84.2, endgame 90.9); ACPL 64.8
Blunders per 100 moves 7.30 [6.72-7.92] (578 blunders in 7913 moves)
Share of win % lost to blunders by phase: opening 12%, middlegame 70%, endgame 18%
Blunder types (share of blunders): allowed a mate 2%, left a piece en prise 12%, walked into a tactic 6%, failed to punish 24%, endgame conversion error 1%, other (plans / calculation) 55%
Opponent blunders left unpunished: 30.8% of 577; winning endgames converted: 89.7% of 29; blunders made with own clock < 10% of base: 8%

Read the third and fourth lines together. Seventy per cent of the win percentage Dev throws away through blunders goes in the middlegame, and 55% of his blunders are of the "other" type — not a hung piece, not an allowed fork, not a failure to punish, but the residual category Chapter 38 labelled plans and calculation: the opponent's reply that wins is usually a quiet move, the kind you only see if you ask "what does my opponent want?" (Chapter 7). Every player's middlegame accuracy is lowest, so those two lines alone prove nothing about Dev. That is what the peer pool is for:

PEERS: 1500 anonymous Lichess blitz games, side rated 1550-1750 (analysed games, bots excluded, colours balanced, seed 2026; 762 as White)
Indicators (z = worse by / combined SE; |z| >= 2.73 after Bonferroni for 8 tests):
                             indicator  player  reference  worse_by     z  n_player
            blunders per 100 own moves    7.58       7.02      0.56  1.40       240
            middlegame accuracy (book)   84.20      85.14      0.94  1.58       236
               opening accuracy (book)   90.16      90.12     -0.03 -0.09       240
               own win % after move 10   50.42      49.97     -0.45 -0.36       238
               endgame accuracy (book)   90.87      91.65      0.78  0.81        98
        winning endgames converted (%)   87.88      83.01     -4.87 -0.78        33
                games lost on time (%)    9.58      10.80     -1.22 -0.59       240
games with own clock < 10% of base (%)   20.83      21.43     -0.60 -0.21       240
Error types per 100 moves vs peers (|z| >= 2.77 for 9 tests):
                                   metric  student  reference     z  z_clustered       verdict
                   blunders per 100 moves     7.30       6.83  1.60         1.24  within noise
             allowed a mate per 100 moves     0.13       0.22 -1.71        -1.99  within noise
      left a piece en prise per 100 moves     0.85       0.99 -1.25        -1.09  within noise
       walked into a tactic per 100 moves     0.45       0.42  0.46         0.40  within noise
           failed to punish per 100 moves     1.77       1.66  0.77         0.56  within noise
   endgame conversion error per 100 moves     0.10       0.29 -3.10        -4.14 real strength
other (plans / calculation) per 100 moves     4.01       3.27  3.65         3.15 real weakness
           unpunished opponent blunders %    30.85      31.69 -0.43        -0.38  within noise
             winning endgames converted %    89.66      82.35 -1.03        -1.18  within noise

Seventeen comparisons; fifteen within noise. The opening — Dev's worry — is level with his peers to a tenth of a point (90.16 vs 90.12 book accuracy; 50.4% vs 50.0% win expectancy after move 10). His clock is, if anything, slightly better managed than theirs (9.6% of games lost on time vs 10.8%). His endgame accuracy and conversion are ordinary. Two lines pass the Bonferroni bar: he makes more "other" blunders than his peers (4.01 vs 3.27 per 100 moves, clustered z = +3.15), and fewer endgame-conversion blunders (0.10 vs 0.29, z = −4.14).

Two different modules count blunders here, with slightly different definitions — Chapter 25's training.measure_games gives 7.58 per 100 moves (the average of each game's rate), Chapter 38's census 7.30 (total blunders over total moves) — and they agree on the verdict. When two independently written measurements of the same thing agree, you have learned something about the measurement as well as the player.

Dev's blunders by type, per 100 moves, against 1,500 peers

📊 Figure (described): Blunders per 100 own moves for each of Chapter 38's six error types, Dev (blue) against 1,500 anonymous Lichess blitz players rated 1550–1750 (orange). The bars are nearly the same length for every type except two: Dev's "other (plans / calculation)" bar is visibly longer (4.01 vs 3.27) and his "endgame conversion error" bar visibly shorter (0.10 vs 0.29). Everything else — hung pieces, allowed tactics, failures to punish — sits at his level's normal rate.

🔍 Why this works — why games, not moves, are the unit. A blunder is not a coin flip made fresh on every move. Players have bad games — a time scramble, a position they misread from move 12, a tilt after the last game — and in those games blunders cluster. If you treat 7,913 moves as 7,913 independent trials, you behave as if you had far more information than you do: the interval around Dev's rate would be too narrow and every gap would look more significant. Treating the 240 games as the independent units — the cluster-robust standard error — widens the interval exactly as much as the clustering warrants. Dev's "other" gap drops from z = 3.65 to 3.15; his overall blunder gap from 1.60 to 1.24. The endgame-conversion gap goes the other way (−3.10 to −4.14), which is itself a warning: with only eight such blunders in Dev's games, the cluster formula has very little to work with, and its estimate of the spread is unstable. Rare events are where every formula is least trustworthy — which is why the next step is replication, not belief.

📋 Try it — Database research. Run python -m outpost analyze --work runs/dev --peers blitz:1350-1550 (a peer pool two hundred points below Dev) and then --peers blitz:1750-1950 (two hundred above). Which of the seventeen comparisons change verdict?

Worked answer

Expect the total blunder rate to move most: the book's data (section 40.8) shows 7.59 blunders per 100 moves at Lichess blitz 1400–1599 and 6.43 at 1800–1999, so against the lower pool Dev looks better and against the higher pool worse. This is the reason the toolkit's default pool is centred on the player's own band: a peer comparison answers "am I unusual for my level?", and that question only makes sense at your level. Comparing with a stronger pool tells you what the next rung looks like (40.8), which is a different, also useful, question.

40.5 Dev's pipeline, part three: one Najdorf game, move by move

Statistics tell you where to look; a single game tells you what you will see there. The review command (Chapter 26's module) runs Stockfish 19 over every move of one game, lists the critical moments (plies that move White's win % by 15 points or more), classifies each mistake, draws the evaluation graph and saves a diagram of the player's first critical moment. We point it at Dev's most recent Najdorf 6.Be3 loss that has its moves — game 401 of his composite (14 of his 19 Najdorf games with moves are losses):

# Game 401 - Dev (white, Najdorf 6.Be3)

Dev vs opponent · 0-1 · Stockfish 19, depth 18

| side | moves | ACPL | accuracy | inacc. | mistakes | blunders | ACPL alive only |
|---|---|---|---|---|---|---|---|
| black | 36 | 30.5 | 95.3 | 0 | 0 | 1 | 7.9 |
| white | 36 | 57.2 | 91.1 | 1 | 0 | 2 | 59.8 |

## Critical moments (one ply moved White's win % by 15+ points)

- 15.Bxh6 (middlegame, 9 s spent): -0.55 -> -2.71; engine: Bh4 (Bh4 Qb6 b3 Bd8 Nd5 Nxd5)
- 18...Bxf3 (middlegame, 2 s spent): -3.78 -> -1.03; engine: Kh8 (Kh8 Qe3 Qc5 Rcd1 b5 b3)
- 19.gxf3 (middlegame, 1 s spent): -1.03 -> -6.34; engine: Nf5 (Nf5 Bf6 Re3 Bg4 Rg3 Kh8)

## Error types

- 15.Bxh6 blunder: hung material; best reply gxh6
- 19.gxf3 blunder: quiet punishment; best reply Bg5

The first thing to notice is where the game was not lost. After move 10 — the end of the opening, the place Dev was sure his problem lived — Stockfish 19 at depth 18 rates the position +0.07: dead level. Dev's opening did its job. His first real error came at move 15:

Dev's game 401 before 15.Bxh6: the bishop takes on h6 (red); Stockfish prefers the retreat Bh4 (green)

♟️ Position: White Kg1, Qd2, Rc1, Re1, Bf1, Bg5, Nc3, Nf3, a2, b2, c2, f2, g2, h2, e4; Black Kg8, Qc7, Ra8, Rf8, Be6, Be7, Nf6, Nd7, e5, a6, d6, h6, b7, f7, g7 — White to move. FEN: r4rk1/1pqnbpp1/p2pbn1p/4p1B1/4P3/2N2N2/PPPQ1PPP/2R1RBK1 w - - 0 15

The structure is a Najdorf with ...e5: Black has the d5-square under watch from the e6-bishop, a backward pawn on d6 that is not easy to reach, and has just asked the g5-bishop a question with ...h6. Dev answered with a "sacrifice" — 15.Bxh6 — spending nine seconds on it.

🤖 Engine check: Stockfish 19 rates the position −0.55 at depth 18 and −0.44 at depth 22 with 15.Bh4 (depth 22 line: 15.Bh4 Qb6 16.b3 Bd8 17.Nd5 Bxd5). After 15.Bxh6 the evaluation drops to −2.71 (depth 18): the review classifies it as hung material — Black simply takes, 15...gxh6, and White has no follow-up. The human explanation is Chapter 4's checklist and Chapter 11's preconditions: a bishop sacrifice on h6 needs attackers that can arrive before the defence regroups — a queen that reaches h6 with tempo, a knight heading for f5 or g5, a rook that can lift. Here the d2-queen reaches h6 only after the bishop is gone, the f3-knight is two moves from anything useful, and the rooks sit on c1 and e1. One attacker against an intact defence is not a sacrifice; it is a donation.

Three moves later came the second blunder, 19.gxf3 (−1.03 → −6.34), a recapture that wrecked White's own king cover when 19.Nf5 kept the game going (−0.93 at depth 20; Exercise B1 asks you to find it). Neither error had anything to do with the English Attack's theory. Both were middlegame decisions — the first a miscounted attack, the second a "natural" recapture that ignored what the opponent wanted next.

Is game 401 typical? Case Study 1 checks every Najdorf 6.Be3 game in Dev's composite that has evaluations (nine games). In seven of them Dev made at least one mistake or blunder; his first came at moves 7, 10, 11, 15, 15, 15 and 18 — median move 15, only two of seven inside the first ten moves. That matches what Chapter 20 found from the other direction: the English Attack losses sat at a median of +0.32 after move 10. The points are lost in the middlegame that the opening leads to, not in the opening.

⚠️ Common pitfall: blaming the opening for the middlegame. Opening names are attached to whole games, so a loss in the Najdorf becomes "a Najdorf loss" even when the game was level at move 15 and lost at move 19. If you want to know whether an opening is your problem, measure where the evaluation was when you left the opening (analyze and Chapter 25's "own win % after move 10"), not the result at move 40.

🔄 Check your understanding 1. In game 401, what single number tells you the opening was not the problem? 2. Why did the review label 15.Bxh6 "hung material" rather than "allowed tactic"?

Answer

  1. The evaluation after move 10: +0.07 (Stockfish 19, depth 18) — level. Across Dev's Najdorf games with evaluations, his first mistake came at a median of move 15.
  2. Chapter 26's rule: an error is "hung material" when the opponent's best reply captures a minor or major piece that is undefended or taken by a cheaper piece. 15...gxh6 captures the bishop with a pawn — the simplest kind of loss, one capture, no combination needed.

40.6 Does the data find the weakness Dev expected?

Here is the question the whole book has been building towards, put to Dev's data. He expected the Najdorf 6.Be3 to be his weak spot. The table below collects what the pipeline actually found, with the verdict each finding earned.

What Number Verdict
Expected: Najdorf 6.Be3 as White 36.0% [24.1–49.9], −12.2 vs own average, n = 50 noise (q = 0.254)
Opening accuracy vs peers 90.16 vs 90.12 noise (z = −0.09)
Win % after move 10 vs peers 50.42 vs 49.97 noise (z = −0.36)
Italian Game as White 67.5% [56.6–76.8], +15.4 vs own average, n = 80 strength (q = 0.065)
Clock: games lost on time vs peers 9.58% vs 10.80% noise (z = −0.59)
"Other" (plans / calculation) blunders 4.01 vs 3.27 per 100 moves weakness (clustered z = +3.15)
Endgame-conversion blunders 0.10 vs 0.29 per 100 moves strength (clustered z = −4.14)

On the face of it the story writes itself: the data reveals a different weakness from the one the player expected — not the opening, but quiet middlegame decisions. A hundred improvement books would stop here and prescribe a calculation course. This book won't, because a single comparison, however significant, is one draw from a noisy process. Before believing it we ask the two questions from Chapters 24 and 31: does it replicate in another sample, and could it be an artefact of how the data were assembled?

Case Study 1 runs both checks, and its summary figure tells the story:

Dev vs his peers: do the gaps survive a second peer pool and a split of his games?

📊 Figure (described): Clustered z-scores for three gaps — all blunders (grey), "other" blunders (blue), endgame-conversion blunders (orange) — in seven comparisons: Dev against peer pool A and an independent pool B (seed 2027), his odd- and even-numbered games, his White and Black games, and pool A against pool B as a null check. Dashed lines mark the Bonferroni bar (±2.77). The "other" gap is positive in every Dev comparison (+1.32 to +3.15) and crosses the bar only with the full sample or the White games; the endgame "strength" crosses it in some splits and not others; the null comparison stays inside the bars for all three.

The numbers behind it (from code/case_study_01.py):

             comparison                      metric    n  student  reference  z_poisson  z_clustered
              vs pool B 'other' (plans/calculation)  240     4.01       3.34       3.25         2.85
         odd games vs B 'other' (plans/calculation)  127     4.04       3.34       2.44         2.11
        even games vs B 'other' (plans/calculation)  113     3.97       3.34       2.16         2.07
          as White vs B 'other' (plans/calculation)  121     4.22       3.34       3.06         2.92
          as Black vs B 'other' (plans/calculation)  119     3.78       3.34       1.52         1.32
         odd games vs B          endgame conversion  127     0.05       0.24      -2.44        -4.16
        even games vs B          endgame conversion  113     0.16       0.24      -1.01        -1.18

Read it like a scientist. The "other" gap replicates in direction: a second, independent peer pool still puts it above the bar (z = 2.85), and both halves of Dev's games show it at almost exactly the same size (4.04 and 3.97 per 100 moves, z = 2.11 and 2.07 — each half too small to clear the bar on its own, as you would expect when you halve the sample). That is a consistent signal. But it is twice as strong in his White games as in his Black games (z = 2.92 vs 1.32) — and Dev's White games are exactly the ones the composite selected by opening (a 1.e4 repertoire, with the Italian and the Najdorf over-represented), while his Black games are a random draw. Part of the gap may therefore come from the kind of middlegames 1.e4 open games produce, not from "Dev". The endgame "strength" does not replicate cleanly at all: it rests on eight blunders, it is strong in one half and absent in the other, and it should be read as cannot tell.

So the honest answer to "does the data find the weakness Dev expected?" has three parts:

  1. No. The expected weakness — the Najdorf, the opening in general — is not in the data. His opening play is level with his peers to a tenth of a point, and the Najdorf's bad score is indistinguishable from luck.
  2. It points somewhere else, moderately. The one gap that survives correction and a second pool is an excess of quiet, plan-and-calculation blunders in the middlegame, about one extra such blunder every 140 moves (4.01 − 3.27 = 0.74 per 100). It is a real-looking signal, partly confounded by how the composite was built.
  3. The next step is a measurement, not a course. For a real player, the right response is to make the finding testable: spend the next block of training on the thing it points to (Chapter 7's "what does my opponent want?" before each move in the middlegame), then measure again on new games. Section 40.9 gives the arithmetic for how many.

⚠️ Common pitfall: the second weakness is as seductive as the first. It is tempting to swap one certainty for another — "it's not my Najdorf, it's my calculation!" — on the strength of one z-score. The data replaced a wrong belief with a hypothesis, which is a large step forward. It did not replace it with a fact. Keep the verdict vocabulary even in your own head.

🪞 Learning check-in. Think of the weakness you would type into import --expect today. Where did that belief come from — a painful loss you remember, a coach's comment, a statistic you saw once? How many games is it based on? Before you run the toolkit, write down what result would change your mind: "if my win % after move 10 in this opening is within two points of my peers', the opening is not my problem." Deciding in advance what would count as evidence is the habit that separates analysis from confirmation.

40.7 A real player: what GothamChess's games say

A composite is a demonstration; the real test of a toolkit is a real player. The book's data includes the public Chess.com archive of GothamChess — Levy Rozman, International Master, chess's most-watched teacher — retrieved on 20 November 2026. Nothing below is a claim about how he plays at a board in a tournament: it is what his public online games say when you run the same seven commands on them. His opponents are not named anywhere; import drops their usernames.

Dev's expectation, typed into import --expect, was a guess from the outside: "the clock costs him points — he flags, and he blunders in clock scrambles." Fast blitz, thousands of games a year, a stream to talk to at the same time: it sounds plausible. Here is what the commands said.

Import and progress

31719 games, 2017-03-14 to 2026-11-20
              games  score  expected  median_rating
speed  color
blitz  black   9184   59.2      61.6         2660.0
       white   9110   63.7      61.5         2660.5
bullet black   6620   59.3      60.8         2700.0
       white   6672   62.5      60.8         2701.0
rapid  black     54   84.3      85.0         2416.0
       white     63   83.3      85.2         2238.0
with moves: 1500; with stored engine evals: 0; lost on time: 2023 of 11224 losses

Blitz is his main speed (18,294 games). The import keeps the moves of the most recent 1,500 games (the rest keep results, ratings and openings — enough for everything except engine analysis), and Chess.com games carry clocks but no engine evaluations, so analyze will have to run Stockfish itself. One caveat sits in the table: the Chess.com archive stores each player's rating after the game, so every "expected" score here uses post-game ratings; Chapter 35's module notes that the resulting bias is a few points, and it is the same for every line, so comparisons within his games are unaffected.

progress runs Chapter 35's machinery on the blitz history:

PROGRESS - GothamChess (blitz): 18294 games, 111 active months (>= 10 games)
Trend, last 12 active months: -3.0 rating points/month [-8.0, +6.7]
   from      to  points  slope_per_step           ci  level_start  level_end label
2017-03 2026-11     111             3.8 [+3.4, +4.2]         2466       2881 climb

Tilt (after a loss minus after a win, permutation-corrected, 50 shuffles): -0.9 pts [-2.5, +0.6] over 2581 sessions (median 4 games) -> cannot tell (interval includes 0)

Time classes (Chess.com/Lichess own pools; residual = score minus expectation):
 speed  games  share  score  expected  residual  won_on_time  lost_on_time
bullet  13292   41.9   60.9      60.8       0.1         18.2           7.5
 blitz  18294   57.7   61.5      61.5      -0.0         14.7           5.6

GothamChess's blitz dashboard from the progress command

📊 Figure (described): Six panels from progress.dashboard. Top left: monthly performance (grey dots) and median rating (black dots) in Chess.com blitz, with the single performance segment the detector finds — one climb from about 2466 to 2881 between March 2017 and November 2026. Top middle: games per active month, peaking in 2020–21. Top right: score minus Elo expectation per month, scattered around zero. Bottom: score minus expectation by speed (all within about one point of zero except the small rapid sample); openings against his own average with intervals (the Trompowsky clearly to the right); and Chess.com's own accuracy figure by year (labelled as the platform's number, not the book's).

Three things to take from it. First, the trend is one long climb, about 3.8 rating points per month for nine and a half years, with no plateau the detector believes in — the same result Chapter 35 found with the same module, which is what you want from a tool. The last twelve months alone show "no clear trend" (−3.0 per month, interval −8.0 to +6.7): a year of blitz at this level is not enough to see a slope of a few points a month, even with hundreds of games. Second, the tilt test — Chapter 28's after-loss-minus-after-win residual with a permutation null — gives −0.9 points with an interval of −2.5 to +0.6 over 2,581 sessions: cannot tell. The population effect Chapter 28 measured is about −2; his interval includes both that and zero. Third, and directly against Dev's guess: in blitz he won on time in 14.7% of his games and lost on time in 5.6% — 2,690 wins on the clock against 1,024 losses. The clock is not costing him points. On balance it is earning them.

The engine sample: where the blunders really are

analyze ran Stockfish 19 at depth 12 on his 60 most recent blitz games (about 35 seconds with three worker processes; depth 12 is Chapter 32's "cheap but usable" setting — its move labels agreed with depth 18 in 86.7% of moves):

ANALYSIS - GothamChess (blitz, 60 games, evals: sf19 d12)
Book accuracy 88.9 (opening 91.2, middlegame 88.0, endgame 89.2); ACPL 47.5
Blunders per 100 moves 4.06 [3.29-4.95] (98 blunders in 2415 moves)
Share of win % lost to blunders by phase: opening 10%, middlegame 58%, endgame 32%
Blunder types (share of blunders): allowed a mate 0%, left a piece en prise 16%, walked into a tactic 7%, failed to punish 31%, endgame conversion error 7%, other (plans / calculation) 39%
Opponent blunders left unpunished: 33.9% of 115; winning endgames converted: 100.0% of 10; blunders made with own clock < 10% of base: 14%

PEERS: none (a peer pool needs a Lichess-pool player; this account is judged against its own average).

The chapter's script digs one level deeper into the clock question:

Engine sample: 60 games, 98 blunders, of which made with own clock < 10% of base: 14; low-clock moves 153 of 2415
Blunders per 100 moves: with own clock < 10% 9.2; otherwise 3.7

So the clock does matter in the way everyone's clock matters: with less than 18 seconds left in a 3-minute game, his blunder rate is about two and a half times his normal rate (9.2 vs 3.7 per 100 moves). But only 153 of his 2,415 moves — 6% — were played that low, and they hold 14 of his 98 blunders. The other 84 blunders came with plenty of time on the clock. The largest single named type is failed to punish: 31% of his blunders were moves that handed back an advantage the opponent had just given him, and a third of his opponents' blunders went unpunished.

⚠️ Common pitfall: comparing across pools because the numbers look comparable. It is tempting to set Levy's 4.06 blunders per 100 moves next to the Lichess 2400+ blitz rung (4.34 in 40.8) and conclude something. Don't. His numbers come from Chess.com games and Stockfish at depth 12; the ladder comes from Lichess server analysis of self-selected games, and the two players' pools are different scales. The toolkit's refusal to build a peer pool for a Chess.com account is deliberate. What his data can say is internal: which of his blunders are most common, and when they happen.

One game

review picked his most recent blitz loss with moves: a 3-minute game from November 2026 in which Levy had Black against an opponent rated about 2800 on Chess.com. It began 1.d4 Na6 2.e4 c6 — one of his offbeat streaming openings, which the archive files under the Caro-Kann — and turned on move 9:

Before 9...e6 in GothamChess's game: Black played 9...e6 (red); Stockfish's 9...Qa5+ (green) wins the b5-bishop

♟️ Position: White Ke1, Qd1, Ra1, Rh1, Bc1, Bb5, Ne5, a2, b2, c2, f2, g2, h2, d4; Black Ke8, Qc7, Ra8, Rh8, Bc8, Bf8, Nd7, d5, a7, b7, e7, f7, g7, h7 — Black to move. FEN: r1b1kb1r/ppqnpppp/8/1B1pN3/3P4/8/PPP2PPP/R1BQK2R b KQkq - 1 9

White's last move, 9.Bb5, was itself a blunder: the bishop on b5 is attacked by nothing yet, but a queen check on a5 hits the king and the bishop at once.

🤖 Engine check: Stockfish 19 rates the position −6.56 at depth 18 and −6.46 at depth 22, both with 9...Qa5+ (depth 22 line: 9...Qa5+ 10.Bd2 Qxb5 11.Nd3 Nf6 12.O-O) — Black wins a piece. Levy played 9...e6 after one second, with 2 minutes 50 seconds left on his clock, and the evaluation swung to +1.63 (depth 16): White's 10.Qh5! would now have hit f7. The human explanation is Chapter 10's checks-captures-threats scan: the opponent's last move put a piece on a square where a check could attack it, and the scan finds 9...Qa5+ in seconds. The scan was skipped, not failed — there was no time pressure at all.

The game went on: the opponent returned the favour with 10.O-O (10.Qh5 was stronger), Levy lost the thread with 16...f6 and 19...e5 (Case Study 2 annotates the whole game), and he resigned after 21.Be3 with more than two minutes left. The clock never entered into it. A one-second "failure to punish" did.

Openings — and whether they replicate

repertoire tested 73 lines with at least 30 blitz games each. Two came out of the false-discovery correction:

                line    n  score   lo   hi  expected  vs_baseline     p     q  verdict
W: Trompowsky Attack 1448   63.2 60.6 65.6      56.5          6.6 0.000 0.000 strength
      B: Indian Game  278   58.8 52.9 64.4      67.2         -8.5 0.001 0.031 weakness
(73 lines tested; 71 within noise)

Before you tell a streamer to drop a defence on the strength of a q-value, run the check from Chapter 31: split the history in two and see whether the finding holds in both halves.

GothamChess's openings in the first and second half of his blitz history

📊 Figure (described): Each dot is one opening line with at least 30 games in both halves of his blitz history (split at 27 February 2021; 36 lines), placed by its score against his own average in the first half (x) and second half (y); dot size grows with games. Perfect replication would put every dot on the dotted diagonal. The cloud is loose (r = 0.42; same sign in 67% of lines). The Trompowsky (orange, top right) sits close to the diagonal: +6.2 then +6.7. The Indian Game as Black (orange, lower left) keeps its sign but shrinks from −9.5 to −6.0 and loses its verdict in the second half.

                      n_1  vs_baseline_1 verdict_1  n_2  vs_baseline_2 verdict_2
W: Trompowsky Attack  579            6.2  strength  869            6.7  strength
B: Indian Game        196           -9.5  weakness   82           -6.0     noise

The Trompowsky is the kind of finding you can build on: a large sample, a strength in both halves of nine years. The Indian Game weakness is the kind you should watch: same direction, smaller in the second half, now on 82 games — typical regression towards the mean, the pattern Chapter 24 found across 1,732 players.

So: did the data find the weakness Dev expected for Levy? No. The clock is a net asset in his blitz (he wins on time 2.6 times as often as he loses on time), blunders made in time trouble are a small minority, and tilt is undetectable. The data points instead at fast decisions made with time to spare — the one-second 9...e6 in a position that called for a three-second scan — and, descriptively, at failures to punish as his most common blunder type in the engine sample. Without a peer pool on his own scale we cannot say whether that share is unusual for a player of his level; we can say it is where his points go.

📋 Try it — Engine analysis. Re-run analyze on the GothamChess workspace with --engine always --depth 16 --max-games 30. Does the share of "failed to punish" blunders survive a deeper search and a smaller sample?

Worked answer

Expect the shares to move by several points either way: 30 games contain roughly 50 blunders, so one blunder is two percentage points of the mix, and depth 16 relabels about one move in twelve compared with depth 12 (Chapter 32's label agreement: 86.7% at d12 vs 91.6% at d16, both against d18). If "failed to punish" stays the largest named type at both depths, treat it as a stable description of his blunders; it is still not a comparison with anyone else. The cost: depth 16 is about six times slower per position than depth 12 on this machine, so the 60-game run would take a few minutes instead of half a minute — the cache makes the second run free.

🔄 Check your understanding 1. Give two numbers from this section that contradict "the clock costs him points". 2. Why does the toolkit not compare Levy's blunder rate with the Lichess peer pool?

Answer

  1. He won on time in 14.7% of his blitz games and lost on time in 5.6%; and only 14 of the 98 blunders in the engine sample were made with less than 10% of his base time left (153 of 2,415 moves were played that low).
  2. Different rating pools (Chess.com vs Lichess) and different evaluation sources (our Stockfish at depth 12 vs Lichess server analysis of self-selected games). A "peer" must be at the same level on the same scale, measured the same way; otherwise the comparison measures the difference between the pools.

40.8 The six themes, one last time — and the ladder

The book began with six recurring themes. A capstone is a good place to ask what each of them looks like after forty chapters of real games and real engine output, and whether the data kept faith with them.

Theme 1 — Understanding beats memorization

The first position the book took seriously was this one: the Carlsbad skeleton of Smyslov–Keres, World Championship 1948 (Anchor A).

The Carlsbad skeleton from Smyslov–Keres, 1948, after 6...exd5

♟️ Position: White Ke1, Qd1, Ra1, Rh1, Bf1, Bg5, Ng1, Nc3, a2, b2, f2, g2, h2, e3, d4; Black Ke8, Qd8, Ra8, Rh8, Bc8, Bf8, Nf6, Nd7, d5, c6, a7, b7, f7, g7, h7 — White to move. FEN: r1bqkb1r/pp1n1ppp/2p2n2/3p2B1/3P4/2N1P3/PP3PPP/R2QKBNR w KQkq - 0 7

Stockfish 19 calls it +0.29 at depth 18 — nothing. What makes it a lesson is not the number but the skeleton: White's two queenside pawns against Black's three tell White to push b4–b5 (the minority attack, which Smyslov played on moves 12 and 13), and Black's kingside majority tells Black where to look for counterplay. A player who understands why the minority attack works can find it in any Carlsbad, from any move order, against any setup; a player who memorised Smyslov's moves is lost when Black deviates on move 7. Outpost's structure module recognises the skeleton in one line of code (the test suite checks it), but it cannot do the understanding for you. Every module in the toolkit is a lens; the eye is yours.

Theme 2 — Strategy creates tactics

Anchor B: White to move in a London System between two 1613-rated players

♟️ Position: White Ke1, Qd1, Ra1, Rh1, Bf4, Nd2, Ne5, a2, b2, c2, f2, g2, h2, e3; Black Ke8, Qd8, Ra8, Rh8, Bc5, Bc8, Nb8, e4, a6, e6, b7, f7, g7, h7 — White to move. FEN: rnbqk2r/1p3ppp/p3p3/2b1N3/4pB2/4P3/PPPN1PPP/R2QK2R w KQkq - 0 10

The hidden sacrifice of Anchor B, from a Lichess rapid game between two anonymous players rated 1613: White played 10.O-O, and Stockfish 19 at depth 18 rates the position +6.18 with 10.Nxf7! Kxf7 11.Qh5+ Kg8 12.Qxc5 — the queen check forks the king and the loose c5-bishop. The tactic exists because of strategy: Black's king is still in the centre, Black's queenside is undeveloped (knight, bishop and rook on their home squares) and the c5-bishop is unprotected. Dev's game 401 in 40.5 is the mirror image — a bishop sacrifice on h6 with none of those preconditions, which the review classified, correctly, as hung material. Learn the preconditions, and both the sacrifice that works and the one that doesn't become obvious.

Theme 3 — The engine is a tool, not a teacher

Anchor D: the round-3 game after 24.Nxh7

♟️ Position: White Kg1, Qh3, Ra1, Rd1, Nh7, b2, f2, h2, a3, g4, e5; Black Kg7, Qb6, Ra8, Rf8, Nh6, a6, e6, g6, b7, f7 — Black to move. FEN: r4r2/1p3pkN/pq2p1pn/4P3/6P1/P6Q/1P3P1P/R2R2K1 b - - 0 24

The illustrative round-3 game behind Grace's preparation (Anchor D) — an over-the-board junior game, WIM 2035 against WCM 1807 — turned on 24.Nxh7. Before it White was clearly better (+1.86 at depth 24, with 24.Rd7 the engine's move); after it Stockfish 19 rates the position −0.50 at depth 18: objectively unsound. It won anyway, because only one defence (24...Kxh7) held and the defender did not find it. The engine told us the sacrifice was wrong; it could not tell us that it was a good practical decision against a tired opponent with one narrow path. That was the book's position from Chapter 1, where Stockfish never rated Kasparov's 24.Rxd4!! against Topalov as winning at any depth: the engine is the best calculator in the room, and a poor judge of what a human opponent will find. In this chapter the same lesson ran the other way. The engine told Levy that 9...Qa5+ won a piece; the human lesson was not the move but the habit — the checks-captures-threats scan he skipped.

Theme 4 — Chess improvement is measurable

This chapter is the theme's long answer, and the honest version has a second clause: improvement is measurable, and so is the uncertainty. The toolkit measured Dev's opening play to a tenth of a point and found nothing; it measured Levy's clock and found it was an asset; it found two weaknesses that survived correction and showed that one of them shrinks when you split the history. A measurement without its interval would have sent Dev to study the Najdorf and Levy to practise time management — both wasted months.

Theme 5 — Pawn structure determines everything

Anchor D: the Advance French after 3.e5

♟️ Position: White Ke1, Qd1, Ra1, Rh1, Bc1, Bf1, Nb1, Ng1, a2, b2, c2, f2, g2, h2, d4, e5; Black Ke8, Qd8, Ra8, Rh8, Bc8, Bf8, Nb8, Ng8, d5, e6, a7, b7, c7, f7, g7, h7 — Black to move. FEN: rnbqkbnr/ppp2ppp/4p3/3pP3/3P4/8/PPP2PPP/RNBQKBNR b KQkq - 0 3

The Advance French chain (+0.24 at depth 18, with 3...c5 as the engine's first choice) is the cleanest example of a structure dictating play: the chain's base on d4 is the target, so ...c5 is not a choice but the plan. When Grace prepared against her round-3 opponent (Chapter 24), the story she had been told — that the opponent played the French passively against the Advance — fell apart on contact with the data: that player struck with 3...c5 in every Advance game with moves. The structure predicted the plan; the data confirmed the structure; the folklore was wrong. In Dev's game 401 the Najdorf's ...e5 structure, with d5 controlled by Black's bishop, told White that the game would be decided by the fight for d5 and the queenside, not by a bishop on h6.

Theme 6 — Every master was once a beginner

The last chart of the book puts every rung of the ladder on one page.

The ladder: blunders per 100 moves and book accuracy by rating band

📊 Figure (described): Left: blunders per 100 own moves by the player's own rating band, Lichess blitz (blue, server-analysed games, Lichess ratings) and over-the-board classical (orange, broadcast games with relay evaluations, FIDE ratings). Right: book accuracy by band. Both lines fall (or rise) steadily on every rung, with no cliff anywhere; Dev's composite (black star) sits on the Lichess 1600–1799 rung, almost exactly on the line. The two pools are different scales and different speeds — compare the shapes, not the heights.

Lichess blitz, analysed games, by own band (book accuracy; blunders per 100 own moves):
           player_games  accuracy  blunders_per_100
<1000             28172     84.83             10.11
1200-1399         49805     86.37              8.20
1600-1799         62295     87.46              7.05
2000-2199         39923     88.91              5.73
2400+             17211     90.71              4.34
change in blunders per 100 moves per 200-point rung (Lichess blitz): [-1.23, -0.68, -0.61, -0.54, -0.61, -0.7, -0.64, -0.75]
Dev (composite, 241 analysed games): accuracy 87.2, blunders per 100 moves 7.27

(The full nine-band tables for both pools are in code/_out04.txt.) Over the board the same ladder runs from 5.56 blunders per 100 moves below FIDE 1000 to 1.07 at 2400+.

Two things about this chart are worth carrying out of the book. First, there is no cliff. Every 200-point rung above 1000 costs about six-tenths of a blunder per hundred moves (the steps are −0.54 to −0.75) — no rung is a different kind of chess from the one below it. The 2400-rated player is not doing something the 1600 cannot; they are doing the same things with about three fewer blunders every hundred moves (7.05 → 4.34 per 100). Dev's next rung, 1800–1999, is 6.43: about 0.6 fewer blunders per 100 moves, or roughly one fewer blunder every three games of 50 moves. That is what "the next rung" means, in numbers. Second, the ladder is a cross-section, not a film: it shows that stronger players blunder less, not that any one player will climb. The book's improvement data was blunt about that (Chapter 35): over about six months, adult players' median rating barely moved, while juniors gained a few dozen points. Climbing is real and possible — every name on the 2400+ rung was once on the bottom one — but it is slow for adults, which is exactly why measuring the right thing matters. You cannot afford to spend a year fixing a weakness you don't have.

🔄 Check your understanding 1. What is the typical difference in blunders per 100 moves between adjacent Lichess blitz rungs above 1000, and what does it mean for a player rated 1650? 2. Why does the ladder chart not prove that reducing blunders raises your rating?

Answer

  1. About 0.6 (the steps run from −0.54 to −0.75). For a 1650 (7.05 on the 1600–1799 rung), the next rung (6.43) is about one fewer blunder every three 50-move games.
  2. It is a cross-section: different players at different ratings. Stronger players blunder less, but the chart cannot separate "fewer blunders cause higher ratings" from "whatever makes players stronger also reduces blunders". Only measuring the same player before and after a change (40.9) gets closer to cause.

40.9 Your own games: a twelve-week protocol

Everything in this chapter was run on someone else's games so that you could check every number. Here is the protocol for running it on yours.

Week 0 — measure, and write down your expectation first. Export your games (a PGN from your site, or import --lichess YourName --online, or import --chesscom YourName --online). Before you run anything, type your expectation: import ... --expect "my endgames". Then run analyze, repertoire, scout, progress and report, and read the report top to bottom. Use at least 200 games at one speed — preferably your slowest regular speed, where your moves are most your own.

Week 1 — choose one thing. From the findings, pick one target, in this order of preference: a weakness that survives the statistics; else the largest gap that is "noise" but large and in a big sample (worth a look, not a verdict); else your largest blunder type by share (descriptive). Write it as a measurable sentence: "failed-to-punish blunders per 100 moves", "win % after move 10 in the Caro-Kann". If the report says your expectation was noise, believe the report over your memory of three painful losses.

Weeks 2–11 — train it. Chapter 25's training and Chapter 38's coach modules turn the target into a weekly plan (puzzles in your window, a review habit, endgame positions, a calculation routine). Keep playing your normal games. Do not re-run the analysis every week: Chapter 35 showed that weekly rating checks mostly measure noise, and a small sample will tell you a different story every Sunday.

Week 12 — measure again, on new games only. Import only the games played since week 2 (--limit, or a new PGN) into a new workspace and run the same commands. Compare the target metric between the two workspaces, with its interval.

How many games is "enough"? The book's earlier chapters already did the arithmetic. One player's score against expectation has a standard deviation of about 48 points per game (Chapter 28), so the 95% half-width is about ±20 points at 100 games, ±11.5 at 300 and ±6.3 at 1,000. Halving a blunder-type rate like Lena's failed-to-punish rate needs around 66 games before and 66 after to see; a 25% cut needs about 309 (Chapter 38). An average ACPL is known to within about ±6 centipawns after roughly 129 games (Chapter 26). If those numbers make you want to play more slow games, good: that is the improvement plan the data supports most firmly.

🔄 Check your understanding 1. Why should the week-12 measurement use only games played after the training started? 2. Your week-0 report says "failed to punish: 2.2 per 100 moves (noise vs peers)". Is it a sensible training target?

Answer

  1. Because the question is whether something changed. Mixing old and new games dilutes any change with the games that could not have been affected, and re-using week-0 games makes the two measurements partly the same sample.
  2. It can be — as the third choice in the week-1 order: a large descriptive share is a reasonable place to train even when it is not unusual for your level, because it is where your points go. Just don't describe it as a weakness, and size the retest for the change you hope to see (about 66 games before and after for a halving).

📋 Try it — Database research. Run the full protocol's week-0 step on the book's third composite player, Grace (import --persona grace). Her games are over-the-board classical with FIDE ratings, so analyze will not build a Lichess peer pool. What does progress say, and why?

Worked answer

progress reports no trend and refuses to compute tilt or sessions, because Grace is a composite: her 250 games come from many anonymous OTB players over a year of broadcasts, not from one person's history. For a peer comparison you would pass --peers a pool on her own scale — which the Lichess sample cannot provide — so the honest output is her own profile and her openings against her own average. A real tournament player in Grace's position would build a peer pool from the broadcast database at her FIDE band (Chapter 31's database.load_otb is the starting point), excluding engine and online events.

Spaced Review

Before you close the book, three questions from earlier chapters, each of which the capstone relied on. Try them before you look.

  1. Chapter 20. Dev's Najdorf 6.Be3 score was 36.0% over 50 games with a 95% interval of [24.1–49.9]. What would the interval look like with 200 games at the same score — and would the verdict change?
  2. Chapter 24. Why should an opponent's (or your own) line be judged against the player's own average rather than the Elo expectation?
  3. Chapter 35. Why does Outpost's trend detector work on monthly performance rather than on the rating itself?
Answers
  1. The width of a proportion's interval shrinks roughly with the square root of the sample: four times the games, half the width — about ±6–7 points instead of ±13. At 36% that interval would sit well below Dev's own average (51.9%), so with 200 games at the same score the verdict would very likely change to weakness. The problem was never the 36%; it was the 50.
  2. Because the Elo formula over-predicts favourites and under-predicts underdogs, a player who usually scores above (or below) expectation would have every line flagged in the same direction. Comparing a line with the player's own average removes that constant and asks the useful question: is this line different from the rest of their chess?
  3. Because a rating is a running average with memory: each month's rating carries most of the previous month's error, so the series is strongly autocorrelated and changepoint detectors see "plateaus" and "declines" in pure noise (Chapter 35 measured false alarms of 76% on the rating level at 30 games a month, against about 5% on performance). Monthly performance uses each month's games alone, so its noise is independent from month to month.

Project Checkpoint: cli.py, report.py and project/tests/

This is the checkpoint the other thirty-nine were building towards. Dev's additions this week are three files and a folder:

  • outpost/cli.py — the seven commands. Public functions: run_import, run_analyze, run_review, run_repertoire, run_scout, run_progress, run_report, plus the loaders from_persona, from_chesscom, from_pgn_text, from_lichess, the helpers movetext_with_evals (rebuilds a Lichess-style movetext with our own Stockfish evaluations so every module that reads stored evaluations can read ours), clustered_z, and main / build_parser for the command line.
  • outpost/report.py — build_report(work) assembles one self-contained HTML page (charts embedded as images, no external scripts, readable offline and in dark mode) with "What you expected vs what the data says" at the top, and expectation_matches, chart_openings, chart_phases, chart_errors, md_to_html as helpers.
  • outpost/__main__.py — three lines that make python -m outpost work, with the Windows guard that parallel engine batches need.
  • project/tests/ — 65 tests (test_modules.py, test_cli.py, a 4-game PGN fixture), all passing.
  • project/README.md — install, data, usage and the module map by chapter.

The checkpoint script drives the finished tool exactly as a reader would — python -m outpost in a subprocess — on Lena's composite games, with the worry she has carried all book: "I lose the boring positions - my endgames."

$ python -m outpost analyze --peers rapid:1300-1500 ...
ANALYSIS - Lena (rapid, 203 games, evals: stored)
Book accuracy 86.6 (opening 87.8, middlegame 84.2, endgame 91.4); ACPL 72.8
Blunders per 100 moves 8.42 [7.73-9.15] (557 blunders in 6618 moves)
               endgame accuracy (book)   91.43      92.10      0.67  0.58       100
        winning endgames converted (%)   84.21      89.02      4.81  0.76        38
                games lost on time (%)    7.39       4.60      2.79  1.45       203
   endgame conversion error per 100 moves     0.24       0.21  0.50         0.36 within noise

Lena's endgame accuracy (91.4) is her best phase and level with her peers' (92.1, z = 0.58); her conversion of winning endgames (84.2% of 38) is a few points below theirs (89.0%) with z = 0.76 — nothing the data can see on 38 endgames. None of her seventeen comparisons survives correction. That is not a failure of the tool; it is the most common true answer for a player at her level, and it is the same answer Chapter 38's coach report gave her. For Lena the message is "you are a typical 1400 — the general plan for your rung (Chapter 25) is your plan, and the endgame worry is not supported". Her workspace ends with twenty files — a trail from games to report that she, or her coach, can open one at a time.

How the pieces plug together for the future: every command is also a Python function, so a notebook can call cli.run_analyze(work) and get DataFrames back; every finding is a JSON record, so a future module (a weekly e-mail, a coach's dashboard over several students) can read findings_*.json without re-running anything; and the tests are the safety net for whoever edits a module next — including you.

Chapter Summary

Principle In practice Where
One table, many questions Every source becomes the same games table, from the player's side import
State your expectation first --expect puts your belief at the top of the report, beside the evidence 40.2, 40.6
Judge a line against yourself Opening lines vs your own average, false-discovery control across lines 40.3
Games, not moves, are the unit Cluster-robust z for blunder rates; both samples' noise included 40.4
Check who you compare with Peer pools at your band, on your scale, colours balanced 40.2, 40.4
Replicate before you believe Second peer pool, split halves, White/Black, a null comparison 40.6, 40.7
Where, not just what The evaluation when you left the opening; the first mistake's move number 40.5
Refuse undefendable numbers No trend, sessions or tilt for a composite; no cross-pool peers 40.2, 40.7

Decision checklist — before you act on a finding about your chess:

  1. Is it a verdict (survived correction) or a description? Act on the first; investigate the second.
  2. How many games is it based on, and what is the interval?
  3. Who is it compared with — your own average, or a peer pool at your band, speed and rating scale?
  4. Does it hold in both halves of your games, and against a second comparison group?
  5. Could the way the games were selected explain it (one opening, one time control, analysed games only)?
  6. Is the location right — did the points go in this phase, or does the opening name just label the whole game?
  7. What would the retest look like, and how many new games does it need?

The Last Word

Dev closes the laptop. Grace has been reading over his other shoulder.

Grace: "So after all that, your Najdorf is fine and your Italian is great."

Dev: "My Najdorf is unproven. And I apparently blunder a bit more than other 1650s when nothing is happening."

Lena: "That's everyone's problem. That's literally chess."

Sam: "That's what we used to call 'playing the position, not the opening'. Took us forty years and no computer."

Dev: "It took me forty chapters and one."

They are all a little right. The tools in this book are not a shortcut past the work — the move-by-move understanding of why a minority attack works, why a knight sacrifice on f7 needs an uncastled king, why a bishop on h6 needs a queen behind it. They are a way to spend that work where it will count, and to know, with an honest interval, when it has. Every master was once a beginner, and every master spent years improving without anything like Outpost; you have it now. Measure, choose one thing, train it, measure again. Then go and play — slowly, with the clock running and the scan done before every move — because the ladder is climbed at the board.