{"abstract":"Decimal fused multiply-add forgets its local context.","category":"Floating-point arithmetic","checks":7,"contract":"Decimal fused multiply-add rounds a*b+c once in a fresh precision-limited half-even context. Inputs are decimal strings; return final decimal string and Inexact flag.","contract_signature":"a,b,c,precision","evaluation_group":"s3-float-decimal-fma","failed_approach":"The attempted local correction result=av*bv+cv still violates the explicit regression fixtures.","family":"s3-floating_point_arithmetic-decimal-fma-ambient-fma","id":"FA-16936","implementations":{"attempt":{"sha256":"8336e4f18cfc2fa22a87b21194c65702429232d50e0da86e320959c3aae260e6","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport decimal\nfrom decimal import Decimal, Context, ROUND_HALF_EVEN, ROUND_HALF_UP, ROUND_DOWN\n\nN = 1\nobservations = []\ndef solve(a,b,c,precision):\n    ctx=Context(prec=precision,rounding=ROUND_HALF_EVEN)\n    for signal in ctx.traps: ctx.traps[signal]=False\n    av=Decimal(a); bv=Decimal(b); cv=Decimal(c)\n    result=av*bv+cv\n    return [str(result),ctx.flags[decimal.Inexact]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('cancellation', solve(\"1.23\",\"4.56\",\"-5.61\",3), [\"-0.0012\",False])\ncheck('opposite cancellation', solve(\"-1.23\",\"4.56\",\"5.61\",3), [\"0.0012\",False])\ncheck('tiny addend', solve(\"1\",\"1\",\"0.005\",3), [\"1.00\",True])\ncheck('odd tie', solve(\"1\",\"1\",\"0.015\",3), [\"1.02\",True])\ncheck('variable exact', solve(str(N),\"2\",\"3\",3), [str(2*N+3),False])\ncheck('addend precision', solve(\"1.23456\",\"1\",\"-1.23455\",3), [\"0.00001\",False])\ncheck('operand precision', solve(\"1.23456\",\"1\",\"0\",3), [\"1.23\",True])\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":"37ee72bc0b25c4c748bf8e7d9320184d92865dde2de7770ff4889b4b02c8618c","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport decimal\nfrom decimal import Decimal, Context, ROUND_HALF_EVEN, ROUND_HALF_UP, ROUND_DOWN\n\nN = 1\nobservations = []\ndef solve(a,b,c,precision):\n    ctx=Context(prec=precision,rounding=ROUND_HALF_EVEN)\n    for signal in ctx.traps: ctx.traps[signal]=False\n    av=Decimal(a); bv=Decimal(b); cv=Decimal(c)\n    result=av.fma(bv,cv)\n    return [str(result),ctx.flags[decimal.Inexact]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('cancellation', solve(\"1.23\",\"4.56\",\"-5.61\",3), [\"-0.0012\",False])\ncheck('opposite cancellation', solve(\"-1.23\",\"4.56\",\"5.61\",3), [\"0.0012\",False])\ncheck('tiny addend', solve(\"1\",\"1\",\"0.005\",3), [\"1.00\",True])\ncheck('odd tie', solve(\"1\",\"1\",\"0.015\",3), [\"1.02\",True])\ncheck('variable exact', solve(str(N),\"2\",\"3\",3), [str(2*N+3),False])\ncheck('addend precision', solve(\"1.23456\",\"1\",\"-1.23455\",3), [\"0.00001\",False])\ncheck('operand precision', solve(\"1.23456\",\"1\",\"0\",3), [\"1.23\",True])\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-decimal-fma-ambient-fma","generated_at":"2026-09-29T14:39:41.621633+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":"Decimal fused multiply-add forgets its local context. The faulty expression is result=av.fma(bv,cv).","sha256":"b84aa94b7cc9b4184fd683d030b418ebe16a1b1eb58818b9073344fd91b5a14b","title":"Decimal fused multiply-add forgets its local context · 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":42.47,"exit_code":1,"observations":[{"actual":["-0.0012",false],"check":"cancellation","expected":["-0.0012",false],"passed":true},{"actual":["0.0012",false],"check":"opposite cancellation","expected":["0.0012",false],"passed":true},{"actual":["1.005",false],"check":"tiny addend","expected":["1.00",true],"passed":false},{"actual":["1.015",false],"check":"odd tie","expected":["1.02",true],"passed":false},{"actual":["5",false],"check":"variable exact","expected":["5",false],"passed":true},{"actual":["0.00001",false],"check":"addend precision","expected":["0.00001",false],"passed":true},{"actual":["1.23456",false],"check":"operand precision","expected":["1.23",true],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"cancellation\", \"actual\": [\"-0.0012\", false], \"expected\": [\"-0.0012\", false], \"passed\": true}, {\"check\": \"opposite cancellation\", \"actual\": [\"0.0012\", false], \"expected\": [\"0.0012\", false], \"passed\": true}, {\"check\": \"tiny addend\", \"actual\": [\"1.005\", false], \"expected\": [\"1.00\", true], \"passed\": false}, {\"check\": \"odd tie\", \"actual\": [\"1.015\", false], \"expected\": [\"1.02\", true], \"passed\": false}, {\"check\": \"variable exact\", \"actual\": [\"5\", false], \"expected\": [\"5\", false], \"passed\": true}, {\"check\": \"addend precision\", \"actual\": [\"0.00001\", false], \"expected\": [\"0.00001\", false], \"passed\": true}, {\"check\": \"operand precision\", \"actual\": [\"1.23456\", false], \"expected\": [\"1.23\", true], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.289,"exit_code":1,"observations":[{"actual":["-0.0012",false],"check":"cancellation","expected":["-0.0012",false],"passed":true},{"actual":["0.0012",false],"check":"opposite cancellation","expected":["0.0012",false],"passed":true},{"actual":["1.005",false],"check":"tiny addend","expected":["1.00",true],"passed":false},{"actual":["1.015",false],"check":"odd tie","expected":["1.02",true],"passed":false},{"actual":["5",false],"check":"variable exact","expected":["5",false],"passed":true},{"actual":["0.00001",false],"check":"addend precision","expected":["0.00001",false],"passed":true},{"actual":["1.23456",false],"check":"operand precision","expected":["1.23",true],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"cancellation\", \"actual\": [\"-0.0012\", false], \"expected\": [\"-0.0012\", false], \"passed\": true}, {\"check\": \"opposite cancellation\", \"actual\": [\"0.0012\", false], \"expected\": [\"0.0012\", false], \"passed\": true}, {\"check\": \"tiny addend\", \"actual\": [\"1.005\", false], \"expected\": [\"1.00\", true], \"passed\": false}, {\"check\": \"odd tie\", \"actual\": [\"1.015\", false], \"expected\": [\"1.02\", true], \"passed\": false}, {\"check\": \"variable exact\", \"actual\": [\"5\", false], \"expected\": [\"5\", false], \"passed\": true}, {\"check\": \"addend precision\", \"actual\": [\"0.00001\", false], \"expected\": [\"0.00001\", false], \"passed\": true}, {\"check\": \"operand precision\", \"actual\": [\"1.23456\", false], \"expected\": [\"1.23\", true], \"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."}}