Case Study 2 — The Engine's View vs the Scoreboard

Setup

Section 2.8 measured structures by results: who scores better than their rating predicts. Section 2.7 measured pawn features by evaluations: what Stockfish thinks a weakness is worth. This case study puts the two side by side for each named structure and asks a practical question:

When a game reaches a given structure, do its owners go on to score about what the engine's evaluation of the position predicts — or do they systematically under- or over-perform it?

A structure whose owners score below what the engine expects is one that humans find hard to handle: the resources are there, but people do not use them (or the position drifts toward something worse, such as an endgame). A structure whose owners score above the engine's expectation is one where practical chances favour the owner: the opponent's task is harder than the evaluation suggests.

The data

We use the toolkit's positions_sample: one random position from each game, stratified by source (Lichess or OTB broadcast), rating band and phase, with the evaluation of that exact position where one exists. We keep positions after ply 20 that have an evaluation, a final result and both ratings: 83,095 positions (36,881 Lichess, 46,214 OTB). For each we run structures.classify_structure; 24.7% of them (weighted) carry at least one named label.

📐 Definitions used here: - Engine expectation = the owner's win % implied by the evaluation of the sampled position, chessdata.win_pct(eval) from the owner's side (the Lichess model; 50 = level). - Actual score = the owner's final score in that game (1 / ½ / 0), as a percentage. - Gap = actual score minus engine expectation, in percentage points. - Weights stratum_weight × sample_weight restore the populations; labels with fewer than 300 positions in a source are skipped. gap_ci95 = half-width of a 95% interval for the gap (Kish effective sample size).

The core of code/case_study_02.py:

e = ps.labels.str.split(";").explode()
e = e[e != ""]
L = ps.loc[e.index].copy()
L["label"] = e.to_numpy()
isw = L.label.str.endswith(":white").to_numpy()
L["eng"] = np.where(isw, L.wp_white, 100 - L.wp_white)                  # owner's engine win %
L["score"] = np.where(isw, L.score_white, 1 - L.score_white) * 100      # owner's actual score
L["exp"] = np.where(isw, L.exp_white, 1 - L.exp_white) * 100            # Elo-expected score

The output, sorted by engine expectation within each source:

positions with eval, ply > 20, result and ratings: 83,095 (Lichess 36,881, OTB 46,214)
share with at least one structure label: 24.7% (weighted)

 source              label    n  engine_win%  score%  elo_exp%  adj  gap_ci95  gap
Lichess  FrenchChain:white  562         54.5    53.9      50.7  3.2       4.4 -0.6
Lichess     KIDChain:white  310         54.5    51.8      49.1  2.8       6.1 -2.6
Lichess SlavTriangle:white  336         53.3    53.5      50.8  2.7       5.7  0.2
Lichess          IQP:white 1745         51.5    49.3      49.3 -0.1       2.5 -2.2
Lichess SlavTriangle:black  476         49.9    52.3      50.3  2.0       4.7  2.4
Lichess OpenSicilian:white 1003         49.6    52.5      49.8  2.7       3.3  2.8
Lichess          IQP:black 1532         48.0    48.1      49.9 -1.8       2.7  0.1
Lichess OpenSicilian:black  698         46.0    45.8      50.1 -4.3       4.1 -0.1
    OTB     KIDChain:white  616         54.4    57.6      50.8  6.8       3.2  3.3
    OTB  FrenchChain:white  730         54.1    56.3      51.2  5.1       3.0  2.2
    OTB OpenSicilian:white 1874         52.2    53.0      48.7  4.3       1.8  0.8
    OTB     Carlsbad:white  405         52.1    54.0      52.8  1.2       4.1  1.8
    OTB          IQP:white 2648         51.9    50.2      48.8  1.4       1.4 -1.6
    OTB     Carlsbad:black  356         47.7    46.6      51.3 -4.7       4.3 -1.1
    OTB          IQP:black 2536         46.1    44.0      48.4 -4.4       1.4 -2.1
    OTB SlavTriangle:black  430         46.0    42.6      46.6 -4.0       4.1 -3.4
    OTB OpenSicilian:black 1066         45.5    42.0      46.8 -4.8       2.3 -3.5
baseline lichess: White engine win% 51.5, White score 51.5, White Elo-expected 49.9
baseline broadcast: White engine win% 52.6, White score 53.2, White Elo-expected 50.2

Engine expectation vs actual score by structure, OTB and Lichess

📊 Figure (described): Each point is a structure label (blue = White-owned, orange = Black-owned, size proportional to the number of positions). The horizontal axis is the owner's win % implied by the engine's evaluation of the sampled position; the vertical axis is the owner's actual final score. Points on the dashed diagonal score exactly what the engine expects. In OTB games the White chains sit above the line and the Black-owned labels below it; the White IQP sits below the line in both pools.

Reading one row

Take the OTB IQP:white row. There are 2,648 sampled positions, each from a different game, in which White had an isolated d-pawn at some random moment after move 10. Averaging the engine's evaluation of those positions, converted to an expected score from White's side, gives 51.9% — the engine thinks the isolani's owner is, on average, very slightly better at that moment. The same games ended with White scoring 50.2%. The Elo formula, which knows only the ratings, expected 48.8%: these IQP owners were, on average, a little lower-rated than their opponents. So relative to their ratings the owners did fine (+1.4 rating-adjusted), but relative to the positions they had on the board they did worse (−1.6 gap). Both statements are true at once; they answer different questions. "Did they play above their strength?" is the rating question; "did they get out of the position what it contained?" is the engine question.

Analysis

First, the baseline. Across all sampled positions, the engine's expectation and the actual result agree closely: Lichess White engine win % 51.5 vs White score 51.5; OTB 52.6 vs 53.2. The win-% model is calibrated on Lichess games, so it is reassuring that it is also roughly right for OTB games.

Second, how sure are we? The gap_ci95 column is the half-width of a 95% interval for each label's gap (weighted, using the effective sample size). It ranges from ±1.4 points for the large OTB IQP samples to ±6.1 for the 310 Lichess KID-chain positions. A gap only deserves a story if it is clearly larger than its interval — and only four do: the White IQP OTB (−1.6 ± 1.4), the Black IQP OTB (−2.1 ± 1.4), the colour-reversed open Sicilian OTB (−3.5 ± 2.3) and, just barely, the White KID chain OTB (+3.3 ± 3.2). Everything else is "no detectable difference" at this sample size, however tempting the point looks on the chart.

Pattern 1 — isolani owners underperform their evaluation. The engine thinks the White isolani's owner is slightly better at the sampled moment (51.9% OTB, 51.5% Lichess), but the owners finish with 50.2% and 49.3%. OTB the shortfall (−1.6 ± 1.4) is outside the noise; on Lichess it is the same size (−2.2) but its interval (±2.5) includes zero. The Black IQP OTB shows the same pattern (−2.1 ± 1.4). This fits the IQP bargain of section 2.4 from a new angle. The evaluation credits the activity the structure gives right now; the result reflects what happens next — and what often happens next is exchanges, a drift toward the endgame, and the isolani becoming a target (section 2.8 measured that endgame drop directly).

Pattern 2 — closed White chains may overperform OTB. The King's Indian chain owner (54.4% expected, 57.6% actual) scores more than the engine predicts over the board, though the interval (±3.2) only just excludes zero; the French chain owner (54.1% vs 56.3%) points the same way but within the noise (±3.0). A plausible chess reason: closed chains produce long manoeuvring games in which the side with space has the easier practical task, and the defender's problems accumulate over many moves rather than showing up in one evaluation. Treat this as a hypothesis to test with more data, not a finding. Online, the KID chain owner's gap is negative (−2.6) but with only 310 positions (±6.1) it tells us nothing.

Pattern 3 — Black's structures OTB. Every Black-owned label in the OTB list has a negative gap, from −1.1 to −3.5 points, though individually only the IQP and the colour-reversed open Sicilian clear their intervals. Part of this is the White first-move edge that inflated White-owned labels in the rating-adjusted chart of 2.8: White scores 0.6 points above the engine baseline OTB, so Black scores 0.6 below it. The rest — up to about three points for the colour-reversed open Sicilian, which (section 2.8) mostly arises in Queen's Gambit and Catalan positions after ...dxc4 — suggests that defending these Black structures over the board is practically harder than a single evaluation suggests.

What it means (and doesn't)

It means the engine's number and the practical value of a structure are not the same thing, and the difference has a direction you can use. If you are the owner of an isolani, the evaluation flatters you slightly: plan to use the activity before the exchanges come, because the scoreboard says owners do not use it fully on average. If you are White in a closed chain over the board, the data hint — no more than that — that the practical chances may be better than the evaluation.

It does not mean that a particular IQP position is worse than Stockfish says. The gaps are averages over thousands of different positions and players, measured at one random moment per game. They mix the structure's effect with the openings that lead to it and the kinds of players who choose them. And the win-% model is a convenience: it converts centipawns to an expected score using a formula fitted to Lichess games, which treats a +0.50 position the same whether it arises in a blitz game between 1200s or a classical game between grandmasters.

Discussion questions

  1. The White IQP owner underperforms the engine by about two points in both pools. Give two different explanations, one about chess and one about statistics, and say what data would distinguish them.
  2. Why might closed pawn chains give the side with space better practical chances than the evaluation shows? Use the idea of "how many accurate moves does the defender need?".
  3. The KID chain owner overperforms OTB but underperforms on Lichess. Which differences between the two pools (time control, rating, opening choice) could explain the reversal?
  4. Every Black-owned label underperforms OTB. How would you separate a "colour effect" from a "structure effect" with this data?
  5. Would you expect the gaps to grow or shrink if we sampled the position at ply 40 instead of a random ply after 20? Why?

Your turn

Extend code/case_study_02.py in one of two ways and report what changes: - By rating band: repeat the comparison for Lichess positions below 1600 and from 2000 up (balanced games only). Does the IQP gap grow at lower ratings, where the activity is harder to use? - By phase: split the positions into middlegame and endgame (the phase column). Is the IQP owner's underperformance concentrated in positions that are still middlegames — that is, does it come from what happens after the sampled move?

Print the table, draw the scatter, and write five sentences on what you found — including the sample sizes and whether the differences are larger than about ±2 points.