FAILURE MAP
← Case archive

FA-98711 / Model quantization arithmetic / Open access

Quantization: Accumulator silently wraps at a narrow width · case 01

Accumulator silently wraps at a narrow width.

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

ROOT CAUSE

Accumulate integer products exactly without modular wrap; width is metadata and does not impose overflow in this toy contract.

THE FAILURE

Accumulate integer products exactly without modular wrap; width is metadata and does not impose overflow in this toy contract.

Unsuccessful approach: The attempted code avoids a single final mask but masks every product before summing, so high product bits are still lost.

Case contract

Accumulate integer products exactly without modular wrap; width is metadata and does not impose overflow in this toy contract. Inputs follow this explicit integer toy contract; ties use Python round-to-even where rounding is required.

Why this case matters

This deterministic model isolates one quantization arithmetic contract from tensor storage and runtime kernels.

1 / The failure

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

N = 1
observations = []
def solve(products, width):
    mask=(1<<width)-1
    return sum(products)&mask
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('positive carry',solve([3*N,5*N],8),8*N)
check('negative sum',solve([-N,-2*N],8),-3*N)
check('empty',solve([],8),0)
check('single',solve([N],8),N)
check('large exact',solve([100*N],8),100*N)
check('cancellation',solve([10*N,-10*N],8),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
positive carry88Passed
negative sum253-3Failed
empty00Passed
single11Passed
large exact100100Passed
cancellation00Passed

SHA-256 / 7f7a941282fcd198d40fab451a10ea6945e1b1de7b5acc8341af1d96354a9150

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(products, width):
    mask=(1<<width)-1
    return sum(p&mask for p in products)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('positive carry',solve([3*N,5*N],8),8*N)
check('negative sum',solve([-N,-2*N],8),-3*N)
check('empty',solve([],8),0)
check('single',solve([N],8),N)
check('large exact',solve([100*N],8),100*N)
check('cancellation',solve([10*N,-10*N],8),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
positive carry88Passed
negative sum509-3Failed
empty00Passed
single11Passed
large exact100100Passed
cancellation2560Failed

SHA-256 / b6d47bfa8f7af42c7faf3a4194f8d22357e283e26cd366cf37a91ce59107acb6

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

Toy scalar/list arithmetic only; it does not model a production quantizer, hardware instruction, or accuracy/performance gain. 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:15.841772+00:00.

Case digest / b75c1acaf3744129b2aa2bc6efe2de4dba944ad6195d374fe8eff78b5607cdba