{"abstract":"Quantized upper code is excluded.","category":"Model quantization arithmetic","checks":7,"contract":"Map values to integer codes and clamp both ends inclusively to the declared representable range. Inputs follow this explicit integer toy contract; ties use Python round-to-even where rounding is required.","contract_signature":"values, scale, zero, lo, hi","evaluation_group":"quant-saturation","failed_approach":"The attempted code restores the upper endpoint but truncates fractional scaled values instead of rounding to nearest-even.","family":"w3-model-quantization-arithmetic-inclusive-code-range","id":"FA-98676","implementations":{"attempt":{"sha256":"4236e1161ba167cc6fb769abb06d5990e76b53fdbdc0b8f990c1b4cd240b6d72","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(values, scale, zero, lo, hi):\n    return [max(lo,min(hi,int(x/scale)+zero)) for x in values]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('exact upper',solve([5],1,0,-3,5),[5])\ncheck('over upper',solve([100],1,0,-3,5),[5])\ncheck('exact lower',solve([-3],1,0,-3,5),[-3])\ncheck('under lower',solve([-100],1,0,-3,5),[-3])\ncheck('empty',solve([],1,0,-3,5),[])\ncheck('interior',solve([0],1,0,-3,5),[0])\ncheck('halfway rounding inside',solve([3.5],1,0,-3,5),[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":"ed9b8db3354f0056c73add6bf6628081d6b48120ea87d396cc5fb784768ac66a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(values, scale, zero, lo, hi):\n    return [max(lo,min(hi-1,round(x/scale)+zero)) for x in values]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('exact upper',solve([5],1,0,-3,5),[5])\ncheck('over upper',solve([100],1,0,-3,5),[5])\ncheck('exact lower',solve([-3],1,0,-3,5),[-3])\ncheck('under lower',solve([-100],1,0,-3,5),[-3])\ncheck('empty',solve([],1,0,-3,5),[])\ncheck('interior',solve([0],1,0,-3,5),[0])\ncheck('halfway rounding inside',solve([3.5],1,0,-3,5),[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-inclusive-code-range","generated_at":"2026-09-30T16:48:15.403749+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":"Map values to integer codes and clamp both ends inclusively to the declared representable range.","sha256":"6aa2fb7187b00543e0b5d891bd3082e85fc8b0f9de9850be773450b8ddac4ee8","title":"Quantization: Quantized upper code is excluded · case 01","variant":1,"variant_policy":"The same explicitly authored fixtures repeat across all five numbered records; runtime N is unused. These records share one mechanism and must remain together in evaluation splits.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":28.561,"exit_code":1,"observations":[{"actual":[5],"check":"exact upper","expected":[5],"passed":true},{"actual":[5],"check":"over upper","expected":[5],"passed":true},{"actual":[-3],"check":"exact lower","expected":[-3],"passed":true},{"actual":[-3],"check":"under lower","expected":[-3],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":[0],"check":"interior","expected":[0],"passed":true},{"actual":[3],"check":"halfway rounding inside","expected":[4],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"exact upper\", \"actual\": [5], \"expected\": [5], \"passed\": true}, {\"check\": \"over upper\", \"actual\": [5], \"expected\": [5], \"passed\": true}, {\"check\": \"exact lower\", \"actual\": [-3], \"expected\": [-3], \"passed\": true}, {\"check\": \"under lower\", \"actual\": [-3], \"expected\": [-3], \"passed\": true}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"interior\", \"actual\": [0], \"expected\": [0], \"passed\": true}, {\"check\": \"halfway rounding inside\", \"actual\": [3], \"expected\": [4], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":26.023,"exit_code":1,"observations":[{"actual":[4],"check":"exact upper","expected":[5],"passed":false},{"actual":[4],"check":"over upper","expected":[5],"passed":false},{"actual":[-3],"check":"exact lower","expected":[-3],"passed":true},{"actual":[-3],"check":"under lower","expected":[-3],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":[0],"check":"interior","expected":[0],"passed":true},{"actual":[4],"check":"halfway rounding inside","expected":[4],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"exact upper\", \"actual\": [4], \"expected\": [5], \"passed\": false}, {\"check\": \"over upper\", \"actual\": [4], \"expected\": [5], \"passed\": false}, {\"check\": \"exact lower\", \"actual\": [-3], \"expected\": [-3], \"passed\": true}, {\"check\": \"under lower\", \"actual\": [-3], \"expected\": [-3], \"passed\": true}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"interior\", \"actual\": [0], \"expected\": [0], \"passed\": true}, {\"check\": \"halfway rounding inside\", \"actual\": [4], \"expected\": [4], \"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."}}