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 A pawn one step away — only when the line proves it
  • When no pawn promotes within the short line, Koga still considers the motif if a pawn has just reached the 7th rank (the 2nd rank for Black), or a pawn already there has an empty, unguarded square in front of it.
  • Reaching the 7th rank alone is not enough. Koga follows the whole engine line and keeps the promotion only if a pawn one step from queening actually queens later in the line, or the opponent must give up material to take it (for example a rook for the pawn), or the line ends with that pawn free to queen safely on the next move.
  • A pawn the opponent simply wins for free proves nothing. It does not cancel another pawn that still queens, though — taking the first pawn can drag a rook away from the other pawn's queening square.
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. The board is shown right after 1…Qxc2+, so the b2-pawn still stands one step from promoting.

✓ 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

Pawn on the 2nd rank, taken for free

Lichess eOhly. Black's pawn captures on f2 and stands one step from queening, but the king simply takes it (Kxf2) and nothing was paid to stop it. Reaching the 2nd rank alone is not a promotion.

✗ not detectedNo promotion · pawn lost♟ Lichess eOhlytest_pawn_pushed_to_seventh_and_taken_for_free_is_not_a_promotion
. . . . . r k .
. . R . . p p .
Q . . . . . b p
P . . q . . . .
. . . . . . . .
. . . . . . . P
. . . . . p P .
. . . . R . K .
Targeted / won piece
Attacking piece

Pawn on the 7th with a free square, but taken

A constructed position. The a7-pawn's queening square is empty and unguarded, but the rook on b7 just takes the pawn (Rxa7). A pawn that is won for free is no promotion threat.

✗ not detectedNo promotion · pawn losttest_stationary_seventh_rank_pawn_taken_for_free_is_not_a_promotion
. . . . . . . k
P r . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . K .
. . . . . . . .
Targeted / won piece
Attacking piece

One pawn is taken, the other queens

A constructed position. White pushes b7; the rook takes it (Rxb7) and so leaves the 8th rank, and the g7-pawn is now free to queen on g8. Losing one pawn does not cancel the other pawn's promotion.

✓ detectedPromotion · threattest_other_pawn_still_promotes_after_the_pushed_pawn_is_taken
. r . . . . . .
. P . . . . P .
. . . . . . . k
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . K
Sacrificed piece
Defender (removed or overloaded)
Piece that moves

Pawn on the 2nd rank that costs a rook

Lichess oEEQD. Black's pawn reaches b2, and White gives up the rook to take it (Rxb2 Rxb2). The opponent paid material to stop the pawn, so the promotion threat counts.

✓ detectedPromotion · threat♟ Lichess oEEQDtest_pawn_on_seventh_that_costs_the_opponent_a_rook_is_a_promotion
. . . . . . k .
. . . . . . . .
. . . . . . . p
. . . . . . p .
. . . . . . N .
. . . . . . P P
. p r . p K . .
. R . . . . . .
Piece that moves
Defender (removed or overloaded)
Attacking piece

Pawn that queens a few moves later

Lichess 01Qs6. White plays c7; after Rd1+ Kc6 h6 the pawn queens on c8. The queening happens beyond the short line Koga reads first, so Koga checks the whole line to confirm the pawn really queens.

✓ detectedPromotion · threat♟ Lichess 01Qs6test_pushed_pawn_that_promotes_past_the_pv_cap_is_a_promotion
. . . . . . k .
. N P . . p p p
p . . K . . . .
. . . . . . . .
. . . . . . . .
. . . . p . . P
. . . . . . . .
. r . . . . . .
Piece that moves

A different pawn queens later in the line

Lichess IMrOF. After Rb8 the bishop wins the a7-pawn for free (Bxa7), but then c7 Rc6 c8=Q follows. The c-pawn reaches the 7th inside the line and queens, so the promotion stands.

✓ detectedPromotion · threat♟ Lichess IMrOFtest_pawn_pushed_to_seventh_later_in_the_line_keeps_the_card
. R . . . . . .
P . . . . p k .
r b P . . . p .
. . . . . . . .
. . . . . . . .
. . . . . P . .
. . P . K . . .
. . . . . . . .
Targeted / won piece
Piece that moves

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

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 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
. . . . . . . .