FAILURE MAP
← Case archive

FA-100676 / Speculative decoding bookkeeping / Open access

Decoding: Replacement token is missing from the emitted-token count · case 01

Replacement token is missing from the emitted-token count.

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

ROOT CAUSE

The replacement is omitted from accounting.

THE FAILURE

The replacement is omitted from accounting.

Unsuccessful approach: Adding the whole rejected suffix counts draft tokens that are discarded.

Case contract

Output length is accepted draft prefix length plus one replacement token after a rejection.

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):
    return accepted
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('partial', solve([1,2,3],1),2)
check('reject first', solve([1],0),1)
check('last rejected', solve([1,2],1),2)
check('empty proposal rejection', solve([],0),1)
check('vary accepted', solve(list(range(N+1)),N),N+1)
check('all but one', solve([1,2,3,4],3),4)
check('zero prefix', solve([1,2,3],0),1)
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
partial12Failed
reject first01Failed
last rejected12Failed
empty proposal rejection01Failed
vary accepted12Failed
all but one34Failed
zero prefix01Failed

SHA-256 / a340fe9e69a822e54631a222475fd19fe4c7c2a367f299b321c5f624aef672c1

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(draft, accepted):
    return accepted + len(draft)-accepted
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('partial', solve([1,2,3],1),2)
check('reject first', solve([1],0),1)
check('last rejected', solve([1,2],1),2)
check('empty proposal rejection', solve([],0),1)
check('vary accepted', solve(list(range(N+1)),N),N+1)
check('all but one', solve([1,2,3,4],3),4)
check('zero prefix', solve([1,2,3],0),1)
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
partial32Failed
reject first11Passed
last rejected22Passed
empty proposal rejection01Failed
vary accepted22Passed
all but one44Passed
zero prefix31Failed

SHA-256 / b9101fbfbb38fbebffee5bc34e39ee8e42240dee8f7525b850e2dada8ff3a6fb

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:38.099094+00:00.

Case digest / 1565f8e472bf4e98768a18b667af94cc5640aba44fcfbfa92acce781299c9284