FA-82391 / Chess move legality / Open access
Black pawns cannot make their initial double step · case 01
A black pawn on d7 is offered only d6.
ROOT CAUSE
The starting rank is the white starting rank for both colours.
THE FAILURE
The starting rank is the white starting rank for both colours.
Unsuccessful approach: Index 5 lets black pawns double-step from the sixth rank instead.
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
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']),
('black promotion', {'board': {'h2': 'p'}, 'ep': None, 'from': 'h2'},
['h1b', 'h1n', 'h1q', 'h1r']),
('black on sixth rank', {'board': {'a6': 'p'}, 'ep': None, 'from': 'a6'}, ['a5'])],
[('black double push', {'board': {'d7': 'p'}, 'ep': None, 'from': 'd7'}, ['d5', 'd6']),
('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']),
('blocked jump', {'board': {'e2': 'P', 'e3': 'n'}, 'ep': None, 'from': 'e2'}, []),
('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']),
('black captures',
{'board': {'e5': 'P', 'f5': 'P', 'f6': 'p', 'g5': 'n'}, 'ep': None, 'from': 'f6'}, ['e5']),
('black promotion', {'board': {'h2': 'p'}, 'ep': None, 'from': 'h2'},
['h1b', 'h1n', 'h1q', 'h1r']),
('black on sixth rank', {'board': {'a6': 'p'}, 'ep': None, 'from': 'a6'}, ['a5'])],
[('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']),
('black promotion', {'board': {'h2': 'p'}, 'ep': None, 'from': 'h2'},
['h1b', 'h1n', 'h1q', 'h1r']),
('black on sixth rank', {'board': {'a6': 'p'}, 'ep': None, 'from': 'a6'}, ['a5'])]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| white double push | ['e3', 'e4'] | ['e3', 'e4'] | Passed |
| black double push | ['d6'] | ['d5', 'd6'] | Failed |
| blocked jump | [] | [] | Passed |
| far square blocked | ['c6'] | ['c6'] | Passed |
| captures both colours | ['c5', 'd5'] | ['c5', 'd5'] | Passed |
| black captures | ['e5'] | ['e5'] | Passed |
| black promotion | ['h0', 'h1b', 'h1n', 'h1q', 'h1r'] | ['h1b', 'h1n', 'h1q', 'h1r'] | Failed |
| black on sixth rank | ['a5'] | ['a5'] | Passed |
SHA-256 / ec1bed5884e5670495dc2dea5f16a2b09343a1be32a22548eb10a8235fcf8586
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 5
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']),
('black promotion', {'board': {'h2': 'p'}, 'ep': None, 'from': 'h2'},
['h1b', 'h1n', 'h1q', 'h1r']),
('black on sixth rank', {'board': {'a6': 'p'}, 'ep': None, 'from': 'a6'}, ['a5'])],
[('black double push', {'board': {'d7': 'p'}, 'ep': None, 'from': 'd7'}, ['d5', 'd6']),
('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']),
('blocked jump', {'board': {'e2': 'P', 'e3': 'n'}, 'ep': None, 'from': 'e2'}, []),
('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']),
('black captures',
{'board': {'e5': 'P', 'f5': 'P', 'f6': 'p', 'g5': 'n'}, 'ep': None, 'from': 'f6'}, ['e5']),
('black promotion', {'board': {'h2': 'p'}, 'ep': None, 'from': 'h2'},
['h1b', 'h1n', 'h1q', 'h1r']),
('black on sixth rank', {'board': {'a6': 'p'}, 'ep': None, 'from': 'a6'}, ['a5'])],
[('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']),
('black promotion', {'board': {'h2': 'p'}, 'ep': None, 'from': 'h2'},
['h1b', 'h1n', 'h1q', 'h1r']),
('black on sixth rank', {'board': {'a6': 'p'}, 'ep': None, 'from': 'a6'}, ['a5'])]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| white double push | ['e3', 'e4'] | ['e3', 'e4'] | Passed |
| black double push | ['d6'] | ['d5', 'd6'] | Failed |
| blocked jump | [] | [] | Passed |
| far square blocked | ['c6'] | ['c6'] | Passed |
| captures both colours | ['c5', 'd5'] | ['c5', 'd5'] | Passed |
| black captures | ['e5'] | ['e5'] | Passed |
| black promotion | ['h1b', 'h1n', 'h1q', 'h1r'] | ['h1b', 'h1n', 'h1q', 'h1r'] | Passed |
| black on sixth rank | ['a4', 'a5'] | ['a5'] | Failed |
SHA-256 / c8f37e8bb857af51ca71fc934aecebdc5cc7f02e228c0d3ed32987eeb160afe8
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 8 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
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.627142+00:00.
Case digest / 739ea9d6179b24bf59b5e8463c01da5de6bbc9534df39ebc07fa484b35899bdf