{"abstract":"Euro converted to yen is printed with two decimals, and yen converted to dinar loses decimals.","category":"Currency rounding and FX conversion","checks":7,"contract":"solve(amount, frm, to, rates): rates maps a currency to units of that currency per 1 USD (decimal strings); USD is implicitly 1 when absent. Convert exactly as amount / rate[frm] * rate[to] with no intermediate rounding, then round half-even to the target exponent (USD/EUR/GBP/CHF/SEK/NOK 2, JPY/KRW 0, KWD 3, CLF 4) and return a plain string. A missing rate returns 'ERR:no-rate:<code>', a zero or negative rate 'ERR:bad-rate:<code>' (source checked first).","contract_signature":"amount, frm, to, rates","evaluation_group":"w2-currency_rounding_and_fx_conversion-usd-pivot-cross","failed_approach":"Using the larger of the two exponents still prints fractional yen when the source has cents.","family":"w2-currency_rounding_and_fx_conversion-usd-pivot-cross-target-exponent","id":"FA-61876","implementations":{"attempt":{"sha256":"4e81d2cc407c5e2d3bbf6bd69e0853675baf3dc563e1b9d473af2603efecb68c","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, rates):\n    exps = {'USD': 2, 'EUR': 2, 'GBP': 2, 'CHF': 2, 'SEK': 2, 'NOK': 2, 'JPY': 0, 'KRW': 0, 'KWD': 3, 'CLF': 4}\n    def rate(c):\n        if c == 'USD' and c not in rates: return Decimal(1)\n        if c not in rates: return None\n        return Decimal(rates[c])\n    rf, rt = rate(frm), rate(to)\n    for c, r in ((frm, rf), (to, rt)):\n        if r is None: return 'ERR:no-rate:' + c\n        if r <= 0: return 'ERR:bad-rate:' + c\n    usd = Decimal(amount) / rf\n    out = usd * rt\n    return format(out.quantize(Decimal(1).scaleb(-max(exps[frm], exps[to])), rounding=ROUND_HALF_EVEN), 'f')\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression target-exponent 1',\n   ('100', 'EUR', 'JPY',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   '16453'),\n  ('regression target-exponent 2',\n   ('100.00', 'USD', 'KWD',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   '30.710'),\n  ('partial repair guard 2',\n   ('19481.34', 'KWD', 'USD',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   '63436.47'),\n  ('control: pound to usd',\n   ('5', 'GBP', 'USD',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   '6.33'),\n  ('control: missing target',\n   ('1', 'EUR', 'SEK',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   'ERR:no-rate:SEK'),\n  ('control: won to franc',\n   ('250000', 'KRW', 'CHF',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   '162.68'),\n  ('control: yen to unit of account',\n   ('99999', 'JPY', 'CLF',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   '16.1920')],\n [('regression target-exponent 1',\n   ('250000', 'KRW', 'CHF',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   '162.68'),\n  ('regression target-exponent 2',\n   ('99999', 'JPY', 'CLF',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   '16.1920'),\n  ('partial repair guard 1',\n   ('31699.892', 'KWD', 'USD',\n    {'EUR': '0.92', 'KRW': '1352.5', 'KWD': '0.3071', 'GBP': '0.7893', 'CLF': '0.02451', 'CHF': '0.8801'}),\n   '103223.35'),\n  ('partial repair guard 2',\n   ('2442.484', 'CHF', 'JPY',\n    {'EUR': '0.92', 'JPY': '151.37', 'KWD': '0.3071', 'GBP': '0.7893', 'CLF': '0.02451', 'CHF': '0.8801', 'USD': '1'}),\n   '420087'),\n  ('control: missing target',\n   ('1', 'EUR', 'SEK',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   'ERR:no-rate:SEK'),\n  ('control: zero rate target', ('10', 'EUR', 'CHF', {'EUR': '0.92', 'CHF': '0'}), 'ERR:bad-rate:CHF'),\n  ('control: explicit usd rate', ('10', 'USD', 'EUR', {'USD': '1', 'EUR': '0.92'}), '9.20'),\n  ('control: usd absent', ('42.42', 'EUR', 'USD', {'EUR': '0.92'}), '46.11')],\n [('regression target-exponent 1',\n   ('113222', 'EUR', 'CLF',\n    {'EUR': '0.92', 'JPY': '151.37', 'KWD': '0.3071', 'GBP': '0.7893', 'CLF': '0.02451', 'CHF': '0.8801'}),\n   '3016.3818'),\n  ('regression target-exponent 2',\n   ('19481.34', 'KWD', 'USD',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   '63436.47'),\n  ('partial repair guard 1',\n   ('132236.08', 'CLF', 'KRW', {'EUR': '0.92', 'JPY': '151.37', 'KRW': '1352.5', 'CLF': '0.02451', 'CHF': '0.8801'}),\n   '7296992991'),\n  ('partial repair guard 2',\n   ('23223.04', 'CLF', 'KWD',\n    {'EUR': '0.92', 'KRW': '1352.5', 'KWD': '0.3071', 'GBP': '0.7893', 'CLF': '0.02451', 'CHF': '0.8801'}),\n   '290974.932'),\n  ('control: zero rate target', ('10', 'EUR', 'CHF', {'EUR': '0.92', 'CHF': '0'}), 'ERR:bad-rate:CHF'),\n  ('control: explicit usd rate', ('10', 'USD', 'EUR', {'USD': '1', 'EUR': '0.92'}), '9.20'),\n  ('control: usd absent', ('42.42', 'EUR', 'USD', {'EUR': '0.92'}), '46.11'),\n  ('control: euro to yen',\n   ('100', 'EUR', 'JPY',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   '16453')],\n [('regression target-exponent 1',\n   ('12406.83', 'JPY', 'USD',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801',\n     'USD': '1'}),\n   '81.96'),\n  ('regression target-exponent 2',\n   ('69492.535', 'JPY', 'EUR',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '0',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801',\n     'USD': '1'}),\n   '422.36'),\n  ('partial repair guard 1',\n   ('62580.312', 'CHF', 'KRW',\n    {'EUR': '0.92', 'JPY': '151.37', 'KRW': '1352.5', 'KWD': '0.3071', 'GBP': '0.7893', 'CHF': '0.8801'}),\n   '96170744'),\n  ('partial repair guard 2',\n   ('86444.328', 'KWD', 'KRW',\n    {'EUR': '0.92', 'JPY': '151.37', 'KRW': '1352.5', 'KWD': '0.3071', 'GBP': '0.7893', 'CLF': '0.02451'}),\n   '380709715'),\n  ('control: euro to yen',\n   ('100', 'EUR', 'JPY',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   '16453'),\n  ('control: usd to dinar',\n   ('100.00', 'USD', 'KWD',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   '30.710'),\n  ('control: pound to usd',\n   ('5', 'GBP', 'USD',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   '6.33'),\n  ('control: missing target',\n   ('1', 'EUR', 'SEK',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   'ERR:no-rate:SEK')],\n [('regression target-exponent 1',\n   ('31699.892', 'KWD', 'USD',\n    {'EUR': '0.92', 'KRW': '1352.5', 'KWD': '0.3071', 'GBP': '0.7893', 'CLF': '0.02451', 'CHF': '0.8801'}),\n   '103223.35'),\n  ('regression target-exponent 2',\n   ('48429.445', 'EUR', 'KWD',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   '16165.959'),\n  ('partial repair guard 1',\n   ('31654.45', 'KWD', 'CHF',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '-1.2',\n     'CLF': '0.02451',\n     'CHF': '0.8801',\n     'USD': '1'}),\n   '90716.64'),\n  ('partial repair guard 2',\n   ('45677.89', 'GBP', 'KRW',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801',\n     'USD': '1'}),\n   '78271058'),\n  ('control: missing target',\n   ('1', 'EUR', 'SEK',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   'ERR:no-rate:SEK'),\n  ('control: won to franc',\n   ('250000', 'KRW', 'CHF',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   '162.68'),\n  ('control: yen to unit of account',\n   ('99999', 'JPY', 'CLF',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   '16.1920'),\n  ('control: zero rate target', ('10', 'EUR', 'CHF', {'EUR': '0.92', 'CHF': '0'}), 'ERR:bad-rate:CHF')]]\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":"19bf258c9c1bda83f5c401b9f5994a1cba2ba1da931c7f8ac8cf2af6f0bdc8f8","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, rates):\n    exps = {'USD': 2, 'EUR': 2, 'GBP': 2, 'CHF': 2, 'SEK': 2, 'NOK': 2, 'JPY': 0, 'KRW': 0, 'KWD': 3, 'CLF': 4}\n    def rate(c):\n        if c == 'USD' and c not in rates: return Decimal(1)\n        if c not in rates: return None\n        return Decimal(rates[c])\n    rf, rt = rate(frm), rate(to)\n    for c, r in ((frm, rf), (to, rt)):\n        if r is None: return 'ERR:no-rate:' + c\n        if r <= 0: return 'ERR:bad-rate:' + c\n    usd = Decimal(amount) / rf\n    out = usd * rt\n    return format(out.quantize(Decimal(1).scaleb(-exps[frm]), rounding=ROUND_HALF_EVEN), 'f')\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression target-exponent 1',\n   ('100', 'EUR', 'JPY',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   '16453'),\n  ('regression target-exponent 2',\n   ('100.00', 'USD', 'KWD',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   '30.710'),\n  ('partial repair guard 2',\n   ('19481.34', 'KWD', 'USD',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   '63436.47'),\n  ('control: pound to usd',\n   ('5', 'GBP', 'USD',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   '6.33'),\n  ('control: missing target',\n   ('1', 'EUR', 'SEK',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   'ERR:no-rate:SEK'),\n  ('control: won to franc',\n   ('250000', 'KRW', 'CHF',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   '162.68'),\n  ('control: yen to unit of account',\n   ('99999', 'JPY', 'CLF',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   '16.1920')],\n [('regression target-exponent 1',\n   ('250000', 'KRW', 'CHF',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   '162.68'),\n  ('regression target-exponent 2',\n   ('99999', 'JPY', 'CLF',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   '16.1920'),\n  ('partial repair guard 1',\n   ('31699.892', 'KWD', 'USD',\n    {'EUR': '0.92', 'KRW': '1352.5', 'KWD': '0.3071', 'GBP': '0.7893', 'CLF': '0.02451', 'CHF': '0.8801'}),\n   '103223.35'),\n  ('partial repair guard 2',\n   ('2442.484', 'CHF', 'JPY',\n    {'EUR': '0.92', 'JPY': '151.37', 'KWD': '0.3071', 'GBP': '0.7893', 'CLF': '0.02451', 'CHF': '0.8801', 'USD': '1'}),\n   '420087'),\n  ('control: missing target',\n   ('1', 'EUR', 'SEK',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   'ERR:no-rate:SEK'),\n  ('control: zero rate target', ('10', 'EUR', 'CHF', {'EUR': '0.92', 'CHF': '0'}), 'ERR:bad-rate:CHF'),\n  ('control: explicit usd rate', ('10', 'USD', 'EUR', {'USD': '1', 'EUR': '0.92'}), '9.20'),\n  ('control: usd absent', ('42.42', 'EUR', 'USD', {'EUR': '0.92'}), '46.11')],\n [('regression target-exponent 1',\n   ('113222', 'EUR', 'CLF',\n    {'EUR': '0.92', 'JPY': '151.37', 'KWD': '0.3071', 'GBP': '0.7893', 'CLF': '0.02451', 'CHF': '0.8801'}),\n   '3016.3818'),\n  ('regression target-exponent 2',\n   ('19481.34', 'KWD', 'USD',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   '63436.47'),\n  ('partial repair guard 1',\n   ('132236.08', 'CLF', 'KRW', {'EUR': '0.92', 'JPY': '151.37', 'KRW': '1352.5', 'CLF': '0.02451', 'CHF': '0.8801'}),\n   '7296992991'),\n  ('partial repair guard 2',\n   ('23223.04', 'CLF', 'KWD',\n    {'EUR': '0.92', 'KRW': '1352.5', 'KWD': '0.3071', 'GBP': '0.7893', 'CLF': '0.02451', 'CHF': '0.8801'}),\n   '290974.932'),\n  ('control: zero rate target', ('10', 'EUR', 'CHF', {'EUR': '0.92', 'CHF': '0'}), 'ERR:bad-rate:CHF'),\n  ('control: explicit usd rate', ('10', 'USD', 'EUR', {'USD': '1', 'EUR': '0.92'}), '9.20'),\n  ('control: usd absent', ('42.42', 'EUR', 'USD', {'EUR': '0.92'}), '46.11'),\n  ('control: euro to yen',\n   ('100', 'EUR', 'JPY',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   '16453')],\n [('regression target-exponent 1',\n   ('12406.83', 'JPY', 'USD',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801',\n     'USD': '1'}),\n   '81.96'),\n  ('regression target-exponent 2',\n   ('69492.535', 'JPY', 'EUR',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '0',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801',\n     'USD': '1'}),\n   '422.36'),\n  ('partial repair guard 1',\n   ('62580.312', 'CHF', 'KRW',\n    {'EUR': '0.92', 'JPY': '151.37', 'KRW': '1352.5', 'KWD': '0.3071', 'GBP': '0.7893', 'CHF': '0.8801'}),\n   '96170744'),\n  ('partial repair guard 2',\n   ('86444.328', 'KWD', 'KRW',\n    {'EUR': '0.92', 'JPY': '151.37', 'KRW': '1352.5', 'KWD': '0.3071', 'GBP': '0.7893', 'CLF': '0.02451'}),\n   '380709715'),\n  ('control: euro to yen',\n   ('100', 'EUR', 'JPY',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   '16453'),\n  ('control: usd to dinar',\n   ('100.00', 'USD', 'KWD',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   '30.710'),\n  ('control: pound to usd',\n   ('5', 'GBP', 'USD',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   '6.33'),\n  ('control: missing target',\n   ('1', 'EUR', 'SEK',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   'ERR:no-rate:SEK')],\n [('regression target-exponent 1',\n   ('31699.892', 'KWD', 'USD',\n    {'EUR': '0.92', 'KRW': '1352.5', 'KWD': '0.3071', 'GBP': '0.7893', 'CLF': '0.02451', 'CHF': '0.8801'}),\n   '103223.35'),\n  ('regression target-exponent 2',\n   ('48429.445', 'EUR', 'KWD',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   '16165.959'),\n  ('partial repair guard 1',\n   ('31654.45', 'KWD', 'CHF',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '-1.2',\n     'CLF': '0.02451',\n     'CHF': '0.8801',\n     'USD': '1'}),\n   '90716.64'),\n  ('partial repair guard 2',\n   ('45677.89', 'GBP', 'KRW',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801',\n     'USD': '1'}),\n   '78271058'),\n  ('control: missing target',\n   ('1', 'EUR', 'SEK',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   'ERR:no-rate:SEK'),\n  ('control: won to franc',\n   ('250000', 'KRW', 'CHF',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   '162.68'),\n  ('control: yen to unit of account',\n   ('99999', 'JPY', 'CLF',\n    {'EUR': '0.92',\n     'JPY': '151.37',\n     'KRW': '1352.5',\n     'KWD': '0.3071',\n     'GBP': '0.7893',\n     'CLF': '0.02451',\n     'CHF': '0.8801'}),\n   '16.1920'),\n  ('control: zero rate target', ('10', 'EUR', 'CHF', {'EUR': '0.92', 'CHF': '0'}), 'ERR:bad-rate:CHF')]]\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-usd-pivot-cross-target-exponent","generated_at":"2026-09-29T14:46:59.351272+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 quantum is taken from exps[frm] instead of exps[to].","sha256":"2de1ee43934aed3cd7898a217424b38b54c294d921e000a56b5324d35f8659f8","title":"The converted amount is rounded with the source currency exponent · 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":39.936,"exit_code":1,"observations":[{"actual":"16453.26","check":"regression target-exponent 1","expected":"16453","passed":false},{"actual":"30.710","check":"regression target-exponent 2","expected":"30.710","passed":true},{"actual":"63436.470","check":"partial repair guard 2","expected":"63436.47","passed":false},{"actual":"6.33","check":"control: pound to usd","expected":"6.33","passed":true},{"actual":"ERR:no-rate:SEK","check":"control: missing target","expected":"ERR:no-rate:SEK","passed":true},{"actual":"162.68","check":"control: won to franc","expected":"162.68","passed":true},{"actual":"16.1920","check":"control: yen to unit of account","expected":"16.1920","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression target-exponent 1\", \"actual\": \"16453.26\", \"expected\": \"16453\", \"passed\": false}, {\"check\": \"regression target-exponent 2\", \"actual\": \"30.710\", \"expected\": \"30.710\", \"passed\": true}, {\"check\": \"partial repair guard 2\", \"actual\": \"63436.470\", \"expected\": \"63436.47\", \"passed\": false}, {\"check\": \"control: pound to usd\", \"actual\": \"6.33\", \"expected\": \"6.33\", \"passed\": true}, {\"check\": \"control: missing target\", \"actual\": \"ERR:no-rate:SEK\", \"expected\": \"ERR:no-rate:SEK\", \"passed\": true}, {\"check\": \"control: won to franc\", \"actual\": \"162.68\", \"expected\": \"162.68\", \"passed\": true}, {\"check\": \"control: yen to unit of account\", \"actual\": \"16.1920\", \"expected\": \"16.1920\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.833,"exit_code":1,"observations":[{"actual":"16453.26","check":"regression target-exponent 1","expected":"16453","passed":false},{"actual":"30.71","check":"regression target-exponent 2","expected":"30.710","passed":false},{"actual":"63436.470","check":"partial repair guard 2","expected":"63436.47","passed":false},{"actual":"6.33","check":"control: pound to usd","expected":"6.33","passed":true},{"actual":"ERR:no-rate:SEK","check":"control: missing target","expected":"ERR:no-rate:SEK","passed":true},{"actual":"163","check":"control: won to franc","expected":"162.68","passed":false},{"actual":"16","check":"control: yen to unit of account","expected":"16.1920","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression target-exponent 1\", \"actual\": \"16453.26\", \"expected\": \"16453\", \"passed\": false}, {\"check\": \"regression target-exponent 2\", \"actual\": \"30.71\", \"expected\": \"30.710\", \"passed\": false}, {\"check\": \"partial repair guard 2\", \"actual\": \"63436.470\", \"expected\": \"63436.47\", \"passed\": false}, {\"check\": \"control: pound to usd\", \"actual\": \"6.33\", \"expected\": \"6.33\", \"passed\": true}, {\"check\": \"control: missing target\", \"actual\": \"ERR:no-rate:SEK\", \"expected\": \"ERR:no-rate:SEK\", \"passed\": true}, {\"check\": \"control: won to franc\", \"actual\": \"163\", \"expected\": \"162.68\", \"passed\": false}, {\"check\": \"control: yen to unit of account\", \"actual\": \"16\", \"expected\": \"16.1920\", \"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."}}