{"abstract":"length penalty favors longer paths under a penalty contract.","category":"Beam search bookkeeping","checks":6,"contract":"Return score divided by 1 + alpha*(length-1), for each [score,length]; alpha is nonnegative.","contract_signature":"rows, alpha","evaluation_group":"beam-penalty_direction","failed_approach":"Dividing by the square root changes the contract for linear length normalization.","family":"w3-beam-search-bookkeeping-length-penalty-direction","id":"FA-98486","implementations":{"attempt":{"sha256":"924364d709ee81074f8595d1cc6eff2ce23f3ebaf979ace9d4e8fccb8133af7d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows, alpha):\n    return [s/(1+alpha*((l-1)**0.5)) for s,l in rows]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('long path penalty',solve([[N,3]],1),[N/3])\ncheck('unit path unchanged',solve([[N,1]],N),[float(N)])\ncheck('zero alpha unchanged',solve([[2*N,4]],0),[float(2*N)])\ncheck('empty rows',solve([],N),[])\ncheck('two lengths',solve([[6,1],[6,3]],1),[6.0,2.0])\ncheck('fractional alpha',solve([[8,3]],.5),[4.0])\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":"0660671123822b86ed8070e5004594208602f6cd0ae561f4d2a5b1ab246733e4","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows, alpha):\n    return [s*(1+alpha*(l-1)) for s,l in rows]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('long path penalty',solve([[N,3]],1),[N/3])\ncheck('unit path unchanged',solve([[N,1]],N),[float(N)])\ncheck('zero alpha unchanged',solve([[2*N,4]],0),[float(2*N)])\ncheck('empty rows',solve([],N),[])\ncheck('two lengths',solve([[6,1],[6,3]],1),[6.0,2.0])\ncheck('fractional alpha',solve([[8,3]],.5),[4.0])\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-penalty-direction","generated_at":"2026-09-30T16:48:13.672203+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":"A positive penalty multiplier is applied by increasing, rather than dividing by, length.","sha256":"c99addedb7d20556ccf412600a004e875ea1d7b74e6f44cdf15aef71fdb25665","title":"Beam search: length penalty favors longer paths under a penalty contract · 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.119,"exit_code":1,"observations":[{"actual":[0.4142135623730951],"check":"long path penalty","expected":[0.3333333333333333],"passed":false},{"actual":[1.0],"check":"unit path unchanged","expected":[1.0],"passed":true},{"actual":[2.0],"check":"zero alpha unchanged","expected":[2.0],"passed":true},{"actual":[],"check":"empty rows","expected":[],"passed":true},{"actual":[6.0,2.4852813742385704],"check":"two lengths","expected":[6.0,2.0],"passed":false},{"actual":[4.68629150101524],"check":"fractional alpha","expected":[4.0],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"long path penalty\", \"actual\": [0.4142135623730951], \"expected\": [0.3333333333333333], \"passed\": false}, {\"check\": \"unit path unchanged\", \"actual\": [1.0], \"expected\": [1.0], \"passed\": true}, {\"check\": \"zero alpha unchanged\", \"actual\": [2.0], \"expected\": [2.0], \"passed\": true}, {\"check\": \"empty rows\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"two lengths\", \"actual\": [6.0, 2.4852813742385704], \"expected\": [6.0, 2.0], \"passed\": false}, {\"check\": \"fractional alpha\", \"actual\": [4.68629150101524], \"expected\": [4.0], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":29.452,"exit_code":1,"observations":[{"actual":[3],"check":"long path penalty","expected":[0.3333333333333333],"passed":false},{"actual":[1],"check":"unit path unchanged","expected":[1.0],"passed":true},{"actual":[2],"check":"zero alpha unchanged","expected":[2.0],"passed":true},{"actual":[],"check":"empty rows","expected":[],"passed":true},{"actual":[6,18],"check":"two lengths","expected":[6.0,2.0],"passed":false},{"actual":[16.0],"check":"fractional alpha","expected":[4.0],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"long path penalty\", \"actual\": [3], \"expected\": [0.3333333333333333], \"passed\": false}, {\"check\": \"unit path unchanged\", \"actual\": [1], \"expected\": [1.0], \"passed\": true}, {\"check\": \"zero alpha unchanged\", \"actual\": [2], \"expected\": [2.0], \"passed\": true}, {\"check\": \"empty rows\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"two lengths\", \"actual\": [6, 18], \"expected\": [6.0, 2.0], \"passed\": false}, {\"check\": \"fractional alpha\", \"actual\": [16.0], \"expected\": [4.0], \"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."}}