Chapter 12 Exercises — Attack and Defense

Difficulty: ⭐ recall · ⭐⭐ apply · ⭐⭐⭐ analyse and judge · ⭐⭐⭐⭐ open-ended research. Every position below comes from a real game in the book's data; every engine verdict is Stockfish 19 from code/08_exercise_positions.py (output in code/out_08_exercise_positions.txt), White's point of view.


Part A — Concepts ⭐

A1. List the four conditions for an attack on the king. For each, say whether it is usually static or dynamic, and give one way the defender can remove it.

Answer

Development lead (dynamic — the defender completes development, or trades the developed pieces); local superiority near the king (dynamic — bring defenders, trade attackers); open lines (dynamic — close them with a pawn or piece, or contest the file); weakened shelter (mostly static — pawns cannot go back — but it can be compensated by defenders or by moving the king). The first three are the "clock is ticking" assets.

A2. Define the chapter's development count and compute it for White and Black in the starting position, and after 1.e4 e5 2.Nf3 Nc6 3.Bb5 a6 4.Ba4 Nf6 5.O-O.

Answer

Count = own knights and bishops not on the own back rank, + 1 if castled. Start: 0 and 0. After 5.O-O: White Nf3, Ba4 = 2, + castled = 3; Black Nc6, Nf6 = 2. Lead +1.

A3. Name the defender's five tools from least to most active. Which one does the chapter call "the most important", and why?

Answer

Close/block lines; bring defenders (or move the king); trade attackers; return material; counterattack. The counterattack, because every tempo the attacker spends meeting your threat is a tempo his attack does not get — it changes the race rather than just slowing it.

A4. What is a stable −2? Why does the chapter require four consecutive plies?

Answer

A side's own evaluation of −2.00 or worse on four consecutive plies. One bad reading often reflects a capture whose recapture is pending; four readings give the opponent two moves to cash in.

A5. Explain "dynamic equilibrium" in two sentences, using the words static, dynamic and time.

Answer

When one side's advantage is static (material, structure) and the other's is dynamic (activity, tempi), the balance holds only while the dynamic side keeps renewing its activity. Time works for the static side, so the dynamic side must keep creating threats or the evaluation drifts against it.

A6. True or false, with a reason: "If Stockfish at depth 8 says my sacrifice is +0.5, it is sound."

Answer

False. In the chapter's depth study, compensation positions' depth-8 evaluations were a median 51 cp (mean 86 cp) away from depth 20, and the verdict class changed in 15% of them. Praggnanandhaa–Carlsen's ...Rxc3 went from −0.18 at depth 8 to +0.26 at depth 20. Check at depth 20+ and at two depths.

A7. Why does a development lead of two or more score less above expectation at 2400+ than at 1200?

Answer

Strong defenders neutralise it in time — they trade the most active attacker, close lines, castle by hand — so the temporary asset expires before it is converted. Weaker defenders let the leader make threat after threat. (The data are associations; part of the low-level effect also comes from opening blunders that create the lead.)

A8. Lena says: "I was −2, so I resigned. No point dragging it out." Using two numbers from the chapter, explain why that is a poor policy at her level.

Answer

In Lichess rapid, a trailing side in the 1400–1599 band still saves 26.7% of games [25.3–28.1]; in blitz at the same band 28.3%. And saved games last much longer after the stable −2 (Case Study 2: median 41 plies for wins and 73 for draws in rapid, against 28 for losses). Resigning at −2 throws away roughly a quarter of the points.

A9. In the Tal–Petrosian hook position, White is about to win the exchange. Explain in terms of tempo why 21.Qh7+ (+0.80, depth 24) is better than 21.Nxa8 (0.00).

Answer

21.Nxa8 spends White's move on material while three black pieces (knight, queen, bishop) are one move from checking the white king; Black's checks then arrive first and never stop (perpetual). 21.Qh7+ uses the move to give check — the opponent must answer it — and in the engine's line White trades off the knight that would have started the checks. In a race, a move with tempo is worth more than material.

A10. Classify each as a static or a dynamic deficit for the side concerned, and say which the chapter's data suggest is saved more often: (a) you blundered a knight and the evaluation is −3.0; (b) material is level but your king is stuck in the centre and the evaluation is −2.5.

Answer

(a) static (material); (b) dynamic (position). In all three data sets a stable −2 with material level was saved more often than one with material down — e.g. 21.7% vs 18.1% in OTB classical, 28.3% vs 25.2% in Lichess blitz.


Part B — Positions ⭐⭐

B1. Analyze this position — Tal–Tringov, Amsterdam Interzonal 1964 (Black to move)

Tal–Tringov 1964, Black to move after 11.Bf4

♟️ Position: White Kg1, Qd2, Rb1, Re1, Bc4, Bf4, Nc3, Nf3, a2, c2, d4, e4, f2, g2, h2; Black Ke8, Qa5, Ra8, Rh8, Bc8, Bg7, Nb8, Ng8, a6, b7, c6, d6, e6, f7, g6, h7 — Black to move. FEN: rnb1k1nr/1p3pbp/p1ppp1p1/q7/2BPPB2/2N2N2/P1PQ1PPP/1R2R1K1 b kq - 1 11

Black is a pawn up and has developed one piece. Choose a defence — and explain why 11...e5 (the game) lost.

Solution

Stockfish 19: 11...Qd8 +1.83 (depth 20), +2.50 (depth 24); 11...Qc7 +2.53 (depth 20). The game's 11...e5 is +5.76 (depth 20) after the move. The defence is tool number 3 — bring the queen home to cover d6 and the king, and get on with developing. 11...e5 is a pawn move that opens a line (the d-file after 12.dxe5 dxe5) for an opponent who is four tempi ahead: White's queen arrives on d6 next move (13.Qd6) and Black never castles. Even after the best defence White is clearly better — the development deficit has a price — but +2.5 is a fight; +6 is resignation.

B2. Find the tactic — Olafsson–Petrosian, Candidates 1959 (White to move)

Olafsson–Petrosian 1959, White to move

♟️ Position: White Kh1, Qe4, Rd1, Rf1, a3, d6, g2, h2; Black Kg8, Qd8, Rd7, Bb2, a6, b5, c4, f7, g4, h5 — White to move. FEN: 3q2k1/3r1p2/p2P4/1p5p/2p1Q1p1/P7/1b4PP/3R1R1K w - - 1 37

Last moves: 34.Qxe5 Nxe4 35.Qxe4 Bxb2 36.d6 Rd7. White's attack has arrived. Finish the job.

Solution

37.Qf5! — +4.84 (Stockfish 19, depth 24); +3.91 at depth 20 (37.Qd5 is second, +2.96). The queen attacks f7 and h5 at once; the engine's line continues 37...Bh8 38.Qxh5, collecting the kingside pawns with a decisive attack against the bare king. The game's 37.Rd5 scores +0.12 (depth 20) — 37...Rxd6 and Black's rook comes back into defence. Petrosian, once again, survived: the game was drawn at move 42. The point for defenders: a passive-looking position with the right pieces near the king (rook on d7, queen on d8) holds more often than you think if the attacker misses the one quiet queen move.

B3. Analyze this position — Vaishali–Tan Zhongyi, FIDE Women's Candidates 2026 (Black to move)

Vaishali–Tan Zhongyi 2026, Black to move

♟️ Position: White Kf3, Ra6, Be3, f4, g2, h2; Black Kg7, Ra4, Bf6, a5, f7, g6, h5 — Black to move. FEN: 8/5pk1/R4bp1/p6p/r4P2/4BK2/6PP/8 b - - 3 37

A quiet endgame-like position. Which move keeps the balance — and which loses at once?

Solution

37...Ra3 −0.42 (depth 24), or 37...Bc3 −0.35 (depth 20): Black is if anything slightly better. The game's 37...Ra1? is +5.21 (depth 20): 38.Rxf6! Rf1+ 39.Ke2 Kxf6 40.Kxf1 and White is a bishop up in the ending. The bishop on f6 was defended only by the king; the rook's "active" move to a1 created a check that White could simply walk away from, after which the rook was itself loose. Defensive lesson: before an "active" move, check what it undefends. White went on to win.

B4. Build the plan — Spielmann–Lasker, Moscow 1935 (White to move)

Spielmann–Lasker 1935, White to move

♟️ Position: White Kf1, Ra1, Rd1, Bd3, Bf4, Nd4, a2, b2, c3, f2, g2, h2; Black Kb6, Ra8, Re8, Bc8, Bf8, Nf6, a7, c6, d5, f7, g7, h7 — White to move. FEN: r1b1rb2/p4ppp/1kp2n2/3p4/3N1B2/2PB4/PP3PPP/R2R1K1 w - - 7 17

Queens are off, but Black's king has walked to b6. How should White attack it?

Solution

With pawns: 17.a4 +1.36 (depth 20), +1.41 (depth 24), or 17.b4 (+1.35, depth 20). The plan is a minority of pawns running at the king — a4–a5+ and b2–b4 — to open lines on the queenside where the black king lives; the engine line is 17.a4 Kb7 18.a5 a6 19.b4. Spielmann played exactly 17.a4, and after 17...a5 18.b4 axb4 19.a5+ the attack was rolling. Lasker defended with his pieces — ...Ne4, ...g5 and an active king — and drew. Attack without queens is still attack: open lines toward the king and bring the pieces.

B5. Find the tactic — Muzychuk–Divya Deshmukh, FIDE Women's Candidates 2026 (White to move)

Muzychuk–Divya Deshmukh 2026, White to move

♟️ Position: White Kg2, Qg4, Re4, a5, b4, d5, g3, h6; Black Kh8, Qf8, Rc7, b5, d6, e7, f6, h7 — White to move. FEN: 5q1k/2r1p2p/3p1p1P/Pp1P4/1P2R1Q1/6P1/6K1/8 w - - 1 43

You are pressing against an exposed king. Keep the pressure.

Solution

43.Qh5! +2.15 (depth 20), +1.47 (depth 24) — the queen stays on the kingside, ties Black's queen to h6/h7, and prepares Re3–e6 or g3–g4–g5. The game's 43.Qe2 is +0.46 (depth 20): the queen leaves the attack to hit b5, and Black immediately takes the h6 pawn (43...Qxh6) and liquidates; the game was drawn for a long time and eventually won by Black. The two depths disagree by 0.7 — a dynamic position — but both say the same thing: the attacking queen belongs near the king.

B6. Find the tactic — Gukesh–Erigaisi, Chennai Grandmasters 2026 (White to move)

Gukesh–Erigaisi 2026, White to move

♟️ Position: White Kg2, Qg4, Rh1, Bg3, Ne2, a2, d4, e3, f2, g5; Black Ke8, Qb2, Ra8, Ne6, Ne7, a7, b7, c6, d5, f7, g6 — White to move. FEN: r3k3/pp2np2/2p1n1p1/3p2P1/3P2Q1/4P1B1/Pq2NPK1/7R w q - 0 24

Black's queen has just taken on b2 — far from her king. Punish it.

Solution

24.Rh8+! +5.16 (depth 20), +6.03 (depth 24); the quiet 24.Qf3 is only +0.54. After 24...Nf8 25.Bd6 the black king is stuck in the centre: the bishop takes away the escape squares and threatens Bxe7/Rxf8+. Gukesh found 24.Rh8+ and 25.Bd6 — the attack worked exactly as the conditions predict (open h-file, Black's best defender far away on b2, uncastled king). The rest of the game is a reminder of section 12.7: the advantage later slipped away and Erigaisi won. An evaluation of +6 is not a win until it is converted.

B7. Find the tactic — Pranesh–Gukesh, Chennai Grandmasters 2026 (White to move)

Pranesh–Gukesh 2026, White to move

♟️ Position: White Ka1, Qc4, Rb1, Rh1, Bf4, Nd3, a2, f2, g2, h4; Black Kc8, Qd7, Rd5, Rh7, Ba3, Nc6, a6, b5, d4, f7, g7, h6 — White to move. FEN: 2k5/3q1ppr/p1n4p/1p1r4/2Qp1B1P/b2N4/P4PP1/KR5R w - - 0 30

You have been defending for ten moves; Black has just played ...b5. Counterattack.

Solution

30.Qb3! +3.59 (depth 20), +4.28 (depth 24); the "safe" 30.Qc2 is 0.00. ...b5 loosened the shelter of Black's queenside king and left the a3 bishop and a6 pawn hanging together; 30.Qb3 attacks a3 and eyes b5 and the b-file. Pranesh played it, followed by Qc4, Nc5 and Nb7+, and won — the defender turned attacker the moment the attacker weakened his own king. This is the chapter's comeback in miniature: the defender kept the position together, waited for the weakening, and struck.


Part C — Data & Code ⭐⭐–⭐⭐⭐

C1. Database research ⭐⭐. Extend 01_development_lead.py to report the leader's score separately for leads of exactly 2, exactly 3, and 4 or more, by Lichess band. Input: the same sample. Expected output: a table with 8 band rows × 3 lead columns (score, n), plus a note on which cells have n < 100.

C2. Database research ⭐⭐. In 04_comebacks.py, split the trailing-side save rate by colour (was the trailing side White or Black?). Expected output: a set × colour table of saved % with Wilson intervals. Does Black save more or less often than White, and is the difference larger in OTB play (where draws are common)?

C3. Engine analysis ⭐⭐⭐. Using 06_engine_depth.py, add depth 24 for the 20 most depth-sensitive compensation positions. Does the depth-20 → depth-24 shift look like the depth-16 → depth-20 shift, or has the evaluation settled? Expected output: mean and median |d24 − d20| for the subset, next to |d20 − d16|.

C4. Database research ⭐⭐⭐. The compensation detector uses a four-ply window and a −1.00 threshold. Re-run 02_game_scan.py's logic (on a smaller sample — 1,000 games per cell is enough) with windows of 2, 4 and 8 plies and thresholds of −0.50 and −1.00. How sensitive is the headline (balanced compensation scores +6.8 online, −0.5 OTB classical) to these choices? Expected output: a 3 × 2 grid of rating-adjusted scores per set.

C5. Engine analysis ⭐⭐. Run outpost.dynamics.game_dynamics() with depth-16 evaluations on Tal–Tringov and Abdusattorov–Gukesh. Plot White's development lead, mobility difference and king pressure under the evaluation curve. In which game do the dynamic factors lead the evaluation (change before it), and in which do they lag? Expected output: two stacked line charts, one per game.

C6. Database research ⭐⭐⭐. Case Study 2 found that saved games last much longer after the stable −2. Using [%clk] from the movetext, add the trailing side's remaining clock (as a share of base time) at the start of the episode and test whether trailing sides with more time save more often. Expected output: save rate by clock tercile × set.

C7. Database research ⭐⭐. The chapter's levels table pools bands into three groups. Produce the full eight-band version of the balanced-compensation table (score, rating-adjusted score, Wilson interval, n) for each set, and mark the cells where the interval includes zero adjustment. Expected output: an 8 × 3 table. Which conclusions of section 12.6 survive at the finer resolution?

Hints for C1–C7

C1: df["lead_abs"] = df.lead.abs().clip(upper=4) then group by band and lead_abs. C2: the scan's cb_side column is 'w' or 'b'. C3: reuse the _evaluate worker with DEPTHS = [24] on the selected FENs (keep 3 workers). C4: wrap the detector loop in a function with win and thr arguments. C5: pass the eval_after column of engine.analyse_game(...) as evals. C6: chessdata.parse_movetext() returns clock_s per ply; the base time is in lichess_games.time_control / broadcast_games.base_s. C7: reuse 05_compensation.py's bal frame and group by band instead of lvl; expect several cells with n < 150.


Part D — Judgment & Transfer ⭐⭐⭐

D1. A 1200 and a 2000 both reach a position where they are a piece up but their opponent has a strong attack (engine: 0.00). Using the chapter's data, predict how each will score and explain what each should do differently.

Answer

Online, the side with the compensation scores about +6 to +9 points above expectation at every level (the material-up side correspondingly below), so both are under-dogs relative to the engine's verdict in blitz or rapid; in OTB classical the balance holds (−0.5 points for the compensation side). The 1200 should simplify: return some material to kill the initiative and trade the attacking pieces, accepting a smaller edge; dynamic positions are volatile (median ten-ply eval change about four times a quiet position's at that level online). The 2000 can defend more precisely but should still prefer trades over grabbing more (Tal's 17.Qc7 lesson).

D2. "The engine says my opponent's attack is unsound, so I can grab the pawn." When is that reasoning right for a human, and when is it wrong? Use Steinitz–Lasker and Tal–Petrosian in your answer.

Answer

Right when the refutation is short and you can see it; wrong when the "unsoundness" depends on finding a long sequence of only-moves under time pressure. Steinitz was +5 at move 33 but needed the quiet 33.Kd3 against a stream of checks and found 33.f3 instead; Tal had +2.64 with 17.Qc7 but chose the attacking move. The practical value of an attack (for the attacker) or of a defensive resource is how hard it is for the opponent to meet, not only what the engine says.

D3. Your opponent castles queenside and starts a pawn storm on your king. You have a choice between defending (…h6, …Kh8, bringing a knight to f8) and counterattacking on the queenside at the cost of a pawn. Which factors decide it?

Answer

Count tempi to impact for both storms (Chapter 4's "first storm to arrive"); count attackers and defenders on both wings; check whether your counterattack comes with tempo (attacking his king or pieces) — if it does, it is usually better than passive defence; if it needs three quiet moves to make a threat, defend first. Remember that opposite-side castling makes games more decisive (OTB draw rate 19.4% vs 26.8%), so passivity is punished.

D4. Why might the development-lead effect be larger in Lichess rapid (+7.3 points) than in bullet (+2.8)? Offer two explanations, one chess and one about the data, and say how you would tell them apart.

Answer

Chess: converting a lead needs calculation (the knockout blow), which bullet does not allow. Data: the kind of games that produce a lead differ by speed (e.g. more early pawn grabs in rapid, more pre-moves and random blunders in bullet). Test: condition on the opening (ECO family) and on the evaluation after move 12 where available, and see whether the speed gap shrinks.

D5. Grace (FIDE ~1850) has White in a classical game and is offered a pawn-grab like Tringov's 6...Qxb2 — but from the other side: her opponent sacrifices the b-pawn for development. The engine says +0.6 for her if she takes. Should she?

Answer

Objectively yes — +0.6 is a real edge, and in OTB classical play balanced dynamic compensation scores only what the engine predicts (−0.5 points vs expectation for the compensation side), so the gambiteer gains no hidden practical bonus at her level and speed. But the price is that she must spend the next several moves developing, not grabbing more (Tringov's lesson: four queen moves and three pawn moves lost the game). If she would play it as Tringov did, she should decline. The data point for a blitz game would be different: online, the side with the initiative outscores its evaluation by about seven points.


Part M — Mixed / Interleaved ⭐⭐–⭐⭐⭐

M1. (Chapter 4 + 12) ⭐⭐. Take the position after 31...fxg4 in Abdusattorov–Gukesh (FEN in the chapter, ch12-pos-13). Run Chapter 4's king_safety_report() for White and Chapter 12's attack_conditions() for Black. Which readings agree with the engine's −2.92 and which miss the danger?

M2. (Chapter 6 + 12) ⭐⭐. Chapter 6 priced material imbalances by data; Chapter 12 found that balanced compensation scores +6.8 online and −0.5 OTB classical. Use Chapter 6's material.py to classify the imbalance in the compensation episodes of ch12_scan.csv.gz (replay to comp_ply) and report the score by imbalance type (exchange down, piece for pawns, …).

M3. (Chapter 7 + 12) ⭐⭐⭐. For the five critical defensive positions of this chapter (Tal–Tringov after 11.Bf4, Steinitz–Lasker after 26...Qxh2, Tal–Petrosian after 13.Nxe6, Abdusattorov–Gukesh after 32...b5, Assaubayeva–Lagno after 34.e6), run Chapter 7's null-move threat finder. In how many does the threat it finds match the piece that the best defence trades or neutralises?

M4. (Chapter 9 + 12) ⭐⭐. Use Chapter 9's motif detector on the position after 14...Nd7 in Tal–Tringov (ch12-pos-03). Which motifs does it find in 15.Bxf7+ and 16.Ng5+, and which of the four attack conditions made each motif possible?

M5. (Chapter 10 + 12) ⭐⭐⭐. Build a forcing-move tree (Chapter 10's calc.py) from the hook position (Tal–Petrosian after 20...Qc5) to depth 6 plies of checks and captures only. Does the tree find the perpetual after 21.Nxa8? Does it find 21.Qh7+ as the move that prevents it?

Notes for M1–M5

M1: expect the shelter and open-file readings to flag danger and the zone-attacker count to understate it — the black knights are one move away from the zone, which is why defensive_resources() uses potential attackers. M3: the threat finder's null-move test will flag several of these; compare its threat move with the piece removed in the engine's defence. M5: the perpetual is a short forcing line (checks only), so a checks-and-captures tree finds it quickly; 21.Qh7+ appears as a check that changes the order of the race.


Part E — Research & Extension ⭐⭐⭐⭐

E1. The defender's tools in the wild. Using dynamics.defensive_resources() with engine ranking, classify the engine's best move in every position of the scan where one side has just reached a stable −2 from an attack (attack conditions ≥ 3 for the opponent). Which tool is most often best — trade, check, block, king move, return of material — and does the answer change by rating band or time control?

E2. Is the counterattack faster? In opposite-castling games, identify the first move at which each side has three or more attack conditions against the other king. Does the side that reaches three conditions first win more often than its Elo expectation, and by how much? Compare with Chapter 4's pawn-storm race.

E3. Your own dynamics profile. Fetch 200 of your own analysed games (Chapter 1's games.py), run trailing_episode() and compensation_episode(), and compare your save rate and your "conversion failures" (opponent trailed first, you did not win) with the band reference in 04_comebacks.py. Write a one-page plan targeting the weaker of the two.