FAILURE MAP
← Case archive

FA-98921 / Gradient accumulation weighting / Open access

The final short batch is discarded from accumulation · case 01

The final short batch is discarded from accumulation.

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

ROOT CAUSE

The broken path sums only batches exactly equal to the target and drops partial or oversized contributions.

THE FAILURE

The broken path sums only batches exactly equal to the target and drops partial or oversized contributions.

Unsuccessful approach: Rounding the total down to a multiple of target discards the final remainder.

Case contract

Sum every observed batch size in order-independent aggregate form, including a final remainder smaller than target.

Why this case matters

A deterministic toy model isolates one local accumulation contract.

1 / The failure

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

N = 1
observations = []
def solve(batch_sizes, target):
    return sum(size for size in batch_sizes if size == target)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('short final batch',solve([N,N,1],2*N),2*N+1)
check('all full batches',solve([N,N],N),2*N)
check('single short',solve([1],N+1),1)
check('empty',solve([],N),0)
check('oversized batch',solve([3*N],N),3*N)
check('mixed remainder',solve([2*N,N-1],N+1),3*N-1)
check('unit batch',solve([1,1,1],2),3)
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
short final batch03Failed
all full batches22Passed
single short01Failed
empty00Passed
oversized batch03Failed
mixed remainder22Passed
unit batch03Failed

SHA-256 / d3953127d7246b718e7fc63ed5d9348feb644afacb10dd47339aaba00537157f

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(batch_sizes, target):
    return sum(batch_sizes) - (sum(batch_sizes) % target if target else 0)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('short final batch',solve([N,N,1],2*N),2*N+1)
check('all full batches',solve([N,N],N),2*N)
check('single short',solve([1],N+1),1)
check('empty',solve([],N),0)
check('oversized batch',solve([3*N],N),3*N)
check('mixed remainder',solve([2*N,N-1],N+1),3*N-1)
check('unit batch',solve([1,1,1],2),3)
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
short final batch23Failed
all full batches22Passed
single short01Failed
empty00Passed
oversized batch33Passed
mixed remainder22Passed
unit batch23Failed

SHA-256 / eac8bbea99346135842b0a4326ec3050bbf6ad2680b39197782399f93181ad0e

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 7 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 scalar or short-list summaries and do not model autodiff, devices, or an optimizer. 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:18.535136+00:00.

Case digest / 74a424fc52e6faa167222a2d71e2934c886258981317e46222f3c35933e4df56