{"abstract":"Marks converted to euros are reported with three decimals.","category":"Currency rounding and FX conversion","checks":6,"contract":"solve(amount, frm, to): stipulated legacy-currency triangulation. Fixed rates are units per 1 EUR (DEM 1.95583, FRF 6.55957, ITL 1936.27, ESP 166.386, IEP 0.787564, NLG 2.20371, BEF 40.3399, PTE 200.482, ATS 13.7603, FIM 5.94573). Exponents: ITL, ESP, BEF, PTE 0; others and EUR 2. Legacy to legacy: divide by the source rate, round the EUR intermediate half-up to 3 decimals, multiply by the target rate, round half-up to the target exponent. Legacy to EUR: divide and round half-up to 2 decimals. EUR to legacy: multiply and round half-up to the target exponent. Same currency: round the amount half-up to its exponent. Inverse rates are never used. Unknown codes return 'ERR:currency'.","contract_signature":"amount, frm, to","evaluation_group":"w2-currency_rounding_and_fx_conversion-legacy-euro-triangulation","failed_approach":"Rounding the three-decimal intermediate again to cents double-rounds values like x.xx45.","family":"w2-currency_rounding_and_fx_conversion-legacy-euro-triangulation-euro-target-rounding","id":"FA-61936","implementations":{"attempt":{"sha256":"30fd11f9d651cf659c0df1dfd2ec1e1bf4629c9332db799c9c0f27ea0e49377e","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(amount, frm, to):\n    rates = {'DEM': '1.95583', 'FRF': '6.55957', 'ITL': '1936.27', 'ESP': '166.386', 'IEP': '0.787564', 'NLG': '2.20371', 'BEF': '40.3399', 'PTE': '200.482', 'ATS': '13.7603', 'FIM': '5.94573', 'EUR': '1'}\n    zero = ('ITL', 'ESP', 'BEF', 'PTE')\n    if frm not in rates or to not in rates: return 'ERR:currency'\n    def q(v, c):\n        return v.quantize(Decimal(1) if c in zero else Decimal('0.01'), rounding=ROUND_HALF_UP)\n    x = Decimal(amount)\n    if frm == to: return format(q(x, to), 'f')\n    if frm == 'EUR':\n        eur = x\n    elif to == 'EUR':\n        return format(q((x / Decimal(rates[frm])).quantize(Decimal('0.001'), rounding=ROUND_HALF_UP), 'EUR'), 'f')\n    else:\n        eur = (x / Decimal(rates[frm])).quantize(Decimal('0.001'), rounding=ROUND_HALF_UP)\n    return format(q(eur * Decimal(rates[to]), to), 'f')\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression euro-target-rounding 1', ('0.85', 'DEM', 'EUR'), '0.43'),\n  ('regression euro-target-rounding 2', ('2.18', 'DEM', 'EUR'), '1.11'),\n  ('control: mark to franc', ('100', 'DEM', 'FRF'), '335.38'),\n  ('control: lira to euro', ('1000000', 'ITL', 'EUR'), '516.46'),\n  ('control: euro to lira', ('10', 'EUR', 'ITL'), '19363'),\n  ('control: same currency rounding', ('100.5', 'ITL', 'ITL'), '101')],\n [('regression euro-target-rounding 1', ('5.54', 'FRF', 'EUR'), '0.84'),\n  ('regression euro-target-rounding 2', ('106', 'ITL', 'EUR'), '0.05'),\n  ('control: same currency rounding', ('100.5', 'ITL', 'ITL'), '101'),\n  ('control: unknown', ('5', 'XEU', 'DEM'), 'ERR:currency'),\n  ('control: peseta to punt', ('123456', 'ESP', 'IEP'), '584.36'),\n  ('control: guilder to escudo', ('0.01', 'NLG', 'PTE'), '1')],\n [('regression euro-target-rounding 1', ('1.20', 'NLG', 'EUR'), '0.54'),\n  ('regression euro-target-rounding 2', ('1000000', 'ITL', 'EUR'), '516.46'),\n  ('partial repair guard 2', ('0.85', 'DEM', 'EUR'), '0.43'),\n  ('control: guilder to escudo', ('0.01', 'NLG', 'PTE'), '1'),\n  ('control: schilling to markka', ('987.65', 'ATS', 'FIM'), '426.75'),\n  ('control: franc to franc', ('12.345', 'BEF', 'FRF'), '2.01'),\n  ('control: mark to franc', ('100', 'DEM', 'FRF'), '335.38')],\n [('regression euro-target-rounding 1', ('2838484', 'ESP', 'EUR'), '17059.63'),\n  ('regression euro-target-rounding 2', ('4062865.64', 'FRF', 'EUR'), '619379.87'),\n  ('partial repair guard 1', ('2.18', 'DEM', 'EUR'), '1.11'),\n  ('partial repair guard 2', ('5.54', 'FRF', 'EUR'), '0.84'),\n  ('control: mark to franc', ('100', 'DEM', 'FRF'), '335.38'),\n  ('control: lira to euro', ('1000000', 'ITL', 'EUR'), '516.46'),\n  ('control: euro to lira', ('10', 'EUR', 'ITL'), '19363'),\n  ('control: same currency rounding', ('100.5', 'ITL', 'ITL'), '101')],\n [('regression euro-target-rounding 1', ('4466382', 'FRF', 'EUR'), '680895.55'),\n  ('regression euro-target-rounding 2', ('3694885', 'IEP', 'EUR'), '4691536.18'),\n  ('partial repair guard 1', ('106', 'ITL', 'EUR'), '0.05'), ('partial repair guard 2', ('1.20', 'NLG', 'EUR'), '0.54'),\n  ('control: same currency rounding', ('100.5', 'ITL', 'ITL'), '101'),\n  ('control: unknown', ('5', 'XEU', 'DEM'), 'ERR:currency'),\n  ('control: peseta to punt', ('123456', 'ESP', 'IEP'), '584.36'),\n  ('control: guilder to escudo', ('0.01', 'NLG', 'PTE'), '1')]]\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":"ab1806dddecd653cdd502f334eab861cfe956674c062ab7078a1155f645cb59a","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(amount, frm, to):\n    rates = {'DEM': '1.95583', 'FRF': '6.55957', 'ITL': '1936.27', 'ESP': '166.386', 'IEP': '0.787564', 'NLG': '2.20371', 'BEF': '40.3399', 'PTE': '200.482', 'ATS': '13.7603', 'FIM': '5.94573', 'EUR': '1'}\n    zero = ('ITL', 'ESP', 'BEF', 'PTE')\n    if frm not in rates or to not in rates: return 'ERR:currency'\n    def q(v, c):\n        return v.quantize(Decimal(1) if c in zero else Decimal('0.01'), rounding=ROUND_HALF_UP)\n    x = Decimal(amount)\n    if frm == to: return format(q(x, to), 'f')\n    if frm == 'EUR':\n        eur = x\n    elif to == 'EUR':\n        return format((x / Decimal(rates[frm])).quantize(Decimal('0.001'), rounding=ROUND_HALF_UP), 'f')\n    else:\n        eur = (x / Decimal(rates[frm])).quantize(Decimal('0.001'), rounding=ROUND_HALF_UP)\n    return format(q(eur * Decimal(rates[to]), to), 'f')\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression euro-target-rounding 1', ('0.85', 'DEM', 'EUR'), '0.43'),\n  ('regression euro-target-rounding 2', ('2.18', 'DEM', 'EUR'), '1.11'),\n  ('control: mark to franc', ('100', 'DEM', 'FRF'), '335.38'),\n  ('control: lira to euro', ('1000000', 'ITL', 'EUR'), '516.46'),\n  ('control: euro to lira', ('10', 'EUR', 'ITL'), '19363'),\n  ('control: same currency rounding', ('100.5', 'ITL', 'ITL'), '101')],\n [('regression euro-target-rounding 1', ('5.54', 'FRF', 'EUR'), '0.84'),\n  ('regression euro-target-rounding 2', ('106', 'ITL', 'EUR'), '0.05'),\n  ('control: same currency rounding', ('100.5', 'ITL', 'ITL'), '101'),\n  ('control: unknown', ('5', 'XEU', 'DEM'), 'ERR:currency'),\n  ('control: peseta to punt', ('123456', 'ESP', 'IEP'), '584.36'),\n  ('control: guilder to escudo', ('0.01', 'NLG', 'PTE'), '1')],\n [('regression euro-target-rounding 1', ('1.20', 'NLG', 'EUR'), '0.54'),\n  ('regression euro-target-rounding 2', ('1000000', 'ITL', 'EUR'), '516.46'),\n  ('partial repair guard 2', ('0.85', 'DEM', 'EUR'), '0.43'),\n  ('control: guilder to escudo', ('0.01', 'NLG', 'PTE'), '1'),\n  ('control: schilling to markka', ('987.65', 'ATS', 'FIM'), '426.75'),\n  ('control: franc to franc', ('12.345', 'BEF', 'FRF'), '2.01'),\n  ('control: mark to franc', ('100', 'DEM', 'FRF'), '335.38')],\n [('regression euro-target-rounding 1', ('2838484', 'ESP', 'EUR'), '17059.63'),\n  ('regression euro-target-rounding 2', ('4062865.64', 'FRF', 'EUR'), '619379.87'),\n  ('partial repair guard 1', ('2.18', 'DEM', 'EUR'), '1.11'),\n  ('partial repair guard 2', ('5.54', 'FRF', 'EUR'), '0.84'),\n  ('control: mark to franc', ('100', 'DEM', 'FRF'), '335.38'),\n  ('control: lira to euro', ('1000000', 'ITL', 'EUR'), '516.46'),\n  ('control: euro to lira', ('10', 'EUR', 'ITL'), '19363'),\n  ('control: same currency rounding', ('100.5', 'ITL', 'ITL'), '101')],\n [('regression euro-target-rounding 1', ('4466382', 'FRF', 'EUR'), '680895.55'),\n  ('regression euro-target-rounding 2', ('3694885', 'IEP', 'EUR'), '4691536.18'),\n  ('partial repair guard 1', ('106', 'ITL', 'EUR'), '0.05'), ('partial repair guard 2', ('1.20', 'NLG', 'EUR'), '0.54'),\n  ('control: same currency rounding', ('100.5', 'ITL', 'ITL'), '101'),\n  ('control: unknown', ('5', 'XEU', 'DEM'), 'ERR:currency'),\n  ('control: peseta to punt', ('123456', 'ESP', 'IEP'), '584.36'),\n  ('control: guilder to escudo', ('0.01', 'NLG', 'PTE'), '1')]]\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-legacy-euro-triangulation-euro-target-rounding","generated_at":"2026-09-29T14:47:00.023405+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.","root_cause":"The legacy-to-EUR path is routed through the three-decimal triangulation intermediate.","sha256":"e5731a64f2bf9c3cc8215dfc252578c9c4bb10ba51150108dfde445d0f1593ef","title":"A conversion into EUR returns the three-decimal intermediate · 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.369,"exit_code":1,"observations":[{"actual":"0.44","check":"regression euro-target-rounding 1","expected":"0.43","passed":false},{"actual":"1.12","check":"regression euro-target-rounding 2","expected":"1.11","passed":false},{"actual":"335.38","check":"control: mark to franc","expected":"335.38","passed":true},{"actual":"516.46","check":"control: lira to euro","expected":"516.46","passed":true},{"actual":"19363","check":"control: euro to lira","expected":"19363","passed":true},{"actual":"101","check":"control: same currency rounding","expected":"101","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression euro-target-rounding 1\", \"actual\": \"0.44\", \"expected\": \"0.43\", \"passed\": false}, {\"check\": \"regression euro-target-rounding 2\", \"actual\": \"1.12\", \"expected\": \"1.11\", \"passed\": false}, {\"check\": \"control: mark to franc\", \"actual\": \"335.38\", \"expected\": \"335.38\", \"passed\": true}, {\"check\": \"control: lira to euro\", \"actual\": \"516.46\", \"expected\": \"516.46\", \"passed\": true}, {\"check\": \"control: euro to lira\", \"actual\": \"19363\", \"expected\": \"19363\", \"passed\": true}, {\"check\": \"control: same currency rounding\", \"actual\": \"101\", \"expected\": \"101\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.62,"exit_code":1,"observations":[{"actual":"0.435","check":"regression euro-target-rounding 1","expected":"0.43","passed":false},{"actual":"1.115","check":"regression euro-target-rounding 2","expected":"1.11","passed":false},{"actual":"335.38","check":"control: mark to franc","expected":"335.38","passed":true},{"actual":"516.457","check":"control: lira to euro","expected":"516.46","passed":false},{"actual":"19363","check":"control: euro to lira","expected":"19363","passed":true},{"actual":"101","check":"control: same currency rounding","expected":"101","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression euro-target-rounding 1\", \"actual\": \"0.435\", \"expected\": \"0.43\", \"passed\": false}, {\"check\": \"regression euro-target-rounding 2\", \"actual\": \"1.115\", \"expected\": \"1.11\", \"passed\": false}, {\"check\": \"control: mark to franc\", \"actual\": \"335.38\", \"expected\": \"335.38\", \"passed\": true}, {\"check\": \"control: lira to euro\", \"actual\": \"516.457\", \"expected\": \"516.46\", \"passed\": false}, {\"check\": \"control: euro to lira\", \"actual\": \"19363\", \"expected\": \"19363\", \"passed\": true}, {\"check\": \"control: same currency rounding\", \"actual\": \"101\", \"expected\": \"101\", \"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."}}