{"abstract":"candidate budget is shared before per-parent expansion.","category":"Beam search bookkeeping","checks":6,"contract":"Candidates are [parent,score,token]; return globally top width ordered by descending score then parent and token.","contract_signature":"candidates, width","evaluation_group":"beam-candidate_prune","failed_approach":"Selecting only one candidate per parent can discard multiple top children from the same parent.","family":"w3-beam-search-bookkeeping-per-parent-expansion","id":"FA-98456","implementations":{"attempt":{"sha256":"0b9aecc3228367a9a151f1b3dd11d274a94af0c362f7604e2cf3731d7364a8a2","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(candidates, width):\n    return sorted([x for p in sorted({r[0] for r in candidates}) for x in sorted([r for r in candidates if r[0]==p],key=lambda r:(-r[1],r[2]))[:1]],key=lambda x:(-x[1],x[0],x[2]))[:width]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nc=[[0,N+3,'a'],[0,N+2,'b'],[1,N+4,'c'],[1,0,'d']]\ncheck('same parent owns top slots',solve(c,2),[[1,N+4,'c'],[0,N+3,'a']])\ncheck('mixed parents',solve(c,3),[[1,N+4,'c'],[0,N+3,'a'],[0,N+2,'b']])\ncheck('empty',solve([],2),[])\ncheck('zero width',solve(c,0),[])\ncheck('tie stable order',solve([[1,N,'z'],[0,N,'a']],2),[[0,N,'a'],[1,N,'z']])\ncheck('one candidate',solve([[2,N,'x']],4),[[2,N,'x']])\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":"b1b186e07f5016d62cad1ed54b6d95a3a0afea889a1d9f14dc31ffc128d962db","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(candidates, width):\n    return sorted(candidates,key=lambda x:(x[0],-x[1],x[2]))[:width]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nc=[[0,N+3,'a'],[0,N+2,'b'],[1,N+4,'c'],[1,0,'d']]\ncheck('same parent owns top slots',solve(c,2),[[1,N+4,'c'],[0,N+3,'a']])\ncheck('mixed parents',solve(c,3),[[1,N+4,'c'],[0,N+3,'a'],[0,N+2,'b']])\ncheck('empty',solve([],2),[])\ncheck('zero width',solve(c,0),[])\ncheck('tie stable order',solve([[1,N,'z'],[0,N,'a']],2),[[0,N,'a'],[1,N,'z']])\ncheck('one candidate',solve([[2,N,'x']],4),[[2,N,'x']])\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-per-parent-expansion","generated_at":"2026-09-30T16:48:13.237305+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":"Only the globally best candidates should occupy the next beam, but each parent is locally capped first.","sha256":"7f4c7dbff737766d806fd7cd3f985500c9fef20645151753cd9ed1f1afbf07f0","title":"Beam search: candidate budget is shared before per-parent expansion · 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.855,"exit_code":1,"observations":[{"actual":[[1,5,"c"],[0,4,"a"]],"check":"same parent owns top slots","expected":[[1,5,"c"],[0,4,"a"]],"passed":true},{"actual":[[1,5,"c"],[0,4,"a"]],"check":"mixed parents","expected":[[1,5,"c"],[0,4,"a"],[0,3,"b"]],"passed":false},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":[],"check":"zero width","expected":[],"passed":true},{"actual":[[0,1,"a"],[1,1,"z"]],"check":"tie stable order","expected":[[0,1,"a"],[1,1,"z"]],"passed":true},{"actual":[[2,1,"x"]],"check":"one candidate","expected":[[2,1,"x"]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"same parent owns top slots\", \"actual\": [[1, 5, \"c\"], [0, 4, \"a\"]], \"expected\": [[1, 5, \"c\"], [0, 4, \"a\"]], \"passed\": true}, {\"check\": \"mixed parents\", \"actual\": [[1, 5, \"c\"], [0, 4, \"a\"]], \"expected\": [[1, 5, \"c\"], [0, 4, \"a\"], [0, 3, \"b\"]], \"passed\": false}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"zero width\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"tie stable order\", \"actual\": [[0, 1, \"a\"], [1, 1, \"z\"]], \"expected\": [[0, 1, \"a\"], [1, 1, \"z\"]], \"passed\": true}, {\"check\": \"one candidate\", \"actual\": [[2, 1, \"x\"]], \"expected\": [[2, 1, \"x\"]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":26.582,"exit_code":1,"observations":[{"actual":[[0,4,"a"],[0,3,"b"]],"check":"same parent owns top slots","expected":[[1,5,"c"],[0,4,"a"]],"passed":false},{"actual":[[0,4,"a"],[0,3,"b"],[1,5,"c"]],"check":"mixed parents","expected":[[1,5,"c"],[0,4,"a"],[0,3,"b"]],"passed":false},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":[],"check":"zero width","expected":[],"passed":true},{"actual":[[0,1,"a"],[1,1,"z"]],"check":"tie stable order","expected":[[0,1,"a"],[1,1,"z"]],"passed":true},{"actual":[[2,1,"x"]],"check":"one candidate","expected":[[2,1,"x"]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"same parent owns top slots\", \"actual\": [[0, 4, \"a\"], [0, 3, \"b\"]], \"expected\": [[1, 5, \"c\"], [0, 4, \"a\"]], \"passed\": false}, {\"check\": \"mixed parents\", \"actual\": [[0, 4, \"a\"], [0, 3, \"b\"], [1, 5, \"c\"]], \"expected\": [[1, 5, \"c\"], [0, 4, \"a\"], [0, 3, \"b\"]], \"passed\": false}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"zero width\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"tie stable order\", \"actual\": [[0, 1, \"a\"], [1, 1, \"z\"]], \"expected\": [[0, 1, \"a\"], [1, 1, \"z\"]], \"passed\": true}, {\"check\": \"one candidate\", \"actual\": [[2, 1, \"x\"]], \"expected\": [[2, 1, \"x\"]], \"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."}}