FAILURE MAP
← Case archive

FA-98706 / Model quantization arithmetic / Open access

Quantization: Bias is divided by the input scale · case 01

An output-unit bias changes when the input scale changes.

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

ROOT CAUSE

The broken implementation adds bias to the input before dividing, even though bias is already expressed in output integer units.

THE FAILURE

The broken implementation adds bias to the input before dividing, even though bias is already expressed in output integer units.

Unsuccessful approach: The attempted code adds bias after scale conversion but truncates the scaled value, leaving halfway cases wrong.

Case contract

Input values are divided by positive scale and rounded; bias is already in output integer units and is added afterward. 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, bias, scale):
    return [round((x+bias)/scale) for x in values]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('integer bias',solve([2*N],3,2),[N+3])
check('zero value',solve([0],N,2),[N])
check('negative value',solve([-2*N],1,2),[1-N])
check('empty',solve([],3,2),[])
check('half value',solve([1],2,2),[2])
check('multiple',solve([4,8],1,2),[3,5])
check('halfway scaled value',solve([3],0,2),[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
integer bias[2][4]Failed
zero value[0][1]Failed
negative value[0][0]Passed
empty[][]Passed
half value[2][2]Passed
multiple[2, 4][3, 5]Failed
halfway scaled value[2][2]Passed

SHA-256 / 4c20367afc10d230fe93e038410ed8e8400cbcde2a5da94dcefc82aea15a3438

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(values, bias, scale):
    return [int(x/scale)+bias for x in values]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('integer bias',solve([2*N],3,2),[N+3])
check('zero value',solve([0],N,2),[N])
check('negative value',solve([-2*N],1,2),[1-N])
check('empty',solve([],3,2),[])
check('half value',solve([1],2,2),[2])
check('multiple',solve([4,8],1,2),[3,5])
check('halfway scaled value',solve([3],0,2),[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
integer bias[4][4]Passed
zero value[1][1]Passed
negative value[0][0]Passed
empty[][]Passed
half value[2][2]Passed
multiple[3, 5][3, 5]Passed
halfway scaled value[1][2]Failed

SHA-256 / 77b3bdacaeb9cced5b1a0fe1ca74b3e8ded86e709174041d889d153fa2bdd05a

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 7 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.841981+00:00.

Case digest / 1cb0c8b3c5b7e174f729c10b525e25b9023a85521cfe81fbedf0f84a8b4467d5