How Koga decides

Definition A pawn reaches the last rank
  • A promotion is flagged whenever a pawn marches to the far rank and turns into a new piece — almost always a queen.
  • Koga looks at the move being played first, then walks the player's own moves further down the engine's main line, so a promotion that only happens several moves later in a forcing sequence is still caught.
Threat An unstoppable pawn one step away
  • Even when no pawn promotes within the line, Koga still flags the motif if a pawn has reached the 7th rank (the 2nd rank for Black) and the square in front of it is empty and not guarded by the opponent.
  • Such a pawn is one move from queening with nothing able to stop it, so the promotion is treated as already decisive.
Queen vs. minor Promotion, not underpromotion
  • Promoting to a queen is always a plain promotion.
  • A non-queen promotion (rook, bishop, or knight) played as the very move being judged is usually cosmetic: the position is so winning that any piece queens the point, and the engine just happened to emit a minor piece. Koga calls that a plain promotion too.
  • It is only the special tactical underpromotion when the minor piece is genuinely required — for example a queen would stalemate or walk into a forced mate, or (with an engine available) the minor piece scores clearly higher than a queen would.
  • A non-queen promotion appearing deeper in the forced line is taken as a deliberate underpromotion.

Test positions (the examples that guard against regressions)

Pawn queens on the last rank

In a constructed position the pawn on e7 advances to e8 and becomes a queen. A pawn reaching the far rank is the core of the motif.

✓ detectedPromotion · motiftest_detects_promotion
. . . . Q . k .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . K . . .
Piece that moves

Cosmetic rook promotion

A constructed position where the pawn on e7 promotes to a rook. With no stalemate or mate at stake, a queen would have done just as well, so this counts as a plain promotion rather than a tactical underpromotion.

✓ detectedPromotion · motiftest_cosmetic_rook_promotion_treated_as_promotion
. . . . R . . .
. . . . . . . k
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . K . . .
Piece that moves

Cosmetic knight promotion

A constructed position where the pawn on e7 promotes to a knight that gives no check. Since a queen would have been at least as good, this is treated as a plain promotion, not an underpromotion.

✓ detectedPromotion · motiftest_cosmetic_knight_promotion_no_check_treated_as_promotion
. . . . N . k .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . K . . .
Piece that moves

Engine confirms a cosmetic underpromotion

A constructed position where the engine scores the rook promotion only a shade above the queen promotion. Because the gap is too small to call the minor piece necessary, Koga records a plain promotion.

✓ detectedPromotion · motiftest_engine_rejects_cosmetic_best_move_underpromotion
. . . . R . . .
. . . . . . . k
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . K . . .
Piece that moves

Promotion that also delivers mate

The pawn on d2 captures to e1 and promotes to a queen, giving checkmate. The promotion is *how* the mate is delivered, so it is recorded as a co-headline alongside the mate rather than hidden behind it.

✓ detectedPromotion · matetest_mating_promotion_keeps_promotion_label_in_02nvq
. . k r r . . .
. p p . . . p .
p . . . . p . .
. . . . . P . .
. . . . . P . .
. . . . . . . P
P P Q . . . R .
. R . K q B . .
Piece that moves

Mating promotion where a queen mates too

Lichess n5QUx. Black plays …b1=R#, delivering mate — but …b1=Q# mates just as well. The rook is not required, so this is a plain promotion, not a tactical under-promotion (which is reserved for a minor piece the queen cannot replace).

✓ detectedPromotion · cosmetic mate♟ Lichess n5QUxtest_cosmetic_mating_rook_promotion_is_promotion_not_underpromotion
. . . . . . . .
. . . Q . p p .
P . . . p . k .
. . . p . . . p
. . . b . . . .
. . . . . . . .
. . . . . R P P
. r . . . . K .
Piece that moves

Cosmetic mating promotion deeper in the line

Lichess 0rESt. After 1…Qxc2+ 2.Ka2 the line ends with …b1=R# — but …b1=Q# mates just as well. The mating promotion sits a couple of moves into the forced line rather than being the move judged, yet the same cosmetic rule applies: a queen would mate too, so the rook is not required and Koga records a plain promotion.

✓ detectedPromotion · cosmetic mate (in line)♟ Lichess 0rESttest_cosmetic_mating_rook_promotion_deep_in_pv_is_promotion
. . r . k b . r
. . . . . p p p
p B . . . . . .
. . . Q . . P P
. . . . . P . .
P . . . . . . .
. p q . . . . .
. K . R . . . R
Piece that moves

Promotion deep in the main line

Lichess 004b0. The line opens with the bishop check Bg5, and only at its very end does the a-pawn queen on a1 (after the a1-bishop has been deflected and traded off). The board is shown right after Bg5, so the a2-pawn is still one of several moves from promoting. Koga finds the promotion only when it follows the full main line rather than the short capped one.

✓ detectedPromotion · in line♟ Lichess 004b0test_use_full_pv_recovers_late_promotion_in_004b0
. . . . . k . .
. . . . . B . .
. . . . P . . .
. . p . . P b .
. . b . . . . .
. . . . . . . .
p . . . . . . .
B . . . . . . K
Piece that moves

Clearance that opens the queening square

Lichess 00oYS. Black's rook leaves c1 (Rd1), clearing the path so the c2-pawn can queen on c1 on the next player move. The promotion is the payoff of the clearance. The board is shown after Rd1, so the c2-pawn still stands one step from promoting on the now-empty c1.

✓ detectedPromotion · motif♟ Lichess 00oYStest_clearance_counts_promotion_beneficiary_in_00oys
. . . . . . . .
. . . K P . k .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . p . R . . .
. . . r . . . .
Piece that moves

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

Lichess 01do1

Lichess 01do1 (rating 1102). Solution: Qxf8+ Kxf8 d8=Q+.

✓ detectedrating 1102♟ Lichess 01do1
. . . . . r k .
n . . P . . . p
. p . . p . p Q
p P . . . . . .
q . . . p . p .
. . . . . . . .
. . . . . P P P
. . . . . R K .

Lichess 01Qs6

Lichess 01Qs6 (rating 1878). Solution: c7 Rd1+ Kc6 h6 c8=Q+.

✓ detectedrating 1878♟ Lichess 01Qs6
. . . . . . k .
. N . . . p p p
p . P K . . . .
. . . . . . . .
. . . . . . . .
. . . . p . . P
. . . . . . . .
. r . . . . . .

Lichess 01GcH

Lichess 01GcH (rating 1814). Solution: Ra1+ Kb6 e1=Q Qc7+ Qe7 Qxe7+ Kxe7.

✓ detectedrating 1814♟ Lichess 01GcH
. Q . . . . . .
K . . . . k . .
. . . . . . . .
. . . . . p . .
. . . . . . . .
. . . . . . . .
. R . . p . . .
. . r . . . . .

Lichess 018Iz

Lichess 018Iz (rating 1314). Solution: h6 Kc6 h7 Kxd7 h8=Q.

✓ detectedrating 1314♟ Lichess 018Iz
. . . . . . . .
. . . P . . . .
. . . . . . . .
. . k . . p b P
. . . . . . . .
. . . . . K . .
. . . . . . . .
. . . . . . . .

Lichess 004LZ

Lichess 004LZ (rating 1187). Solution: c2+ Ka2 c1=Q Rd7+ Ke2.

✓ detectedrating 1187♟ Lichess 004LZ
. . . . . . . .
. . . . . . . R
. . . . . p . .
p . . . . . . .
. . . . . . . P
. . p . . . . .
. . . k . . N .
. K . . . . . .

Lichess 00zrq

Lichess 00zrq (rating 2071). Solution: g8=Q Rxg8 Rxg8 e2 Re1.

✓ detectedrating 2071♟ Lichess 00zrq
. . . . . . . R
. . . . . . P .
p . . . p . . P
. p . . k . . .
. . . . . . . .
. . P p p . . .
r . . . . . r .
. . . R . . . K

Lichess 00xxi

Lichess 00xxi (rating 1399). Solution: Kg7 Rd8 h8=Q Rxh8 Kxh8 Ke4 a4 Kd4 a5.

✓ detectedrating 1399♟ Lichess 00xxi
. . . . . r . .
. . . . . . . P
. . . . . K . .
. . . . . . . .
. . P . . k . .
P . . . . . . .
. . . . . . . .
. . . . . . . .

Lichess 00X2j

Lichess 00X2j (rating 1570). Solution: Rg6 Rxg6 Kxg6 d3 g8=Q.

✓ detectedrating 1570♟ Lichess 00X2j
. . . . . . . .
. . . . . K P .
R . . . . . . .
. . k . . . . .
. . p p . . . .
. . . . . . . .
. . . . . . . .
. . . . . . r .

Lichess 01z8k

Lichess 01z8k (rating 442). Solution: h3 a6 h2 Ka7 h1=Q.

✓ detectedrating 442♟ Lichess 01z8k
. . . . . . . .
. . . . . . . .
. K . . . . . .
P . . . . . . .
. . . . . . k p
. . . . . . . .
. . . . . . . .
. . . . . . . .

Lichess 02fzY

Lichess 02fzY (rating 1353). Solution: b2 Rb7 Rxh7+ Rxh7 b1=Q.

✓ detectedrating 1353♟ Lichess 02fzY
. . . . . . . r
. . . . . . R P
. . p . . . . .
. . . . . . . K
. . k . . . . .
. p . . . . . .
. . . . . P . .
. . . . . . . .

Lichess 02QgP

Lichess 02QgP (rating 1661). Solution: c7 Rd2+ Kc3 Rxd6 c8=Q.

✓ detectedrating 1661♟ Lichess 02QgP
. . . . . . . .
p . . . . . . .
. . P R p . . .
. . . . . k . p
. P . . . p . .
P . . K p P . .
. r . . . . . P
. . . . . . . .