How Koga decides

Definition Unmasking a piece behind
  • A discovered attack happens when the piece we move was standing in front of one of our own long-range pieces — a rook, bishop, or queen — and stepping aside opens that piece's line.
  • The piece that moves and the slider behind it must start on the same rank, file, or diagonal; the mover was the only thing blocking the view.
  • Once the line is opened, the slider must newly attack an enemy piece it was not attacking before. If the freshly exposed piece is the enemy king, it is also a discovered check (the king target is reported alongside).
Confirmation Is the exposed piece really winnable?
  • If the newly attacked piece has more of our attackers than its own defenders, it is plainly winnable and the discovered attack is accepted at once.
  • If the piece is adequately defended, we do not trust the bare geometry — we require the main line to actually show that piece being captured (or the discovery itself giving check) before we call it a discovered attack.
  • This filters out 'phantom' discoveries: a slider that lines up on a well-guarded piece which is only ever taken because it is forced to capture elsewhere, not because the discovery won it.
Priority When it collides with other motifs
  • A discovered attack always outranks a plain double attack or an insufficiently-defended capture made by the same move: opening the hidden line is the real idea, so those simpler labels are dropped.
  • Against a fork or a pinned-defender on the same move, we compare what each actually wins. The motif that captures the heavier piece is kept; the other is suppressed. Ties keep the more specific motif.
Roles How it relates to the move
  • New discovery (motif) — the move itself opens the line and reveals the attack.
  • Set up by a sacrifice (promoted to motif) — when the move sacrifices a piece that the opponent then recaptures, and the discovery appears only on the next move, the discovery is treated as the whole point of the sacrifice rather than an afterthought.

Test positions (the examples that guard against regressions)

Discovered check (and attack)

In a constructed position, the knight steps from e4 to d6 and unmasks the rook on e1, which now attacks the black king on e8 along the open e-file. Because the exposed piece is the king, Koga reports both a discovered check and a discovered attack.

✓ detectedDiscovered check · motiftest_discovered_check_includes_both
. . . . k . . .
. . . . . . . .
. . . N . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . R . K .
Attacking piece
Piece that moves
King

Quiet discovered attack on an undefended queen

A constructed position. The bishop on a3 slides to b4 — a quiet move, no check, no fork — and uncovers the rook on a1, which now bears down the open a-file at the black queen on a8. The queen has no defender, so the discovery is accepted immediately even from a one-move line.

✓ detectedMotiftest_discovered_attack_detected_with_short_pv_quiet
q . . . k . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. B . . . . . .
. . . . . . . .
. . . . . . . .
R . . . K . . .
Attacking piece
Piece that moves
Targeted / won piece

Discovery outranks a double attack

Played in a real game (Bh7+). The bishop leaves e4 to give check, and in doing so it unmasks the queen on e1, which now attacks the black queen on e5 down the e-file. The move could look like a double attack, but the hidden queen's line is the real idea, so the double-attack label is suppressed in favour of the discovered attack.

✓ detectedMotif · suppresses double attacktest_discovered_attack_suppresses_double_attack_in_BKuEHBIo
. . . . . . k .
. p . . . p p B
p . . . . . . p
. . p . q . . .
. . . p . . b .
. . . P . . P .
P P P . . P . P
. . . . Q . K .
Attacking piece
Piece that moves
Targeted / won piece

Discovery beats an incidental fork

Played in a real game (f5+). The pawn advance checks the king and also happens to attack the g4 pawn (a king-and-pawn fork), but at the same time it uncovers the rook on c7, which now hits the undefended white rook on h7. Winning the rook is the point, so the small fork is suppressed and the discovered attack is kept.

✓ detectedMotif · suppresses forktest_fork_suppressed_when_discovered_attack_wins_in_qcGvxNHv
. . . . k . r .
. . r . . . . R
. . . . p . p .
. . . . P p . .
p . p . K . P P
P . P . . . . .
. P . R . . . .
. . . . . . . .
Attacking piece
Piece that moves
Targeted / won piece

Discovery that traps the attacked piece

Lichess 06tuT. After the rook trade Qxc5 bxc5, White plays c4: the pawn advances and uncovers the bishop on d2, which now attacks the black knight on a5. The knight has no safe square — the line ends with it lost (a5–b7, then Bxb7) — so this discovery also traps a piece.

✓ detectedMotif · in line♟ Lichess 06tuTtest_detects_trapped_piece_from_discovered_attack
. . . . r r . k
p . p . . . b .
. . . . . . . .
n . p . . . p .
. . P . . p P p
. . . . . B . .
P . . B P . . .
. . R . . K . R
Attacking piece
Piece that moves
Targeted / won piece

Discovery set up by a sacrifice

Played in a real game (Nxf7). White sacrifices the knight so the king must recapture (Kxf7); then Ng5+ steps the other knight aside and uncovers the bishop on g2, which rakes the long diagonal onto the bishop on b7. The discovery only appears after the sacrifice, but since the sacrifice exists precisely to set it up, Koga promotes it to the main motif. The board is shown right after the sacrifice; the g2 bishop's line still runs through the f3 knight until it moves.

✓ detectedSacrifice setup · promoted to motiftest_promotes_followup_discovered_attack_when_sacrificing_to_set_it_up
r . . q . b . r
. b . n . k p p
p . . . p n . .
. p p . . . N .
. . . . . . . .
. . . . . . P .
P P Q P P P B P
R . B . . R K .
Attacking piece
Piece that moves
Targeted / won piece

Phantom discovery — rejected

Lichess zv50i. Black plays Nxc2+, forking the king, the a1 rook and the e3 pawn, and the knight's departure also lines up the queen on d8 down the d-file at the white queen on d1. But d1 has two defenders (king e1 and knight c3) against one attacker, so it is not actually winnable. The queen is captured later only because she is forced to take the checking knight — so the discovery is rejected and the fork is kept.

✗ not detectedPhantom · rejected♟ Lichess zv50itest_phantom_da_does_not_suppress_fork_in_zv50i
r . . q k b . r
p . . . . p p p
. . . . . n . .
. . . . . b . .
. . . . . . . .
. . N . P . . .
P P n . . P P P
R . B Q K B N R
Attacking piece
Piece that moves
Targeted / won piece

No discovery from a quiet pawn push

1.e4 from the starting position. The pawn moves, but there is no friendly long-range piece lined up behind it to unmask, so nothing is discovered.

✗ not detectedNegativetest_no_discovered_attack_in_quiet
r n b q k b n r
p p p p p p p p
. . . . . . . .
. . . . . . . .
. . . . P . . .
. . . . . . . .
P P P P . P P P
R N B Q K B N R
Piece that moves

Golden puzzles — every real Lichess puzzle Koga is tested against for this tactic (11)

Lichess 001XA

Lichess 001XA (rating 1686). Solution: Rxb7 Qxb7 Nf6+ Bxf6 Bxb7.

Koga flags discovered attack as a follow-up here — it fires later in the line, on Nf6+, not on the move shown above.

✓ detectedrating 1686♟ Lichess 001XA
. . r . . r k .
p q . . b p p p
. . . . . . . .
. . . . . . . .
. . p . N . . .
P . B n . . P .
. . Q . . P B P
. . . . . R K .

Lichess 01q4A

Lichess 01q4A (rating 1791). Solution: Nf2+ Kh2 Qxd1 Rxd1 Nxd1.

✓ detectedrating 1791♟ Lichess 01q4A
r . . . . . . .
p p k . . . . .
. . n . . . p p
. . b . p N . q
. . . p P . n .
. P . . . . N P
. P . . . . P .
R . B Q . R . K

Lichess 01I9O

Lichess 01I9O (rating 1337). Solution: Rg4+ hxg4 Qxh6 Rxf1+ Kxf1.

✓ detectedrating 1337♟ Lichess 01I9O
r . . . . . k .
. p p . . r . .
p . . . n . . q
. . . p P . . p
. . P . . R . P
. . . . . . . .
P P . Q . . P .
. . . . . R K .

Lichess 012QY

Lichess 012QY (rating 1223). Solution: Nxe6 fxe6 Rxd8.

✓ detectedrating 1223♟ Lichess 012QY
. . r q . r k .
. b . . b p p p
p p . . p . . .
. . . . . . . .
. . . N . . . .
P . P . P . . .
. . . . B P P P
. Q . R . R K .

Lichess 00mvP

Lichess 00mvP (rating 995). Solution: Nf3+ gxf3 Qxd4.

✓ detectedrating 995♟ Lichess 00mvP
r . b . . k . r
p p p p . . p p
. . . . . q . .
. . . . n . . .
. . B Q . . . .
. . . . . . . .
P P P . . P P P
R N . . R . K .

Lichess 00XQ8

Lichess 00XQ8 (rating 1488). Solution: Qe3+ Kb1 Rxf1 Qg8+ Re8.

✓ detectedrating 1488♟ Lichess 00XQ8
k . . . . r . .
p p . . . . . .
. . p . . . Q .
. . . p . . P .
. . . . r . . P
. . . . . . . .
P P P . . q . .
. . K R . R . .

Lichess 00AdI

Lichess 00AdI (rating 1253). Solution: Rd3+ g3 Rxg3+ Kh2 Rc3+.

Koga flags discovered attack as a follow-up here — it fires later in the line, on Rc3+, not on the move shown above.

✓ detectedrating 1253♟ Lichess 00AdI
. . . . . . . .
. . . . k p . p
. P Q . p . p .
p . . . b . . .
. p . . P . . P
. P . . . . r .
. . . . . . . K
. . . . . . . .

Lichess 01dLk

Lichess 01dLk (rating 1486). Solution: Nxf6+ gxf6 Qxe8+ Qxe8 Rxe8+ Rxe8 Nxd4.

✓ detectedrating 1486♟ Lichess 01dLk
r . . q r . k .
p b p . . p p p
. p . . . n . .
. . . . . . . .
. . . n N . . .
. . . . . N P .
P P . . Q P B P
R . . . R . K .

Lichess 00Kia

Lichess 00Kia (rating 1723). Solution: Qe5+ Kg8 Bd5+ Nxd5 Qxe1.

Koga flags discovered attack as a follow-up here — it fires later in the line, on Bd5+, not on the move shown above.

✓ detectedrating 1723♟ Lichess 00Kia
. . . . . r k .
. . . . n . . p
. p . . . . p .
p P . . Q . . .
P . . p B . . K
. . . . . . P .
. . P . . . . P
. . . . q . . .

Lichess 01Ni2

Lichess 01Ni2 (rating 1738). Solution: Ng1+ Kd2 Rxf2+ Bxf2 h1=Q.

✓ detectedrating 1738♟ Lichess 01Ni2
. . k . . r . .
. b N p . . . .
p B . P . . . .
. . . . . . . .
P . . . . . . .
. . . . . n . .
. P . . K R . p
. . . . . R . .

Lichess 03Sxg

Lichess 03Sxg (rating 1631). Solution: c2+ Ke4 Bc3 Rc6 c1=Q.

✓ detectedrating 1631♟ Lichess 03Sxg
. . . . . . . .
. . . . . . . .
. . . . p . . p
. . R . P . . P
. . . K . . P .
. . p P . . . .
. b . k . . . .
. . . . . . . .