FAILURE MAP
← Case archive

FA-82401 / Chess move legality / Open access

Promotion triggered one rank early · case 01

A white pawn arriving on the seventh rank is expanded into promotion moves, while the eighth rank is not.

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

ROOT CAUSE

The rank digit is compared to a zero-based last-rank index.

VERIFIED REPAIR

Convert the destination rank to zero-based before comparing.

Unsuccessful approach: Hard-coding rank index 7 never promotes black pawns.

Case contract

Input: {"board", "from": square of a pawn, "ep": en passant target square or null}. Return sorted pseudo-legal destinations: one step forward if empty; two steps from the starting rank if both squares are empty; diagonal captures of enemy pieces or onto the ep square. A destination on the last rank is expanded into four entries suffixed q, r, b, n.

Why this case matters

Move validators gate every move in engines, servers and arbiters; accepting an illegal move or rejecting a legal one corrupts the game record.

1 / The failure

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

N = 1
observations = []
def solve(x):
    b=x['board']; sq=x['from']; p=b[sq]; white=p=='P'
    f,r=ord(sq[0])-97,int(sq[1])-1
    d=1 if white else -1
    start=1 if white else 6
    last=7 if white else 0
    def at(ff,rr): return chr(97+ff)+str(rr+1)
    out=[]
    if 0<=r+d<8 and at(f,r+d) not in b:
        out.append(at(f,r+d))
        if r==start and at(f,r+2*d) not in b: out.append(at(f,r+2*d))
    for df in (-1,1):
        ff=f+df
        if not 0<=ff<8 or not 0<=r+d<8: continue
        t=at(ff,r+d); occ=b.get(t)
        if (occ and occ.isupper()!=white) or t==x.get('ep'): out.append(t)
    res=[]
    for t in out:
        if int(t[1])==last: res+=[t+c for c in 'qrbn']
        else: res.append(t)
    return sorted(res)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('white double push', {'board': {'e2': 'P'}, 'ep': None, 'from': 'e2'}, ['e3', 'e4']),
  ('black double push', {'board': {'d7': 'p'}, 'ep': None, 'from': 'd7'}, ['d5', 'd6']),
  ('blocked jump', {'board': {'e2': 'P', 'e3': 'n'}, 'ep': None, 'from': 'e2'}, []),
  ('far square blocked', {'board': {'c5': 'P', 'c7': 'p'}, 'ep': None, 'from': 'c7'}, ['c6']),
  ('captures both colours', {'board': {'c5': 'p', 'd4': 'P', 'e5': 'B'}, 'ep': None, 'from': 'd4'},
   ['c5', 'd5']),
  ('black captures',
   {'board': {'e5': 'P', 'f5': 'P', 'f6': 'p', 'g5': 'n'}, 'ep': None, 'from': 'f6'}, ['e5']),
  ('white promotion', {'board': {'a8': 'r', 'b7': 'P'}, 'ep': None, 'from': 'b7'},
   ['a8b', 'a8n', 'a8q', 'a8r', 'b8b', 'b8n', 'b8q', 'b8r']),
  ('black promotion', {'board': {'h2': 'p'}, 'ep': None, 'from': 'h2'},
   ['h1b', 'h1n', 'h1q', 'h1r'])],
 [('far square blocked', {'board': {'c5': 'P', 'c7': 'p'}, 'ep': None, 'from': 'c7'}, ['c6']),
  ('captures both colours', {'board': {'c5': 'p', 'd4': 'P', 'e5': 'B'}, 'ep': None, 'from': 'd4'},
   ['c5', 'd5']),
  ('black captures',
   {'board': {'e5': 'P', 'f5': 'P', 'f6': 'p', 'g5': 'n'}, 'ep': None, 'from': 'f6'}, ['e5']),
  ('white promotion', {'board': {'a8': 'r', 'b7': 'P'}, 'ep': None, 'from': 'b7'},
   ['a8b', 'a8n', 'a8q', 'a8r', 'b8b', 'b8n', 'b8q', 'b8r']),
  ('black promotion', {'board': {'h2': 'p'}, 'ep': None, 'from': 'h2'},
   ['h1b', 'h1n', 'h1q', 'h1r']),
  ('en passant target', {'board': {'d5': 'p', 'e5': 'P'}, 'ep': 'd6', 'from': 'e5'}, ['d6', 'e6']),
  ('black on sixth rank', {'board': {'a6': 'p'}, 'ep': None, 'from': 'a6'}, ['a5']),
  ('white third rank', {'board': {'g3': 'P'}, 'ep': None, 'from': 'g3'}, ['g4'])],
 [('white double push', {'board': {'e2': 'P'}, 'ep': None, 'from': 'e2'}, ['e3', 'e4']),
  ('black double push', {'board': {'d7': 'p'}, 'ep': None, 'from': 'd7'}, ['d5', 'd6']),
  ('white promotion', {'board': {'a8': 'r', 'b7': 'P'}, 'ep': None, 'from': 'b7'},
   ['a8b', 'a8n', 'a8q', 'a8r', 'b8b', 'b8n', 'b8q', 'b8r']),
  ('black promotion', {'board': {'h2': 'p'}, 'ep': None, 'from': 'h2'},
   ['h1b', 'h1n', 'h1q', 'h1r']),
  ('en passant target', {'board': {'d5': 'p', 'e5': 'P'}, 'ep': 'd6', 'from': 'e5'}, ['d6', 'e6']),
  ('black on sixth rank', {'board': {'a6': 'p'}, 'ep': None, 'from': 'a6'}, ['a5']),
  ('white third rank', {'board': {'g3': 'P'}, 'ep': None, 'from': 'g3'}, ['g4']),
  ('black blocked by own', {'board': {'a6': 'P', 'b6': 'p', 'b7': 'p'}, 'ep': None, 'from': 'b7'},
   ['a6'])],
 [('white double push', {'board': {'e2': 'P'}, 'ep': None, 'from': 'e2'}, ['e3', 'e4']),
  ('black double push', {'board': {'d7': 'p'}, 'ep': None, 'from': 'd7'}, ['d5', 'd6']),
  ('blocked jump', {'board': {'e2': 'P', 'e3': 'n'}, 'ep': None, 'from': 'e2'}, []),
  ('far square blocked', {'board': {'c5': 'P', 'c7': 'p'}, 'ep': None, 'from': 'c7'}, ['c6']),
  ('captures both colours', {'board': {'c5': 'p', 'd4': 'P', 'e5': 'B'}, 'ep': None, 'from': 'd4'},
   ['c5', 'd5']),
  ('white promotion', {'board': {'a8': 'r', 'b7': 'P'}, 'ep': None, 'from': 'b7'},
   ['a8b', 'a8n', 'a8q', 'a8r', 'b8b', 'b8n', 'b8q', 'b8r']),
  ('black promotion', {'board': {'h2': 'p'}, 'ep': None, 'from': 'h2'},
   ['h1b', 'h1n', 'h1q', 'h1r']),
  ('black blocked by own', {'board': {'a6': 'P', 'b6': 'p', 'b7': 'p'}, 'ep': None, 'from': 'b7'},
   ['a6'])],
 [('white double push', {'board': {'e2': 'P'}, 'ep': None, 'from': 'e2'}, ['e3', 'e4']),
  ('black double push', {'board': {'d7': 'p'}, 'ep': None, 'from': 'd7'}, ['d5', 'd6']),
  ('blocked jump', {'board': {'e2': 'P', 'e3': 'n'}, 'ep': None, 'from': 'e2'}, []),
  ('far square blocked', {'board': {'c5': 'P', 'c7': 'p'}, 'ep': None, 'from': 'c7'}, ['c6']),
  ('captures both colours', {'board': {'c5': 'p', 'd4': 'P', 'e5': 'B'}, 'ep': None, 'from': 'd4'},
   ['c5', 'd5']),
  ('black captures',
   {'board': {'e5': 'P', 'f5': 'P', 'f6': 'p', 'g5': 'n'}, 'ep': None, 'from': 'f6'}, ['e5']),
  ('white promotion', {'board': {'a8': 'r', 'b7': 'P'}, 'ep': None, 'from': 'b7'},
   ['a8b', 'a8n', 'a8q', 'a8r', 'b8b', 'b8n', 'b8q', 'b8r']),
  ('black promotion', {'board': {'h2': 'p'}, 'ep': None, 'from': 'h2'},
   ['h1b', 'h1n', 'h1q', 'h1r'])]]
for label, args, expected in fixtures[N-1]:
    try:
        actual = solve(args)
    except Exception as exc:
        actual = 'error:' + type(exc).__name__
    check(label, actual, expected)
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
white double push['e3', 'e4']['e3', 'e4']Passed
black double push['d5', 'd6']['d5', 'd6']Passed
blocked jump[][]Passed
far square blocked['c6']['c6']Passed
captures both colours['c5', 'd5']['c5', 'd5']Passed
black captures['e5']['e5']Passed
white promotion['a8', 'b8']['a8b', 'a8n', 'a8q', 'a8r', 'b8b', 'b8n', 'b8q', 'b8r']Failed
black promotion['h1']['h1b', 'h1n', 'h1q', 'h1r']Failed

SHA-256 / 34bc0fd42977c2773f91c403e9e3632c1b05c73982358caaf74b008a6b42c4ae

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(x):
    b=x['board']; sq=x['from']; p=b[sq]; white=p=='P'
    f,r=ord(sq[0])-97,int(sq[1])-1
    d=1 if white else -1
    start=1 if white else 6
    last=7 if white else 0
    def at(ff,rr): return chr(97+ff)+str(rr+1)
    out=[]
    if 0<=r+d<8 and at(f,r+d) not in b:
        out.append(at(f,r+d))
        if r==start and at(f,r+2*d) not in b: out.append(at(f,r+2*d))
    for df in (-1,1):
        ff=f+df
        if not 0<=ff<8 or not 0<=r+d<8: continue
        t=at(ff,r+d); occ=b.get(t)
        if (occ and occ.isupper()!=white) or t==x.get('ep'): out.append(t)
    res=[]
    for t in out:
        if int(t[1])-1==7: res+=[t+c for c in 'qrbn']
        else: res.append(t)
    return sorted(res)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('white double push', {'board': {'e2': 'P'}, 'ep': None, 'from': 'e2'}, ['e3', 'e4']),
  ('black double push', {'board': {'d7': 'p'}, 'ep': None, 'from': 'd7'}, ['d5', 'd6']),
  ('blocked jump', {'board': {'e2': 'P', 'e3': 'n'}, 'ep': None, 'from': 'e2'}, []),
  ('far square blocked', {'board': {'c5': 'P', 'c7': 'p'}, 'ep': None, 'from': 'c7'}, ['c6']),
  ('captures both colours', {'board': {'c5': 'p', 'd4': 'P', 'e5': 'B'}, 'ep': None, 'from': 'd4'},
   ['c5', 'd5']),
  ('black captures',
   {'board': {'e5': 'P', 'f5': 'P', 'f6': 'p', 'g5': 'n'}, 'ep': None, 'from': 'f6'}, ['e5']),
  ('white promotion', {'board': {'a8': 'r', 'b7': 'P'}, 'ep': None, 'from': 'b7'},
   ['a8b', 'a8n', 'a8q', 'a8r', 'b8b', 'b8n', 'b8q', 'b8r']),
  ('black promotion', {'board': {'h2': 'p'}, 'ep': None, 'from': 'h2'},
   ['h1b', 'h1n', 'h1q', 'h1r'])],
 [('far square blocked', {'board': {'c5': 'P', 'c7': 'p'}, 'ep': None, 'from': 'c7'}, ['c6']),
  ('captures both colours', {'board': {'c5': 'p', 'd4': 'P', 'e5': 'B'}, 'ep': None, 'from': 'd4'},
   ['c5', 'd5']),
  ('black captures',
   {'board': {'e5': 'P', 'f5': 'P', 'f6': 'p', 'g5': 'n'}, 'ep': None, 'from': 'f6'}, ['e5']),
  ('white promotion', {'board': {'a8': 'r', 'b7': 'P'}, 'ep': None, 'from': 'b7'},
   ['a8b', 'a8n', 'a8q', 'a8r', 'b8b', 'b8n', 'b8q', 'b8r']),
  ('black promotion', {'board': {'h2': 'p'}, 'ep': None, 'from': 'h2'},
   ['h1b', 'h1n', 'h1q', 'h1r']),
  ('en passant target', {'board': {'d5': 'p', 'e5': 'P'}, 'ep': 'd6', 'from': 'e5'}, ['d6', 'e6']),
  ('black on sixth rank', {'board': {'a6': 'p'}, 'ep': None, 'from': 'a6'}, ['a5']),
  ('white third rank', {'board': {'g3': 'P'}, 'ep': None, 'from': 'g3'}, ['g4'])],
 [('white double push', {'board': {'e2': 'P'}, 'ep': None, 'from': 'e2'}, ['e3', 'e4']),
  ('black double push', {'board': {'d7': 'p'}, 'ep': None, 'from': 'd7'}, ['d5', 'd6']),
  ('white promotion', {'board': {'a8': 'r', 'b7': 'P'}, 'ep': None, 'from': 'b7'},
   ['a8b', 'a8n', 'a8q', 'a8r', 'b8b', 'b8n', 'b8q', 'b8r']),
  ('black promotion', {'board': {'h2': 'p'}, 'ep': None, 'from': 'h2'},
   ['h1b', 'h1n', 'h1q', 'h1r']),
  ('en passant target', {'board': {'d5': 'p', 'e5': 'P'}, 'ep': 'd6', 'from': 'e5'}, ['d6', 'e6']),
  ('black on sixth rank', {'board': {'a6': 'p'}, 'ep': None, 'from': 'a6'}, ['a5']),
  ('white third rank', {'board': {'g3': 'P'}, 'ep': None, 'from': 'g3'}, ['g4']),
  ('black blocked by own', {'board': {'a6': 'P', 'b6': 'p', 'b7': 'p'}, 'ep': None, 'from': 'b7'},
   ['a6'])],
 [('white double push', {'board': {'e2': 'P'}, 'ep': None, 'from': 'e2'}, ['e3', 'e4']),
  ('black double push', {'board': {'d7': 'p'}, 'ep': None, 'from': 'd7'}, ['d5', 'd6']),
  ('blocked jump', {'board': {'e2': 'P', 'e3': 'n'}, 'ep': None, 'from': 'e2'}, []),
  ('far square blocked', {'board': {'c5': 'P', 'c7': 'p'}, 'ep': None, 'from': 'c7'}, ['c6']),
  ('captures both colours', {'board': {'c5': 'p', 'd4': 'P', 'e5': 'B'}, 'ep': None, 'from': 'd4'},
   ['c5', 'd5']),
  ('white promotion', {'board': {'a8': 'r', 'b7': 'P'}, 'ep': None, 'from': 'b7'},
   ['a8b', 'a8n', 'a8q', 'a8r', 'b8b', 'b8n', 'b8q', 'b8r']),
  ('black promotion', {'board': {'h2': 'p'}, 'ep': None, 'from': 'h2'},
   ['h1b', 'h1n', 'h1q', 'h1r']),
  ('black blocked by own', {'board': {'a6': 'P', 'b6': 'p', 'b7': 'p'}, 'ep': None, 'from': 'b7'},
   ['a6'])],
 [('white double push', {'board': {'e2': 'P'}, 'ep': None, 'from': 'e2'}, ['e3', 'e4']),
  ('black double push', {'board': {'d7': 'p'}, 'ep': None, 'from': 'd7'}, ['d5', 'd6']),
  ('blocked jump', {'board': {'e2': 'P', 'e3': 'n'}, 'ep': None, 'from': 'e2'}, []),
  ('far square blocked', {'board': {'c5': 'P', 'c7': 'p'}, 'ep': None, 'from': 'c7'}, ['c6']),
  ('captures both colours', {'board': {'c5': 'p', 'd4': 'P', 'e5': 'B'}, 'ep': None, 'from': 'd4'},
   ['c5', 'd5']),
  ('black captures',
   {'board': {'e5': 'P', 'f5': 'P', 'f6': 'p', 'g5': 'n'}, 'ep': None, 'from': 'f6'}, ['e5']),
  ('white promotion', {'board': {'a8': 'r', 'b7': 'P'}, 'ep': None, 'from': 'b7'},
   ['a8b', 'a8n', 'a8q', 'a8r', 'b8b', 'b8n', 'b8q', 'b8r']),
  ('black promotion', {'board': {'h2': 'p'}, 'ep': None, 'from': 'h2'},
   ['h1b', 'h1n', 'h1q', 'h1r'])]]
for label, args, expected in fixtures[N-1]:
    try:
        actual = solve(args)
    except Exception as exc:
        actual = 'error:' + type(exc).__name__
    check(label, actual, expected)
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
white double push['e3', 'e4']['e3', 'e4']Passed
black double push['d5', 'd6']['d5', 'd6']Passed
blocked jump[][]Passed
far square blocked['c6']['c6']Passed
captures both colours['c5', 'd5']['c5', 'd5']Passed
black captures['e5']['e5']Passed
white promotion['a8b', 'a8n', 'a8q', 'a8r', 'b8b', 'b8n', 'b8q', 'b8r']['a8b', 'a8n', 'a8q', 'a8r', 'b8b', 'b8n', 'b8q', 'b8r']Passed
black promotion['h1']['h1b', 'h1n', 'h1q', 'h1r']Failed

SHA-256 / dd7f9a4637fa6023f949c9198fc43f029dc96faa5c765625131721918a2cc32d

3 / The verified repair

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

N = 1
observations = []
def solve(x):
    b=x['board']; sq=x['from']; p=b[sq]; white=p=='P'
    f,r=ord(sq[0])-97,int(sq[1])-1
    d=1 if white else -1
    start=1 if white else 6
    last=7 if white else 0
    def at(ff,rr): return chr(97+ff)+str(rr+1)
    out=[]
    if 0<=r+d<8 and at(f,r+d) not in b:
        out.append(at(f,r+d))
        if r==start and at(f,r+2*d) not in b: out.append(at(f,r+2*d))
    for df in (-1,1):
        ff=f+df
        if not 0<=ff<8 or not 0<=r+d<8: continue
        t=at(ff,r+d); occ=b.get(t)
        if (occ and occ.isupper()!=white) or t==x.get('ep'): out.append(t)
    res=[]
    for t in out:
        if int(t[1])-1==last: res+=[t+c for c in 'qrbn']
        else: res.append(t)
    return sorted(res)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('white double push', {'board': {'e2': 'P'}, 'ep': None, 'from': 'e2'}, ['e3', 'e4']),
  ('black double push', {'board': {'d7': 'p'}, 'ep': None, 'from': 'd7'}, ['d5', 'd6']),
  ('blocked jump', {'board': {'e2': 'P', 'e3': 'n'}, 'ep': None, 'from': 'e2'}, []),
  ('far square blocked', {'board': {'c5': 'P', 'c7': 'p'}, 'ep': None, 'from': 'c7'}, ['c6']),
  ('captures both colours', {'board': {'c5': 'p', 'd4': 'P', 'e5': 'B'}, 'ep': None, 'from': 'd4'},
   ['c5', 'd5']),
  ('black captures',
   {'board': {'e5': 'P', 'f5': 'P', 'f6': 'p', 'g5': 'n'}, 'ep': None, 'from': 'f6'}, ['e5']),
  ('white promotion', {'board': {'a8': 'r', 'b7': 'P'}, 'ep': None, 'from': 'b7'},
   ['a8b', 'a8n', 'a8q', 'a8r', 'b8b', 'b8n', 'b8q', 'b8r']),
  ('black promotion', {'board': {'h2': 'p'}, 'ep': None, 'from': 'h2'},
   ['h1b', 'h1n', 'h1q', 'h1r'])],
 [('far square blocked', {'board': {'c5': 'P', 'c7': 'p'}, 'ep': None, 'from': 'c7'}, ['c6']),
  ('captures both colours', {'board': {'c5': 'p', 'd4': 'P', 'e5': 'B'}, 'ep': None, 'from': 'd4'},
   ['c5', 'd5']),
  ('black captures',
   {'board': {'e5': 'P', 'f5': 'P', 'f6': 'p', 'g5': 'n'}, 'ep': None, 'from': 'f6'}, ['e5']),
  ('white promotion', {'board': {'a8': 'r', 'b7': 'P'}, 'ep': None, 'from': 'b7'},
   ['a8b', 'a8n', 'a8q', 'a8r', 'b8b', 'b8n', 'b8q', 'b8r']),
  ('black promotion', {'board': {'h2': 'p'}, 'ep': None, 'from': 'h2'},
   ['h1b', 'h1n', 'h1q', 'h1r']),
  ('en passant target', {'board': {'d5': 'p', 'e5': 'P'}, 'ep': 'd6', 'from': 'e5'}, ['d6', 'e6']),
  ('black on sixth rank', {'board': {'a6': 'p'}, 'ep': None, 'from': 'a6'}, ['a5']),
  ('white third rank', {'board': {'g3': 'P'}, 'ep': None, 'from': 'g3'}, ['g4'])],
 [('white double push', {'board': {'e2': 'P'}, 'ep': None, 'from': 'e2'}, ['e3', 'e4']),
  ('black double push', {'board': {'d7': 'p'}, 'ep': None, 'from': 'd7'}, ['d5', 'd6']),
  ('white promotion', {'board': {'a8': 'r', 'b7': 'P'}, 'ep': None, 'from': 'b7'},
   ['a8b', 'a8n', 'a8q', 'a8r', 'b8b', 'b8n', 'b8q', 'b8r']),
  ('black promotion', {'board': {'h2': 'p'}, 'ep': None, 'from': 'h2'},
   ['h1b', 'h1n', 'h1q', 'h1r']),
  ('en passant target', {'board': {'d5': 'p', 'e5': 'P'}, 'ep': 'd6', 'from': 'e5'}, ['d6', 'e6']),
  ('black on sixth rank', {'board': {'a6': 'p'}, 'ep': None, 'from': 'a6'}, ['a5']),
  ('white third rank', {'board': {'g3': 'P'}, 'ep': None, 'from': 'g3'}, ['g4']),
  ('black blocked by own', {'board': {'a6': 'P', 'b6': 'p', 'b7': 'p'}, 'ep': None, 'from': 'b7'},
   ['a6'])],
 [('white double push', {'board': {'e2': 'P'}, 'ep': None, 'from': 'e2'}, ['e3', 'e4']),
  ('black double push', {'board': {'d7': 'p'}, 'ep': None, 'from': 'd7'}, ['d5', 'd6']),
  ('blocked jump', {'board': {'e2': 'P', 'e3': 'n'}, 'ep': None, 'from': 'e2'}, []),
  ('far square blocked', {'board': {'c5': 'P', 'c7': 'p'}, 'ep': None, 'from': 'c7'}, ['c6']),
  ('captures both colours', {'board': {'c5': 'p', 'd4': 'P', 'e5': 'B'}, 'ep': None, 'from': 'd4'},
   ['c5', 'd5']),
  ('white promotion', {'board': {'a8': 'r', 'b7': 'P'}, 'ep': None, 'from': 'b7'},
   ['a8b', 'a8n', 'a8q', 'a8r', 'b8b', 'b8n', 'b8q', 'b8r']),
  ('black promotion', {'board': {'h2': 'p'}, 'ep': None, 'from': 'h2'},
   ['h1b', 'h1n', 'h1q', 'h1r']),
  ('black blocked by own', {'board': {'a6': 'P', 'b6': 'p', 'b7': 'p'}, 'ep': None, 'from': 'b7'},
   ['a6'])],
 [('white double push', {'board': {'e2': 'P'}, 'ep': None, 'from': 'e2'}, ['e3', 'e4']),
  ('black double push', {'board': {'d7': 'p'}, 'ep': None, 'from': 'd7'}, ['d5', 'd6']),
  ('blocked jump', {'board': {'e2': 'P', 'e3': 'n'}, 'ep': None, 'from': 'e2'}, []),
  ('far square blocked', {'board': {'c5': 'P', 'c7': 'p'}, 'ep': None, 'from': 'c7'}, ['c6']),
  ('captures both colours', {'board': {'c5': 'p', 'd4': 'P', 'e5': 'B'}, 'ep': None, 'from': 'd4'},
   ['c5', 'd5']),
  ('black captures',
   {'board': {'e5': 'P', 'f5': 'P', 'f6': 'p', 'g5': 'n'}, 'ep': None, 'from': 'f6'}, ['e5']),
  ('white promotion', {'board': {'a8': 'r', 'b7': 'P'}, 'ep': None, 'from': 'b7'},
   ['a8b', 'a8n', 'a8q', 'a8r', 'b8b', 'b8n', 'b8q', 'b8r']),
  ('black promotion', {'board': {'h2': 'p'}, 'ep': None, 'from': 'h2'},
   ['h1b', 'h1n', 'h1q', 'h1r'])]]
for label, args, expected in fixtures[N-1]:
    try:
        actual = solve(args)
    except Exception as exc:
        actual = 'error:' + type(exc).__name__
    check(label, actual, expected)
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
white double push['e3', 'e4']['e3', 'e4']Passed
black double push['d5', 'd6']['d5', 'd6']Passed
blocked jump[][]Passed
far square blocked['c6']['c6']Passed
captures both colours['c5', 'd5']['c5', 'd5']Passed
black captures['e5']['e5']Passed
white promotion['a8b', 'a8n', 'a8q', 'a8r', 'b8b', 'b8n', 'b8q', 'b8r']['a8b', 'a8n', 'a8q', 'a8r', 'b8b', 'b8n', 'b8q', 'b8r']Passed
black promotion['h1b', 'h1n', 'h1q', 'h1r']['h1b', 'h1n', 'h1q', 'h1r']Passed

SHA-256 / 265e58d6130dae31d9aec2fd7dd4dbb05360642039d6936ed062c49531d74366

Verification & scope

A deterministic toy model with an explicitly stated contract; boards are {square: piece} with white upper-case and black lower-case pieces; no claim of full FIDE Laws conformance. 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:50:11.849853+00:00.

Case digest / 5bd1e43efb3aaf17d08c0aa40d966bb40135a2f27999a9704fa2617267080364