FAILURE MAP
← Case archive

FA-98696 / Model quantization arithmetic / Open access

Quantization: Input zero point correction skips right-shift rescaling · case 01

Centered accumulator values are left at the wrong scale.

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

ROOT CAUSE

The broken path multiplies the centered code but subtracts the shift count instead of dividing by 2**shift.

THE FAILURE

The broken path multiplies the centered code but subtracts the shift count instead of dividing by 2**shift.

Unsuccessful approach: The attempted code restores the right shift but subtracts the input zero point after rescaling, so the zero point is treated as output units.

Case contract

Subtract integer input zero point before applying multiplier and right shift, rounding once to nearest-even. 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(codes, zero, multiplier, shift):
    return [round((q-zero)*multiplier)-shift for q in codes]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('offset then scale',solve([N+3],N,3,1),[4])
check('at zero',solve([N],N,3,2),[0])
check('below zero',solve([N-2],N,3,1),[-3])
check('empty',solve([],N,3,1),[])
check('nonunit multiplier',solve([N+2],N,5,1),[5])
check('single code',solve([N+1],N,1,0),[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 fixtureActualExpectedOutcome
offset then scale[8][4]Failed
at zero[-2][0]Failed
below zero[-7][-3]Failed
empty[][]Passed
nonunit multiplier[9][5]Failed
single code[1][1]Passed

SHA-256 / b78470ce68d8489fde0ae5c28ea1d82bfab5b8849e71f05aafe357f4e71545de

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(codes, zero, multiplier, shift):
    return [round(q*multiplier/(1<<shift))-zero for q in codes]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('offset then scale',solve([N+3],N,3,1),[4])
check('at zero',solve([N],N,3,2),[0])
check('below zero',solve([N-2],N,3,1),[-3])
check('empty',solve([],N,3,1),[])
check('nonunit multiplier',solve([N+2],N,5,1),[5])
check('single code',solve([N+1],N,1,0),[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 fixtureActualExpectedOutcome
offset then scale[5][4]Failed
at zero[0][0]Passed
below zero[-3][-3]Passed
empty[][]Passed
nonunit multiplier[7][5]Failed
single code[1][1]Passed

SHA-256 / 9977a383bfb2e55dc11893985ceec8892164b35d25b1157aa141f6b7dfa5f6eb

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

Case digest / 9b7746db814943fd19bccce2c844c7fbbfe85f287bf060af5286d20384154657