{"abstract":"An output-unit bias changes when the input scale changes.","category":"Model quantization arithmetic","checks":7,"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.","contract_signature":"values, bias, scale","evaluation_group":"quant-bias_units","failed_approach":"The attempted code adds bias after scale conversion but truncates the scaled value, leaving halfway cases wrong.","family":"w3-model-quantization-arithmetic-bias-scale","id":"FA-98706","implementations":{"attempt":{"sha256":"77b3bdacaeb9cced5b1a0fe1ca74b3e8ded86e709174041d889d153fa2bdd05a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(values, bias, scale):\n    return [int(x/scale)+bias for x in values]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('integer bias',solve([2*N],3,2),[N+3])\ncheck('zero value',solve([0],N,2),[N])\ncheck('negative value',solve([-2*N],1,2),[1-N])\ncheck('empty',solve([],3,2),[])\ncheck('half value',solve([1],2,2),[2])\ncheck('multiple',solve([4,8],1,2),[3,5])\ncheck('halfway scaled value',solve([3],0,2),[2])\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":"4c20367afc10d230fe93e038410ed8e8400cbcde2a5da94dcefc82aea15a3438","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(values, bias, scale):\n    return [round((x+bias)/scale) for x in values]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('integer bias',solve([2*N],3,2),[N+3])\ncheck('zero value',solve([0],N,2),[N])\ncheck('negative value',solve([-2*N],1,2),[1-N])\ncheck('empty',solve([],3,2),[])\ncheck('half value',solve([1],2,2),[2])\ncheck('multiple',solve([4,8],1,2),[3,5])\ncheck('halfway scaled value',solve([3],0,2),[2])\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-bias-scale","generated_at":"2026-09-30T16:48:15.841981+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 implementation adds bias to the input before dividing, even though bias is already expressed in output integer units.","sha256":"1cb0c8b3c5b7e174f729c10b525e25b9023a85521cfe81fbedf0f84a8b4467d5","title":"Quantization: Bias is divided by the input scale · 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":30.24,"exit_code":1,"observations":[{"actual":[4],"check":"integer bias","expected":[4],"passed":true},{"actual":[1],"check":"zero value","expected":[1],"passed":true},{"actual":[0],"check":"negative value","expected":[0],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":[2],"check":"half value","expected":[2],"passed":true},{"actual":[3,5],"check":"multiple","expected":[3,5],"passed":true},{"actual":[1],"check":"halfway scaled value","expected":[2],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"integer bias\", \"actual\": [4], \"expected\": [4], \"passed\": true}, {\"check\": \"zero value\", \"actual\": [1], \"expected\": [1], \"passed\": true}, {\"check\": \"negative value\", \"actual\": [0], \"expected\": [0], \"passed\": true}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"half value\", \"actual\": [2], \"expected\": [2], \"passed\": true}, {\"check\": \"multiple\", \"actual\": [3, 5], \"expected\": [3, 5], \"passed\": true}, {\"check\": \"halfway scaled value\", \"actual\": [1], \"expected\": [2], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":27.736,"exit_code":1,"observations":[{"actual":[2],"check":"integer bias","expected":[4],"passed":false},{"actual":[0],"check":"zero value","expected":[1],"passed":false},{"actual":[0],"check":"negative value","expected":[0],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":[2],"check":"half value","expected":[2],"passed":true},{"actual":[2,4],"check":"multiple","expected":[3,5],"passed":false},{"actual":[2],"check":"halfway scaled value","expected":[2],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"integer bias\", \"actual\": [2], \"expected\": [4], \"passed\": false}, {\"check\": \"zero value\", \"actual\": [0], \"expected\": [1], \"passed\": false}, {\"check\": \"negative value\", \"actual\": [0], \"expected\": [0], \"passed\": true}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"half value\", \"actual\": [2], \"expected\": [2], \"passed\": true}, {\"check\": \"multiple\", \"actual\": [2, 4], \"expected\": [3, 5], \"passed\": false}, {\"check\": \"halfway scaled value\", \"actual\": [2], \"expected\": [2], \"passed\": true}], \"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."}}