How Koga decides

What it is The move that launches a forcing sequence
  • A preparatory move does not, by itself, create a named tactic — there is no fork, pin, or discovered attack the moment it is played.
  • Instead it is the first move of a completely forcing sequence whose tactical point arrives a few moves later: a discovered check, a pin, and so on lands deeper in the line.
  • Koga tags this lead move as the preparatory move and reports the later tactic as a follow-up. In practice the lead move is itself a check or a capture — it sets the forcing chain in motion.
All forcing Every move in the line must be forced
  • We look at the engine's main line from the move played. For each of our moves in that line, the move must be forcing: it gives check, it is a capture, or it is the only reply to a check.
  • If even one of our moves in the line is a quiet, non-forcing move, the chain is broken and we do NOT call the lead move preparatory — even when a real tactic still appears later in the line.
Only as a fallback When there is no tactic on the move itself
  • Preparatory move is a fallback. We only reach for it when the move played creates no tactic of its own — no fork, pin, discovered attack, and so on right now.
  • If the move already is a real tactic, that tactic is reported and the preparatory label is not added.
  • We also require that a genuine tactic does appear later in the forcing line (tagged as a follow-up). The preparatory move is the quiet-looking lead-in to that payoff.

Test positions (the examples that guard against regressions)

Forcing rook check that sets up a discovered check

Lichess 00AdI. Black plays Rd3+, a check that wins no material on its own. The whole line — Rd3+ g3 Rxg3+ Kh2 Rc3+ — is forcing, and the real point, a discovered check, only arrives at the end. The lead rook move is the preparatory move.

✓ detectedForcing · payoff is a discovered check♟ Lichess 00AdItest_all_forcing_gets_preparatory_move
. . . . . . . .
. . . . k p . p
. P Q . p . p .
p . . . b . . .
. p . . P . . P
. P . r . . . K
. . . . . . P .
. . . . . . . .
Piece that moves
Piece behind (king or valuable piece)

Forcing bishop check that sets up a discovered check

Lichess 01KFo. Black plays Bh2+. It is only a check; the gain comes later. The line Bh2+ Kh1 Ng3+ Kxh2 Nxe2 is entirely forcing and ends in a discovered check that wins the queen, so the bishop check is flagged as the preparatory move.

✓ detectedForcing · payoff is a discovered check♟ Lichess 01KFotest_all_forcing_discovered_check_01KFo
. . . . . r k .
p p q . . p p p
. . . . p . . .
. . . p . n P P
. . . P . . . .
. . P . B . . .
P P . . Q . P b
R . . . . R K .
Piece that moves
Piece behind (king or valuable piece)

Forcing queen check that sets up a pin

Lichess 00cy1. White plays Qb6+, a check with no immediate material win. The forcing line Qb6+ Kxc7 dxc7 ends with a pin as its point, so the queen check is the preparatory move that leads into it.

✓ detectedForcing · payoff is a pin♟ Lichess 00cy1test_all_forcing_pin_00cy1
. . r k n b . .
. . . q . p p .
p Q p P . . . r
. p . . P . . .
. . . . . P . p
. P . . . . P .
P B . . . . K .
. . . R . . . .
Piece that moves
Piece behind (king or valuable piece)

A quiet move breaks the forcing chain

Lichess 00kDo. The classified move Qb1+ is a check, and the line does contain a later pin — but Be2 further down the line is a quiet, non-forcing move. Because not every move in the line is forced, the chain is broken and the lead move is NOT called preparatory, even though the payoff tactic is present.

✗ not detectedNot all forcing — no preparatory move♟ Lichess 00kDotest_quiet_move_no_preparatory
. . . . . . . .
. . . . . p p k
P . . . . . . p
. . p . p . . .
. . B . . . . Q
. P . . P b P .
. . . . . P . P
. q . . . . K .
Piece that moves
Piece behind (king or valuable piece)

A real tactic is already on the move — no fallback

A constructed position. The move Nc7 forks the rook on a8 and the king on e8, so a genuine tactic exists on the move itself. Because the preparatory label is only a fallback for moves that create no tactic, it is not added here.

✗ not detectedFork on the move — preparatory move suppressedtest_existing_motif_no_preparatory
r . . . k . . .
. . N . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . K . . .
Piece that moves
Targeted / won piece
Piece behind (king or valuable piece)