{"abstract":"Class IDs shift when the vocabulary is sorted differently.","category":"Training label alignment","checks":7,"contract":"Encode each label by its index in the given ordered vocabulary; unknown labels produce -1.","contract_signature":"labels, vocabulary","evaluation_group":"training-label-alignment-ordered-class-vocabulary","failed_approach":"Sorting the vocabulary before indexing still disagrees with its declared order.","family":"w3-training-label-alignment-class-index-vocabulary","id":"FA-97946","implementations":{"attempt":{"sha256":"be084bfc254061dc690a729df362c10a3daa3c8eba490b74a5059ecbb83f25a0","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(labels, vocabulary):\n    return [sorted(set(vocabulary)).index(x) if x in vocabulary else -1 for x in labels]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('declared order',solve(['cat','dog'],['dog','cat']),[1,0])\ncheck('unknown class',solve(['bird'],['cat','dog']),[-1])\ncheck('empty labels',solve([],['x']),[])\ncheck('singleton class',solve(['x'],['x']),[0])\ncheck('later class',solve(['c','a'],['b','c','a']),[1,2])\ncheck('unknown among known',solve(['a','q','b'],['b','a']),[1,-1,0])\ncheck('zero index remains zero',solve(['z'],['z','a']),[0])\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":"0b6249829bdabc1d9c3d29743daa8a2b825cf98daa6678988c48f6c282753006","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(labels, vocabulary):\n    return [i for i,_ in enumerate(labels)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('declared order',solve(['cat','dog'],['dog','cat']),[1,0])\ncheck('unknown class',solve(['bird'],['cat','dog']),[-1])\ncheck('empty labels',solve([],['x']),[])\ncheck('singleton class',solve(['x'],['x']),[0])\ncheck('later class',solve(['c','a'],['b','c','a']),[1,2])\ncheck('unknown among known',solve(['a','q','b'],['b','a']),[1,-1,0])\ncheck('zero index remains zero',solve(['z'],['z','a']),[0])\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":"The vocabulary is expected to contain unique hashable labels. 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":"w3-training-label-alignment-class-index-vocabulary","generated_at":"2026-09-30T16:48:07.548404+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A small deterministic training-data operation makes label ownership and ordering explicit.","root_cause":"The encoder derives class IDs from observed row order while the decoder uses a declared order.","sha256":"373f1ef3d5acc5107287f2a49852de096fb9fd48d3af0d6fc580ebfd83eaae36","title":"Class IDs shift when the vocabulary is sorted differently · case 01","variant":1,"variant_policy":"The same explicitly authored fixtures repeat across all five numbered records; runtime N is unused. These records share one mechanism and must remain together in evaluation splits.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":28.284,"exit_code":1,"observations":[{"actual":[0,1],"check":"declared order","expected":[1,0],"passed":false},{"actual":[-1],"check":"unknown class","expected":[-1],"passed":true},{"actual":[],"check":"empty labels","expected":[],"passed":true},{"actual":[0],"check":"singleton class","expected":[0],"passed":true},{"actual":[2,0],"check":"later class","expected":[1,2],"passed":false},{"actual":[0,-1,1],"check":"unknown among known","expected":[1,-1,0],"passed":false},{"actual":[1],"check":"zero index remains zero","expected":[0],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"declared order\", \"actual\": [0, 1], \"expected\": [1, 0], \"passed\": false}, {\"check\": \"unknown class\", \"actual\": [-1], \"expected\": [-1], \"passed\": true}, {\"check\": \"empty labels\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"singleton class\", \"actual\": [0], \"expected\": [0], \"passed\": true}, {\"check\": \"later class\", \"actual\": [2, 0], \"expected\": [1, 2], \"passed\": false}, {\"check\": \"unknown among known\", \"actual\": [0, -1, 1], \"expected\": [1, -1, 0], \"passed\": false}, {\"check\": \"zero index remains zero\", \"actual\": [1], \"expected\": [0], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":27.783,"exit_code":1,"observations":[{"actual":[0,1],"check":"declared order","expected":[1,0],"passed":false},{"actual":[0],"check":"unknown class","expected":[-1],"passed":false},{"actual":[],"check":"empty labels","expected":[],"passed":true},{"actual":[0],"check":"singleton class","expected":[0],"passed":true},{"actual":[0,1],"check":"later class","expected":[1,2],"passed":false},{"actual":[0,1,2],"check":"unknown among known","expected":[1,-1,0],"passed":false},{"actual":[0],"check":"zero index remains zero","expected":[0],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"declared order\", \"actual\": [0, 1], \"expected\": [1, 0], \"passed\": false}, {\"check\": \"unknown class\", \"actual\": [0], \"expected\": [-1], \"passed\": false}, {\"check\": \"empty labels\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"singleton class\", \"actual\": [0], \"expected\": [0], \"passed\": true}, {\"check\": \"later class\", \"actual\": [0, 1], \"expected\": [1, 2], \"passed\": false}, {\"check\": \"unknown among known\", \"actual\": [0, 1, 2], \"expected\": [1, -1, 0], \"passed\": false}, {\"check\": \"zero index remains zero\", \"actual\": [0], \"expected\": [0], \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}