{"abstract":"Tensor scale is selected from the first value.","category":"Model quantization arithmetic","checks":6,"contract":"All values in one tensor share the supplied positive scalar scale; divide and round-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-per_tensor_scale","failed_approach":"The attempted code uses the supplied shared scale but truncates fractional results instead of rounding to nearest-even.","family":"w3-model-quantization-arithmetic-scale-per-tensor","id":"FA-98736","implementations":{"attempt":{"sha256":"5045c2bcfbf3efe586dfbd91e16560ef10a294a220dc40bba37da589bd87e5a3","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(values, scale):\n    return [int(x/scale) for x in values]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('same scale applied',solve([2*N,4*N],2),[N,2*N])\ncheck('empty',solve([],3),[])\ncheck('singleton',solve([6],3),[2])\ncheck('different magnitudes',solve([3,9],3),[1,3])\ncheck('negative',solve([-6,3],3),[-2,1])\ncheck('fraction rounding',solve([3,5],2),[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":"d1a73868d24316d22f45a779189f6c4ca87c313b47b16dbb08e036563a179961","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(values, scale):\n    return [round(x/values[0]) for x in values] if values else []\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('same scale applied',solve([2*N,4*N],2),[N,2*N])\ncheck('empty',solve([],3),[])\ncheck('singleton',solve([6],3),[2])\ncheck('different magnitudes',solve([3,9],3),[1,3])\ncheck('negative',solve([-6,3],3),[-2,1])\ncheck('fraction rounding',solve([3,5],2),[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-scale-per-tensor","generated_at":"2026-09-30T16:48:16.277514+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":"All values in one tensor share the supplied positive scalar scale; divide and round-to-even.","sha256":"b51de4a3bee545504d2d3c2c01c2722d31ac16f9e730069a20612eab227ef5a6","title":"Quantization: Tensor scale is selected from the first value · 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":25.222,"exit_code":1,"observations":[{"actual":[1,2],"check":"same scale applied","expected":[1,2],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":[2],"check":"singleton","expected":[2],"passed":true},{"actual":[1,3],"check":"different magnitudes","expected":[1,3],"passed":true},{"actual":[-2,1],"check":"negative","expected":[-2,1],"passed":true},{"actual":[1,2],"check":"fraction rounding","expected":[2,2],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"same scale applied\", \"actual\": [1, 2], \"expected\": [1, 2], \"passed\": true}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"singleton\", \"actual\": [2], \"expected\": [2], \"passed\": true}, {\"check\": \"different magnitudes\", \"actual\": [1, 3], \"expected\": [1, 3], \"passed\": true}, {\"check\": \"negative\", \"actual\": [-2, 1], \"expected\": [-2, 1], \"passed\": true}, {\"check\": \"fraction rounding\", \"actual\": [1, 2], \"expected\": [2, 2], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":26.292,"exit_code":1,"observations":[{"actual":[1,2],"check":"same scale applied","expected":[1,2],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":[1],"check":"singleton","expected":[2],"passed":false},{"actual":[1,3],"check":"different magnitudes","expected":[1,3],"passed":true},{"actual":[1,0],"check":"negative","expected":[-2,1],"passed":false},{"actual":[1,2],"check":"fraction rounding","expected":[2,2],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"same scale applied\", \"actual\": [1, 2], \"expected\": [1, 2], \"passed\": true}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"singleton\", \"actual\": [1], \"expected\": [2], \"passed\": false}, {\"check\": \"different magnitudes\", \"actual\": [1, 3], \"expected\": [1, 3], \"passed\": true}, {\"check\": \"negative\", \"actual\": [1, 0], \"expected\": [-2, 1], \"passed\": false}, {\"check\": \"fraction rounding\", \"actual\": [1, 2], \"expected\": [2, 2], \"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."}}