How Koga decides

Definition Take a piece whose only guards are pinned
  • The move captures an enemy piece (not the king).
  • That captured square is guarded — at least one enemy piece could recapture on it.
  • But every one of those guards is pinned, so none of them can legally recapture. The piece falls off for nothing.
  • This is more specific than a plain pin: the point is not just that a piece is frozen, but that its paralysis lets us win the piece it was supposed to protect.
When the pin counts Operative pins only
  • An absolute pin (the guard is pinned to its own king) always counts — recapturing would be illegal.
  • A relative pin (the guard shields a more valuable piece) counts only when recapturing would still lose more than it gains: the piece behind the guard must be worth at least as much as the piece we captured with. If recapturing and then taking our capturer would come out ahead for the defender, the guard is not truly tied down and we do not fire.
  • The pinning piece must already be on the board before our move. If our own move is what lands the pinner into place, the guard was free to recapture beforehand, so this is not a pinned-defender win.
  • We judge the pins on the position right after the capture — which also means a file or diagonal that opens only once our piece vacates it can supply the pin.
Versus discovered attack Bigger gain wins the headline
  • When the same move is both a pinned-defender capture and a discovered attack, Koga keeps whichever describes the larger material gain.
  • If the captured piece is worth more than (or as much as) the piece the discovery hits, the pinned-defender label stays and the discovered attack is dropped; if the discovery wins more, it is the other way round.
Roles The four pieces involved
  • Victim — the guarded piece we capture and keep.
  • Pinned defender — the guard that should have recaptured but is frozen.
  • Pinner — our long-range piece that holds the defender in place.
  • Behind — the king (absolute pin) or more valuable piece (relative pin) the defender is pinned to.

Test positions (the examples that guard against regressions)

Capturing a knight guarded only by a pinned pawn

From a real game. The knight on c6 is guarded only by the d5 pawn. Right now the d-file is blocked by Black's own queen on d6, but after Qxc6 that queen is gone and the d7 rook pins the d5 pawn to the d4 queen. The pawn cannot recapture, so the knight is simply won.

✓ detectedRelative pintest_e2e_motivating_case_returns_pinned_defender_motif
. . . . . . . .
. . . r . k . p
. . N q p . p .
. . . P . . . .
. P . Q . P . .
. . . . . . . .
. P . . . . P K
. . . . . . . .
Piece that moves
Targeted / won piece
Defender (removed or overloaded)
Pinner (our long-range piece)
Piece behind (king or valuable piece)

Pinned-defender absorbs the plain pin and capturing-defender labels

Same position as above. Because the pinned-defender story already explains the whole point — the d5 pawn is pinned AND it was the c6 knight's defender — Koga reports only Pinned Defender and suppresses the bare pin and the capturing-defender label that describe the same idea less completely.

✓ detectedSuppressiontest_e2e_pin_and_capturing_defender_suppressed_when_pinned_defender_fires
. . . . . . . .
. . . r . k . p
. . N q p . p .
. . . P . . . .
. P . Q . P . .
. . . . . . . .
. P . . . . P K
. . . . . . . .
Piece that moves
Targeted / won piece
Defender (removed or overloaded)
Pinner (our long-range piece)
Piece behind (king or valuable piece)

Knight guarded only by an absolutely pinned knight

A constructed position. The bishop captures the d5 knight, whose sole guard is the c7 knight. But the c7 knight is pinned by the c8 rook to its own king on c1, so it cannot recapture — the d5 knight is won outright.

✓ detectedAbsolute pintest_absolute_pin_single_defender_fires
. . R . . . . .
. . n . . . . .
. . . . . . . .
. . . n . . . .
. . . . . . . .
. . . . . . . .
B . . . . . . .
. . k . . . . K
Piece that moves
Targeted / won piece
Defender (removed or overloaded)
Pinner (our long-range piece)
Piece behind (king or valuable piece)

Rook takes a knight that a pinned knight cannot recapture

Lichess 00bQA. Rxe7+ grabs the e7 knight. Its only guard is the g6 knight, but that knight is absolutely pinned by the g5 rook to the king on g7, so Nxe7 is illegal. The e7 knight is won.

✓ detectedAbsolute pin♟ Lichess 00bQAtest_absolute_pin_restricts_knight_recapture_in_00bqa
r . . . . . . .
. . . . n . k .
. . b . R . n .
. p . . . . R .
. P . p . . . p
. . . P . P p P
. . N . . . P .
. . . . . . K .
Piece that moves
Targeted / won piece
Defender (removed or overloaded)
Pinner (our long-range piece)
Piece behind (king or valuable piece)

Guard exists but is not pinned

A constructed position. The pawn captures the d5 knight, which the c7 knight guards. Nothing pins the c7 knight, so it would simply recapture. With a free guard available this is not a pinned-defender win.

✗ not detectedNo pintest_negative_no_pin_exists
. . . . . . . .
. . n . . . . .
. . . . . . . .
. . . P . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . k . . . . K
Defender (removed or overloaded)

One of two guards is free

A constructed position. The pawn takes the d5 knight, which has two guards: the c7 knight and the e6 pawn. The c7 knight is pinned by the c8 rook, but the e6 pawn is not — it can recapture freely. Because not every guard is frozen, Koga does not fire.

✗ not detectedGuard left freetest_negative_mixed_defenders_one_unpinned
. . R . . . . .
. . n . . . . .
. . . . p . . .
. . . P . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . k . . . . K
Defender (removed or overloaded)
Pinner (our long-range piece)

Taking the pinned piece, not the piece it guards

A constructed position. The bishop captures the e5 knight, which is itself pinned by the e1 rook to the e7 queen. We took the pinned piece directly rather than something it was guarding, so this is an ordinary attack on a pinned piece — not a pinned-defender win.

✗ not detectedNot the defendertest_negative_capture_of_pinned_piece_itself
. . . . k . . .
. . . . q . . .
. . . . . . . .
. . . . B . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . R . K .
Piece that moves
Pinner (our long-range piece)
Piece behind (king or valuable piece)

The move itself creates the pin

Lichess 0TDKH. Bxh6 captures on h6, and only afterwards does the bishop now on h6 line up against the g7 bishop and f8 rook. Since the pin did not exist before the move, the guard was free to recapture, so this is not a pinned-defender win.

✗ not detectedPinner created by the move♟ Lichess 0TDKHtest_negative_pinner_created_by_best_move
r . . q . r . k
p b . . n . b .
. . . . . . . B
. p . . p B . Q
. . p . . . . .
. . P . . . . P
P P . . . . P .
R . . . . R K .
Pinner (our long-range piece)
Pinned piece (frozen)
Piece behind (king or valuable piece)

Relative pin that does not really hold

A constructed position. The queen takes the d5 knight, guarded by the e6 pawn. The pawn is in a relative pin (the e1 rook eyes the e8 rook behind it), but recapturing only exposes a rook, worth less than the queen we captured with — the defender would happily make that trade. The pin is not operative, so Koga does not fire.

✗ not detectedPin not operativetest_negative_relative_pin_recapture_still_profitable
. . . . r . k .
. . . . . . . .
. . . . p . . .
. . . Q . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . R . . K
Defender (removed or overloaded)
Pinner (our long-range piece)
Piece behind (king or valuable piece)