{"abstract":"beam pruning ranks raw totals instead of normalized totals.","category":"Beam search bookkeeping","checks":6,"contract":"Rows [id,total,length]; rank by total divided by positive length, descending, with lexical ID ties.","contract_signature":"rows, width","evaluation_group":"beam-length_norm_prune","failed_approach":"Normalizing only the already selected raw-score winners cannot recover a pruned path.","family":"w3-beam-search-bookkeeping-length-normalization-order","id":"FA-98476","implementations":{"attempt":{"sha256":"70a137f46995069683b2243a0be99ad737adc6c7b1ade461b918cc463e79b683","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows, width):\n    return sorted(sorted(rows,key=lambda r:(-r[1],r[0]))[:width],key=lambda r:(-r[1]/r[2],r[0]))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nrows=[['short',2*N,1],['long',3*N,3]]\ncheck('normalization changes winner',solve(rows,1),[['short',2*N,1]])\ncheck('long wins with stronger total',solve([['s',N,1],['l',4*N,2]],1),[['l',4*N,2]])\ncheck('tie by ID',solve([['z',N,1],['a',N,1]],1),[['a',N,1]])\ncheck('empty rows',solve([],N),[])\ncheck('width zero',solve(rows,0),[])\ncheck('all fit',solve(rows,4),[['short',2*N,1],['long',3*N,3]])\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":"9a98d0b13a6f1df41ccb0a4e616dc865b054940cec42ed32b511eff4926b00af","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows, width):\n    return sorted(rows,key=lambda r:(-r[1],r[0]))[:width]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nrows=[['short',2*N,1],['long',3*N,3]]\ncheck('normalization changes winner',solve(rows,1),[['short',2*N,1]])\ncheck('long wins with stronger total',solve([['s',N,1],['l',4*N,2]],1),[['l',4*N,2]])\ncheck('tie by ID',solve([['z',N,1],['a',N,1]],1),[['a',N,1]])\ncheck('empty rows',solve([],N),[])\ncheck('width zero',solve(rows,0),[])\ncheck('all fit',solve(rows,4),[['short',2*N,1],['long',3*N,3]])\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-normalization-order","generated_at":"2026-09-30T16:48:13.239171+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":"Hypotheses of different lengths are compared before applying the declared penalty.","sha256":"22c126035cec2208044f8dc373e735f2053538f5f7b224f6b35a34f3f3f354f2","title":"Beam search: beam pruning ranks raw totals instead of normalized totals · 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.262,"exit_code":1,"observations":[{"actual":[["long",3,3]],"check":"normalization changes winner","expected":[["short",2,1]],"passed":false},{"actual":[["l",4,2]],"check":"long wins with stronger total","expected":[["l",4,2]],"passed":true},{"actual":[["a",1,1]],"check":"tie by ID","expected":[["a",1,1]],"passed":true},{"actual":[],"check":"empty rows","expected":[],"passed":true},{"actual":[],"check":"width zero","expected":[],"passed":true},{"actual":[["short",2,1],["long",3,3]],"check":"all fit","expected":[["short",2,1],["long",3,3]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"normalization changes winner\", \"actual\": [[\"long\", 3, 3]], \"expected\": [[\"short\", 2, 1]], \"passed\": false}, {\"check\": \"long wins with stronger total\", \"actual\": [[\"l\", 4, 2]], \"expected\": [[\"l\", 4, 2]], \"passed\": true}, {\"check\": \"tie by ID\", \"actual\": [[\"a\", 1, 1]], \"expected\": [[\"a\", 1, 1]], \"passed\": true}, {\"check\": \"empty rows\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"width zero\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"all fit\", \"actual\": [[\"short\", 2, 1], [\"long\", 3, 3]], \"expected\": [[\"short\", 2, 1], [\"long\", 3, 3]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":25.951,"exit_code":1,"observations":[{"actual":[["long",3,3]],"check":"normalization changes winner","expected":[["short",2,1]],"passed":false},{"actual":[["l",4,2]],"check":"long wins with stronger total","expected":[["l",4,2]],"passed":true},{"actual":[["a",1,1]],"check":"tie by ID","expected":[["a",1,1]],"passed":true},{"actual":[],"check":"empty rows","expected":[],"passed":true},{"actual":[],"check":"width zero","expected":[],"passed":true},{"actual":[["long",3,3],["short",2,1]],"check":"all fit","expected":[["short",2,1],["long",3,3]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"normalization changes winner\", \"actual\": [[\"long\", 3, 3]], \"expected\": [[\"short\", 2, 1]], \"passed\": false}, {\"check\": \"long wins with stronger total\", \"actual\": [[\"l\", 4, 2]], \"expected\": [[\"l\", 4, 2]], \"passed\": true}, {\"check\": \"tie by ID\", \"actual\": [[\"a\", 1, 1]], \"expected\": [[\"a\", 1, 1]], \"passed\": true}, {\"check\": \"empty rows\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"width zero\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"all fit\", \"actual\": [[\"long\", 3, 3], [\"short\", 2, 1]], \"expected\": [[\"short\", 2, 1], [\"long\", 3, 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."}}