FA-98051 / Sequence batch packing / Open access
Batch padding rounds down to a length multiple · case 01
Batch padding rounds down to a length multiple.
ROOT CAUSE
Floor division chooses the previous bucket when maximum length is not divisible.
THE FAILURE
Floor division chooses the previous bucket when maximum length is not divisible.
Unsuccessful approach: Adding a full extra bucket fixes nonmultiples but wastes a bucket for exact multiples.
Case contract
Return the smallest multiple of positive multiple that is at least the maximum length; empty input returns zero.
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, multiple):
return (max(lengths)//multiple)*multiple if lengths else 0
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('between multiples', solve([2*N+1],N+1), 2*(N+1))
check('already multiple', solve([2*N],N), 2*N)
check('zero length', solve([0],N), 0)
check('empty', solve([],N), 0)
check('mixed maximum', solve([N,2*N+1,1],N), 3*N)
check('unit multiple', solve([N+1],1), N+1)
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| between multiples | 2 | 4 | Failed |
| already multiple | 2 | 2 | Passed |
| zero length | 0 | 0 | Passed |
| empty | 0 | 0 | Passed |
| mixed maximum | 3 | 3 | Passed |
| unit multiple | 2 | 2 | Passed |
SHA-256 / 3fbdbec0066f6352f7a4cca62a83aab35de47b83f50aa76781f0adac6c072148
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(lengths, multiple):
return ((max(lengths)+multiple-1)//multiple+1)*multiple if lengths else 0
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('between multiples', solve([2*N+1],N+1), 2*(N+1))
check('already multiple', solve([2*N],N), 2*N)
check('zero length', solve([0],N), 0)
check('empty', solve([],N), 0)
check('mixed maximum', solve([N,2*N+1,1],N), 3*N)
check('unit multiple', solve([N+1],1), N+1)
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| between multiples | 6 | 4 | Failed |
| already multiple | 3 | 2 | Failed |
| zero length | 1 | 0 | Failed |
| empty | 0 | 0 | Passed |
| mixed maximum | 4 | 3 | Failed |
| unit multiple | 3 | 2 | Failed |
SHA-256 / d0b18764d490dc1164472b218bd05e6f7f1d5118137a7994b6e5156ee737ed7c
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.895983+00:00.
Case digest / f4e40efc38fa442fa089935f16540e6df098df7460193d4b3a9bcdbcf06fbb50