FAILURE MAP
← Case archive

FA-98111 / Sequence batch packing / Open access

Segment spans include the next segment boundary · case 01

Segment spans include the next segment boundary.

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

ROOT CAUSE

The end cursor is advanced one beyond the segment length.

THE FAILURE

The end cursor is advanced one beyond the segment length.

Unsuccessful approach: Subtracting one creates reversed or incomplete spans, especially for empty segments.

Case contract

Return half-open [start,end] token spans for consecutive segments; zero-length segments have empty spans at the current cursor.

Why this case matters

This deterministic toy packing rule models a common boundary in preparing bounded training sequences.

1 / The failure

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

N = 1
observations = []
def solve(lengths):
    out=[]; p=0
    for n in lengths: out.append([p,p+n+1]); p+=n
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('adjacent segments', solve([N,2]), [[0,N],[N,N+2]])
check('zero length', solve([0,N]), [[0,0],[0,N]])
check('empty', solve([]), [])
check('singleton', solve([1]), [[0,1]])
check('three segments', solve([1,0,2]), [[0,1],[1,1],[1,3]])
check('cursor cumulative', solve([N,N]), [[0,N],[N,2*N]])
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
adjacent segments[[0, 2], [1, 4]][[0, 1], [1, 3]]Failed
zero length[[0, 1], [0, 2]][[0, 0], [0, 1]]Failed
empty[][]Passed
singleton[[0, 2]][[0, 1]]Failed
three segments[[0, 2], [1, 2], [1, 4]][[0, 1], [1, 1], [1, 3]]Failed
cursor cumulative[[0, 2], [1, 3]][[0, 1], [1, 2]]Failed

SHA-256 / b9d7732fde273b7794371fd98f6f444062f8d0b17665e367f16bf9730bafa4ad

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(lengths):
    out=[]; p=0
    for n in lengths: out.append([p,p+n-1]); p+=n
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('adjacent segments', solve([N,2]), [[0,N],[N,N+2]])
check('zero length', solve([0,N]), [[0,0],[0,N]])
check('empty', solve([]), [])
check('singleton', solve([1]), [[0,1]])
check('three segments', solve([1,0,2]), [[0,1],[1,1],[1,3]])
check('cursor cumulative', solve([N,N]), [[0,N],[N,2*N]])
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
adjacent segments[[0, 0], [1, 2]][[0, 1], [1, 3]]Failed
zero length[[0, -1], [0, 0]][[0, 0], [0, 1]]Failed
empty[][]Passed
singleton[[0, 0]][[0, 1]]Failed
three segments[[0, 0], [1, 0], [1, 2]][[0, 1], [1, 1], [1, 3]]Failed
cursor cumulative[[0, 0], [1, 1]][[0, 1], [1, 2]]Failed

SHA-256 / 422f3e4f794dffba81d3e41100d45685adec664c93b3018413f2f5b2165c3efe

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

Inputs are short integer-token lists under the stated toy contract; results do not claim compatibility with a specific training framework. 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:09.321879+00:00.

Case digest / c268f199e0721e96017ee0d7114543bd7ccf2f817c23906039de9da184a2231e