FAILURE MAP
← Case archive

FA-100776 / Model output stopping rules / Open access

Output stopping: A length finish overwrites an observed stop reason · case 01

A length finish overwrites an observed stop reason.

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

ROOT CAUSE

A later length check overwrites a stop reason already observed in the output.

THE FAILURE

A later length check overwrites a stop reason already observed in the output.

Unsuccessful approach: Checking length first gives it priority even when a stop marker is present.

Case contract

Given stop position and generated count at cap, reason is stop if a stop was observed; otherwise length when at cap; otherwise null.

Why this case matters

A deterministic output-control model isolates one finish or streaming boundary from any particular runtime.

1 / The failure

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

N = 1
observations = []
def solve(tokens, stop_ids, limit):
    reason=None
    for t in tokens:
        if t in stop_ids:reason='stop'
    if len(tokens)>=limit:reason='length'
    return reason
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('stop exactly at cap',solve([1,8],[8],2),'stop')
check('length only',solve([1,2],[],2),'length')
check('stop before cap',solve([8], [8],3),'stop')
check('below cap',solve([1],[],2),None)
check('zero cap empty',solve([],[],0),'length')
check('stop after cap input',solve([1,8,2],[8],2),'stop')
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
stop exactly at caplengthstopFailed
length onlylengthlengthPassed
stop before capstopstopPassed
below capNoneNonePassed
zero cap emptylengthlengthPassed
stop after cap inputlengthstopFailed

SHA-256 / 76f1e3e9a963688c8e41f60d78122f79ff96eb8c47f9839844521a0e00c47168

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(tokens, stop_ids, limit):
    if len(tokens)>=limit:return 'length'
    if any(t in stop_ids for t in tokens):return 'stop'
    return None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('stop exactly at cap',solve([1,8],[8],2),'stop')
check('length only',solve([1,2],[],2),'length')
check('stop before cap',solve([8], [8],3),'stop')
check('below cap',solve([1],[],2),None)
check('zero cap empty',solve([],[],0),'length')
check('stop after cap input',solve([1,8,2],[8],2),'stop')
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
stop exactly at caplengthstopFailed
length onlylengthlengthPassed
stop before capstopstopPassed
below capNoneNonePassed
zero cap emptylengthlengthPassed
stop after cap inputlengthstopFailed

SHA-256 / 83414ae8014e3e000c1cc6e8d43122186f72b566a2db212dab5f7fd561456a2c

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 toy contract covers the supplied token records only; it does not claim compatibility with a particular model runtime or tokenizer. 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.593524+00:00.

Case digest / f2e0d6ce8241796b378f3f877d6bc8ba002939c96f0d652686d3303116b87ffd