Case Study 2 — "The First Attack Wins": Testing a Rule of Thumb on 70,000 Opposite-Castling Games
Setup
Every chess coach has said some version of it: in opposite-side castling, the side whose attack arrives first wins. Section 4.5 measured it and found a real but modest edge — the first stormer scored 56.0% over the board, 3.7 points above its rating expectation. This case study asks the question a data analyst should ask next:
Does arriving first cause the better result — or do players who were already better simply get their attack going first?
The question matters for your games. If storming first is valuable in itself, you should push pawns at the first opportunity. If it mostly reflects a better position, your priority is the position, and the storm is a symptom.
Data. 03_opposite_castling_race.py replayed every opposite-castling game in the OTB broadcast data
(30,629 human, standard, finished games with both FIDE ratings) and a fixed random sample of 40,000
balanced Lichess games (|rating difference| ≤ 100, bots excluded, bullet to classical; seed 4). For each
game it recorded:
- the ply at which both kings had castled;
- each side's storm arrival (first ply with a pawn on its own fifth rank or beyond, on one of the three files around the enemy king);
- the evaluation stored in the game record at both moments (Lichess server evals or broadcast cloud evals, White's view, clipped to ±10 pawns).
case_study_02.py then keeps the games in which at least one storm arrived and both evaluations exist —
22,675 OTB games and 12,874 Lichess games — and groups them by the evaluation at the moment both kings
had castled, from the first stormer's point of view.
The data
d["eval_fs"] = d.eval_both.clip(-1000, 1000) * np.where(d.first_side == "white", 1, -1)
bins = [-1001, -150, -50, 50, 150, 1001]
labels = ["≤ −1.50", "−1.49 to −0.51", "−0.50 to +0.50", "+0.51 to +1.49", "≥ +1.50"]
d["bucket"] = pd.cut(d.eval_fs, bins=bins, labels=labels)
for (src, b), g in d.groupby(["source", "bucket"], observed=True):
s = g.score.mean() # first stormer's score
adj = s - g.expected.mean() # minus Elo expectation
The output:
First stormer's score by the evaluation when both kings had castled (first stormer's view)
source eval_when_both_castled n share score lo hi expected adj
broadcast ≤ −1.50 1911 8.4 23.5 21.6 25.4 40.7 -17.2
broadcast −1.49 to −0.51 3292 14.5 40.6 38.9 42.2 46.1 -5.6
broadcast −0.50 to +0.50 8967 39.5 52.7 51.7 53.8 51.1 1.7
broadcast +0.51 to +1.49 5120 22.6 66.6 65.3 67.9 56.2 10.4
broadcast ≥ +1.50 3385 14.9 80.8 79.4 82.1 61.6 19.2
lichess ≤ −1.50 2666 20.7 36.6 34.8 38.4 49.6 -13.0
lichess −1.49 to −0.51 1579 12.3 48.5 46.0 50.9 50.1 -1.6
lichess −0.50 to +0.50 2824 21.9 53.0 51.2 54.9 50.0 3.0
lichess +0.51 to +1.49 2015 15.7 58.6 56.4 60.7 50.5 8.1
lichess ≥ +1.50 3790 29.4 66.7 65.2 68.2 50.4 16.3
Raw vs eval-stratified advantage of the first stormer (score - Elo-expected, points):
broadcast: raw +3.6 (n = 22,675); among level positions (|eval| <= 0.50) +1.7; share of first stormers already ahead by > +0.50: 37.5% vs behind by > 0.50: 22.6%
lichess: raw +3.8 (n = 12,874); among level positions (|eval| <= 0.50) +3.0; share of first stormers already ahead by > +0.50: 45.1% vs behind by > 0.50: 32.8%
(The raw OTB edge here, +3.6, differs by a tenth from Section 4.5's +3.7 because this table keeps only games with stored evaluations.)

📊 Figure (described): The first stormer's score (with 95% intervals) in five evaluation buckets, OTB in blue and Lichess in green. Both lines climb steeply from left to right: from 23.5% (OTB) when the first stormer was at least 1.50 pawns worse when the kings had castled, to 80.8% when it was at least 1.50 better. In the middle bucket — level positions — the first stormer scores 52.7% (OTB) and 53.0% (Lichess), only a little above 50%.
Analysis
1. Most of the edge was there before the storm. Over the board, 37.5% of first stormers were already more than half a pawn better when the kings castled, and only 22.6% were more than half a pawn worse. The first storm is, in part, a consequence of being better: the side with the freer position has the time to push pawns.
2. In level positions a small edge survives. Among games that were level when both kings had castled (|eval| ≤ 0.50), the first stormer still scores 52.7% OTB (n = 8,967), +1.7 points above its rating expectation, and 53.0% on Lichess (n = 2,824), +3.0. That is a little under half of the raw OTB edge — consistent with a real but small value to arriving first.
3. Storming first from a worse position does not rescue it. First stormers who were already 1.50 pawns or more worse scored 23.5% OTB — 17.2 points below their rating expectation. Pushing pawns at the enemy king doesn't fix a bad position; often it is the reason the position gets worse (every tempo spent on the storm is a tempo not spent on defence).
4. Lichess is noisier. The Lichess buckets are flatter at the extremes (66.7% at ≥ +1.50 vs 80.8% OTB) because online games, especially fast ones, swing more after the opening: a +1.50 position is less reliably converted with a few minutes on the clock. The pattern is the same; the slope is gentler.
5. The race shape matters more than the starting gun. The replay script also records how the race ran, and those rows (Section 4.5's table) put the evaluation result in context:
group n score lo hi expected adj draw
broadcast only one storm ever arrived 12670 62.2 61.3 63.0 54.7 7.5 17.9
broadcast both arrived, gap <= 4 plies 1995 51.5 49.3 53.6 50.4 1.1 16.8
broadcast both arrived, gap >= 10 plies 7778 49.2 48.1 50.3 49.8 -0.6 20.0
When the opponent's storm never arrived, the first stormer scored 62.2% — the largest edge anywhere in this study. When both storms arrived, being first by two moves (gap ≤ 4 plies) was worth about one point, and being first by five moves or more was worth nothing (49.2%). That last row looks paradoxical until you picture the games: if your storm arrived ten plies before your opponent's and he still got his attack going, your attack did not do its job — it neither mated nor forced him onto the defensive. A storm that leaves the opponent free to storm back is a storm that missed.
Checking that the buckets aren't doing the work
Any analysis that bins a continuous variable can be distorted by where the bin edges fall. Two checks are built into the design:
- Symmetric, round edges. The buckets are symmetric around zero (±0.50 and ±1.50 pawns), chosen
before looking at the results, so that the middle bucket is a genuinely level band and the outer ones
hold clear advantages. With these edges the score rises monotonically across all five buckets in both
databases. We did not try other edges; testing them (say ±0.25 and ±1.00) is a two-line change to
case_study_02.pyand a good first check before trusting the middle row. - Elo expectation inside each bucket. Each row compares the first stormer's score with its own rating expectation, so a bucket that happens to contain stronger first stormers is judged against a higher bar. Notice that the expected score itself climbs from 40.7% to 61.6% across the OTB buckets: being better at castling time is partly being the stronger player, and the table separates that from the position.
The Lichess sample is balanced by construction (|rating difference| ≤ 100), so its expected scores all sit near 50%; any slope there comes from the position, not the ratings — which is why the Lichess middle-bucket edge (+3.0) is a useful cross-check on the OTB one (+1.7).
By level
Section 4.5's band table showed the first stormer's raw edge at every level — on Lichess from +2.0 to +4.3 points, over the board from +2.1 to +5.1. The edge does not fade at higher levels; strong players convert a lead in the race about as well as club players do. If anything, the practical message for a club player is the opposite of "attack first at all costs": the most expensive row in the whole study is the first stormer who was already worse (−17.2 points OTB). Whether club players make that mistake more often than masters is a question this table cannot answer — splitting the worst bucket by band would.
What it means (and doesn't)
It means the rule of thumb is half right. Arriving first is associated with a small extra score even in level positions — a point or three — but the bulk of the famous effect is the simple fact that the better side usually gets its attack moving first. The practical lesson: in an opposite-castling race, judge the race by the position — piece placement, open lines, who has the initiative — and use the storm as the means, not the goal. And remember the finding of Section 4.5: the larger effect is whether the opponent's storm arrives at all. Slowing the enemy attack by one well-chosen move (…h5 against h4, a blockading knight) can be worth more than speeding up your own.
It doesn't mean that the remaining +1.7 points are a clean causal effect. The evaluation at castling time is only one control; players who storm first may also be the stronger players on the day, or play openings they know better, and our storm definition ignores piece attacks entirely (Caruana's 13...Rxc3 in Section 4.5 is invisible to it). Stored evaluations come from different engines and depths, and the Lichess sample includes all speeds. A careful study would add opening, speed and clock time as controls.
Discussion questions
- Why does controlling for the evaluation at castling time reduce the first stormer's edge? Draw the causal arrows you think connect "position quality", "storm first" and "result".
- The Lichess level-position edge (+3.0) is larger than the OTB one (+1.7). Suggest two explanations.
- Our definition counts only pawns. Which games would move from "first stormer = White" to "first stormer = Black" if piece sacrifices like ...Rxc3 counted as an "arrival"?
- In the worst bucket the first stormer scores 23.5% OTB. Is storming first in a bad position a mistake, or the best practical try? What data would answer that?
- How would you design a test in which the storm is closer to "randomly assigned"?
Your turn
Extend case_study_02.py: add the speed of each game as a second grouping variable and recompute the
level-position row (|eval| ≤ 0.50) separately for OTB classical, rapid and blitz (FIDE classes in the
speed column) and for Lichess bullet, blitz and rapid. Expected output: one row per speed with n, score,
expected and adj. Does the first stormer's edge in level positions grow as the clock gets shorter? Write
three sentences on what your result means for a player choosing between a quiet move and a pawn storm in
a rapid game.