FA-98701 / Model quantization arithmetic / Open access
Quantization: Output zero point is scaled with the accumulator · case 01
The output zero point changes with the requantization multiplier.
ROOT CAUSE
The broken implementation adds output zero point to the centered input before multiplying and shifting it.
THE FAILURE
The broken implementation adds output zero point to the centered input before multiplying and shifting it.
Unsuccessful approach: The attempted code moves output offset outside the multiplier but still divides the output zero point by the accumulator shift; it must be added in output-code units afterward.
Case contract
Requantize centered input codes by multiplier/2**shift, then add output zero point in output-code units. 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, in_zero, multiplier, shift, out_zero):
return [round((q-in_zero+out_zero)*multiplier/(1<<shift)) for q in codes]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('offset outside scale',solve([N+2],N,2,1,3),[5])
check('input zero',solve([N],N,2,1,3),[3])
check('negative centered value',solve([N-1],N,2,1,3),[2])
check('empty',solve([],N,2,1,3),[])
check('unit shift',solve([N+1],N,3,0,-2),[1])
check('two codes',solve([N,N+2],N,2,1,0),[0,2])
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 |
|---|---|---|---|
| offset outside scale | [5] | [5] | Passed |
| input zero | [3] | [3] | Passed |
| negative centered value | [2] | [2] | Passed |
| empty | [] | [] | Passed |
| unit shift | [-3] | [1] | Failed |
| two codes | [0, 2] | [0, 2] | Passed |
SHA-256 / 10f412b03b9923a4005dcf72f490268f4d97bcd53a7de5766ea0413435e5afc8
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(codes, in_zero, multiplier, shift, out_zero):
return [round((q-in_zero)*multiplier/(1<<shift)+out_zero/(1<<shift)) for q in codes]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('offset outside scale',solve([N+2],N,2,1,3),[5])
check('input zero',solve([N],N,2,1,3),[3])
check('negative centered value',solve([N-1],N,2,1,3),[2])
check('empty',solve([],N,2,1,3),[])
check('unit shift',solve([N+1],N,3,0,-2),[1])
check('two codes',solve([N,N+2],N,2,1,0),[0,2])
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 |
|---|---|---|---|
| offset outside scale | [4] | [5] | Failed |
| input zero | [2] | [3] | Failed |
| negative centered value | [0] | [2] | Failed |
| empty | [] | [] | Passed |
| unit shift | [1] | [1] | Passed |
| two codes | [0, 2] | [0, 2] | Passed |
SHA-256 / 3f5c83900ca634b0e88d7121a77bd06e1fe02b85ec12a840fe99d37075fbbe04
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.842390+00:00.
Case digest / ae830906da248c6d0f1417f3218e231c38f5e4bd2bf044b5e2042db64491b27a