FAILURE MAP
← Case archive

FA-98081 / Sequence batch packing / Open access

Segment identifiers continue across packed rows · case 01

Segment identifiers continue across packed rows.

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

ROOT CAUSE

A global segment counter is carried between rows instead of restarting for each packed row.

THE FAILURE

A global segment counter is carried between rows instead of restarting for each packed row.

Unsuccessful approach: Starting at one only changes the initial label and keeps the ownership convention wrong.

Case contract

For each row of packed sequence lengths, label tokens with that row-local sequence index; numbering restarts at zero per row.

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(rows):
    out=[]; base=0
    for row in rows:
        out.append([base+j for j,length in enumerate(row) for _ in range(length)])
        base+=len(row)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('two rows reset', solve([[N,1],[2]]), [[0]*N+[1],[0,0]])
check('empty batch', solve([]), [])
check('empty row', solve([[]]), [[]])
check('zero length segment', solve([[0,N]]), [([1]*N)])
check('three owners', solve([[1,2,1]]), [[0,1,1,2]])
check('equal lengths distinct', solve([[N,N]]), [[0]*N+[1]*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
two rows reset[[0, 1], [2, 2]][[0, 1], [0, 0]]Failed
empty batch[][]Passed
empty row[[]][[]]Passed
zero length segment[[1]][[1]]Passed
three owners[[0, 1, 1, 2]][[0, 1, 1, 2]]Passed
equal lengths distinct[[0, 1]][[0, 1]]Passed

SHA-256 / 7569d76a4fc499727c8a11bae25100b6a8fd6073181944a6ab908655f2a32154

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(rows):
    return [[j for j,length in enumerate(row,1) for _ in range(length)] for row in rows]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('two rows reset', solve([[N,1],[2]]), [[0]*N+[1],[0,0]])
check('empty batch', solve([]), [])
check('empty row', solve([[]]), [[]])
check('zero length segment', solve([[0,N]]), [([1]*N)])
check('three owners', solve([[1,2,1]]), [[0,1,1,2]])
check('equal lengths distinct', solve([[N,N]]), [[0]*N+[1]*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
two rows reset[[1, 2], [1, 1]][[0, 1], [0, 0]]Failed
empty batch[][]Passed
empty row[[]][[]]Passed
zero length segment[[2]][[1]]Failed
three owners[[1, 2, 2, 3]][[0, 1, 1, 2]]Failed
equal lengths distinct[[1, 2]][[0, 1]]Failed

SHA-256 / 26a442c6904dc98d2e0f658480daa686dd660e5c8b95bdc8e90c719237a14c54

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

Case digest / 87fd076c641b52bb472bccb51b66810bb92c8bf760ce7305e901ed328c5148f9