{"abstract":"Midpoint rounding uses half-up.","category":"Model quantization arithmetic","checks":8,"contract":"Divide values by positive scale and round to nearest integer using ties-to-even. Inputs follow this explicit integer toy contract; ties use Python round-to-even where rounding is required.","contract_signature":"values, scale","evaluation_group":"quant-rounding","failed_approach":"The attempted code handles negative signs symmetrically but rounds every midpoint away from zero instead of to the even integer.","family":"w3-model-quantization-arithmetic-ties-even","id":"FA-98661","implementations":{"attempt":{"sha256":"ee545bf3dc277a980ab1719d1a5d99835f850ad1392dfc94495121f95af41d29","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(values, scale):\n    return [int(abs(x/scale)+0.5)*(1 if x>=0 else -1) for x in values]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('positive midpoint',solve([N+0.5],1),[round(N+0.5)])\ncheck('negative midpoint',solve([-(N+0.5)],1),[round(-(N+0.5))])\ncheck('integer',solve([N],1),[N])\ncheck('empty',solve([],1),[])\ncheck('quarter',solve([N+0.25],1),[N])\ncheck('negative quarter',solve([-(N+0.25)],1),[-N])\ncheck('fixed even midpoint',solve([2.5],1),[2])\ncheck('fixed negative even midpoint',solve([-2.5],1),[-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":"fb5b0e40d6859aebbfee3be75a2456f9055908e82d12360b806d0d7df95e0499","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(values, scale):\n    return [int(x/scale+0.5) for x in values]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('positive midpoint',solve([N+0.5],1),[round(N+0.5)])\ncheck('negative midpoint',solve([-(N+0.5)],1),[round(-(N+0.5))])\ncheck('integer',solve([N],1),[N])\ncheck('empty',solve([],1),[])\ncheck('quarter',solve([N+0.25],1),[N])\ncheck('negative quarter',solve([-(N+0.25)],1),[-N])\ncheck('fixed even midpoint',solve([2.5],1),[2])\ncheck('fixed negative even midpoint',solve([-2.5],1),[-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-ties-even","generated_at":"2026-09-30T16:48:15.404386+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":"Divide values by positive scale and round to nearest integer using ties-to-even.","sha256":"f30442d5c579edd84fcdb0c6b1f02e9158efe5263912c5df9c03020f97574e42","title":"Quantization: Midpoint rounding uses half-up · 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.23,"exit_code":1,"observations":[{"actual":[2],"check":"positive midpoint","expected":[2],"passed":true},{"actual":[-2],"check":"negative midpoint","expected":[-2],"passed":true},{"actual":[1],"check":"integer","expected":[1],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":[1],"check":"quarter","expected":[1],"passed":true},{"actual":[-1],"check":"negative quarter","expected":[-1],"passed":true},{"actual":[3],"check":"fixed even midpoint","expected":[2],"passed":false},{"actual":[-3],"check":"fixed negative even midpoint","expected":[-2],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"positive midpoint\", \"actual\": [2], \"expected\": [2], \"passed\": true}, {\"check\": \"negative midpoint\", \"actual\": [-2], \"expected\": [-2], \"passed\": true}, {\"check\": \"integer\", \"actual\": [1], \"expected\": [1], \"passed\": true}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"quarter\", \"actual\": [1], \"expected\": [1], \"passed\": true}, {\"check\": \"negative quarter\", \"actual\": [-1], \"expected\": [-1], \"passed\": true}, {\"check\": \"fixed even midpoint\", \"actual\": [3], \"expected\": [2], \"passed\": false}, {\"check\": \"fixed negative even midpoint\", \"actual\": [-3], \"expected\": [-2], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":27.46,"exit_code":1,"observations":[{"actual":[2],"check":"positive midpoint","expected":[2],"passed":true},{"actual":[-1],"check":"negative midpoint","expected":[-2],"passed":false},{"actual":[1],"check":"integer","expected":[1],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":[1],"check":"quarter","expected":[1],"passed":true},{"actual":[0],"check":"negative quarter","expected":[-1],"passed":false},{"actual":[3],"check":"fixed even midpoint","expected":[2],"passed":false},{"actual":[-2],"check":"fixed negative even midpoint","expected":[-2],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"positive midpoint\", \"actual\": [2], \"expected\": [2], \"passed\": true}, {\"check\": \"negative midpoint\", \"actual\": [-1], \"expected\": [-2], \"passed\": false}, {\"check\": \"integer\", \"actual\": [1], \"expected\": [1], \"passed\": true}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"quarter\", \"actual\": [1], \"expected\": [1], \"passed\": true}, {\"check\": \"negative quarter\", \"actual\": [0], \"expected\": [-1], \"passed\": false}, {\"check\": \"fixed even midpoint\", \"actual\": [3], \"expected\": [2], \"passed\": false}, {\"check\": \"fixed negative even midpoint\", \"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."}}