{"abstract":"Mantissa carry is reset to zero rather than the hidden one.","category":"Floating-point arithmetic","checks":14,"contract":"Encode finite exactly represented dyadic x into sign/4-bit-exponent/3-bit-fraction toy float with bias 7, gradual underflow, round-to-nearest-even and infinity overflow. Return the unsigned byte. The miniature format is stipulated, not a hardware conformance claim.","evaluation_group":"s3-float-toy8-encode","failed_approach":"The attempted local correction q=15 still violates the explicit regression fixtures.","family":"s3-floating_point_arithmetic-toy8-encode-carry-reset","id":"FA-16021","implementations":{"attempt":{"sha256":"036db6526fdfce19223a287900c43270ac57a0e828ef6c58d60e5305566defd6","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport struct\nN = 1\nobservations = []\ndef solve(x):\n    sign=128 if math.copysign(1.0,x)<0 else 0\n    x=abs(x)\n    if x == 0: return sign\n    if x >= 248: return sign|120\n    if x < 2**-6:\n        q=round(x*512)\n        return sign|q\n    m,e=math.frexp(x)\n    e-=1\n    q=round(m*16)\n    if q == 16:\n        q=15\n        e+=1\n    if e>7: return sign|120\n    exponent=e+7\n    fraction=q-8\n    return sign|(exponent<<3)|fraction\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('zero', solve(0.0), 0)\ncheck('negative zero', solve(-0.0), 128)\ncheck('subnormal', solve(N/512), N)\ncheck('negative subnormal', solve(-N/512), 128|N)\ncheck('underflow tie', solve(1/1024), 0)\ncheck('subnormal carry', solve(15/1024), 8)\ncheck('normal varying', solve(2.0**N), (N+7)<<3)\ncheck('normal fraction', solve((8+N)/8), 56+N)\ncheck('binade carry', solve(1.9375), 64)\ncheck('below midpoint', solve(1.90625), 63)\ncheck('largest finite', solve(240.0), 119)\ncheck('overflow tie', solve(248.0), 120)\ncheck('negative overflow', solve(-256.0), 248)\ncheck('minimum normal', solve(1/64), 8)\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":"4e0ff88fdb388b7549f60792a9ef0e3fa088c9c22dc601f9288e4ed088d1f7c0","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport struct\nN = 1\nobservations = []\ndef solve(x):\n    sign=128 if math.copysign(1.0,x)<0 else 0\n    x=abs(x)\n    if x == 0: return sign\n    if x >= 248: return sign|120\n    if x < 2**-6:\n        q=round(x*512)\n        return sign|q\n    m,e=math.frexp(x)\n    e-=1\n    q=round(m*16)\n    if q == 16:\n        q=0\n        e+=1\n    if e>7: return sign|120\n    exponent=e+7\n    fraction=q-8\n    return sign|(exponent<<3)|fraction\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('zero', solve(0.0), 0)\ncheck('negative zero', solve(-0.0), 128)\ncheck('subnormal', solve(N/512), N)\ncheck('negative subnormal', solve(-N/512), 128|N)\ncheck('underflow tie', solve(1/1024), 0)\ncheck('subnormal carry', solve(15/1024), 8)\ncheck('normal varying', solve(2.0**N), (N+7)<<3)\ncheck('normal fraction', solve((8+N)/8), 56+N)\ncheck('binade carry', solve(1.9375), 64)\ncheck('below midpoint', solve(1.90625), 63)\ncheck('largest finite', solve(240.0), 119)\ncheck('overflow tie', solve(248.0), 120)\ncheck('negative overflow', solve(-256.0), 248)\ncheck('minimum normal', solve(1/64), 8)\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"},"fixed":{"sha256":"a4885c1da227084f5313862887aa4cd62946fb499325336c2d369be5452b6fec","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport struct\nN = 1\nobservations = []\ndef solve(x):\n    sign=128 if math.copysign(1.0,x)<0 else 0\n    x=abs(x)\n    if x == 0: return sign\n    if x >= 248: return sign|120\n    if x < 2**-6:\n        q=round(x*512)\n        return sign|q\n    m,e=math.frexp(x)\n    e-=1\n    q=round(m*16)\n    if q == 16:\n        q=8\n        e+=1\n    if e>7: return sign|120\n    exponent=e+7\n    fraction=q-8\n    return sign|(exponent<<3)|fraction\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('zero', solve(0.0), 0)\ncheck('negative zero', solve(-0.0), 128)\ncheck('subnormal', solve(N/512), N)\ncheck('negative subnormal', solve(-N/512), 128|N)\ncheck('underflow tie', solve(1/1024), 0)\ncheck('subnormal carry', solve(15/1024), 8)\ncheck('normal varying', solve(2.0**N), (N+7)<<3)\ncheck('normal fraction', solve((8+N)/8), 56+N)\ncheck('binade carry', solve(1.9375), 64)\ncheck('below midpoint', solve(1.90625), 63)\ncheck('largest finite', solve(240.0), 119)\ncheck('overflow tie', solve(248.0), 120)\ncheck('negative overflow', solve(-256.0), 248)\ncheck('minimum normal', solve(1/64), 8)\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-toy8-encode-carry-reset","generated_at":"2026-09-29T14:39:32.395677+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.","repair":"Apply the contract at this fault site using q=8.","root_cause":"Mantissa carry is reset to zero rather than the hidden one. The faulty expression is q=0.","sha256":"b8304d29399fe430bc4b4920e8fb553a26c48932b00b42e09288bf16e1bd933d","title":"Mantissa carry is reset to zero rather than the hidden one · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":37.993,"exit_code":1,"observations":[{"actual":0,"check":"zero","expected":0,"passed":true},{"actual":128,"check":"negative zero","expected":128,"passed":true},{"actual":1,"check":"subnormal","expected":1,"passed":true},{"actual":129,"check":"negative subnormal","expected":129,"passed":true},{"actual":0,"check":"underflow tie","expected":0,"passed":true},{"actual":8,"check":"subnormal carry","expected":8,"passed":true},{"actual":64,"check":"normal varying","expected":64,"passed":true},{"actual":57,"check":"normal fraction","expected":57,"passed":true},{"actual":71,"check":"binade carry","expected":64,"passed":false},{"actual":63,"check":"below midpoint","expected":63,"passed":true},{"actual":119,"check":"largest finite","expected":119,"passed":true},{"actual":120,"check":"overflow tie","expected":120,"passed":true},{"actual":248,"check":"negative overflow","expected":248,"passed":true},{"actual":8,"check":"minimum normal","expected":8,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"zero\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"negative zero\", \"actual\": 128, \"expected\": 128, \"passed\": true}, {\"check\": \"subnormal\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"negative subnormal\", \"actual\": 129, \"expected\": 129, \"passed\": true}, {\"check\": \"underflow tie\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"subnormal carry\", \"actual\": 8, \"expected\": 8, \"passed\": true}, {\"check\": \"normal varying\", \"actual\": 64, \"expected\": 64, \"passed\": true}, {\"check\": \"normal fraction\", \"actual\": 57, \"expected\": 57, \"passed\": true}, {\"check\": \"binade carry\", \"actual\": 71, \"expected\": 64, \"passed\": false}, {\"check\": \"below midpoint\", \"actual\": 63, \"expected\": 63, \"passed\": true}, {\"check\": \"largest finite\", \"actual\": 119, \"expected\": 119, \"passed\": true}, {\"check\": \"overflow tie\", \"actual\": 120, \"expected\": 120, \"passed\": true}, {\"check\": \"negative overflow\", \"actual\": 248, \"expected\": 248, \"passed\": true}, {\"check\": \"minimum normal\", \"actual\": 8, \"expected\": 8, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.47,"exit_code":1,"observations":[{"actual":0,"check":"zero","expected":0,"passed":true},{"actual":128,"check":"negative zero","expected":128,"passed":true},{"actual":1,"check":"subnormal","expected":1,"passed":true},{"actual":129,"check":"negative subnormal","expected":129,"passed":true},{"actual":0,"check":"underflow tie","expected":0,"passed":true},{"actual":8,"check":"subnormal carry","expected":8,"passed":true},{"actual":64,"check":"normal varying","expected":64,"passed":true},{"actual":57,"check":"normal fraction","expected":57,"passed":true},{"actual":-8,"check":"binade carry","expected":64,"passed":false},{"actual":63,"check":"below midpoint","expected":63,"passed":true},{"actual":119,"check":"largest finite","expected":119,"passed":true},{"actual":120,"check":"overflow tie","expected":120,"passed":true},{"actual":248,"check":"negative overflow","expected":248,"passed":true},{"actual":8,"check":"minimum normal","expected":8,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"zero\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"negative zero\", \"actual\": 128, \"expected\": 128, \"passed\": true}, {\"check\": \"subnormal\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"negative subnormal\", \"actual\": 129, \"expected\": 129, \"passed\": true}, {\"check\": \"underflow tie\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"subnormal carry\", \"actual\": 8, \"expected\": 8, \"passed\": true}, {\"check\": \"normal varying\", \"actual\": 64, \"expected\": 64, \"passed\": true}, {\"check\": \"normal fraction\", \"actual\": 57, \"expected\": 57, \"passed\": true}, {\"check\": \"binade carry\", \"actual\": -8, \"expected\": 64, \"passed\": false}, {\"check\": \"below midpoint\", \"actual\": 63, \"expected\": 63, \"passed\": true}, {\"check\": \"largest finite\", \"actual\": 119, \"expected\": 119, \"passed\": true}, {\"check\": \"overflow tie\", \"actual\": 120, \"expected\": 120, \"passed\": true}, {\"check\": \"negative overflow\", \"actual\": 248, \"expected\": 248, \"passed\": true}, {\"check\": \"minimum normal\", \"actual\": 8, \"expected\": 8, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.409,"exit_code":0,"observations":[{"actual":0,"check":"zero","expected":0,"passed":true},{"actual":128,"check":"negative zero","expected":128,"passed":true},{"actual":1,"check":"subnormal","expected":1,"passed":true},{"actual":129,"check":"negative subnormal","expected":129,"passed":true},{"actual":0,"check":"underflow tie","expected":0,"passed":true},{"actual":8,"check":"subnormal carry","expected":8,"passed":true},{"actual":64,"check":"normal varying","expected":64,"passed":true},{"actual":57,"check":"normal fraction","expected":57,"passed":true},{"actual":64,"check":"binade carry","expected":64,"passed":true},{"actual":63,"check":"below midpoint","expected":63,"passed":true},{"actual":119,"check":"largest finite","expected":119,"passed":true},{"actual":120,"check":"overflow tie","expected":120,"passed":true},{"actual":248,"check":"negative overflow","expected":248,"passed":true},{"actual":8,"check":"minimum normal","expected":8,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"zero\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"negative zero\", \"actual\": 128, \"expected\": 128, \"passed\": true}, {\"check\": \"subnormal\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"negative subnormal\", \"actual\": 129, \"expected\": 129, \"passed\": true}, {\"check\": \"underflow tie\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"subnormal carry\", \"actual\": 8, \"expected\": 8, \"passed\": true}, {\"check\": \"normal varying\", \"actual\": 64, \"expected\": 64, \"passed\": true}, {\"check\": \"normal fraction\", \"actual\": 57, \"expected\": 57, \"passed\": true}, {\"check\": \"binade carry\", \"actual\": 64, \"expected\": 64, \"passed\": true}, {\"check\": \"below midpoint\", \"actual\": 63, \"expected\": 63, \"passed\": true}, {\"check\": \"largest finite\", \"actual\": 119, \"expected\": 119, \"passed\": true}, {\"check\": \"overflow tie\", \"actual\": 120, \"expected\": 120, \"passed\": true}, {\"check\": \"negative overflow\", \"actual\": 248, \"expected\": 248, \"passed\": true}, {\"check\": \"minimum normal\", \"actual\": 8, \"expected\": 8, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}