FAILURE MAP
← Case archive

FA-98691 / Model quantization arithmetic / Open access

Quantization: Multiplier rescale rounds before multiplying · case 01

Multiplier rescale rounds before multiplying.

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

ROOT CAUSE

Multiply by the integer multiplier before dividing by 2**shift, then round-to-even once.

THE FAILURE

Multiply by the integer multiplier before dividing by 2**shift, then round-to-even once.

Unsuccessful approach: The attempted code multiplies before shifting but uses floor division, which rounds fractional negative and positive results down.

Case contract

Multiply by the integer multiplier before dividing by 2**shift, then round-to-even once. 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(values, multiplier, shift):
    return [round(x/(1<<shift))*multiplier for x in values]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fraction after multiply',solve([3],3,2),[2])
check('exact',solve([4*N],3,2),[3*N])
check('negative',solve([-3],3,2),[-2])
check('empty',solve([],3,2),[])
check('ties even',solve([2],1,2),[0])
check('large multiplier',solve([1],5,1),[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 fixtureActualExpectedOutcome
fraction after multiply[3][2]Failed
exact[3][3]Passed
negative[-3][-2]Failed
empty[][]Passed
ties even[0][0]Passed
large multiplier[0][2]Failed

SHA-256 / 5aed21f913dbe4777d79e9c568e6c927f3c58d0b4da1505b00d6f30f22b61b16

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(values, multiplier, shift):
    return [(x*multiplier)//(1<<shift) for x in values]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fraction after multiply',solve([3],3,2),[2])
check('exact',solve([4*N],3,2),[3*N])
check('negative',solve([-3],3,2),[-2])
check('empty',solve([],3,2),[])
check('ties even',solve([2],1,2),[0])
check('large multiplier',solve([1],5,1),[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 fixtureActualExpectedOutcome
fraction after multiply[2][2]Passed
exact[3][3]Passed
negative[-3][-2]Failed
empty[][]Passed
ties even[0][0]Passed
large multiplier[2][2]Passed

SHA-256 / 701eba9d42cb72453ee9621acce4bf3082d1de56899906cad028c601fdfa11b4

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

Case digest / 0292a68e08c911c6c559d195b3c6307bc5b379cbfce37dec132353997bef221a