FA-98456 / Beam search bookkeeping / Open access
Beam search: candidate budget is shared before per-parent expansion · case 01
candidate budget is shared before per-parent expansion.
ROOT CAUSE
Only the globally best candidates should occupy the next beam, but each parent is locally capped first.
THE FAILURE
Only the globally best candidates should occupy the next beam, but each parent is locally capped first.
Unsuccessful approach: Selecting only one candidate per parent can discard multiple top children from the same parent.
Case contract
Candidates are [parent,score,token]; return globally top width ordered by descending score then parent and token.
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(candidates, width):
return sorted(candidates,key=lambda x:(x[0],-x[1],x[2]))[:width]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
c=[[0,N+3,'a'],[0,N+2,'b'],[1,N+4,'c'],[1,0,'d']]
check('same parent owns top slots',solve(c,2),[[1,N+4,'c'],[0,N+3,'a']])
check('mixed parents',solve(c,3),[[1,N+4,'c'],[0,N+3,'a'],[0,N+2,'b']])
check('empty',solve([],2),[])
check('zero width',solve(c,0),[])
check('tie stable order',solve([[1,N,'z'],[0,N,'a']],2),[[0,N,'a'],[1,N,'z']])
check('one candidate',solve([[2,N,'x']],4),[[2,N,'x']])
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 |
|---|---|---|---|
| same parent owns top slots | [[0, 4, 'a'], [0, 3, 'b']] | [[1, 5, 'c'], [0, 4, 'a']] | Failed |
| mixed parents | [[0, 4, 'a'], [0, 3, 'b'], [1, 5, 'c']] | [[1, 5, 'c'], [0, 4, 'a'], [0, 3, 'b']] | Failed |
| empty | [] | [] | Passed |
| zero width | [] | [] | Passed |
| tie stable order | [[0, 1, 'a'], [1, 1, 'z']] | [[0, 1, 'a'], [1, 1, 'z']] | Passed |
| one candidate | [[2, 1, 'x']] | [[2, 1, 'x']] | Passed |
SHA-256 / b1b186e07f5016d62cad1ed54b6d95a3a0afea889a1d9f14dc31ffc128d962db
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(candidates, width):
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]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
c=[[0,N+3,'a'],[0,N+2,'b'],[1,N+4,'c'],[1,0,'d']]
check('same parent owns top slots',solve(c,2),[[1,N+4,'c'],[0,N+3,'a']])
check('mixed parents',solve(c,3),[[1,N+4,'c'],[0,N+3,'a'],[0,N+2,'b']])
check('empty',solve([],2),[])
check('zero width',solve(c,0),[])
check('tie stable order',solve([[1,N,'z'],[0,N,'a']],2),[[0,N,'a'],[1,N,'z']])
check('one candidate',solve([[2,N,'x']],4),[[2,N,'x']])
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 |
|---|---|---|---|
| same parent owns top slots | [[1, 5, 'c'], [0, 4, 'a']] | [[1, 5, 'c'], [0, 4, 'a']] | Passed |
| mixed parents | [[1, 5, 'c'], [0, 4, 'a']] | [[1, 5, 'c'], [0, 4, 'a'], [0, 3, 'b']] | Failed |
| empty | [] | [] | Passed |
| zero width | [] | [] | Passed |
| tie stable order | [[0, 1, 'a'], [1, 1, 'z']] | [[0, 1, 'a'], [1, 1, 'z']] | Passed |
| one candidate | [[2, 1, 'x']] | [[2, 1, 'x']] | Passed |
SHA-256 / 0b9aecc3228367a9a151f1b3dd11d274a94af0c362f7604e2cf3731d7364a8a2
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.237305+00:00.
Case digest / 7f4c7dbff737766d806fd7cd3f985500c9fef20645151753cd9ed1f1afbf07f0