How Koga decides

Definition Two threats at once
  • After the move, the piece that just moved bears on two enemy targets at the same time, and the opponent cannot answer both. A target counts when it is a piece worth a knight or more that is either undefended, or worth more than the piece attacking it.
  • Giving check counts as one of the two threats: a move that both checks the king and attacks a second valuable piece is a double attack, because the opponent must deal with the check and loses the other piece.
  • A threat to deliver checkmate next move also counts — if the opponent does nothing, mate follows — provided that mate is a genuinely separate threat from the piece being attacked.
Second target The second target can be elsewhere on the board
  • The two threats need not both come from the moved piece. A move can attack one piece directly and, at the same time, leave a second enemy piece newly hanging somewhere else — attacked by one of our pieces with no defender, when it was safe before the move.
  • Likewise, the move can attack a piece while the line also ends in a forced mate delivered by a different piece. The attacked piece and the mate are two distinct problems the opponent cannot both solve.
Filters When two threats are really only one
  • Same piece, same square — if the only “second” threat is the same piece delivering mate on the very square it already attacks, that is one threat dressed up as two, and it is not counted. A different piece mating on that square does count.
  • A single target with check — a move that only gives check, or only attacks one piece, is not a double attack. There must be two separate problems.
  • Attacker is given away — if the piece making the threats is immediately captured in the main line and neither target is ever actually won, the double attack fizzles and is dropped.
  • The capture must be legal — a piece pinned to its own king cannot take the target it bears on, so that attack is not a threat. This applies to the moved piece and to the piece that attacks a newly hanging target.
  • One exception: the piece that pins the attacker is itself one of the targets, and it is worth more than the attacker. Then both threats are real: we take the pinning piece, or it moves away and the other capture becomes legal. If the pinning piece is worth the same or less, it just takes the attacker — no double attack.
Roles When a more specific pattern takes over
  • Double attack is Koga’s general name for two simultaneous threats. When a more specific pattern describes the same geometry, that pattern is reported instead and the double attack is suppressed.
  • A knight (or any piece) attacking two targets at once is a fork, and is reported as a fork rather than a double attack.
  • A move that uncovers a waiting piece behind it is a discovered attack; that, too, takes precedence over the generic double-attack label.

Test positions (the examples that guard against regressions)

A knight fork is reported as a fork, not a double attack

A constructed position. The knight lands on c7 attacking both the king on e8 (check) and the rook on a8 — exactly two threats. But a knight hitting two targets at once is a fork, so Koga reports the fork and suppresses the generic double-attack label.

✗ not detectedFork outranks double attacktest_knight_fork_not_double_attack
r . . . k . . .
. . N . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . K . . .
Attacking piece
Targeted / won piece
King

Same piece, same square — one threat, not two

A constructed position. After Rxb1 the rook on b1 pins the white rook on e1 to the king on g1, and the threatened follow-up Rxe1 is mate. But the mate is delivered by the SAME rook on the SAME square it already attacks (e1), so that is a single threat, not a genuine double attack. Koga reports the pin instead and does not flag a double attack.

✗ not detectedOne threat dressed as twotest_no_double_attack_same_piece_mate_via_pv
. . . . . r k .
p . . P . . p .
. . . . . . p .
. . p . N . . .
. . . p . . . .
. . . P . . . b
P . . . . . . P
. r . . R . K .
Attacking piece
Targeted / won piece
King

The attacker is given away — the double attack fizzles

From a real game (11.Nxf7). The knight on f7 geometrically attacks both the queen on d8 and the rook on h8, which looks like a double attack. But the knight is a sacrifice: the king simply takes it on f7 next move, so neither target is ever won. Because the attacking piece dies and the threats never materialize, Koga drops the double attack.

✗ not detectedFizzling attackertest_fizzling_double_attack_dropped_when_attacker_sacrificed
r . . q k b . r
. b . n . N p p
p . . . p n . .
. p p . . . . .
. . . . . . . .
. . . . . N P .
P P Q P P P B P
R . B . . R K .
Sacrificed piece
Targeted / won piece
King

A pinned attacker threatens nothing — no double attack

A constructed position from a review of Koga’s detectors. Nd4+ gives check and lands on a square that bears on the rook on f5, which looks like a double attack. But the bishop on h8 pins the knight to the king on a1, so Nxf5 is illegal. The rook is not really attacked, and Koga does not flag a double attack.

✗ not detectedPinned attackertest_pinned_attacker_is_not_a_double_attack
. . . . . . . b
. . . . . . . .
. . . . k . . .
. . . . . r . .
. . . N . . . .
. . . . . . . .
. . . . . . . .
K . . . . . . .
Pinned piece (frozen)
Targeted / won piece
King

The pinning piece is one of the targets — still a double attack

Amirhosein_1392 – karmanyan (Lichess KCWq986I), best move 10.c3. The pawn blocks the bishop’s check and attacks the bishop on b4 and the queen on d4. The bishop pins the pawn to the king, so cxd4 is not legal yet. But the pawn can take the bishop, and if the bishop moves away cxd4 becomes legal. Both threats are real.

✓ detectedPinner is a targettest_attacker_pinned_by_its_own_target_is_a_double_attack
r n b . k . r .
p p . . . p p p
. . p . p . . .
. . . . P . . .
. b B q N . . .
. . P P . . . .
P P . . . P P P
R . B Q K . . R
Attacking piece
Targeted / won piece
King