FAILURE MAP
← Case archive

FA-100811 / Model output stopping rules / Open access

Output stopping: One sample’s finish state changes a neighboring sample · case 01

One sample’s finish state changes a neighboring sample.

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

ROOT CAUSE

Completion state is shared across samples, so one sample can mark every sample finished.

THE FAILURE

Completion state is shared across samples, so one sample can mark every sample finished.

Unsuccessful approach: A shared loop flag still changes the finish state of later samples.

Case contract

Each sample has own token list and stop IDs. Return per-sample truncated outputs and finish reasons, processing every sample independently.

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(token_batches, stop_ids):
    out=[]
    any_stop=any(t in stop_ids for row in token_batches for t in row)
    for row in token_batches:
        if any_stop: out.append(([], 'stop'))
        else: out.append((row, 'length'))
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('separate finish',solve([[1,8,2],[3,4]], [8]),[([1],'stop'),([3,4],'length')])
check('both stop',solve([[8],[2,8]], [8]),[([],'stop'),([2],'stop')])
check('no batches',solve([], [8]),[])
check('empty row',solve([[]], [8]),[([],'length')])
check('later sample stop',solve([[1],[8,2]], [8]),[([1],'length'),([],'stop')])
check('zero marker',solve([[0,1]], [0]),[([],'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
separate finish[[[], 'stop'], [[], 'stop']][[[1], 'stop'], [[3, 4], 'length']]Failed
both stop[[[], 'stop'], [[], 'stop']][[[], 'stop'], [[2], 'stop']]Failed
no batches[][]Passed
empty row[[[], 'length']][[[], 'length']]Passed
later sample stop[[[], 'stop'], [[], 'stop']][[[1], 'length'], [[], 'stop']]Failed
zero marker[[[], 'stop']][[[], 'stop']]Passed

SHA-256 / 3c8ca6186d074a02846567a5bc47e89c1f831dbac67af2475eeeaa1b371b01b4

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(token_batches, stop_ids):
    out=[]
    finished=False
    for row in token_batches:
        if finished: out.append(([], 'stop'))
        elif any(t in stop_ids for t in row):
            out.append((row[:next(i for i,t in enumerate(row) if t in stop_ids)],'stop')); finished=True
        else: out.append((row,'length'))
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('separate finish',solve([[1,8,2],[3,4]], [8]),[([1],'stop'),([3,4],'length')])
check('both stop',solve([[8],[2,8]], [8]),[([],'stop'),([2],'stop')])
check('no batches',solve([], [8]),[])
check('empty row',solve([[]], [8]),[([],'length')])
check('later sample stop',solve([[1],[8,2]], [8]),[([1],'length'),([],'stop')])
check('zero marker',solve([[0,1]], [0]),[([],'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
separate finish[[[1], 'stop'], [[], 'stop']][[[1], 'stop'], [[3, 4], 'length']]Failed
both stop[[[], 'stop'], [[], 'stop']][[[], 'stop'], [[2], 'stop']]Failed
no batches[][]Passed
empty row[[[], 'length']][[[], 'length']]Passed
later sample stop[[[1], 'length'], [[], 'stop']][[[1], 'length'], [[], 'stop']]Passed
zero marker[[[], 'stop']][[[], 'stop']]Passed

SHA-256 / c8e3b87a9fbacb93d320ae93ee72fa63051c222c8c516bcab016417c0584e606

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

Case digest / 5683cb5d757da80540bc90abcf8e8639d2022ea4bc96b0b5f8920e903857eb77