{"abstract":"One-hot targets omit classes absent from the current batch.","category":"Training label alignment","checks":7,"contract":"Given zero-based class indices and declared class_count, emit one-hot rows of exactly that width; invalid indices yield all-zero rows.","contract_signature":"indices, class_count","evaluation_group":"training-label-alignment-declared-one-hot-width","failed_approach":"Falling back to the observed maximum when an index is invalid still produces a non-contract width for invalid rows.","family":"w3-training-label-alignment-one-hot-declared-width","id":"FA-97951","implementations":{"attempt":{"sha256":"1f642e458178415694621aa3ddfd5d8327b268d62ea9a24ec730c46f87f617da","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(indices, class_count):\n    width=class_count if all(0<=i<class_count for i in indices) else max(indices,default=-1)+1\n    return [[int(j==i) for j in range(width)] for i in indices]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('absent trailing classes',solve([0,1],N+2),[[1]+[0]*(N+1),[0,1]+[0]*N])\ncheck('last class',solve([N-1],N),[[0]*(N-1)+[1]])\ncheck('empty batch keeps width implicit',solve([],N),[])\ncheck('invalid negative',solve([-1],N),[[0]*N])\ncheck('invalid too large',solve([N],N),[[0]*N])\ncheck('single class',solve([0],1),[[1]])\ncheck('mixed indices',solve([N-1,0],N),[[0]*(N-1)+[1],[1]+[0]*(N-1)])\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":"b44cccab3a8d83ebb5a2be2284d024bd009172ae81fd642c594f01115a56e586","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(indices, class_count):\n    return [[int(j==i) for j in range(max(indices,default=-1)+1)] for i in indices]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('absent trailing classes',solve([0,1],N+2),[[1]+[0]*(N+1),[0,1]+[0]*N])\ncheck('last class',solve([N-1],N),[[0]*(N-1)+[1]])\ncheck('empty batch keeps width implicit',solve([],N),[])\ncheck('invalid negative',solve([-1],N),[[0]*N])\ncheck('invalid too large',solve([N],N),[[0]*N])\ncheck('single class',solve([0],1),[[1]])\ncheck('mixed indices',solve([N-1,0],N),[[0]*(N-1)+[1],[1]+[0]*(N-1)])\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":"Indices are integers; malformed noninteger indices are outside the toy contract. 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-one-hot-declared-width","generated_at":"2026-09-30T16:48:07.548571+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":"Output width is inferred from observed labels rather than the declared class count.","sha256":"333369be5bd33ef79d5ae925a282c9feff9324239104de502dc944981c635987","title":"One-hot targets omit classes absent from the current batch · case 01","variant":1,"variant_policy":"The fixture code references N, supplied as 1 through 5. Fixed boundary checks may repeat. These records share one mechanism and must remain together in evaluation splits.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":27.179,"exit_code":1,"observations":[{"actual":[[1,0,0],[0,1,0]],"check":"absent trailing classes","expected":[[1,0,0],[0,1,0]],"passed":true},{"actual":[[1]],"check":"last class","expected":[[1]],"passed":true},{"actual":[],"check":"empty batch keeps width implicit","expected":[],"passed":true},{"actual":[[]],"check":"invalid negative","expected":[[0]],"passed":false},{"actual":[[0,1]],"check":"invalid too large","expected":[[0]],"passed":false},{"actual":[[1]],"check":"single class","expected":[[1]],"passed":true},{"actual":[[1],[1]],"check":"mixed indices","expected":[[1],[1]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"absent trailing classes\", \"actual\": [[1, 0, 0], [0, 1, 0]], \"expected\": [[1, 0, 0], [0, 1, 0]], \"passed\": true}, {\"check\": \"last class\", \"actual\": [[1]], \"expected\": [[1]], \"passed\": true}, {\"check\": \"empty batch keeps width implicit\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"invalid negative\", \"actual\": [[]], \"expected\": [[0]], \"passed\": false}, {\"check\": \"invalid too large\", \"actual\": [[0, 1]], \"expected\": [[0]], \"passed\": false}, {\"check\": \"single class\", \"actual\": [[1]], \"expected\": [[1]], \"passed\": true}, {\"check\": \"mixed indices\", \"actual\": [[1], [1]], \"expected\": [[1], [1]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":26.49,"exit_code":1,"observations":[{"actual":[[1,0],[0,1]],"check":"absent trailing classes","expected":[[1,0,0],[0,1,0]],"passed":false},{"actual":[[1]],"check":"last class","expected":[[1]],"passed":true},{"actual":[],"check":"empty batch keeps width implicit","expected":[],"passed":true},{"actual":[[]],"check":"invalid negative","expected":[[0]],"passed":false},{"actual":[[0,1]],"check":"invalid too large","expected":[[0]],"passed":false},{"actual":[[1]],"check":"single class","expected":[[1]],"passed":true},{"actual":[[1],[1]],"check":"mixed indices","expected":[[1],[1]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"absent trailing classes\", \"actual\": [[1, 0], [0, 1]], \"expected\": [[1, 0, 0], [0, 1, 0]], \"passed\": false}, {\"check\": \"last class\", \"actual\": [[1]], \"expected\": [[1]], \"passed\": true}, {\"check\": \"empty batch keeps width implicit\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"invalid negative\", \"actual\": [[]], \"expected\": [[0]], \"passed\": false}, {\"check\": \"invalid too large\", \"actual\": [[0, 1]], \"expected\": [[0]], \"passed\": false}, {\"check\": \"single class\", \"actual\": [[1]], \"expected\": [[1]], \"passed\": true}, {\"check\": \"mixed indices\", \"actual\": [[1], [1]], \"expected\": [[1], [1]], \"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."}}