FAILURE MAP
← Case archive

FA-100826 / Model output stopping rules / Open access

Output stopping: Repeated stop matches return the final occurrence · case 01

Repeated stop matches return the final occurrence.

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

ROOT CAUSE

Reverse scanning selects the last occurrence of a repeated stop ID.

THE FAILURE

Reverse scanning selects the last occurrence of a repeated stop ID.

Unsuccessful approach: Selecting the first position but returning through it leaves the stopping ID visible.

Case contract

For one stop token, truncate at its first occurrence and report that index; absence returns None.

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_id):
    i=len(tokens)-1-tokens[::-1].index(stop_id) if stop_id in tokens else None
    return (tokens[:i],i) if i is not None else (tokens,None)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('repeated stop',solve([1,8,2,8,3],8),([1],1))
check('first token',solve([8,1],8),([],0))
check('last token',solve([1,8],8),([1],1))
check('absent',solve([1,2],8),([1,2],None))
check('empty',solve([],8),([],None))
check('zero stop',solve([0,1,0],0),([],0))
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
repeated stop[[1, 8, 2], 3][[1], 1]Failed
first token[[], 0][[], 0]Passed
last token[[1], 1][[1], 1]Passed
absent[[1, 2], None][[1, 2], None]Passed
empty[[], None][[], None]Passed
zero stop[[0, 1], 2][[], 0]Failed

SHA-256 / b4bd1dc846d224351ca4d2022b8be9ac9136962dac0cc144060064cbd8474a21

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(tokens, stop_id):
    i=tokens.index(stop_id) if stop_id in tokens else None
    return (tokens[:i+1],i) if i is not None else (tokens,None)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('repeated stop',solve([1,8,2,8,3],8),([1],1))
check('first token',solve([8,1],8),([],0))
check('last token',solve([1,8],8),([1],1))
check('absent',solve([1,2],8),([1,2],None))
check('empty',solve([],8),([],None))
check('zero stop',solve([0,1,0],0),([],0))
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
repeated stop[[1, 8], 1][[1], 1]Failed
first token[[8], 0][[], 0]Failed
last token[[1, 8], 1][[1], 1]Failed
absent[[1, 2], None][[1, 2], None]Passed
empty[[], None][[], None]Passed
zero stop[[0], 0][[], 0]Failed

SHA-256 / c41919ce4a9b6d1c5857e90d507fd29c710c0250e72b74dca2c69c1b7de6a287

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

Case digest / 56350b5eb96a54e88b17f51504d8a95fd3d4755ba56d0bf5b0bcee4ee42f246a