{"abstract":"ULP distance returns signed separation.","category":"Floating-point arithmetic","checks":9,"contract":"Distance between finite binary64 values in representable steps, treating the two zeros as a single position; NaN or infinity yields null. Negative and positive subnormals are adjacent through zero.","contract_signature":"a,b","evaluation_group":"s3-float-ulp-distance","failed_approach":"The attempted local correction return b_index-a_index still violates the explicit regression fixtures.","family":"s3-floating_point_arithmetic-ulp-distance-distance-direction","id":"FA-16101","implementations":{"attempt":{"sha256":"8e82646b9c02c4ca45c5ad6ade7f2b2f43d0b098ed42ed2eda7260425956bbef","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport struct\nN = 1\nobservations = []\ndef solve(a,b):\n    if not math.isfinite(a) or not math.isfinite(b): return None\n    ab=int.from_bytes(struct.pack('>d',a),'big')\n    bb=int.from_bytes(struct.pack('>d',b),'big')\n    a_index=-(ab&((1<<63)-1)) if ab>>63 else ab\n    b_index=-(bb&((1<<63)-1)) if bb>>63 else bb\n    return b_index-a_index\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('same', solve(float(N),float(N)), 0)\ncheck('zero signs', solve(-0.0,0.0), 0)\ncheck('negative adjacent', solve(-float(N),math.nextafter(-float(N),-math.inf)), 1)\ncheck('positive adjacent', solve(float(N),math.nextafter(float(N),math.inf)), 1)\ncheck('cross zero', solve(-math.ldexp(float(N),-1074),math.ldexp(float(N),-1074)), 2*N)\ncheck('reverse cross', solve(math.ldexp(float(N),-1074),-math.ldexp(float(N),-1074)), 2*N)\ncheck('nan left', solve(float(\"nan\"),1.0), None)\ncheck('nan right', solve(1.0,float(\"nan\")), None)\ncheck('infinity', solve(math.inf,math.inf), None)\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":"299bc14863554e22136767f2c98d4daeca783a91b2959b0d38a6055d37117bc3","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport struct\nN = 1\nobservations = []\ndef solve(a,b):\n    if not math.isfinite(a) or not math.isfinite(b): return None\n    ab=int.from_bytes(struct.pack('>d',a),'big')\n    bb=int.from_bytes(struct.pack('>d',b),'big')\n    a_index=-(ab&((1<<63)-1)) if ab>>63 else ab\n    b_index=-(bb&((1<<63)-1)) if bb>>63 else bb\n    return a_index-b_index\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('same', solve(float(N),float(N)), 0)\ncheck('zero signs', solve(-0.0,0.0), 0)\ncheck('negative adjacent', solve(-float(N),math.nextafter(-float(N),-math.inf)), 1)\ncheck('positive adjacent', solve(float(N),math.nextafter(float(N),math.inf)), 1)\ncheck('cross zero', solve(-math.ldexp(float(N),-1074),math.ldexp(float(N),-1074)), 2*N)\ncheck('reverse cross', solve(math.ldexp(float(N),-1074),-math.ldexp(float(N),-1074)), 2*N)\ncheck('nan left', solve(float(\"nan\"),1.0), None)\ncheck('nan right', solve(1.0,float(\"nan\")), None)\ncheck('infinity', solve(math.inf,math.inf), None)\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":"Controlled binary64 or explicitly stipulated miniature format; no hardware exception flags or platform floating environment are modeled. 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":"s3-floating_point_arithmetic-ulp-distance-distance-direction","generated_at":"2026-09-29T14:39:33.258410+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"An offline floating representation model isolates a reproducible arithmetic fault.","root_cause":"ULP distance returns signed separation. The faulty expression is return a_index-b_index.","sha256":"3bdd1c9694185987d85b09d89c1a623ae578d0c0d585e1649eb3204e9eec6ab2","title":"ULP distance returns signed separation · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":41.35,"exit_code":1,"observations":[{"actual":0,"check":"same","expected":0,"passed":true},{"actual":0,"check":"zero signs","expected":0,"passed":true},{"actual":-1,"check":"negative adjacent","expected":1,"passed":false},{"actual":1,"check":"positive adjacent","expected":1,"passed":true},{"actual":2,"check":"cross zero","expected":2,"passed":true},{"actual":-2,"check":"reverse cross","expected":2,"passed":false},{"actual":null,"check":"nan left","expected":null,"passed":true},{"actual":null,"check":"nan right","expected":null,"passed":true},{"actual":null,"check":"infinity","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"same\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"zero signs\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"negative adjacent\", \"actual\": -1, \"expected\": 1, \"passed\": false}, {\"check\": \"positive adjacent\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"cross zero\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"reverse cross\", \"actual\": -2, \"expected\": 2, \"passed\": false}, {\"check\": \"nan left\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"nan right\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"infinity\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.388,"exit_code":1,"observations":[{"actual":0,"check":"same","expected":0,"passed":true},{"actual":0,"check":"zero signs","expected":0,"passed":true},{"actual":1,"check":"negative adjacent","expected":1,"passed":true},{"actual":-1,"check":"positive adjacent","expected":1,"passed":false},{"actual":-2,"check":"cross zero","expected":2,"passed":false},{"actual":2,"check":"reverse cross","expected":2,"passed":true},{"actual":null,"check":"nan left","expected":null,"passed":true},{"actual":null,"check":"nan right","expected":null,"passed":true},{"actual":null,"check":"infinity","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"same\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"zero signs\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"negative adjacent\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"positive adjacent\", \"actual\": -1, \"expected\": 1, \"passed\": false}, {\"check\": \"cross zero\", \"actual\": -2, \"expected\": 2, \"passed\": false}, {\"check\": \"reverse cross\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"nan left\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"nan right\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"infinity\", \"actual\": null, \"expected\": null, \"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."}}