{"abstract":"Mantissa carry does not advance the exponent.","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 e-=1 still violates the explicit regression fixtures.","family":"s3-floating_point_arithmetic-toy8-encode-carry-exponent","id":"FA-16026","implementations":{"attempt":{"sha256":"dfb950bada2569ac18171f746d06c0d2b64a59367eefc78fb04335cfc0afb953","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"},"broken":{"sha256":"0adc9b4ca8326eac852ffe0215f8320c49d899c6294f7b366032a47efaeee6e3","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+=0\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-exponent","generated_at":"2026-09-29T14:39:32.439624+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 e+=1.","root_cause":"Mantissa carry does not advance the exponent. The faulty expression is e+=0.","sha256":"745d28d57e9bb6ebf69cd684c0315b90393b27b5f3856f87063d2cc63267316d","title":"Mantissa carry does not advance the exponent · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.277,"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":48,"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\": 48, \"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.413,"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":56,"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\": 56, \"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":38.337,"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"}