{"abstract":"duplicate token paths occupy multiple beam slots.","category":"Beam search bookkeeping","checks":6,"contract":"Rows [token_tuple,score]; return one row per sequence with its highest score, ordered by score descending then sequence.","contract_signature":"rows","evaluation_group":"beam-path_merge","failed_approach":"Keeping the first occurrence ignores a later duplicate with a better score.","family":"w3-beam-search-bookkeeping-duplicate-path-merge","id":"FA-98511","implementations":{"attempt":{"sha256":"dc6cf3d5c41cb94b1cea36a30a89798c0fb1238c4f20dfba2b5c50fea2b60326","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows):\n    return sorted({r[0]:r for r in rows}.items(),key=lambda x:(-x[1][1],x[0])) and [max([r for r in rows if r[0]==seq],key=lambda r:r[1]) for seq in dict.fromkeys(r[0] for r in rows)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nrows=[[(\"a\",),-N],[(\"a\",),-1],[(\"b\",),-2]]\ncheck('best duplicate score',solve(rows),[[('a',),-1],[('b',),-2]])\ncheck('unique rows',solve([[('z',),N],[('a',),N+1]]),[[('a',),N+1],[('z',),N]])\ncheck('empty paths',solve([]),[])\ncheck('same empty sequence',solve([[(),0],[(),-1]]),[[(),0]])\ncheck('equal score sequence tie',solve([[('z',),N],[('a',),N]]),[[('a',),N],[('z',),N]])\ncheck('single path',solve([[('x',),N]]),[[('x',),N]])\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":"06ba0b554a55ab6b81ef2dd04966afc75f8121ea6f9e1904260c54f60e5bca5a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows):\n    return sorted(rows,key=lambda r:(-r[1],r[0]))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nrows=[[(\"a\",),-N],[(\"a\",),-1],[(\"b\",),-2]]\ncheck('best duplicate score',solve(rows),[[('a',),-1],[('b',),-2]])\ncheck('unique rows',solve([[('z',),N],[('a',),N+1]]),[[('a',),N+1],[('z',),N]])\ncheck('empty paths',solve([]),[])\ncheck('same empty sequence',solve([[(),0],[(),-1]]),[[(),0]])\ncheck('equal score sequence tie',solve([[('z',),N],[('a',),N]]),[[('a',),N],[('z',),N]])\ncheck('single path',solve([[('x',),N]]),[[('x',),N]])\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-duplicate-path-merge","generated_at":"2026-09-30T16:48:13.669357+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":"Equivalent token sequences reached through different parents are retained separately.","sha256":"b69572e1fe5f2abbfe279b67faabeb60d658d7215e2a2b0db50e406af401d410","title":"Beam search: duplicate token paths occupy multiple beam slots · 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.509,"exit_code":1,"observations":[{"actual":[[["a"],-1],[["b"],-2]],"check":"best duplicate score","expected":[[["a"],-1],[["b"],-2]],"passed":true},{"actual":[[["z"],1],[["a"],2]],"check":"unique rows","expected":[[["a"],2],[["z"],1]],"passed":false},{"actual":[],"check":"empty paths","expected":[],"passed":true},{"actual":[[[],0]],"check":"same empty sequence","expected":[[[],0]],"passed":true},{"actual":[[["z"],1],[["a"],1]],"check":"equal score sequence tie","expected":[[["a"],1],[["z"],1]],"passed":false},{"actual":[[["x"],1]],"check":"single path","expected":[[["x"],1]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"best duplicate score\", \"actual\": [[[\"a\"], -1], [[\"b\"], -2]], \"expected\": [[[\"a\"], -1], [[\"b\"], -2]], \"passed\": true}, {\"check\": \"unique rows\", \"actual\": [[[\"z\"], 1], [[\"a\"], 2]], \"expected\": [[[\"a\"], 2], [[\"z\"], 1]], \"passed\": false}, {\"check\": \"empty paths\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"same empty sequence\", \"actual\": [[[], 0]], \"expected\": [[[], 0]], \"passed\": true}, {\"check\": \"equal score sequence tie\", \"actual\": [[[\"z\"], 1], [[\"a\"], 1]], \"expected\": [[[\"a\"], 1], [[\"z\"], 1]], \"passed\": false}, {\"check\": \"single path\", \"actual\": [[[\"x\"], 1]], \"expected\": [[[\"x\"], 1]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":27.561,"exit_code":1,"observations":[{"actual":[[["a"],-1],[["a"],-1],[["b"],-2]],"check":"best duplicate score","expected":[[["a"],-1],[["b"],-2]],"passed":false},{"actual":[[["a"],2],[["z"],1]],"check":"unique rows","expected":[[["a"],2],[["z"],1]],"passed":true},{"actual":[],"check":"empty paths","expected":[],"passed":true},{"actual":[[[],0],[[],-1]],"check":"same empty sequence","expected":[[[],0]],"passed":false},{"actual":[[["a"],1],[["z"],1]],"check":"equal score sequence tie","expected":[[["a"],1],[["z"],1]],"passed":true},{"actual":[[["x"],1]],"check":"single path","expected":[[["x"],1]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"best duplicate score\", \"actual\": [[[\"a\"], -1], [[\"a\"], -1], [[\"b\"], -2]], \"expected\": [[[\"a\"], -1], [[\"b\"], -2]], \"passed\": false}, {\"check\": \"unique rows\", \"actual\": [[[\"a\"], 2], [[\"z\"], 1]], \"expected\": [[[\"a\"], 2], [[\"z\"], 1]], \"passed\": true}, {\"check\": \"empty paths\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"same empty sequence\", \"actual\": [[[], 0], [[], -1]], \"expected\": [[[], 0]], \"passed\": false}, {\"check\": \"equal score sequence tie\", \"actual\": [[[\"a\"], 1], [[\"z\"], 1]], \"expected\": [[[\"a\"], 1], [[\"z\"], 1]], \"passed\": true}, {\"check\": \"single path\", \"actual\": [[[\"x\"], 1]], \"expected\": [[[\"x\"], 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."}}