How Koga decides

Definition One piece attacks two (or more) at once
  • After the move, a single one of our pieces attacks two or more enemy pieces at the same time. The opponent can only answer one threat, so we win the other.
  • Each target must be worth taking: it is either undefended, or worth strictly more than the forking piece, so capturing it gains material. The enemy king always counts as a target.
  • A target that is defended and worth no more than the forker is just an even or losing trade, not a real fork threat — we ignore it.
New attacks only The move must create the double attack
  • We only count targets the forking piece did NOT already attack from its old square. A piece that was hitting one of the targets before the move is no fresh threat — the fork has to be made by this move.
  • Exception for captures: when the move captures a piece that was blocking the forker's own line, that line opens up and the pieces behind it become genuine new targets.
  • Defended targets that are not worth more than the forker can still count when the move adds one more attacker and a static exchange shows we come out ahead on that square.
Does it pay off? Sham sacrifices are not forks
  • If the forking piece is captured on the very next move and the whole sequence does not win material, the fork was only a sacrifice to set up something else. We keep the geometry on record (as enabling) but do not headline it as a fork.
  • A fork that gives check, or one where the forking piece survives the opponent's reply, is treated as real: the opponent must save one target and lets the other go.
  • We also look a little deeper: a check-fork can pay off through the king's forced reply (the king is dragged onto the forking piece and the recapturing piece is then won), even when the other target is never actually taken.
Fork vs. double attack When two related patterns collide
  • A fork (one piece, two targets) and a discovered/double attack (a piece moves to unmask a second attacker) can describe the same move. We keep whichever wins the heavier material.
  • When the fork's targets are the bigger prize, the fork is the headline and the rival pattern is dropped; when the other pattern wins more, the fork steps aside.

Test positions (the examples that guard against regressions)

Knight check-fork

A constructed position. The knight has gone to c7, giving check to the king on e8 while also attacking the rook on a8. The king must move, so the rook is lost.

✓ detectedKnight · checktest_detects_knight_fork
r . . . k . . .
. . N . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . K . . .
Attacking piece
King
Targeted / won piece

Rook check-fork

A constructed position. The rook lands on d6 with check to the king on g6 and at the same time attacks the undefended bishop on a6 along the sixth rank.

✓ detectedRook · checktest_detects_rook_fork
. . . . . . . .
. . . . . . . .
b . . R . . k .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. K . . . . . .
. . . . . . . .
Attacking piece
King
Targeted / won piece

Forking two undefended pawns

A constructed position. The knight on e5 attacks the pawns on d7 and f7 with the black king far away on a8. Both pawns are undefended, so even though they are low value the double attack wins one of them.

✓ detectedKnighttest_fork_on_undefended_pawn
k . . . . . . .
. . . p . p . .
. . . . . . . .
. . . . N . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . K . . .
Attacking piece
Targeted / won piece

A defended target that exchange-math still wins

After ...Qe4+ the queen checks the king on h1 and also attacks the knight on f4. The knight is defended, but adding the queen's attack tips the exchange in Black's favour (…Rxf4 wins it), so it counts as the second fork target. The c2 knight was already attacked before the move, so it is not a new target.

✓ detectedQueen · checktest_fork_counts_newly_underdefended_target_via_see_in_00qno
. k . r . r . .
p p . . . . p .
. . . . . . . .
. . Q p . . . .
. . . . q N P .
. . P . . . . p
P P N . . . . P
R . . . . R . K
Attacking piece
King
Targeted / won piece

Fork wins more than the rival pattern

A constructed position. Nc7+ check-forks the king on a8 and the queen on e8, and the same move also uncovers the rook on b1 attacking the bishop on b6. The fork wins a queen while the uncovered attack only wins a bishop, so the fork is the headline and the rival pattern is dropped.

✓ detectedKnight · check · wins the collisiontest_da_dropped_when_fork_wins_heavier_piece
k . . . q . . .
. . N . . . . .
. b . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. R . . . . . K
Attacking piece
King
Targeted / won piece

Check-fork that pays off through the king's reply

Lichess 004nd. Nxf6+ captures the pawn on f6 and forks the king on g8 and the rook on d7. Black has only two legal replies. Taking with Qxf6 loses the queen for the knight after Qxf6. The king's one flight, Kf7, sidesteps that but runs into Nxd7, so the knight escapes the fork having grabbed the rook — White wins the exchange either way. The board is shown just before Nxf6+, so the knight still stands on e4 and the pawn it takes is on f6.

✓ detectedKnight · check · in line♟ Lichess 004ndtest_check_fork_kept_when_forker_taken_by_higher_piece_wins_material_004nd
. . . q . . k .
. . . r . . . .
p p . . . p . Q
. . b . n . . .
P . . . N . . .
. . P . . . . .
. P . . . . P P
R . . . . . . K
Attacking piece
Targeted / won piece
King

Fork created by capturing one's own blocker

Lichess 00HEx. Rxd1+ takes the bishop that was blocking the rook's first rank. Removing it gives check to the king on g1 and at the same time opens a new attack down the d-file on the knight on d4 — a fork on king and knight. Shown just before the capture: the rook is still on c1 and the bishop it takes sits on d1.

✓ detectedRook · check · in line♟ Lichess 00HExtest_capture_of_blocker_on_own_ray_detects_fork_00HEx
R . . . . . . .
. . . . . p k .
R . . . p n . p
. . . . . . . .
. . . N P . . .
. . . . . P . .
. . . . . . P P
. . r B . . K .
Attacking piece
Targeted / won piece
King

Heavy-piece fork where the forker survives

Lichess 00Rvy. Qd5 forks the rook on a8 and the bishop on d3. There is no check, but the queen is not captured on the next move (the rook just runs with Rf8), so the geometry is real — the opponent saves one piece and White takes the other with Qxd3.

✓ detectedQueen · survivor♟ Lichess 00Rvytest_heavy_piece_queen_fork_survivor_motif_00Rvy
r . . . . . . k
. . . . . . b p
p . . . . . . .
. . . Q . . . .
. . . . . . . .
. . . b . P . .
. . . . . K P P
. . . . . . . .
Attacking piece
Targeted / won piece

Rook fork on a queen and a minor piece

Lichess 00zDb. Rc4 attacks the queen on d4 and the bishop on a4 along the fourth rank. The queen steps away (Qd3) and the rook collects the bishop with Rxa4 — a clean fork where the forking rook is never taken.

✓ detectedRook · survivor♟ Lichess 00zDbtest_heavy_piece_rook_fork_survivor_motif_00zDb
. . . . . . . .
. p k . q . . .
. n . . . p . .
. . . . . P p .
B . r Q P . . p
P . . . . P . .
K P . . . . P .
. . . R . . . .
Attacking piece
Targeted / won piece

Fork kept when a rival pattern is only a phantom

Lichess zv50i. ...Nxc2+ forks the king on e1, the rook on a1 and the pawn on e3, and seems to uncover the queen onto d1. But that uncovered attack wins nothing (d1 is well guarded), so it is discarded and the genuine knight fork stands.

✓ detectedKnight · check♟ 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
King
Targeted / won piece

Only one target — not a fork

A constructed position. Nc7+ checks the king on e8 but attacks no other enemy piece. A single threat is not a fork.

✗ not detectedSingle targettest_no_fork_when_single_target
. . . . k . . .
. . N . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . K .
Attacking piece
King

Both targets defended by the king

A constructed position. The knight on e5 attacks the pawns on d7 and f7, but both are defended by the king on e8 and neither capture gives check. The king simply recaptures, so there is nothing to win — no fork.

✗ not detectedBoth defendedtest_no_fork_on_king_defended_pawns
. . . . k . . .
. . . p . p . .
. . . . . . . .
. . . . N . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . K . . .
Attacking piece
Targeted / won piece
King

Rival pattern wins more — fork dropped

A constructed position. Nc7+ check-forks the king on a8 and the bishop on e8, and the same move uncovers the rook on b1 attacking the rook on b6. The fork's prize is only a bishop while the uncovered attack wins a rook, so the fork is suppressed in favour of the heavier pattern.

✗ not detectedLoses the collisiontest_fork_dropped_when_da_wins_heavier_piece
k . . . b . . .
. . N . . . . .
. r . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. R . . . . . K
Attacking piece
King
Targeted / won piece

Sham fork — forker is recaptured for nothing

Game OHhqWJDj. Rxg6+ lands on the sixth rank hitting the king on g8, the queen on f6 and the bishop on h6, but the rook is immediately taken by Qxg6 and the sequence wins no material. The point of the move is the destruction and a later pin, not the fork, so the fork is recorded only as supporting geometry, not as the headline.

✓ detectedSham · demoted to enablingtest_fork_demoted_when_higher_value_recaptures_forker_in_OHhqWJDj
r . . . . r k .
p . p n . . . .
. . . . . q R b
. . . . p . . p
. . . p P . . P
. . . Q . P . .
P P P N . B . .
. . K R . . . .
Attacking piece
King
Targeted / won piece

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

Lichess 0050w

Lichess 0050w (rating 1063). Solution: Rxg3+ Bxg3 Rg5+ Kf7 Rxg3.

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

✓ detectedrating 1063♟ Lichess 0050w
. . . . . r k .
. p . . p . . p
p . . p . . . .
. . p P . . . R
. . P . P . . .
. P . B K P b .
. . . . . . . .
. . . . . . . .

Lichess 00ISm

Lichess 00ISm (rating 907). Solution: Nxg5+ Kh6 Nxe6.

✓ detectedrating 907♟ Lichess 00ISm
. . . . . r . .
. . . . . p . k
. . p p q . p .
. . . . p . b .
. . . . N . . P
. . . P . . . .
. P . R . P . .
. . . . K . R .

Lichess 00Lyc

Lichess 00Lyc (rating 1975). Solution: Qb5+ Rd3 Qxe8.

✓ detectedrating 1975♟ Lichess 00Lyc
. . . . R . . .
. p . . . . k .
. q . . . b p p
. . . B . . . .
. . . . N p . P
p . . . . P . .
. . . R K . P .
. . . . . . . .

Lichess 00O8m

Lichess 00O8m (rating 1409). Solution: d5 Qe5 dxc6.

✓ detectedrating 1409♟ Lichess 00O8m
r . . . r . k .
p p p . . p p p
. . n n q . . .
. . . . . . . .
. . . P . . . .
P . P . P . P .
. . Q . . . B P
R . B . K R . .

Lichess 00UI2

Lichess 00UI2 (rating 2007). Solution: fxe4 fxe4 Nxe4 dxe4 Rd6+ Kf7 Rxa6.

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

✓ detectedrating 2007♟ Lichess 00UI2
. . r . . . n r
p . . . . . p p
b . . . k . . .
. . . . . . . .
. . . . p . . .
B P . . . . . .
P . P . . . P P
. . K R . . . R

Lichess 00KNK

Lichess 00KNK (rating 1977). Solution: Nf6+ Kf8 Nxh7+ Ke7 Bf6+ Qxf6 Qxf6+.

✓ detectedrating 1977♟ Lichess 00KNK
r . . . r . k .
p . p . . . . p
. . . b . . . .
. . . . . . q N
. . . . p . . .
. P . b . Q . .
P . . P . P P .
B . . . . . K R

Lichess 00HzX

Lichess 00HzX (rating 1693). Solution: Qc1+ Kh2 Qxh6.

✓ detectedrating 1693♟ Lichess 00HzX
. . . . r . k .
. . . . . p p .
. . . . . . . R
. p . . . . . .
. . . . . . . .
. P P . . . Q P
. . q . . P P .
. . . . . . K .

Lichess 003Tx

Lichess 003Tx (rating 1517). Solution: Nd2+ Ka1 Rc1#. Koga intentionally does not flag Fork here — the mating attack is the real tactic, so the fork is suppressed (back-rank mate).

✗ not detectedKnown boundary♟ Lichess 003Tx
. . r . . . . .
p R . . . . . p
. . . . . p . k
. . . . p . . .
. . . . R . . .
B . . . . n P P
P P . . . P . .
. K . . . . . .

Lichess 00Rcs

Lichess 00Rcs (rating 866). Solution: Ng3+ Kf4 Nxh1.

✓ detectedrating 866♟ Lichess 00Rcs
. . . k . . . .
p p p . . p . r
. . . . p . . P
. . . . . n . .
. . . P K . N .
. . P . . . . .
P . P . . . P .
. . . . . . . R

Lichess 00bns

Lichess 00bns (rating 959). Solution: Ne7+ Kf8 Nxg6+.

✓ detectedrating 959♟ Lichess 00bns
. . . . . . k .
. p p . . p p p
p . . . n . q .
. . . . P N . .
. . P . . Q . .
. P . r B P . P
r . . . . P . K
. . . . R . . .