{"abstract":"length counter advances for prompt positions.","category":"Beam search bookkeeping","checks":6,"contract":"Given prompt token count and generated token batches, return generated length after each step.","contract_signature":"prompt_length, batches","evaluation_group":"beam-generated_count","failed_approach":"Subtracting one from total sequence size only works for a one-token prompt.","family":"w3-beam-search-bookkeeping-length-count-generated","id":"FA-98531","implementations":{"attempt":{"sha256":"bb6855008090f5ec0053d8ec842b30dae1bef934647dca697531e1ae498837b4","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(prompt_length, batches):\n    return [prompt_length+sum(batches[:i+1])-1 for i in range(len(batches))]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('prompt excluded',solve(N,[1,1,1]),[1,2,3])\ncheck('multi-token append',solve(2*N,[2,1]),[2,3])\ncheck('no generated tokens',solve(N,[]),[])\ncheck('zero prefix',solve(0,[1]),[1])\ncheck('empty append step',solve(N,[0,1]),[0,1])\ncheck('varying batch sizes',solve(7,[N,2]),[N,N+2])\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":"c19a7f491f9baa313707d7d51468628ba1eec2172f8bb59397b526d823f2d27a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(prompt_length, batches):\n    return [prompt_length+sum(batches[:i+1]) for i in range(len(batches))]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('prompt excluded',solve(N,[1,1,1]),[1,2,3])\ncheck('multi-token append',solve(2*N,[2,1]),[2,3])\ncheck('no generated tokens',solve(N,[]),[])\ncheck('zero prefix',solve(0,[1]),[1])\ncheck('empty append step',solve(N,[0,1]),[0,1])\ncheck('varying batch sizes',solve(7,[N,2]),[N,N+2])\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":"This is a finite toy beam-state contract and makes no claim about neural model quality or production decoding. 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-beam-search-bookkeeping-length-count-generated","generated_at":"2026-09-30T16:48:14.106361+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Beam decoders rely on consistent hypothesis state while expanding and ranking candidates.","root_cause":"The bookkeeping count starts at the input prompt length rather than at zero generated tokens.","sha256":"794ff6b0d48330ee073d39476b50e13a8e04a7cc673b12b44774bd9de8f48864","title":"Beam search: length counter advances for prompt positions · 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":28.826,"exit_code":1,"observations":[{"actual":[1,2,3],"check":"prompt excluded","expected":[1,2,3],"passed":true},{"actual":[3,4],"check":"multi-token append","expected":[2,3],"passed":false},{"actual":[],"check":"no generated tokens","expected":[],"passed":true},{"actual":[0],"check":"zero prefix","expected":[1],"passed":false},{"actual":[0,1],"check":"empty append step","expected":[0,1],"passed":true},{"actual":[7,9],"check":"varying batch sizes","expected":[1,3],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"prompt excluded\", \"actual\": [1, 2, 3], \"expected\": [1, 2, 3], \"passed\": true}, {\"check\": \"multi-token append\", \"actual\": [3, 4], \"expected\": [2, 3], \"passed\": false}, {\"check\": \"no generated tokens\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"zero prefix\", \"actual\": [0], \"expected\": [1], \"passed\": false}, {\"check\": \"empty append step\", \"actual\": [0, 1], \"expected\": [0, 1], \"passed\": true}, {\"check\": \"varying batch sizes\", \"actual\": [7, 9], \"expected\": [1, 3], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":26.519,"exit_code":1,"observations":[{"actual":[2,3,4],"check":"prompt excluded","expected":[1,2,3],"passed":false},{"actual":[4,5],"check":"multi-token append","expected":[2,3],"passed":false},{"actual":[],"check":"no generated tokens","expected":[],"passed":true},{"actual":[1],"check":"zero prefix","expected":[1],"passed":true},{"actual":[1,2],"check":"empty append step","expected":[0,1],"passed":false},{"actual":[8,10],"check":"varying batch sizes","expected":[1,3],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"prompt excluded\", \"actual\": [2, 3, 4], \"expected\": [1, 2, 3], \"passed\": false}, {\"check\": \"multi-token append\", \"actual\": [4, 5], \"expected\": [2, 3], \"passed\": false}, {\"check\": \"no generated tokens\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"zero prefix\", \"actual\": [1], \"expected\": [1], \"passed\": true}, {\"check\": \"empty append step\", \"actual\": [1, 2], \"expected\": [0, 1], \"passed\": false}, {\"check\": \"varying batch sizes\", \"actual\": [8, 10], \"expected\": [1, 3], \"passed\": false}], \"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."}}