{"abstract":"A 10% move against a 1000 bps band is rejected by a few ulps.","category":"Currency rounding and FX conversion","checks":7,"contract":"solve(new, ref, tol_bps, inverted): accept a newly published rate if |n - ref| / ref * 10000 <= tol_bps using exact decimals, where n = new, or 1/new when the new quote arrives inverted. A non-positive new or ref returns 'ERR:rate'. Return 'accept' or 'reject'.","evaluation_group":"w2-currency_rounding_and_fx_conversion-rate-tolerance-band","failed_approach":"Using float arithmetic with a strict comparison rejects every exact boundary.","family":"w2-currency_rounding_and_fx_conversion-rate-tolerance-band-band-boundary","id":"FA-62221","implementations":{"attempt":{"sha256":"c42160cbac758f39f175c5b84d8fc7080a27351809ac038a6ba7e3e24dc6de6d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom decimal import Decimal, ROUND_HALF_EVEN, ROUND_HALF_UP, ROUND_FLOOR, ROUND_CEILING, ROUND_DOWN, ROUND_UP, ROUND_HALF_DOWN\nN = 1\nobservations = []\ndef solve(new, ref, tol_bps, inverted):\n    n, r = Decimal(new), Decimal(ref)\n    if r <= 0 or n <= 0: return 'ERR:rate'\n    if inverted: n = 1 / n\n    dev = abs(n - r) / r\n    return 'accept' if dev * 10000 < tol_bps else 'reject'\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression band-boundary 1', ('1.1', '1.0', 1000, False), 'accept'),\n  ('regression band-boundary 2', ('1.9529160', '1.9432', 50, False), 'accept'),\n  ('partial repair guard 2', ('1.0835', '1.0835', 0, False), 'accept'),\n  ('control: lower boundary', ('0.9', '1.0', 1000, False), 'accept'),\n  ('control: drop too far', ('0.8', '1.0', 1000, False), 'reject'),\n  ('control: inverted exact', ('0.5', '2.0', 0, True), 'accept'),\n  ('control: bad ref', ('1.2', '0', 5, False), 'ERR:rate')],\n [('regression band-boundary 1', ('2.015556', '1.9956', 100, False), 'accept'),\n  ('regression band-boundary 2', ('1.19829675', '1.2013', 25, False), 'accept'),\n  ('partial repair guard 1', ('0.9', '1.0', 1000, False), 'accept'),\n  ('partial repair guard 2', ('0.5', '2.0', 0, True), 'accept'),\n  ('control: bad ref', ('1.2', '0', 5, False), 'ERR:rate'),\n  ('control: small move', ('1.08351', '1.0835', 1, False), 'accept'),\n  ('control: rise too far', ('1.2', '1.0', 1000, False), 'reject'),\n  ('control: inverted far', ('0.9', '1.0', 50, True), 'reject')],\n [('regression band-boundary 1', ('0.61172550', '0.6102', 25, False), 'accept'),\n  ('regression band-boundary 2', ('0.94611', '0.8601', 1000, False), 'accept'),\n  ('partial repair guard 1', ('1.9529160', '1.9432', 50, False), 'accept'),\n  ('partial repair guard 2', ('2.015556', '1.9956', 100, False), 'accept'),\n  ('control: rise too far', ('1.2', '1.0', 1000, False), 'reject'),\n  ('control: inverted far', ('0.9', '1.0', 50, True), 'reject'),\n  ('control: upper boundary', ('1.1', '1.0', 1000, False), 'accept'),\n  ('control: lower boundary', ('0.9', '1.0', 1000, False), 'accept')],\n [('regression band-boundary 1', ('1.8098883', '1.8117', 10, False), 'accept'),\n  ('regression band-boundary 2', ('1.29844', '1.1804', 1000, False), 'accept'),\n  ('partial repair guard 1', ('1.610829', '1.6271', 100, False), 'accept'),\n  ('partial repair guard 2', ('1.19829675', '1.2013', 25, False), 'accept'),\n  ('control: lower boundary', ('0.9', '1.0', 1000, False), 'accept'),\n  ('control: drop too far', ('0.8', '1.0', 1000, False), 'reject'),\n  ('control: inverted exact', ('0.5', '2.0', 0, True), 'accept'),\n  ('control: bad ref', ('1.2', '0', 5, False), 'ERR:rate')],\n [('regression band-boundary 1', ('1.886276', '1.8676', 100, False), 'accept'),\n  ('regression band-boundary 2', ('1.68751', '1.5341', 1000, False), 'accept'),\n  ('partial repair guard 1', ('0.61172550', '0.6102', 25, False), 'accept'),\n  ('partial repair guard 2', ('0.94611', '0.8601', 1000, False), 'accept'),\n  ('control: bad ref', ('1.2', '0', 5, False), 'ERR:rate'),\n  ('control: small move', ('1.08351', '1.0835', 1, False), 'accept'),\n  ('control: rise too far', ('1.2', '1.0', 1000, False), 'reject'),\n  ('control: inverted far', ('0.9', '1.0', 50, True), 'reject')]]\nfor label, args, expected in cases[N - 1]:\n    check(label, solve(*args), expected)\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":"0e7d97ff480543a26194beac65aaaaf4d392f7d6f85d83cf3ae5a66f6583863d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom decimal import Decimal, ROUND_HALF_EVEN, ROUND_HALF_UP, ROUND_FLOOR, ROUND_CEILING, ROUND_DOWN, ROUND_UP, ROUND_HALF_DOWN\nN = 1\nobservations = []\ndef solve(new, ref, tol_bps, inverted):\n    n, r = Decimal(new), Decimal(ref)\n    if r <= 0 or n <= 0: return 'ERR:rate'\n    if inverted: n = 1 / n\n    dev = abs(float(n) - float(r)) / float(r)\n    return 'accept' if dev * 10000 <= tol_bps else 'reject'\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression band-boundary 1', ('1.1', '1.0', 1000, False), 'accept'),\n  ('regression band-boundary 2', ('1.9529160', '1.9432', 50, False), 'accept'),\n  ('partial repair guard 2', ('1.0835', '1.0835', 0, False), 'accept'),\n  ('control: lower boundary', ('0.9', '1.0', 1000, False), 'accept'),\n  ('control: drop too far', ('0.8', '1.0', 1000, False), 'reject'),\n  ('control: inverted exact', ('0.5', '2.0', 0, True), 'accept'),\n  ('control: bad ref', ('1.2', '0', 5, False), 'ERR:rate')],\n [('regression band-boundary 1', ('2.015556', '1.9956', 100, False), 'accept'),\n  ('regression band-boundary 2', ('1.19829675', '1.2013', 25, False), 'accept'),\n  ('partial repair guard 1', ('0.9', '1.0', 1000, False), 'accept'),\n  ('partial repair guard 2', ('0.5', '2.0', 0, True), 'accept'),\n  ('control: bad ref', ('1.2', '0', 5, False), 'ERR:rate'),\n  ('control: small move', ('1.08351', '1.0835', 1, False), 'accept'),\n  ('control: rise too far', ('1.2', '1.0', 1000, False), 'reject'),\n  ('control: inverted far', ('0.9', '1.0', 50, True), 'reject')],\n [('regression band-boundary 1', ('0.61172550', '0.6102', 25, False), 'accept'),\n  ('regression band-boundary 2', ('0.94611', '0.8601', 1000, False), 'accept'),\n  ('partial repair guard 1', ('1.9529160', '1.9432', 50, False), 'accept'),\n  ('partial repair guard 2', ('2.015556', '1.9956', 100, False), 'accept'),\n  ('control: rise too far', ('1.2', '1.0', 1000, False), 'reject'),\n  ('control: inverted far', ('0.9', '1.0', 50, True), 'reject'),\n  ('control: upper boundary', ('1.1', '1.0', 1000, False), 'accept'),\n  ('control: lower boundary', ('0.9', '1.0', 1000, False), 'accept')],\n [('regression band-boundary 1', ('1.8098883', '1.8117', 10, False), 'accept'),\n  ('regression band-boundary 2', ('1.29844', '1.1804', 1000, False), 'accept'),\n  ('partial repair guard 1', ('1.610829', '1.6271', 100, False), 'accept'),\n  ('partial repair guard 2', ('1.19829675', '1.2013', 25, False), 'accept'),\n  ('control: lower boundary', ('0.9', '1.0', 1000, False), 'accept'),\n  ('control: drop too far', ('0.8', '1.0', 1000, False), 'reject'),\n  ('control: inverted exact', ('0.5', '2.0', 0, True), 'accept'),\n  ('control: bad ref', ('1.2', '0', 5, False), 'ERR:rate')],\n [('regression band-boundary 1', ('1.886276', '1.8676', 100, False), 'accept'),\n  ('regression band-boundary 2', ('1.68751', '1.5341', 1000, False), 'accept'),\n  ('partial repair guard 1', ('0.61172550', '0.6102', 25, False), 'accept'),\n  ('partial repair guard 2', ('0.94611', '0.8601', 1000, False), 'accept'),\n  ('control: bad ref', ('1.2', '0', 5, False), 'ERR:rate'),\n  ('control: small move', ('1.08351', '1.0835', 1, False), 'accept'),\n  ('control: rise too far', ('1.2', '1.0', 1000, False), 'reject'),\n  ('control: inverted far', ('0.9', '1.0', 50, True), 'reject')]]\nfor label, args, expected in cases[N - 1]:\n    check(label, solve(*args), expected)\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":"786527074e57835e40832c056218e73f14017e906c01f05070fe12ae37ea8f62","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom decimal import Decimal, ROUND_HALF_EVEN, ROUND_HALF_UP, ROUND_FLOOR, ROUND_CEILING, ROUND_DOWN, ROUND_UP, ROUND_HALF_DOWN\nN = 1\nobservations = []\ndef solve(new, ref, tol_bps, inverted):\n    n, r = Decimal(new), Decimal(ref)\n    if r <= 0 or n <= 0: return 'ERR:rate'\n    if inverted: n = 1 / n\n    dev = abs(n - r) / r\n    return 'accept' if dev * 10000 <= tol_bps else 'reject'\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression band-boundary 1', ('1.1', '1.0', 1000, False), 'accept'),\n  ('regression band-boundary 2', ('1.9529160', '1.9432', 50, False), 'accept'),\n  ('partial repair guard 2', ('1.0835', '1.0835', 0, False), 'accept'),\n  ('control: lower boundary', ('0.9', '1.0', 1000, False), 'accept'),\n  ('control: drop too far', ('0.8', '1.0', 1000, False), 'reject'),\n  ('control: inverted exact', ('0.5', '2.0', 0, True), 'accept'),\n  ('control: bad ref', ('1.2', '0', 5, False), 'ERR:rate')],\n [('regression band-boundary 1', ('2.015556', '1.9956', 100, False), 'accept'),\n  ('regression band-boundary 2', ('1.19829675', '1.2013', 25, False), 'accept'),\n  ('partial repair guard 1', ('0.9', '1.0', 1000, False), 'accept'),\n  ('partial repair guard 2', ('0.5', '2.0', 0, True), 'accept'),\n  ('control: bad ref', ('1.2', '0', 5, False), 'ERR:rate'),\n  ('control: small move', ('1.08351', '1.0835', 1, False), 'accept'),\n  ('control: rise too far', ('1.2', '1.0', 1000, False), 'reject'),\n  ('control: inverted far', ('0.9', '1.0', 50, True), 'reject')],\n [('regression band-boundary 1', ('0.61172550', '0.6102', 25, False), 'accept'),\n  ('regression band-boundary 2', ('0.94611', '0.8601', 1000, False), 'accept'),\n  ('partial repair guard 1', ('1.9529160', '1.9432', 50, False), 'accept'),\n  ('partial repair guard 2', ('2.015556', '1.9956', 100, False), 'accept'),\n  ('control: rise too far', ('1.2', '1.0', 1000, False), 'reject'),\n  ('control: inverted far', ('0.9', '1.0', 50, True), 'reject'),\n  ('control: upper boundary', ('1.1', '1.0', 1000, False), 'accept'),\n  ('control: lower boundary', ('0.9', '1.0', 1000, False), 'accept')],\n [('regression band-boundary 1', ('1.8098883', '1.8117', 10, False), 'accept'),\n  ('regression band-boundary 2', ('1.29844', '1.1804', 1000, False), 'accept'),\n  ('partial repair guard 1', ('1.610829', '1.6271', 100, False), 'accept'),\n  ('partial repair guard 2', ('1.19829675', '1.2013', 25, False), 'accept'),\n  ('control: lower boundary', ('0.9', '1.0', 1000, False), 'accept'),\n  ('control: drop too far', ('0.8', '1.0', 1000, False), 'reject'),\n  ('control: inverted exact', ('0.5', '2.0', 0, True), 'accept'),\n  ('control: bad ref', ('1.2', '0', 5, False), 'ERR:rate')],\n [('regression band-boundary 1', ('1.886276', '1.8676', 100, False), 'accept'),\n  ('regression band-boundary 2', ('1.68751', '1.5341', 1000, False), 'accept'),\n  ('partial repair guard 1', ('0.61172550', '0.6102', 25, False), 'accept'),\n  ('partial repair guard 2', ('0.94611', '0.8601', 1000, False), 'accept'),\n  ('control: bad ref', ('1.2', '0', 5, False), 'ERR:rate'),\n  ('control: small move', ('1.08351', '1.0835', 1, False), 'accept'),\n  ('control: rise too far', ('1.2', '1.0', 1000, False), 'reject'),\n  ('control: inverted far', ('0.9', '1.0', 50, True), 'reject')]]\nfor label, args, expected in cases[N - 1]:\n    check(label, solve(*args), expected)\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":"A deterministic, bounded teaching model with a stipulated toy contract; it makes no claim of conformance to any real regulation, standard, or institution's rules. 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":"w2-currency_rounding_and_fx_conversion-rate-tolerance-band-band-boundary","generated_at":"2026-09-29T14:47:02.628613+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Currency amounts must be rounded at the right stage and in the right unit, or ledgers, quotes and settlements drift by minor units.","repair":"Compute the deviation with exact decimals and compare inclusively.","root_cause":"The deviation is computed with float division, so an exact boundary lands just above the limit.","sha256":"f64c51c0dbd2baf3bff7bab3a5daf16c3ead33a10594b2fc30ad6675ac2e4ee1","title":"A move exactly at the tolerance is computed in floating point · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.794,"exit_code":1,"observations":[{"actual":"reject","check":"regression band-boundary 1","expected":"accept","passed":false},{"actual":"reject","check":"regression band-boundary 2","expected":"accept","passed":false},{"actual":"reject","check":"partial repair guard 2","expected":"accept","passed":false},{"actual":"reject","check":"control: lower boundary","expected":"accept","passed":false},{"actual":"reject","check":"control: drop too far","expected":"reject","passed":true},{"actual":"reject","check":"control: inverted exact","expected":"accept","passed":false},{"actual":"ERR:rate","check":"control: bad ref","expected":"ERR:rate","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression band-boundary 1\", \"actual\": \"reject\", \"expected\": \"accept\", \"passed\": false}, {\"check\": \"regression band-boundary 2\", \"actual\": \"reject\", \"expected\": \"accept\", \"passed\": false}, {\"check\": \"partial repair guard 2\", \"actual\": \"reject\", \"expected\": \"accept\", \"passed\": false}, {\"check\": \"control: lower boundary\", \"actual\": \"reject\", \"expected\": \"accept\", \"passed\": false}, {\"check\": \"control: drop too far\", \"actual\": \"reject\", \"expected\": \"reject\", \"passed\": true}, {\"check\": \"control: inverted exact\", \"actual\": \"reject\", \"expected\": \"accept\", \"passed\": false}, {\"check\": \"control: bad ref\", \"actual\": \"ERR:rate\", \"expected\": \"ERR:rate\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.874,"exit_code":1,"observations":[{"actual":"reject","check":"regression band-boundary 1","expected":"accept","passed":false},{"actual":"reject","check":"regression band-boundary 2","expected":"accept","passed":false},{"actual":"accept","check":"partial repair guard 2","expected":"accept","passed":true},{"actual":"accept","check":"control: lower boundary","expected":"accept","passed":true},{"actual":"reject","check":"control: drop too far","expected":"reject","passed":true},{"actual":"accept","check":"control: inverted exact","expected":"accept","passed":true},{"actual":"ERR:rate","check":"control: bad ref","expected":"ERR:rate","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression band-boundary 1\", \"actual\": \"reject\", \"expected\": \"accept\", \"passed\": false}, {\"check\": \"regression band-boundary 2\", \"actual\": \"reject\", \"expected\": \"accept\", \"passed\": false}, {\"check\": \"partial repair guard 2\", \"actual\": \"accept\", \"expected\": \"accept\", \"passed\": true}, {\"check\": \"control: lower boundary\", \"actual\": \"accept\", \"expected\": \"accept\", \"passed\": true}, {\"check\": \"control: drop too far\", \"actual\": \"reject\", \"expected\": \"reject\", \"passed\": true}, {\"check\": \"control: inverted exact\", \"actual\": \"accept\", \"expected\": \"accept\", \"passed\": true}, {\"check\": \"control: bad ref\", \"actual\": \"ERR:rate\", \"expected\": \"ERR:rate\", \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":43.523,"exit_code":0,"observations":[{"actual":"accept","check":"regression band-boundary 1","expected":"accept","passed":true},{"actual":"accept","check":"regression band-boundary 2","expected":"accept","passed":true},{"actual":"accept","check":"partial repair guard 2","expected":"accept","passed":true},{"actual":"accept","check":"control: lower boundary","expected":"accept","passed":true},{"actual":"reject","check":"control: drop too far","expected":"reject","passed":true},{"actual":"accept","check":"control: inverted exact","expected":"accept","passed":true},{"actual":"ERR:rate","check":"control: bad ref","expected":"ERR:rate","passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression band-boundary 1\", \"actual\": \"accept\", \"expected\": \"accept\", \"passed\": true}, {\"check\": \"regression band-boundary 2\", \"actual\": \"accept\", \"expected\": \"accept\", \"passed\": true}, {\"check\": \"partial repair guard 2\", \"actual\": \"accept\", \"expected\": \"accept\", \"passed\": true}, {\"check\": \"control: lower boundary\", \"actual\": \"accept\", \"expected\": \"accept\", \"passed\": true}, {\"check\": \"control: drop too far\", \"actual\": \"reject\", \"expected\": \"reject\", \"passed\": true}, {\"check\": \"control: inverted exact\", \"actual\": \"accept\", \"expected\": \"accept\", \"passed\": true}, {\"check\": \"control: bad ref\", \"actual\": \"ERR:rate\", \"expected\": \"ERR:rate\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}