{"abstract":"\"4k3\" places the king on b8 and every rank fails the eight-file check.","category":"Chess move legality","checks":8,"contract":"Input: a FEN string. Return {\"pieces\": {square: piece}, \"turn\", \"castling\", \"ep\", \"halfmove\", \"fullmove\"} or \"invalid\". Placement lists rank 8 first; digits skip empty squares; each rank must total 8; exactly one king per side. Turn is w or b; castling is \"-\" or letters from KQkq (returned as \"\" when \"-\"); ep is \"-\" (null) or a square on rank 6 when white is to move, rank 3 when black is; halfmove is a non-negative integer and fullmove at least 1.","evaluation_group":"w2-chess_move_legality-fen-position-parse","failed_approach":"Advancing by the digit minus one still miscounts every run.","family":"w2-chess_move_legality-fen-position-parse-empty-square-run","id":"FA-82546","implementations":{"attempt":{"sha256":"6eeb70a617f19f77d3086f201f0a481cd58753aee1735c75b377cd5aca526de5","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    parts=x.split()\n    if len(parts)!=6: return 'invalid'\n    rows=parts[0].split('/')\n    if len(rows)!=8: return 'invalid'\n    board={}\n    for i,row in enumerate(rows):\n        rank=8-i; f=0\n        for ch in row:\n            if ch.isdigit(): f+=int(ch)-1\n            elif ch in 'pnbrqkPNBRQK':\n                if f>7: return 'invalid'\n                board[chr(97+f)+str(rank)]=ch; f+=1\n            else: return 'invalid'\n        if f!=8: return 'invalid'\n    vals=list(board.values())\n    if vals.count('K')!=1 or vals.count('k')!=1: return 'invalid'\n    turn=parts[1]\n    if turn not in ('w','b'): return 'invalid'\n    cast='' if parts[2]=='-' else parts[2]\n    if any(c not in 'KQkq' for c in cast): return 'invalid'\n    ep=None if parts[3]=='-' else parts[3]\n    if ep is not None and ep[1:]!=('6' if turn=='w' else '3'): return 'invalid'\n    if not (parts[4].isdigit() and parts[5].isdigit()) or int(parts[5])<1: return 'invalid'\n    return {'pieces':board,'turn':turn,'castling':cast,'ep':ep,'halfmove':int(parts[4]),'fullmove':int(parts[5])}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('kings and rook', '4k3/8/8/8/8/8/8/R3K3 w Q - 0 1',\n   {'castling': 'Q',\n    'ep': None,\n    'fullmove': 1,\n    'halfmove': 0,\n    'pieces': {'a1': 'R', 'e1': 'K', 'e8': 'k'},\n    'turn': 'w'}),\n  ('black to move ep', '4k3/8/8/8/3Pp3/8/8/4K3 b - d3 0 12',\n   {'castling': '',\n    'ep': 'd3',\n    'fullmove': 12,\n    'halfmove': 0,\n    'pieces': {'d4': 'P', 'e1': 'K', 'e4': 'p', 'e8': 'k'},\n    'turn': 'b'}),\n  ('ep wrong side', '4k3/8/8/3pP3/8/8/8/4K3 w - d3 0 9', 'invalid'),\n  ('two white kings', '4k3/8/8/8/8/8/8/K3K3 w - - 0 1', 'invalid'),\n  ('two white kings no black', '8/8/8/8/8/8/8/K3K3 w - - 0 1', 'invalid'),\n  ('missing black king', '8/8/8/8/8/8/8/4K3 w - - 0 1', 'invalid'),\n  ('short rank', '4k3/8/8/8/8/8/8/4K2 w - - 0 1', 'invalid'),\n  ('fullmove zero', '4k3/8/8/8/8/8/8/4K3 w - - 0 0', 'invalid')],\n [('black to move ep', '4k3/8/8/8/3Pp3/8/8/4K3 b - d3 0 12',\n   {'castling': '',\n    'ep': 'd3',\n    'fullmove': 12,\n    'halfmove': 0,\n    'pieces': {'d4': 'P', 'e1': 'K', 'e4': 'p', 'e8': 'k'},\n    'turn': 'b'}),\n  ('white ep target', '4k3/8/8/3pP3/8/8/8/4K3 w - d6 0 9',\n   {'castling': '',\n    'ep': 'd6',\n    'fullmove': 9,\n    'halfmove': 0,\n    'pieces': {'d5': 'p', 'e1': 'K', 'e5': 'P', 'e8': 'k'},\n    'turn': 'w'}),\n  ('missing black king', '8/8/8/8/8/8/8/4K3 w - - 0 1', 'invalid'),\n  ('short rank', '4k3/8/8/8/8/8/8/4K2 w - - 0 1', 'invalid'),\n  ('fullmove zero', '4k3/8/8/8/8/8/8/4K3 w - - 0 0', 'invalid'),\n  ('halfmove dash', '4k3/8/8/8/8/8/8/4K3 w - - - 1', 'invalid'),\n  ('bad castling letter', '4k3/8/8/8/8/8/8/4K3 w X - 0 1', 'invalid'),\n  ('bad turn', '4k3/8/8/8/8/8/8/4K3 x - - 0 1', 'invalid')],\n [('kings and rook', '4k3/8/8/8/8/8/8/R3K3 w Q - 0 1',\n   {'castling': 'Q',\n    'ep': None,\n    'fullmove': 1,\n    'halfmove': 0,\n    'pieces': {'a1': 'R', 'e1': 'K', 'e8': 'k'},\n    'turn': 'w'}),\n  ('black to move ep', '4k3/8/8/8/3Pp3/8/8/4K3 b - d3 0 12',\n   {'castling': '',\n    'ep': 'd3',\n    'fullmove': 12,\n    'halfmove': 0,\n    'pieces': {'d4': 'P', 'e1': 'K', 'e4': 'p', 'e8': 'k'},\n    'turn': 'b'}),\n  ('white ep target', '4k3/8/8/3pP3/8/8/8/4K3 w - d6 0 9',\n   {'castling': '',\n    'ep': 'd6',\n    'fullmove': 9,\n    'halfmove': 0,\n    'pieces': {'d5': 'p', 'e1': 'K', 'e5': 'P', 'e8': 'k'},\n    'turn': 'w'}),\n  ('no castling dash', 'r3k2r/8/8/8/8/8/8/R3K2R b - - 3 20',\n   {'castling': '',\n    'ep': None,\n    'fullmove': 20,\n    'halfmove': 3,\n    'pieces': {'a1': 'R', 'a8': 'r', 'e1': 'K', 'e8': 'k', 'h1': 'R', 'h8': 'r'},\n    'turn': 'b'}),\n  ('halfmove dash', '4k3/8/8/8/8/8/8/4K3 w - - - 1', 'invalid'),\n  ('bad castling letter', '4k3/8/8/8/8/8/8/4K3 w X - 0 1', 'invalid'),\n  ('bad turn', '4k3/8/8/8/8/8/8/4K3 x - - 0 1', 'invalid'),\n  ('fullmove dash', '4k3/8/8/8/8/8/8/4K3 w - - 0 -', 'invalid')],\n [('kings and rook', '4k3/8/8/8/8/8/8/R3K3 w Q - 0 1',\n   {'castling': 'Q',\n    'ep': None,\n    'fullmove': 1,\n    'halfmove': 0,\n    'pieces': {'a1': 'R', 'e1': 'K', 'e8': 'k'},\n    'turn': 'w'}),\n  ('black to move ep', '4k3/8/8/8/3Pp3/8/8/4K3 b - d3 0 12',\n   {'castling': '',\n    'ep': 'd3',\n    'fullmove': 12,\n    'halfmove': 0,\n    'pieces': {'d4': 'P', 'e1': 'K', 'e4': 'p', 'e8': 'k'},\n    'turn': 'b'}),\n  ('white ep target', '4k3/8/8/3pP3/8/8/8/4K3 w - d6 0 9',\n   {'castling': '',\n    'ep': 'd6',\n    'fullmove': 9,\n    'halfmove': 0,\n    'pieces': {'d5': 'p', 'e1': 'K', 'e5': 'P', 'e8': 'k'},\n    'turn': 'w'}),\n  ('ep wrong side', '4k3/8/8/3pP3/8/8/8/4K3 w - d3 0 9', 'invalid'),\n  ('no castling dash', 'r3k2r/8/8/8/8/8/8/R3K2R b - - 3 20',\n   {'castling': '',\n    'ep': None,\n    'fullmove': 20,\n    'halfmove': 3,\n    'pieces': {'a1': 'R', 'a8': 'r', 'e1': 'K', 'e8': 'k', 'h1': 'R', 'h8': 'r'},\n    'turn': 'b'}),\n  ('black rights only', 'r3k2r/8/8/8/8/8/8/R3K2R w kq - 0 5',\n   {'castling': 'kq',\n    'ep': None,\n    'fullmove': 5,\n    'halfmove': 0,\n    'pieces': {'a1': 'R', 'a8': 'r', 'e1': 'K', 'e8': 'k', 'h1': 'R', 'h8': 'r'},\n    'turn': 'w'}),\n  ('pawns and knights', 'rn2k3/pp6/8/8/8/8/6PP/4K1NR w K - 7 30',\n   {'castling': 'K',\n    'ep': None,\n    'fullmove': 30,\n    'halfmove': 7,\n    'pieces': {'a7': 'p',\n               'a8': 'r',\n               'b7': 'p',\n               'b8': 'n',\n               'e1': 'K',\n               'e8': 'k',\n               'g1': 'N',\n               'g2': 'P',\n               'h1': 'R',\n               'h2': 'P'},\n    'turn': 'w'}),\n  ('fullmove dash', '4k3/8/8/8/8/8/8/4K3 w - - 0 -', 'invalid')],\n [('white ep target', '4k3/8/8/3pP3/8/8/8/4K3 w - d6 0 9',\n   {'castling': '',\n    'ep': 'd6',\n    'fullmove': 9,\n    'halfmove': 0,\n    'pieces': {'d5': 'p', 'e1': 'K', 'e5': 'P', 'e8': 'k'},\n    'turn': 'w'}),\n  ('ep wrong side', '4k3/8/8/3pP3/8/8/8/4K3 w - d3 0 9', 'invalid'),\n  ('no castling dash', 'r3k2r/8/8/8/8/8/8/R3K2R b - - 3 20',\n   {'castling': '',\n    'ep': None,\n    'fullmove': 20,\n    'halfmove': 3,\n    'pieces': {'a1': 'R', 'a8': 'r', 'e1': 'K', 'e8': 'k', 'h1': 'R', 'h8': 'r'},\n    'turn': 'b'}),\n  ('black rights only', 'r3k2r/8/8/8/8/8/8/R3K2R w kq - 0 5',\n   {'castling': 'kq',\n    'ep': None,\n    'fullmove': 5,\n    'halfmove': 0,\n    'pieces': {'a1': 'R', 'a8': 'r', 'e1': 'K', 'e8': 'k', 'h1': 'R', 'h8': 'r'},\n    'turn': 'w'}),\n  ('two white kings', '4k3/8/8/8/8/8/8/K3K3 w - - 0 1', 'invalid'),\n  ('two white kings no black', '8/8/8/8/8/8/8/K3K3 w - - 0 1', 'invalid'),\n  ('missing black king', '8/8/8/8/8/8/8/4K3 w - - 0 1', 'invalid'),\n  ('pawns and knights', 'rn2k3/pp6/8/8/8/8/6PP/4K1NR w K - 7 30',\n   {'castling': 'K',\n    'ep': None,\n    'fullmove': 30,\n    'halfmove': 7,\n    'pieces': {'a7': 'p',\n               'a8': 'r',\n               'b7': 'p',\n               'b8': 'n',\n               'e1': 'K',\n               'e8': 'k',\n               'g1': 'N',\n               'g2': 'P',\n               'h1': 'R',\n               'h2': 'P'},\n    'turn': 'w'})]]\nfor label, args, expected in fixtures[N-1]:\n    try:\n        actual = solve(args)\n    except Exception as exc:\n        actual = 'error:' + type(exc).__name__\n    check(label, actual, expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"a33e38238bc9ca7ec403ac958ae3e521efe7d4db5f69e8d4cfe988a61801f0de","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    parts=x.split()\n    if len(parts)!=6: return 'invalid'\n    rows=parts[0].split('/')\n    if len(rows)!=8: return 'invalid'\n    board={}\n    for i,row in enumerate(rows):\n        rank=8-i; f=0\n        for ch in row:\n            if ch.isdigit(): f+=1\n            elif ch in 'pnbrqkPNBRQK':\n                if f>7: return 'invalid'\n                board[chr(97+f)+str(rank)]=ch; f+=1\n            else: return 'invalid'\n        if f!=8: return 'invalid'\n    vals=list(board.values())\n    if vals.count('K')!=1 or vals.count('k')!=1: return 'invalid'\n    turn=parts[1]\n    if turn not in ('w','b'): return 'invalid'\n    cast='' if parts[2]=='-' else parts[2]\n    if any(c not in 'KQkq' for c in cast): return 'invalid'\n    ep=None if parts[3]=='-' else parts[3]\n    if ep is not None and ep[1:]!=('6' if turn=='w' else '3'): return 'invalid'\n    if not (parts[4].isdigit() and parts[5].isdigit()) or int(parts[5])<1: return 'invalid'\n    return {'pieces':board,'turn':turn,'castling':cast,'ep':ep,'halfmove':int(parts[4]),'fullmove':int(parts[5])}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('kings and rook', '4k3/8/8/8/8/8/8/R3K3 w Q - 0 1',\n   {'castling': 'Q',\n    'ep': None,\n    'fullmove': 1,\n    'halfmove': 0,\n    'pieces': {'a1': 'R', 'e1': 'K', 'e8': 'k'},\n    'turn': 'w'}),\n  ('black to move ep', '4k3/8/8/8/3Pp3/8/8/4K3 b - d3 0 12',\n   {'castling': '',\n    'ep': 'd3',\n    'fullmove': 12,\n    'halfmove': 0,\n    'pieces': {'d4': 'P', 'e1': 'K', 'e4': 'p', 'e8': 'k'},\n    'turn': 'b'}),\n  ('ep wrong side', '4k3/8/8/3pP3/8/8/8/4K3 w - d3 0 9', 'invalid'),\n  ('two white kings', '4k3/8/8/8/8/8/8/K3K3 w - - 0 1', 'invalid'),\n  ('two white kings no black', '8/8/8/8/8/8/8/K3K3 w - - 0 1', 'invalid'),\n  ('missing black king', '8/8/8/8/8/8/8/4K3 w - - 0 1', 'invalid'),\n  ('short rank', '4k3/8/8/8/8/8/8/4K2 w - - 0 1', 'invalid'),\n  ('fullmove zero', '4k3/8/8/8/8/8/8/4K3 w - - 0 0', 'invalid')],\n [('black to move ep', '4k3/8/8/8/3Pp3/8/8/4K3 b - d3 0 12',\n   {'castling': '',\n    'ep': 'd3',\n    'fullmove': 12,\n    'halfmove': 0,\n    'pieces': {'d4': 'P', 'e1': 'K', 'e4': 'p', 'e8': 'k'},\n    'turn': 'b'}),\n  ('white ep target', '4k3/8/8/3pP3/8/8/8/4K3 w - d6 0 9',\n   {'castling': '',\n    'ep': 'd6',\n    'fullmove': 9,\n    'halfmove': 0,\n    'pieces': {'d5': 'p', 'e1': 'K', 'e5': 'P', 'e8': 'k'},\n    'turn': 'w'}),\n  ('missing black king', '8/8/8/8/8/8/8/4K3 w - - 0 1', 'invalid'),\n  ('short rank', '4k3/8/8/8/8/8/8/4K2 w - - 0 1', 'invalid'),\n  ('fullmove zero', '4k3/8/8/8/8/8/8/4K3 w - - 0 0', 'invalid'),\n  ('halfmove dash', '4k3/8/8/8/8/8/8/4K3 w - - - 1', 'invalid'),\n  ('bad castling letter', '4k3/8/8/8/8/8/8/4K3 w X - 0 1', 'invalid'),\n  ('bad turn', '4k3/8/8/8/8/8/8/4K3 x - - 0 1', 'invalid')],\n [('kings and rook', '4k3/8/8/8/8/8/8/R3K3 w Q - 0 1',\n   {'castling': 'Q',\n    'ep': None,\n    'fullmove': 1,\n    'halfmove': 0,\n    'pieces': {'a1': 'R', 'e1': 'K', 'e8': 'k'},\n    'turn': 'w'}),\n  ('black to move ep', '4k3/8/8/8/3Pp3/8/8/4K3 b - d3 0 12',\n   {'castling': '',\n    'ep': 'd3',\n    'fullmove': 12,\n    'halfmove': 0,\n    'pieces': {'d4': 'P', 'e1': 'K', 'e4': 'p', 'e8': 'k'},\n    'turn': 'b'}),\n  ('white ep target', '4k3/8/8/3pP3/8/8/8/4K3 w - d6 0 9',\n   {'castling': '',\n    'ep': 'd6',\n    'fullmove': 9,\n    'halfmove': 0,\n    'pieces': {'d5': 'p', 'e1': 'K', 'e5': 'P', 'e8': 'k'},\n    'turn': 'w'}),\n  ('no castling dash', 'r3k2r/8/8/8/8/8/8/R3K2R b - - 3 20',\n   {'castling': '',\n    'ep': None,\n    'fullmove': 20,\n    'halfmove': 3,\n    'pieces': {'a1': 'R', 'a8': 'r', 'e1': 'K', 'e8': 'k', 'h1': 'R', 'h8': 'r'},\n    'turn': 'b'}),\n  ('halfmove dash', '4k3/8/8/8/8/8/8/4K3 w - - - 1', 'invalid'),\n  ('bad castling letter', '4k3/8/8/8/8/8/8/4K3 w X - 0 1', 'invalid'),\n  ('bad turn', '4k3/8/8/8/8/8/8/4K3 x - - 0 1', 'invalid'),\n  ('fullmove dash', '4k3/8/8/8/8/8/8/4K3 w - - 0 -', 'invalid')],\n [('kings and rook', '4k3/8/8/8/8/8/8/R3K3 w Q - 0 1',\n   {'castling': 'Q',\n    'ep': None,\n    'fullmove': 1,\n    'halfmove': 0,\n    'pieces': {'a1': 'R', 'e1': 'K', 'e8': 'k'},\n    'turn': 'w'}),\n  ('black to move ep', '4k3/8/8/8/3Pp3/8/8/4K3 b - d3 0 12',\n   {'castling': '',\n    'ep': 'd3',\n    'fullmove': 12,\n    'halfmove': 0,\n    'pieces': {'d4': 'P', 'e1': 'K', 'e4': 'p', 'e8': 'k'},\n    'turn': 'b'}),\n  ('white ep target', '4k3/8/8/3pP3/8/8/8/4K3 w - d6 0 9',\n   {'castling': '',\n    'ep': 'd6',\n    'fullmove': 9,\n    'halfmove': 0,\n    'pieces': {'d5': 'p', 'e1': 'K', 'e5': 'P', 'e8': 'k'},\n    'turn': 'w'}),\n  ('ep wrong side', '4k3/8/8/3pP3/8/8/8/4K3 w - d3 0 9', 'invalid'),\n  ('no castling dash', 'r3k2r/8/8/8/8/8/8/R3K2R b - - 3 20',\n   {'castling': '',\n    'ep': None,\n    'fullmove': 20,\n    'halfmove': 3,\n    'pieces': {'a1': 'R', 'a8': 'r', 'e1': 'K', 'e8': 'k', 'h1': 'R', 'h8': 'r'},\n    'turn': 'b'}),\n  ('black rights only', 'r3k2r/8/8/8/8/8/8/R3K2R w kq - 0 5',\n   {'castling': 'kq',\n    'ep': None,\n    'fullmove': 5,\n    'halfmove': 0,\n    'pieces': {'a1': 'R', 'a8': 'r', 'e1': 'K', 'e8': 'k', 'h1': 'R', 'h8': 'r'},\n    'turn': 'w'}),\n  ('pawns and knights', 'rn2k3/pp6/8/8/8/8/6PP/4K1NR w K - 7 30',\n   {'castling': 'K',\n    'ep': None,\n    'fullmove': 30,\n    'halfmove': 7,\n    'pieces': {'a7': 'p',\n               'a8': 'r',\n               'b7': 'p',\n               'b8': 'n',\n               'e1': 'K',\n               'e8': 'k',\n               'g1': 'N',\n               'g2': 'P',\n               'h1': 'R',\n               'h2': 'P'},\n    'turn': 'w'}),\n  ('fullmove dash', '4k3/8/8/8/8/8/8/4K3 w - - 0 -', 'invalid')],\n [('white ep target', '4k3/8/8/3pP3/8/8/8/4K3 w - d6 0 9',\n   {'castling': '',\n    'ep': 'd6',\n    'fullmove': 9,\n    'halfmove': 0,\n    'pieces': {'d5': 'p', 'e1': 'K', 'e5': 'P', 'e8': 'k'},\n    'turn': 'w'}),\n  ('ep wrong side', '4k3/8/8/3pP3/8/8/8/4K3 w - d3 0 9', 'invalid'),\n  ('no castling dash', 'r3k2r/8/8/8/8/8/8/R3K2R b - - 3 20',\n   {'castling': '',\n    'ep': None,\n    'fullmove': 20,\n    'halfmove': 3,\n    'pieces': {'a1': 'R', 'a8': 'r', 'e1': 'K', 'e8': 'k', 'h1': 'R', 'h8': 'r'},\n    'turn': 'b'}),\n  ('black rights only', 'r3k2r/8/8/8/8/8/8/R3K2R w kq - 0 5',\n   {'castling': 'kq',\n    'ep': None,\n    'fullmove': 5,\n    'halfmove': 0,\n    'pieces': {'a1': 'R', 'a8': 'r', 'e1': 'K', 'e8': 'k', 'h1': 'R', 'h8': 'r'},\n    'turn': 'w'}),\n  ('two white kings', '4k3/8/8/8/8/8/8/K3K3 w - - 0 1', 'invalid'),\n  ('two white kings no black', '8/8/8/8/8/8/8/K3K3 w - - 0 1', 'invalid'),\n  ('missing black king', '8/8/8/8/8/8/8/4K3 w - - 0 1', 'invalid'),\n  ('pawns and knights', 'rn2k3/pp6/8/8/8/8/6PP/4K1NR w K - 7 30',\n   {'castling': 'K',\n    'ep': None,\n    'fullmove': 30,\n    'halfmove': 7,\n    'pieces': {'a7': 'p',\n               'a8': 'r',\n               'b7': 'p',\n               'b8': 'n',\n               'e1': 'K',\n               'e8': 'k',\n               'g1': 'N',\n               'g2': 'P',\n               'h1': 'R',\n               'h2': 'P'},\n    'turn': 'w'})]]\nfor label, args, expected in fixtures[N-1]:\n    try:\n        actual = solve(args)\n    except Exception as exc:\n        actual = 'error:' + type(exc).__name__\n    check(label, actual, expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"78a9b73881ff913ba212bfe49a7ddcb1b37029d73ee5e3e116db00db9d313748","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    parts=x.split()\n    if len(parts)!=6: return 'invalid'\n    rows=parts[0].split('/')\n    if len(rows)!=8: return 'invalid'\n    board={}\n    for i,row in enumerate(rows):\n        rank=8-i; f=0\n        for ch in row:\n            if ch.isdigit(): f+=int(ch)\n            elif ch in 'pnbrqkPNBRQK':\n                if f>7: return 'invalid'\n                board[chr(97+f)+str(rank)]=ch; f+=1\n            else: return 'invalid'\n        if f!=8: return 'invalid'\n    vals=list(board.values())\n    if vals.count('K')!=1 or vals.count('k')!=1: return 'invalid'\n    turn=parts[1]\n    if turn not in ('w','b'): return 'invalid'\n    cast='' if parts[2]=='-' else parts[2]\n    if any(c not in 'KQkq' for c in cast): return 'invalid'\n    ep=None if parts[3]=='-' else parts[3]\n    if ep is not None and ep[1:]!=('6' if turn=='w' else '3'): return 'invalid'\n    if not (parts[4].isdigit() and parts[5].isdigit()) or int(parts[5])<1: return 'invalid'\n    return {'pieces':board,'turn':turn,'castling':cast,'ep':ep,'halfmove':int(parts[4]),'fullmove':int(parts[5])}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('kings and rook', '4k3/8/8/8/8/8/8/R3K3 w Q - 0 1',\n   {'castling': 'Q',\n    'ep': None,\n    'fullmove': 1,\n    'halfmove': 0,\n    'pieces': {'a1': 'R', 'e1': 'K', 'e8': 'k'},\n    'turn': 'w'}),\n  ('black to move ep', '4k3/8/8/8/3Pp3/8/8/4K3 b - d3 0 12',\n   {'castling': '',\n    'ep': 'd3',\n    'fullmove': 12,\n    'halfmove': 0,\n    'pieces': {'d4': 'P', 'e1': 'K', 'e4': 'p', 'e8': 'k'},\n    'turn': 'b'}),\n  ('ep wrong side', '4k3/8/8/3pP3/8/8/8/4K3 w - d3 0 9', 'invalid'),\n  ('two white kings', '4k3/8/8/8/8/8/8/K3K3 w - - 0 1', 'invalid'),\n  ('two white kings no black', '8/8/8/8/8/8/8/K3K3 w - - 0 1', 'invalid'),\n  ('missing black king', '8/8/8/8/8/8/8/4K3 w - - 0 1', 'invalid'),\n  ('short rank', '4k3/8/8/8/8/8/8/4K2 w - - 0 1', 'invalid'),\n  ('fullmove zero', '4k3/8/8/8/8/8/8/4K3 w - - 0 0', 'invalid')],\n [('black to move ep', '4k3/8/8/8/3Pp3/8/8/4K3 b - d3 0 12',\n   {'castling': '',\n    'ep': 'd3',\n    'fullmove': 12,\n    'halfmove': 0,\n    'pieces': {'d4': 'P', 'e1': 'K', 'e4': 'p', 'e8': 'k'},\n    'turn': 'b'}),\n  ('white ep target', '4k3/8/8/3pP3/8/8/8/4K3 w - d6 0 9',\n   {'castling': '',\n    'ep': 'd6',\n    'fullmove': 9,\n    'halfmove': 0,\n    'pieces': {'d5': 'p', 'e1': 'K', 'e5': 'P', 'e8': 'k'},\n    'turn': 'w'}),\n  ('missing black king', '8/8/8/8/8/8/8/4K3 w - - 0 1', 'invalid'),\n  ('short rank', '4k3/8/8/8/8/8/8/4K2 w - - 0 1', 'invalid'),\n  ('fullmove zero', '4k3/8/8/8/8/8/8/4K3 w - - 0 0', 'invalid'),\n  ('halfmove dash', '4k3/8/8/8/8/8/8/4K3 w - - - 1', 'invalid'),\n  ('bad castling letter', '4k3/8/8/8/8/8/8/4K3 w X - 0 1', 'invalid'),\n  ('bad turn', '4k3/8/8/8/8/8/8/4K3 x - - 0 1', 'invalid')],\n [('kings and rook', '4k3/8/8/8/8/8/8/R3K3 w Q - 0 1',\n   {'castling': 'Q',\n    'ep': None,\n    'fullmove': 1,\n    'halfmove': 0,\n    'pieces': {'a1': 'R', 'e1': 'K', 'e8': 'k'},\n    'turn': 'w'}),\n  ('black to move ep', '4k3/8/8/8/3Pp3/8/8/4K3 b - d3 0 12',\n   {'castling': '',\n    'ep': 'd3',\n    'fullmove': 12,\n    'halfmove': 0,\n    'pieces': {'d4': 'P', 'e1': 'K', 'e4': 'p', 'e8': 'k'},\n    'turn': 'b'}),\n  ('white ep target', '4k3/8/8/3pP3/8/8/8/4K3 w - d6 0 9',\n   {'castling': '',\n    'ep': 'd6',\n    'fullmove': 9,\n    'halfmove': 0,\n    'pieces': {'d5': 'p', 'e1': 'K', 'e5': 'P', 'e8': 'k'},\n    'turn': 'w'}),\n  ('no castling dash', 'r3k2r/8/8/8/8/8/8/R3K2R b - - 3 20',\n   {'castling': '',\n    'ep': None,\n    'fullmove': 20,\n    'halfmove': 3,\n    'pieces': {'a1': 'R', 'a8': 'r', 'e1': 'K', 'e8': 'k', 'h1': 'R', 'h8': 'r'},\n    'turn': 'b'}),\n  ('halfmove dash', '4k3/8/8/8/8/8/8/4K3 w - - - 1', 'invalid'),\n  ('bad castling letter', '4k3/8/8/8/8/8/8/4K3 w X - 0 1', 'invalid'),\n  ('bad turn', '4k3/8/8/8/8/8/8/4K3 x - - 0 1', 'invalid'),\n  ('fullmove dash', '4k3/8/8/8/8/8/8/4K3 w - - 0 -', 'invalid')],\n [('kings and rook', '4k3/8/8/8/8/8/8/R3K3 w Q - 0 1',\n   {'castling': 'Q',\n    'ep': None,\n    'fullmove': 1,\n    'halfmove': 0,\n    'pieces': {'a1': 'R', 'e1': 'K', 'e8': 'k'},\n    'turn': 'w'}),\n  ('black to move ep', '4k3/8/8/8/3Pp3/8/8/4K3 b - d3 0 12',\n   {'castling': '',\n    'ep': 'd3',\n    'fullmove': 12,\n    'halfmove': 0,\n    'pieces': {'d4': 'P', 'e1': 'K', 'e4': 'p', 'e8': 'k'},\n    'turn': 'b'}),\n  ('white ep target', '4k3/8/8/3pP3/8/8/8/4K3 w - d6 0 9',\n   {'castling': '',\n    'ep': 'd6',\n    'fullmove': 9,\n    'halfmove': 0,\n    'pieces': {'d5': 'p', 'e1': 'K', 'e5': 'P', 'e8': 'k'},\n    'turn': 'w'}),\n  ('ep wrong side', '4k3/8/8/3pP3/8/8/8/4K3 w - d3 0 9', 'invalid'),\n  ('no castling dash', 'r3k2r/8/8/8/8/8/8/R3K2R b - - 3 20',\n   {'castling': '',\n    'ep': None,\n    'fullmove': 20,\n    'halfmove': 3,\n    'pieces': {'a1': 'R', 'a8': 'r', 'e1': 'K', 'e8': 'k', 'h1': 'R', 'h8': 'r'},\n    'turn': 'b'}),\n  ('black rights only', 'r3k2r/8/8/8/8/8/8/R3K2R w kq - 0 5',\n   {'castling': 'kq',\n    'ep': None,\n    'fullmove': 5,\n    'halfmove': 0,\n    'pieces': {'a1': 'R', 'a8': 'r', 'e1': 'K', 'e8': 'k', 'h1': 'R', 'h8': 'r'},\n    'turn': 'w'}),\n  ('pawns and knights', 'rn2k3/pp6/8/8/8/8/6PP/4K1NR w K - 7 30',\n   {'castling': 'K',\n    'ep': None,\n    'fullmove': 30,\n    'halfmove': 7,\n    'pieces': {'a7': 'p',\n               'a8': 'r',\n               'b7': 'p',\n               'b8': 'n',\n               'e1': 'K',\n               'e8': 'k',\n               'g1': 'N',\n               'g2': 'P',\n               'h1': 'R',\n               'h2': 'P'},\n    'turn': 'w'}),\n  ('fullmove dash', '4k3/8/8/8/8/8/8/4K3 w - - 0 -', 'invalid')],\n [('white ep target', '4k3/8/8/3pP3/8/8/8/4K3 w - d6 0 9',\n   {'castling': '',\n    'ep': 'd6',\n    'fullmove': 9,\n    'halfmove': 0,\n    'pieces': {'d5': 'p', 'e1': 'K', 'e5': 'P', 'e8': 'k'},\n    'turn': 'w'}),\n  ('ep wrong side', '4k3/8/8/3pP3/8/8/8/4K3 w - d3 0 9', 'invalid'),\n  ('no castling dash', 'r3k2r/8/8/8/8/8/8/R3K2R b - - 3 20',\n   {'castling': '',\n    'ep': None,\n    'fullmove': 20,\n    'halfmove': 3,\n    'pieces': {'a1': 'R', 'a8': 'r', 'e1': 'K', 'e8': 'k', 'h1': 'R', 'h8': 'r'},\n    'turn': 'b'}),\n  ('black rights only', 'r3k2r/8/8/8/8/8/8/R3K2R w kq - 0 5',\n   {'castling': 'kq',\n    'ep': None,\n    'fullmove': 5,\n    'halfmove': 0,\n    'pieces': {'a1': 'R', 'a8': 'r', 'e1': 'K', 'e8': 'k', 'h1': 'R', 'h8': 'r'},\n    'turn': 'w'}),\n  ('two white kings', '4k3/8/8/8/8/8/8/K3K3 w - - 0 1', 'invalid'),\n  ('two white kings no black', '8/8/8/8/8/8/8/K3K3 w - - 0 1', 'invalid'),\n  ('missing black king', '8/8/8/8/8/8/8/4K3 w - - 0 1', 'invalid'),\n  ('pawns and knights', 'rn2k3/pp6/8/8/8/8/6PP/4K1NR w K - 7 30',\n   {'castling': 'K',\n    'ep': None,\n    'fullmove': 30,\n    'halfmove': 7,\n    'pieces': {'a7': 'p',\n               'a8': 'r',\n               'b7': 'p',\n               'b8': 'n',\n               'e1': 'K',\n               'e8': 'k',\n               'g1': 'N',\n               'g2': 'P',\n               'h1': 'R',\n               'h2': 'P'},\n    'turn': 'w'})]]\nfor label, args, expected in fixtures[N-1]:\n    try:\n        actual = solve(args)\n    except Exception as exc:\n        actual = 'error:' + type(exc).__name__\n    check(label, actual, expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-chess_move_legality-fen-position-parse-empty-square-run","generated_at":"2026-09-29T14:50:13.213491+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Every position-based legality check starts from a parsed FEN; a misparse silently changes which moves are legal.","repair":"Advance the file by the digit's value.","root_cause":"A digit advances the file pointer by one instead of by its value.","sha256":"bcb2c151ae01742034dd395177e1342650cbd921dd156e7f35c00d6e80e370a6","title":"Digit runs advance one file only · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":42.246,"exit_code":1,"observations":[{"actual":"invalid","check":"kings and rook","expected":{"castling":"Q","ep":null,"fullmove":1,"halfmove":0,"pieces":{"a1":"R","e1":"K","e8":"k"},"turn":"w"},"passed":false},{"actual":"invalid","check":"black to move ep","expected":{"castling":"","ep":"d3","fullmove":12,"halfmove":0,"pieces":{"d4":"P","e1":"K","e4":"p","e8":"k"},"turn":"b"},"passed":false},{"actual":"invalid","check":"ep wrong side","expected":"invalid","passed":true},{"actual":"invalid","check":"two white kings","expected":"invalid","passed":true},{"actual":"invalid","check":"two white kings no black","expected":"invalid","passed":true},{"actual":"invalid","check":"missing black king","expected":"invalid","passed":true},{"actual":"invalid","check":"short rank","expected":"invalid","passed":true},{"actual":"invalid","check":"fullmove zero","expected":"invalid","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"kings and rook\", \"actual\": \"invalid\", \"expected\": {\"castling\": \"Q\", \"ep\": null, \"fullmove\": 1, \"halfmove\": 0, \"pieces\": {\"a1\": \"R\", \"e1\": \"K\", \"e8\": \"k\"}, \"turn\": \"w\"}, \"passed\": false}, {\"check\": \"black to move ep\", \"actual\": \"invalid\", \"expected\": {\"castling\": \"\", \"ep\": \"d3\", \"fullmove\": 12, \"halfmove\": 0, \"pieces\": {\"d4\": \"P\", \"e1\": \"K\", \"e4\": \"p\", \"e8\": \"k\"}, \"turn\": \"b\"}, \"passed\": false}, {\"check\": \"ep wrong side\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"two white kings\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"two white kings no black\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"missing black king\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"short rank\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"fullmove zero\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.534,"exit_code":1,"observations":[{"actual":"invalid","check":"kings and rook","expected":{"castling":"Q","ep":null,"fullmove":1,"halfmove":0,"pieces":{"a1":"R","e1":"K","e8":"k"},"turn":"w"},"passed":false},{"actual":"invalid","check":"black to move ep","expected":{"castling":"","ep":"d3","fullmove":12,"halfmove":0,"pieces":{"d4":"P","e1":"K","e4":"p","e8":"k"},"turn":"b"},"passed":false},{"actual":"invalid","check":"ep wrong side","expected":"invalid","passed":true},{"actual":"invalid","check":"two white kings","expected":"invalid","passed":true},{"actual":"invalid","check":"two white kings no black","expected":"invalid","passed":true},{"actual":"invalid","check":"missing black king","expected":"invalid","passed":true},{"actual":"invalid","check":"short rank","expected":"invalid","passed":true},{"actual":"invalid","check":"fullmove zero","expected":"invalid","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"kings and rook\", \"actual\": \"invalid\", \"expected\": {\"castling\": \"Q\", \"ep\": null, \"fullmove\": 1, \"halfmove\": 0, \"pieces\": {\"a1\": \"R\", \"e1\": \"K\", \"e8\": \"k\"}, \"turn\": \"w\"}, \"passed\": false}, {\"check\": \"black to move ep\", \"actual\": \"invalid\", \"expected\": {\"castling\": \"\", \"ep\": \"d3\", \"fullmove\": 12, \"halfmove\": 0, \"pieces\": {\"d4\": \"P\", \"e1\": \"K\", \"e4\": \"p\", \"e8\": \"k\"}, \"turn\": \"b\"}, \"passed\": false}, {\"check\": \"ep wrong side\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"two white kings\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"two white kings no black\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"missing black king\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"short rank\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"fullmove zero\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.396,"exit_code":0,"observations":[{"actual":{"castling":"Q","ep":null,"fullmove":1,"halfmove":0,"pieces":{"a1":"R","e1":"K","e8":"k"},"turn":"w"},"check":"kings and rook","expected":{"castling":"Q","ep":null,"fullmove":1,"halfmove":0,"pieces":{"a1":"R","e1":"K","e8":"k"},"turn":"w"},"passed":true},{"actual":{"castling":"","ep":"d3","fullmove":12,"halfmove":0,"pieces":{"d4":"P","e1":"K","e4":"p","e8":"k"},"turn":"b"},"check":"black to move ep","expected":{"castling":"","ep":"d3","fullmove":12,"halfmove":0,"pieces":{"d4":"P","e1":"K","e4":"p","e8":"k"},"turn":"b"},"passed":true},{"actual":"invalid","check":"ep wrong side","expected":"invalid","passed":true},{"actual":"invalid","check":"two white kings","expected":"invalid","passed":true},{"actual":"invalid","check":"two white kings no black","expected":"invalid","passed":true},{"actual":"invalid","check":"missing black king","expected":"invalid","passed":true},{"actual":"invalid","check":"short rank","expected":"invalid","passed":true},{"actual":"invalid","check":"fullmove zero","expected":"invalid","passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"kings and rook\", \"actual\": {\"pieces\": {\"e8\": \"k\", \"a1\": \"R\", \"e1\": \"K\"}, \"turn\": \"w\", \"castling\": \"Q\", \"ep\": null, \"halfmove\": 0, \"fullmove\": 1}, \"expected\": {\"castling\": \"Q\", \"ep\": null, \"fullmove\": 1, \"halfmove\": 0, \"pieces\": {\"a1\": \"R\", \"e1\": \"K\", \"e8\": \"k\"}, \"turn\": \"w\"}, \"passed\": true}, {\"check\": \"black to move ep\", \"actual\": {\"pieces\": {\"e8\": \"k\", \"d4\": \"P\", \"e4\": \"p\", \"e1\": \"K\"}, \"turn\": \"b\", \"castling\": \"\", \"ep\": \"d3\", \"halfmove\": 0, \"fullmove\": 12}, \"expected\": {\"castling\": \"\", \"ep\": \"d3\", \"fullmove\": 12, \"halfmove\": 0, \"pieces\": {\"d4\": \"P\", \"e1\": \"K\", \"e4\": \"p\", \"e8\": \"k\"}, \"turn\": \"b\"}, \"passed\": true}, {\"check\": \"ep wrong side\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"two white kings\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"two white kings no black\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"missing black king\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"short rank\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"fullmove zero\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}