FAILURE MAP
← Case archive

FA-98686 / Model quantization arithmetic / Open access

Quantization: Left rescale shifts in the wrong direction · case 01

Left rescale shifts in the wrong direction.

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

ROOT CAUSE

Apply an integer left shift after multiplying: result = x*multiplier*2**shift.

THE FAILURE

Apply an integer left shift after multiplying: result = x*multiplier*2**shift.

Unsuccessful approach: The attempted code now expands by the power of two but adds the multiplier instead of multiplying by it.

Case contract

Apply an integer left shift after multiplying: result = x*multiplier*2**shift. 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*multiplier/(1<<shift)) for x in values]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('left scale',solve([N],3,2),[12*N])
check('zero input',solve([0],7,3),[0])
check('empty',solve([],2,1),[])
check('negative input',solve([-N],2,2),[-8*N])
check('unit shift',solve([3],2,0),[6])
check('multiple values',solve([1,2],1,3),[8,16])
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
left scale[1][12]Failed
zero input[0][0]Passed
empty[][]Passed
negative input[0][-8]Failed
unit shift[6][6]Passed
multiple values[0, 0][8, 16]Failed

SHA-256 / d232b09bc62e1b62cb62c97e599105ec6a9cbe95a14b7c7b34e7594f8e85b60e

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*(1<<shift)+multiplier for x in values]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('left scale',solve([N],3,2),[12*N])
check('zero input',solve([0],7,3),[0])
check('empty',solve([],2,1),[])
check('negative input',solve([-N],2,2),[-8*N])
check('unit shift',solve([3],2,0),[6])
check('multiple values',solve([1,2],1,3),[8,16])
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
left scale[7][12]Failed
zero input[7][0]Failed
empty[][]Passed
negative input[-2][-8]Failed
unit shift[5][6]Failed
multiple values[9, 17][8, 16]Failed

SHA-256 / c1450a9abba9de33a5ed99aeb8ff6797e5c88de832ae0ece0b91aaa985f6f4a5

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

Case digest / 8546dc5597479a0b5d7a0eb205a0d2a8cbdeb164fa94b2b6993814bf7931d876