FA-98516 / Beam search bookkeeping / Open access
Beam search: zero-width search retains one live hypothesis · case 01
zero-width search retains one live hypothesis.
ROOT CAUSE
The pruning helper treats a zero beam width as a request for the default single path.
THE FAILURE
The pruning helper treats a zero beam width as a request for the default single path.
Unsuccessful approach: Clamping width to one still creates a hypothesis when the caller requested none.
Case contract
Return the top width candidate rows; width is a nonnegative integer.
Why this case matters
Beam decoders rely on consistent hypothesis state while expanding and ranking candidates.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(rows, width):
return sorted(rows,key=lambda r:-r[1])[:max(1,width)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
rows=[['a',N],['b',N+1]]
check('zero width',solve(rows,0),[])
check('one width',solve(rows,1),[['b',N+1]])
check('wide beam',solve(rows,5),[['b',N+1],['a',N]])
check('empty rows',solve([],0),[])
check('tie order',solve([['z',N],['a',N]],1),[['a',N]])
check('singleton width zero',solve([['x',1]],0),[])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| zero width | [['b', 2]] | [] | Failed |
| one width | [['b', 2]] | [['b', 2]] | Passed |
| wide beam | [['b', 2], ['a', 1]] | [['b', 2], ['a', 1]] | Passed |
| empty rows | [] | [] | Passed |
| tie order | [['z', 1]] | [['a', 1]] | Failed |
| singleton width zero | [['x', 1]] | [] | Failed |
SHA-256 / 3bcacaa614ddd6ac1d0c76d5067b87468aad49a09098d3c0e73b88c320cab8e0
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(rows, width):
return sorted(rows,key=lambda r:-r[1])[:max(0,width+1)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
rows=[['a',N],['b',N+1]]
check('zero width',solve(rows,0),[])
check('one width',solve(rows,1),[['b',N+1]])
check('wide beam',solve(rows,5),[['b',N+1],['a',N]])
check('empty rows',solve([],0),[])
check('tie order',solve([['z',N],['a',N]],1),[['a',N]])
check('singleton width zero',solve([['x',1]],0),[])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| zero width | [['b', 2]] | [] | Failed |
| one width | [['b', 2], ['a', 1]] | [['b', 2]] | Failed |
| wide beam | [['b', 2], ['a', 1]] | [['b', 2], ['a', 1]] | Passed |
| empty rows | [] | [] | Passed |
| tie order | [['z', 1], ['a', 1]] | [['a', 1]] | Failed |
| singleton width zero | [['x', 1]] | [] | Failed |
SHA-256 / 7d72cb65509f0a747f2511f9555578d1a60e71c0244967a8f124805e473e8064
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 6 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗Verification & scope
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.
Observations recorded using Python 3.12.14 at 2026-09-30T16:48:13.668727+00:00.
Case digest / ce295787c87f0f5c8ad174b34bc2953448b3a2725f6bc76466b9c335e31aa99d