FAILURE MAP
← Case archive

FA-98931 / Gradient accumulation weighting / Open access

Two objective buckets share one normalization denominator · case 01

Two objective buckets share one normalization denominator.

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

ROOT CAUSE

The broken path applies one global count to all objective buckets instead of one denominator per bucket.

THE FAILURE

The broken path applies one global count to all objective buckets instead of one denominator per bucket.

Unsuccessful approach: Averaging microbatch means equally retains unequal within-objective batch weighting.

Case contract

Each bucket is a separate objective with its own sums and counts. Return its total sum divided by its total count, with zero for an empty bucket.

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(bucket_sums, bucket_counts):
    denominator=max(1,sum(sum(row) for row in bucket_counts))
    return [sum(row)/denominator for row in bucket_sums]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('independent objectives',solve([[2*N,12*N],[6*N,4*N]],[[N,3*N],[2*N,2*N]]),[3.5,2.5])
check('one item each',solve([[2*N],[8*N]],[[N],[2*N]]),[2,4])
check('empty bucket',solve([[],[6*N]],[[],[2*N]]),[0,3])
check('both empty',solve([[],[]],[[],[]]),[0,0])
check('zero numerator',solve([[0,9*N],[4*N,0]],[[N,3*N],[2*N,2*N]]),[2.25,1])
check('three entries',solve([[N,6*N],[8*N]],[[1,2],[4]]),[7*N/3,2*N])
check('unequal bucket sizes',solve([[4*N],[2*N,8*N]],[[2*N],[N,3*N]]),[2,2.5])
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
independent objectives[1.75, 1.25][3.5, 2.5]Failed
one item each[0.6666666666666666, 2.6666666666666665][2, 4]Failed
empty bucket[0.0, 3.0][0, 3]Passed
both empty[0.0, 0.0][0, 0]Passed
zero numerator[1.125, 0.5][2.25, 1]Failed
three entries[1.0, 1.1428571428571428][2.3333333333333335, 2]Failed
unequal bucket sizes[0.6666666666666666, 1.6666666666666667][2, 2.5]Failed

SHA-256 / 539f54b12c6d073b1029f6bf2167ac93e30445f62ff183492a498993c3c0d435

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(bucket_sums, bucket_counts):
    return [sum(s/c for s,c in zip(sr,cr) if c)/max(1,sum(c>0 for c in cr)) for sr,cr in zip(bucket_sums,bucket_counts)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('independent objectives',solve([[2*N,12*N],[6*N,4*N]],[[N,3*N],[2*N,2*N]]),[3.5,2.5])
check('one item each',solve([[2*N],[8*N]],[[N],[2*N]]),[2,4])
check('empty bucket',solve([[],[6*N]],[[],[2*N]]),[0,3])
check('both empty',solve([[],[]],[[],[]]),[0,0])
check('zero numerator',solve([[0,9*N],[4*N,0]],[[N,3*N],[2*N,2*N]]),[2.25,1])
check('three entries',solve([[N,6*N],[8*N]],[[1,2],[4]]),[7*N/3,2*N])
check('unequal bucket sizes',solve([[4*N],[2*N,8*N]],[[2*N],[N,3*N]]),[2,2.5])
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
independent objectives[3.0, 2.5][3.5, 2.5]Failed
one item each[2.0, 4.0][2, 4]Passed
empty bucket[0.0, 3.0][0, 3]Passed
both empty[0.0, 0.0][0, 0]Passed
zero numerator[1.5, 1.0][2.25, 1]Failed
three entries[2.0, 2.0][2.3333333333333335, 2]Failed
unequal bucket sizes[2.0, 2.333333333333333][2, 2.5]Failed

SHA-256 / 6218bf3c08dfe8d2eff83dd014c105475b4b8a904a9b24e31fdeb14ba472a0c2

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

Case digest / b42f8092f734400fb4d5e67e396f2927b537bbeb60b3b7c0cb54d671ae3df630