FAILURE MAP
← Case archive

FA-100721 / Speculative decoding bookkeeping / Open access

Decoding: Replacement is emitted before the committed prefix · case 01

Replacement is emitted before the committed prefix.

Verified by executionVariant 1 · 7 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Replacement is emitted before committed tokens.

THE FAILURE

Replacement is emitted before committed tokens.

Unsuccessful approach: Appending to the full proposal leaves rejected tokens in output.

Case contract

Return accepted tokens followed by the replacement token.

Why this case matters

A self-contained bookkeeping model makes prefix and token-count semantics observable without a model runtime.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(draft, accepted, replacement):
    return [replacement]+draft[:accepted]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('partial output', solve([1,2,3],1,9),[1,9])
check('first reject', solve([1,2],0,8),[8])
check('last reject', solve([1,2],1,7),[1,7])
check('empty proposal', solve([],0,4),[4])
check('full accepted prefix', solve([N],1,3),[N,3])
check('order kept', solve([5,2,8],2,1),[5,2,1])
check('replacement duplicate', solve([6],0,6),[6])
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 fixtureActualExpectedOutcome
partial output[9, 1][1, 9]Failed
first reject[8][8]Passed
last reject[7, 1][1, 7]Failed
empty proposal[4][4]Passed
full accepted prefix[3, 1][1, 3]Failed
order kept[1, 5, 2][5, 2, 1]Failed
replacement duplicate[6][6]Passed

SHA-256 / 5d5324c3a8b7368d5b9e5bfcf5b52ef342133639c8b4b611736fe1c4614d55f7

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(draft, accepted, replacement):
    return draft+[replacement]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('partial output', solve([1,2,3],1,9),[1,9])
check('first reject', solve([1,2],0,8),[8])
check('last reject', solve([1,2],1,7),[1,7])
check('empty proposal', solve([],0,4),[4])
check('full accepted prefix', solve([N],1,3),[N,3])
check('order kept', solve([5,2,8],2,1),[5,2,1])
check('replacement duplicate', solve([6],0,6),[6])
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 fixtureActualExpectedOutcome
partial output[1, 2, 3, 9][1, 9]Failed
first reject[1, 2, 8][8]Failed
last reject[1, 2, 7][1, 7]Failed
empty proposal[4][4]Passed
full accepted prefix[1, 3][1, 3]Passed
order kept[5, 2, 8, 1][5, 2, 1]Failed
replacement duplicate[6, 6][6]Failed

SHA-256 / 5c1c8a8e7ab4c43f5e57ae6421c6d15853e87189937503b8201bceb73511808d

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 7 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

These are finite toy sequences with explicit contracts; they make no claim about production decoder behavior or model quality. 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:39.060956+00:00.

Case digest / 1840f5169bb3ce92635650001f86daae02153186f1095134c2ab954e26da8b06