{"abstract":"Replacement is emitted before the committed prefix.","category":"Speculative decoding bookkeeping","checks":7,"contract":"Return accepted tokens followed by the replacement token.","contract_signature":"draft, accepted, replacement","evaluation_group":"spec-replacement-emission","failed_approach":"Appending to the full proposal leaves rejected tokens in output.","family":"w3-speculative-decoding-bookkeeping-replacement-emission","id":"FA-100721","implementations":{"attempt":{"sha256":"5c1c8a8e7ab4c43f5e57ae6421c6d15853e87189937503b8201bceb73511808d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(draft, accepted, replacement):\n    return draft+[replacement]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('partial output', solve([1,2,3],1,9),[1,9])\ncheck('first reject', solve([1,2],0,8),[8])\ncheck('last reject', solve([1,2],1,7),[1,7])\ncheck('empty proposal', solve([],0,4),[4])\ncheck('full accepted prefix', solve([N],1,3),[N,3])\ncheck('order kept', solve([5,2,8],2,1),[5,2,1])\ncheck('replacement duplicate', solve([6],0,6),[6])\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":"5d5324c3a8b7368d5b9e5bfcf5b52ef342133639c8b4b611736fe1c4614d55f7","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(draft, accepted, replacement):\n    return [replacement]+draft[:accepted]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('partial output', solve([1,2,3],1,9),[1,9])\ncheck('first reject', solve([1,2],0,8),[8])\ncheck('last reject', solve([1,2],1,7),[1,7])\ncheck('empty proposal', solve([],0,4),[4])\ncheck('full accepted prefix', solve([N],1,3),[N,3])\ncheck('order kept', solve([5,2,8],2,1),[5,2,1])\ncheck('replacement duplicate', solve([6],0,6),[6])\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":"These are finite toy sequences with explicit contracts; they make no claim about production decoder behavior or model quality. 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-speculative-decoding-bookkeeping-replacement-emission","generated_at":"2026-09-30T16:48:39.060956+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A self-contained bookkeeping model makes prefix and token-count semantics observable without a model runtime.","root_cause":"Replacement is emitted before committed tokens.","sha256":"1840f5169bb3ce92635650001f86daae02153186f1095134c2ab954e26da8b06","title":"Decoding: Replacement is emitted before the committed prefix · 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":32.516,"exit_code":1,"observations":[{"actual":[1,2,3,9],"check":"partial output","expected":[1,9],"passed":false},{"actual":[1,2,8],"check":"first reject","expected":[8],"passed":false},{"actual":[1,2,7],"check":"last reject","expected":[1,7],"passed":false},{"actual":[4],"check":"empty proposal","expected":[4],"passed":true},{"actual":[1,3],"check":"full accepted prefix","expected":[1,3],"passed":true},{"actual":[5,2,8,1],"check":"order kept","expected":[5,2,1],"passed":false},{"actual":[6,6],"check":"replacement duplicate","expected":[6],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"partial output\", \"actual\": [1, 2, 3, 9], \"expected\": [1, 9], \"passed\": false}, {\"check\": \"first reject\", \"actual\": [1, 2, 8], \"expected\": [8], \"passed\": false}, {\"check\": \"last reject\", \"actual\": [1, 2, 7], \"expected\": [1, 7], \"passed\": false}, {\"check\": \"empty proposal\", \"actual\": [4], \"expected\": [4], \"passed\": true}, {\"check\": \"full accepted prefix\", \"actual\": [1, 3], \"expected\": [1, 3], \"passed\": true}, {\"check\": \"order kept\", \"actual\": [5, 2, 8, 1], \"expected\": [5, 2, 1], \"passed\": false}, {\"check\": \"replacement duplicate\", \"actual\": [6, 6], \"expected\": [6], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":31.25,"exit_code":1,"observations":[{"actual":[9,1],"check":"partial output","expected":[1,9],"passed":false},{"actual":[8],"check":"first reject","expected":[8],"passed":true},{"actual":[7,1],"check":"last reject","expected":[1,7],"passed":false},{"actual":[4],"check":"empty proposal","expected":[4],"passed":true},{"actual":[3,1],"check":"full accepted prefix","expected":[1,3],"passed":false},{"actual":[1,5,2],"check":"order kept","expected":[5,2,1],"passed":false},{"actual":[6],"check":"replacement duplicate","expected":[6],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"partial output\", \"actual\": [9, 1], \"expected\": [1, 9], \"passed\": false}, {\"check\": \"first reject\", \"actual\": [8], \"expected\": [8], \"passed\": true}, {\"check\": \"last reject\", \"actual\": [7, 1], \"expected\": [1, 7], \"passed\": false}, {\"check\": \"empty proposal\", \"actual\": [4], \"expected\": [4], \"passed\": true}, {\"check\": \"full accepted prefix\", \"actual\": [3, 1], \"expected\": [1, 3], \"passed\": false}, {\"check\": \"order kept\", \"actual\": [1, 5, 2], \"expected\": [5, 2, 1], \"passed\": false}, {\"check\": \"replacement duplicate\", \"actual\": [6], \"expected\": [6], \"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."}}