FAILURE MAP
← Case archive

FA-98061 / Sequence batch packing / Open access

Right padding mask includes the first padded position · case 01

Right padding mask includes the first padded position.

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

ROOT CAUSE

Mask construction subtracts one from the padding run.

THE FAILURE

Mask construction subtracts one from the padding run.

Unsuccessful approach: A max-zero guard hides the defect only when there is no padding.

Case contract

Right-pad tokens with zero to width and return a mask of ones for original positions followed by zeros.

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(tokens, width):
    pad=width-len(tokens); return tokens+[0]*pad, [1]*(len(tokens)+1)+[0]*max(0,pad-1)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('one pad', solve([N],N+1), ([N]+[0]*N,[1]+[0]*N))
check('many pads', solve([N],N+3), ([N]+[0]*(N+2),[1]+[0]*(N+2)))
check('no pads', solve([1]*N,N), ([1]*N,[1]*N))
check('empty', solve([],N), ([0]*N,[0]*N))
check('single width', solve([7],1), ([7],[1]))
check('two originals', solve([2,3],4), ([2,3,0,0],[1,1,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
one pad[[1, 0], [1, 1]][[1, 0], [1, 0]]Failed
many pads[[1, 0, 0, 0], [1, 1, 0, 0]][[1, 0, 0, 0], [1, 0, 0, 0]]Failed
no pads[[1], [1, 1]][[1], [1]]Failed
empty[[0], [1]][[0], [0]]Failed
single width[[7], [1, 1]][[7], [1]]Failed
two originals[[2, 3, 0, 0], [1, 1, 1, 0]][[2, 3, 0, 0], [1, 1, 0, 0]]Failed

SHA-256 / 868a968071accb243b05e6874779919b125a919de6ab71a19c96ac4df05654e2

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(tokens, width):
    pad=width-len(tokens); return tokens+[0]*pad, [1]*len(tokens)+[0]*max(0,pad-1)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('one pad', solve([N],N+1), ([N]+[0]*N,[1]+[0]*N))
check('many pads', solve([N],N+3), ([N]+[0]*(N+2),[1]+[0]*(N+2)))
check('no pads', solve([1]*N,N), ([1]*N,[1]*N))
check('empty', solve([],N), ([0]*N,[0]*N))
check('single width', solve([7],1), ([7],[1]))
check('two originals', solve([2,3],4), ([2,3,0,0],[1,1,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
one pad[[1, 0], [1]][[1, 0], [1, 0]]Failed
many pads[[1, 0, 0, 0], [1, 0, 0]][[1, 0, 0, 0], [1, 0, 0, 0]]Failed
no pads[[1], [1]][[1], [1]]Passed
empty[[0], []][[0], [0]]Failed
single width[[7], [1]][[7], [1]]Passed
two originals[[2, 3, 0, 0], [1, 1, 0]][[2, 3, 0, 0], [1, 1, 0, 0]]Failed

SHA-256 / aeb26d1085ecdd89776411861c2b5c8dc2ab02e4319218d6dca3ce754e3959be

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

Case digest / c8e1853eb832a3290e398972d741425b15e36272ecee350f2265b84c4c73e07a