FAILURE MAP
← Case archive

FA-11676 / Game simulation rules / Open access

A pawn promotes before reaching its final rank · case 01

A pawn promotes before reaching its final rank.

Verified by executionVariant 1 · 7 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Promotion is based only on the requested piece.

THE FAILURE

Promotion is based only on the requested piece.

Unsuccessful approach: Checking either edge rank permits promotion on the pawn’s starting side.

Case contract

Piece is pawn/rook/knight; color white/black; rank 1..8; choice queen/rook/bishop/knight. Return choice only for pawn at white rank8 or black rank1; else preserve piece.

Why this case matters

A deterministic game-rule model isolates this rule interaction for regression testing.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(piece, color, rank, choice):
    return choice if piece=='pawn' else piece
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('middle rank',solve('pawn','white',N+1,'queen'),'pawn')
check('wrong edge white',solve('pawn','white',1,'queen'),'pawn')
check('wrong edge black',solve('pawn','black',8,'queen'),'pawn')
check('white promotion',solve('pawn','white',8,'knight'),'knight')
check('black promotion',solve('pawn','black',1,'rook'),'rook')
check('nonpawn edge',solve('rook','white',8,'queen'),'rook')
check('nonpawn middle',solve('knight','black',N+1,'bishop'),'knight')
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
middle rankqueenpawnFailed
wrong edge whitequeenpawnFailed
wrong edge blackqueenpawnFailed
white promotionknightknightPassed
black promotionrookrookPassed
nonpawn edgerookrookPassed
nonpawn middleknightknightPassed

SHA-256 / 8988958acf0babf0910f2b309641723550cad76441d3f90b3aa8a6277667786d

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(piece, color, rank, choice):
    return choice if piece=='pawn' and rank in (1,8) else piece
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('middle rank',solve('pawn','white',N+1,'queen'),'pawn')
check('wrong edge white',solve('pawn','white',1,'queen'),'pawn')
check('wrong edge black',solve('pawn','black',8,'queen'),'pawn')
check('white promotion',solve('pawn','white',8,'knight'),'knight')
check('black promotion',solve('pawn','black',1,'rook'),'rook')
check('nonpawn edge',solve('rook','white',8,'queen'),'rook')
check('nonpawn middle',solve('knight','black',N+1,'bishop'),'knight')
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
middle rankpawnpawnPassed
wrong edge whitequeenpawnFailed
wrong edge blackqueenpawnFailed
white promotionknightknightPassed
black promotionrookrookPassed
nonpawn edgerookrookPassed
nonpawn middleknightknightPassed

SHA-256 / 82a16a679b66516f48c3fcb769d643fb4e9bf4db34e94430261c6f9f7541bb5e

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 7 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

Controlled rules-only simulation; not a complete game engine. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:38:49.947789+00:00.

Case digest / 2acff46a198bd2a2edf057551e7ad9da75cf1c4d9a364038b360c412edd5c0e0