FA-98646 / Model quantization arithmetic / Open access
Quantization: Zero point is added before dequantization scaling · case 01
The zero point is included in the value before dequantization scaling.
ROOT CAUSE
The broken dequantizer adds the code offset to the zero point before scaling; the contract first centers the code by subtracting zero point.
THE FAILURE
The broken dequantizer adds the code offset to the zero point before scaling; the contract first centers the code by subtracting zero point.
Unsuccessful approach: The attempted code applies zero-point subtraction after scaling, so the offset stays in raw units instead of code units.
Case contract
Given integer codes, an integer zero point, and a positive integer scale, return integer dequantized values as (code-zero_point)*scale. Scale is restricted to positive integers so results are exact integers.
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, scale, zero):
return [(q+zero)*scale for q in codes]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('offset code',solve([N+2],2,N),[4])
check('zero point',solve([N],3,N),[0])
check('below zero',solve([N-2],2,N),[-4])
check('empty',solve([],2,N),[])
check('repeated codes',solve([N+1,N+1],3,N),[3,3])
check('unit scale',solve([N+4],1,N),[4])
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 code | [8] | [4] | Failed |
| zero point | [6] | [0] | Failed |
| below zero | [0] | [-4] | Failed |
| empty | [] | [] | Passed |
| repeated codes | [9, 9] | [3, 3] | Failed |
| unit scale | [6] | [4] | Failed |
SHA-256 / 8e99879568c2785ee5488940a199a9cb5fd6a718f3643773c3f9e83e902b6a92
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(codes, scale, zero):
return [q*scale-zero for q in codes]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('offset code',solve([N+2],2,N),[4])
check('zero point',solve([N],3,N),[0])
check('below zero',solve([N-2],2,N),[-4])
check('empty',solve([],2,N),[])
check('repeated codes',solve([N+1,N+1],3,N),[3,3])
check('unit scale',solve([N+4],1,N),[4])
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 code | [5] | [4] | Failed |
| zero point | [2] | [0] | Failed |
| below zero | [-3] | [-4] | Failed |
| empty | [] | [] | Passed |
| repeated codes | [5, 5] | [3, 3] | Failed |
| unit scale | [4] | [4] | Passed |
SHA-256 / e1b0da3722c1b74e7e61a10afa89582dc28b0dd8625aa51b79cf3b3d7c236a6d
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.403543+00:00.
Case digest / b0e1e0dfcb5241f3e77493d2352c7b6b71a0823253f91c9930c99c388a6f428d