{"abstract":"The zero point is included in the value before dequantization scaling.","category":"Model quantization arithmetic","checks":6,"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.","contract_signature":"codes, scale, zero","evaluation_group":"quant-affine","failed_approach":"The attempted code applies zero-point subtraction after scaling, so the offset stays in raw units instead of code units.","family":"w3-model-quantization-arithmetic-affine-zero-point","id":"FA-98646","implementations":{"attempt":{"sha256":"e1b0da3722c1b74e7e61a10afa89582dc28b0dd8625aa51b79cf3b3d7c236a6d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(codes, scale, zero):\n    return [q*scale-zero for q in codes]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('offset code',solve([N+2],2,N),[4])\ncheck('zero point',solve([N],3,N),[0])\ncheck('below zero',solve([N-2],2,N),[-4])\ncheck('empty',solve([],2,N),[])\ncheck('repeated codes',solve([N+1,N+1],3,N),[3,3])\ncheck('unit scale',solve([N+4],1,N),[4])\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"8e99879568c2785ee5488940a199a9cb5fd6a718f3643773c3f9e83e902b6a92","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(codes, scale, zero):\n    return [(q+zero)*scale for q in codes]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('offset code',solve([N+2],2,N),[4])\ncheck('zero point',solve([N],3,N),[0])\ncheck('below zero',solve([N-2],2,N),[-4])\ncheck('empty',solve([],2,N),[])\ncheck('repeated codes',solve([N+1,N+1],3,N),[3,3])\ncheck('unit scale',solve([N+4],1,N),[4])\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w3-model-quantization-arithmetic-affine-zero-point","generated_at":"2026-09-30T16:48:15.403543+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"This deterministic model isolates one quantization arithmetic contract from tensor storage and runtime kernels.","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.","sha256":"b0e1e0dfcb5241f3e77493d2352c7b6b71a0823253f91c9930c99c388a6f428d","title":"Quantization: Zero point is added before dequantization scaling · case 01","variant":1,"variant_policy":"The fixture code references N, supplied as 1 through 5. Fixed boundary checks may repeat. These records share one mechanism and must remain together in evaluation splits.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":28.81,"exit_code":1,"observations":[{"actual":[5],"check":"offset code","expected":[4],"passed":false},{"actual":[2],"check":"zero point","expected":[0],"passed":false},{"actual":[-3],"check":"below zero","expected":[-4],"passed":false},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":[5,5],"check":"repeated codes","expected":[3,3],"passed":false},{"actual":[4],"check":"unit scale","expected":[4],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"offset code\", \"actual\": [5], \"expected\": [4], \"passed\": false}, {\"check\": \"zero point\", \"actual\": [2], \"expected\": [0], \"passed\": false}, {\"check\": \"below zero\", \"actual\": [-3], \"expected\": [-4], \"passed\": false}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"repeated codes\", \"actual\": [5, 5], \"expected\": [3, 3], \"passed\": false}, {\"check\": \"unit scale\", \"actual\": [4], \"expected\": [4], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":28.008,"exit_code":1,"observations":[{"actual":[8],"check":"offset code","expected":[4],"passed":false},{"actual":[6],"check":"zero point","expected":[0],"passed":false},{"actual":[0],"check":"below zero","expected":[-4],"passed":false},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":[9,9],"check":"repeated codes","expected":[3,3],"passed":false},{"actual":[6],"check":"unit scale","expected":[4],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"offset code\", \"actual\": [8], \"expected\": [4], \"passed\": false}, {\"check\": \"zero point\", \"actual\": [6], \"expected\": [0], \"passed\": false}, {\"check\": \"below zero\", \"actual\": [0], \"expected\": [-4], \"passed\": false}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"repeated codes\", \"actual\": [9, 9], \"expected\": [3, 3], \"passed\": false}, {\"check\": \"unit scale\", \"actual\": [6], \"expected\": [4], \"passed\": false}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}