{"abstract":"High earners stop paying medicare after crossing the social wage base.","category":"Double-entry ledger accounting","checks":7,"contract":"x = {'gross': [[employee, cents]] (an employee may appear twice), 'ytd': prior year-to-date gross, 'wage_base', 'ss_bp', 'med_bp', 'itax_bp', 'benefit': {employee: pre-tax deduction per paycheck}}. Per paycheck: social wages = min(gross, max(0, wage_base - ytd)), ytd then increases by gross; social tax = round(social wages * ss_bp / 10000), medicare = round(gross * med_bp / 10000) (no cap), income tax = round((gross - benefit) * itax_bp / 10000), all half-up; net = gross - social - medicare - income tax - benefit. The employer matches social and medicare. Return {'wage_expense', 'tax_expense', 'cash', 'withholding', 'benefits'} where withholding holds employee and employer taxes.","evaluation_group":"w2-double-entry-ledger-accounting-payroll-journal","failed_approach":"Charging full medicare only while social wages remain still stops medicare after the base is exhausted.","family":"w2-double-entry-ledger-accounting-payroll-journal-medicare-cap","id":"FA-58291","implementations":{"attempt":{"sha256":"66fc2435bcbd68f20c5c5f1b0cf6a737a1af525ecd6d43344fe33da7587a1ba8","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    def rnd(n, d):\n        q, r = divmod(n, d)\n        return q + (1 if 2 * r >= d else 0)\n    ytd = dict(x['ytd'])\n    wage = tax_exp = cash = withholding = benefits = 0\n    for emp, g in x['gross']:\n        ben = x['benefit'].get(emp, 0)\n        social = min(g, max(0, x['wage_base'] - ytd.get(emp, 0)))\n        ytd[emp] = ytd.get(emp, 0) + g\n        ss = rnd(social * x['ss_bp'], 10000)\n        med = rnd((g if social else 0) * x['med_bp'], 10000)\n        itax = rnd((g - ben) * x['itax_bp'], 10000)\n        employer = ss + med\n        wage += g\n        tax_exp += employer\n        cash += g - ss - med - itax - ben\n        withholding += ss + med + itax + employer\n        benefits += ben\n    return {'wage_expense': wage, 'tax_expense': tax_exp, 'cash': cash, 'withholding': withholding, 'benefits': benefits}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: medicare cap', {'gross': [['bob', 100000]], 'ytd': {'bob': 16800000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1200, 'benefit': {'bob': 5000}}, {'wage_expense': 100000, 'tax_expense': 5170, 'cash': 78430, 'withholding': 21740, 'benefits': 5000}], ['regression: medicare cap, partial-repair probe', {'gross': [['ann', 333333], ['di', 100000], ['bob', 1234]], 'ytd': {'ann': 0, 'di': 17000000, 'bob': 16800000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'ann': 12345, 'di': 5000, 'bob': 5000}}, {'wage_expense': 434567, 'tax_expense': 27045, 'cash': 343955, 'withholding': 95312, 'benefits': 22345}], ['control 1', {'gross': [['di', 1234], ['cy', 50000], ['bob', 50000], ['di', 80000]], 'ytd': {'di': 15000000, 'cy': 16800000, 'bob': 16800000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 2200, 'benefit': {'di': 12345, 'cy': 0, 'bob': 5000}}, {'wage_expense': 181234, 'tax_expense': 13865, 'cash': 104339, 'withholding': 61070, 'benefits': 29690}], ['control 2', {'gross': [['bob', 100000], ['ann', 250000], ['bob', 80000]], 'ytd': {'bob': 0, 'ann': 15000000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 2200, 'benefit': {'bob': 5000, 'ann': 0}}, {'wage_expense': 430000, 'tax_expense': 32895, 'cash': 294705, 'withholding': 158190, 'benefits': 10000}], ['control 3', {'gross': [['di', 50000], ['ann', 50000], ['cy', 1234]], 'ytd': {'di': 16800000, 'ann': 16800000, 'cy': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'di': 12345, 'ann': 0, 'cy': 5000}}, {'wage_expense': 101234, 'tax_expense': 7745, 'cash': 67755, 'withholding': 23879, 'benefits': 17345}], ['control 4', {'gross': [['bob', 1234], ['cy', 333333], ['bob', 80000]], 'ytd': {'bob': 0, 'cy': 15000000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'bob': 12345, 'cy': 0}}, {'wage_expense': 414567, 'tax_expense': 31715, 'cash': 319174, 'withholding': 102418, 'benefits': 24690}], ['control 5', {'gross': [['cy', 100000], ['di', 250000], ['ann', 1234]], 'ytd': {'cy': 15000000, 'di': 15000000, 'ann': 16800000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 2200, 'benefit': {'cy': 12345, 'di': 0, 'ann': 12345}}, {'wage_expense': 351234, 'tax_expense': 26870, 'cash': 227834, 'withholding': 125580, 'benefits': 24690}]], [['regression: medicare cap', {'gross': [['ann', 1234], ['bob', 100000], ['di', 50000], ['ann', 80000]], 'ytd': {'ann': 15000000, 'bob': 0, 'di': 17000000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 2200, 'benefit': {'ann': 0, 'bob': 12345, 'di': 12345}}, {'wage_expense': 231234, 'tax_expense': 14590, 'cash': 146515, 'withholding': 74619, 'benefits': 24690}], ['control 1', {'gross': [['cy', 50000], ['ann', 50000], ['di', 333333]], 'ytd': {'cy': 16700000, 'ann': 15000000, 'di': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'cy': 0, 'ann': 12345, 'di': 12345}}, {'wage_expense': 433333, 'tax_expense': 33150, 'cash': 334628, 'withholding': 107165, 'benefits': 24690}], ['control 2', {'gross': [['bob', 100000], ['ann', 250000]], 'ytd': {'bob': 15000000, 'ann': 15000000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'bob': 12345, 'ann': 5000}}, {'wage_expense': 350000, 'tax_expense': 26775, 'cash': 272614, 'withholding': 86816, 'benefits': 17345}], ['control 3', {'gross': [['bob', 50000], ['bob', 80000]], 'ytd': {'bob': 15000000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 2200, 'benefit': {'bob': 0}}, {'wage_expense': 130000, 'tax_expense': 9945, 'cash': 91455, 'withholding': 48490, 'benefits': 0}], ['control 4', {'gross': [['di', 250000]], 'ytd': {'di': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1200, 'benefit': {'di': 12345}}, {'wage_expense': 250000, 'tax_expense': 19125, 'cash': 190011, 'withholding': 66769, 'benefits': 12345}], ['control 5', {'gross': [['cy', 333333], ['cy', 80000]], 'ytd': {'cy': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1200, 'benefit': {'cy': 12345}}, {'wage_expense': 413333, 'tax_expense': 31620, 'cash': 310385, 'withholding': 109878, 'benefits': 24690}], ['control 6', {'gross': [['di', 100000], ['ann', 50000]], 'ytd': {'di': 15000000, 'ann': 16800000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'di': 12345, 'ann': 5000}}, {'wage_expense': 150000, 'tax_expense': 11475, 'cash': 107914, 'withholding': 36216, 'benefits': 17345}]], [['regression: medicare cap', {'gross': [['ann', 250000], ['di', 333333], ['ann', 200000]], 'ytd': {'ann': 17000000, 'di': 15000000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'ann': 5000, 'di': 12345}}, {'wage_expense': 783333, 'tax_expense': 32025, 'cash': 652864, 'withholding': 140149, 'benefits': 22345}], ['control 1', {'gross': [['ann', 50000], ['cy', 50000], ['bob', 100000]], 'ytd': {'ann': 0, 'cy': 0, 'bob': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1200, 'benefit': {'ann': 5000, 'cy': 5000, 'bob': 5000}}, {'wage_expense': 200000, 'tax_expense': 15300, 'cash': 147500, 'withholding': 52800, 'benefits': 15000}], ['control 2', {'gross': [['di', 50000], ['cy', 50000]], 'ytd': {'di': 16800000, 'cy': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1200, 'benefit': {'di': 5000, 'cy': 5000}}, {'wage_expense': 100000, 'tax_expense': 7650, 'cash': 71550, 'withholding': 26100, 'benefits': 10000}], ['control 3', {'gross': [['cy', 250000]], 'ytd': {'cy': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1200, 'benefit': {'cy': 0}}, {'wage_expense': 250000, 'tax_expense': 19125, 'cash': 200875, 'withholding': 68250, 'benefits': 0}], ['control 4', {'gross': [['bob', 333333]], 'ytd': {'bob': 15000000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1200, 'benefit': {'bob': 12345}}, {'wage_expense': 333333, 'tax_expense': 25500, 'cash': 256969, 'withholding': 89519, 'benefits': 12345}], ['control 5', {'gross': [['bob', 50000]], 'ytd': {'bob': 16800000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'bob': 5000}}, {'wage_expense': 50000, 'tax_expense': 3825, 'cash': 36675, 'withholding': 12150, 'benefits': 5000}], ['control 6', {'gross': [['ann', 50000]], 'ytd': {'ann': 16700000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 2200, 'benefit': {'ann': 12345}}, {'wage_expense': 50000, 'tax_expense': 3825, 'cash': 25546, 'withholding': 15934, 'benefits': 12345}]], [['regression: medicare cap', {'gross': [['ann', 100000], ['bob', 100000], ['cy', 250000]], 'ytd': {'ann': 16700000, 'bob': 17000000, 'cy': 16700000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 2200, 'benefit': {'ann': 12345, 'bob': 5000, 'cy': 0}}, {'wage_expense': 450000, 'tax_expense': 22645, 'cash': 314826, 'withholding': 140474, 'benefits': 17345}], ['control 1', {'gross': [['bob', 100000]], 'ytd': {'bob': 15000000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'bob': 5000}}, {'wage_expense': 100000, 'tax_expense': 7650, 'cash': 77850, 'withholding': 24800, 'benefits': 5000}], ['control 2', {'gross': [['cy', 100000]], 'ytd': {'cy': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'cy': 5000}}, {'wage_expense': 100000, 'tax_expense': 7650, 'cash': 77850, 'withholding': 24800, 'benefits': 5000}], ['control 3', {'gross': [['cy', 50000], ['bob', 50000], ['ann', 50000]], 'ytd': {'cy': 16700000, 'bob': 16800000, 'ann': 15000000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'cy': 0, 'bob': 12345, 'ann': 5000}}, {'wage_expense': 150000, 'tax_expense': 11475, 'cash': 107914, 'withholding': 36216, 'benefits': 17345}], ['control 4', {'gross': [['ann', 100000]], 'ytd': {'ann': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 2200, 'benefit': {'ann': 12345}}, {'wage_expense': 100000, 'tax_expense': 7650, 'cash': 60721, 'withholding': 34584, 'benefits': 12345}], ['control 5', {'gross': [['bob', 1234]], 'ytd': {'bob': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1200, 'benefit': {'bob': 5000}}, {'wage_expense': 1234, 'tax_expense': 95, 'cash': -3409, 'withholding': -262, 'benefits': 5000}], ['control 6', {'gross': [['bob', 250000]], 'ytd': {'bob': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 2200, 'benefit': {'bob': 5000}}, {'wage_expense': 250000, 'tax_expense': 19125, 'cash': 171975, 'withholding': 92150, 'benefits': 5000}]], [['regression: medicare cap', {'gross': [['ann', 333333], ['bob', 250000], ['cy', 1234]], 'ytd': {'ann': 0, 'bob': 16700000, 'cy': 16800000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 2200, 'benefit': {'ann': 5000, 'bob': 12345, 'cy': 0}}, {'wage_expense': 584567, 'tax_expense': 39140, 'cash': 403294, 'withholding': 203068, 'benefits': 17345}], ['regression: medicare cap, partial-repair probe', {'gross': [['di', 333333], ['bob', 100000], ['ann', 250000], ['di', 200000]], 'ytd': {'di': 17000000, 'bob': 17000000, 'ann': 16700000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'di': 5000, 'bob': 12345, 'ann': 12345}}, {'wage_expense': 883333, 'tax_expense': 22728, 'cash': 741050, 'withholding': 130321, 'benefits': 34690}], ['control 1', {'gross': [['di', 1234], ['bob', 333333], ['di', 80000]], 'ytd': {'di': 15000000, 'bob': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 2200, 'benefit': {'di': 0, 'bob': 0}}, {'wage_expense': 414567, 'tax_expense': 31715, 'cash': 291648, 'withholding': 154634, 'benefits': 0}], ['control 2', {'gross': [['di', 250000], ['di', 80000]], 'ytd': {'di': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1200, 'benefit': {'di': 5000}}, {'wage_expense': 330000, 'tax_expense': 25245, 'cash': 256355, 'withholding': 88890, 'benefits': 10000}], ['control 3', {'gross': [['di', 1234]], 'ytd': {'di': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1200, 'benefit': {'di': 5000}}, {'wage_expense': 1234, 'tax_expense': 95, 'cash': -3409, 'withholding': -262, 'benefits': 5000}], ['control 4', {'gross': [['di', 100000]], 'ytd': {'di': 16700000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1200, 'benefit': {'di': 5000}}, {'wage_expense': 100000, 'tax_expense': 7650, 'cash': 75950, 'withholding': 26700, 'benefits': 5000}], ['control 5', {'gross': [['bob', 333333], ['bob', 200000]], 'ytd': {'bob': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'bob': 0}}, {'wage_expense': 533333, 'tax_expense': 40800, 'cash': 439200, 'withholding': 134933, 'benefits': 0}]]]\nfor label, args, expected in fixtures[N-1]:\n    try:\n        actual = solve(args)\n    except Exception as exc:\n        actual = 'raised ' + type(exc).__name__\n    check(label, actual, 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":"8e0b1bdfabe93be25067386cdb9bc3265980680ded1bffc11c000ab049798a69","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    def rnd(n, d):\n        q, r = divmod(n, d)\n        return q + (1 if 2 * r >= d else 0)\n    ytd = dict(x['ytd'])\n    wage = tax_exp = cash = withholding = benefits = 0\n    for emp, g in x['gross']:\n        ben = x['benefit'].get(emp, 0)\n        social = min(g, max(0, x['wage_base'] - ytd.get(emp, 0)))\n        ytd[emp] = ytd.get(emp, 0) + g\n        ss = rnd(social * x['ss_bp'], 10000)\n        med = rnd(social * x['med_bp'], 10000)\n        itax = rnd((g - ben) * x['itax_bp'], 10000)\n        employer = ss + med\n        wage += g\n        tax_exp += employer\n        cash += g - ss - med - itax - ben\n        withholding += ss + med + itax + employer\n        benefits += ben\n    return {'wage_expense': wage, 'tax_expense': tax_exp, 'cash': cash, 'withholding': withholding, 'benefits': benefits}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: medicare cap', {'gross': [['bob', 100000]], 'ytd': {'bob': 16800000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1200, 'benefit': {'bob': 5000}}, {'wage_expense': 100000, 'tax_expense': 5170, 'cash': 78430, 'withholding': 21740, 'benefits': 5000}], ['regression: medicare cap, partial-repair probe', {'gross': [['ann', 333333], ['di', 100000], ['bob', 1234]], 'ytd': {'ann': 0, 'di': 17000000, 'bob': 16800000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'ann': 12345, 'di': 5000, 'bob': 5000}}, {'wage_expense': 434567, 'tax_expense': 27045, 'cash': 343955, 'withholding': 95312, 'benefits': 22345}], ['control 1', {'gross': [['di', 1234], ['cy', 50000], ['bob', 50000], ['di', 80000]], 'ytd': {'di': 15000000, 'cy': 16800000, 'bob': 16800000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 2200, 'benefit': {'di': 12345, 'cy': 0, 'bob': 5000}}, {'wage_expense': 181234, 'tax_expense': 13865, 'cash': 104339, 'withholding': 61070, 'benefits': 29690}], ['control 2', {'gross': [['bob', 100000], ['ann', 250000], ['bob', 80000]], 'ytd': {'bob': 0, 'ann': 15000000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 2200, 'benefit': {'bob': 5000, 'ann': 0}}, {'wage_expense': 430000, 'tax_expense': 32895, 'cash': 294705, 'withholding': 158190, 'benefits': 10000}], ['control 3', {'gross': [['di', 50000], ['ann', 50000], ['cy', 1234]], 'ytd': {'di': 16800000, 'ann': 16800000, 'cy': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'di': 12345, 'ann': 0, 'cy': 5000}}, {'wage_expense': 101234, 'tax_expense': 7745, 'cash': 67755, 'withholding': 23879, 'benefits': 17345}], ['control 4', {'gross': [['bob', 1234], ['cy', 333333], ['bob', 80000]], 'ytd': {'bob': 0, 'cy': 15000000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'bob': 12345, 'cy': 0}}, {'wage_expense': 414567, 'tax_expense': 31715, 'cash': 319174, 'withholding': 102418, 'benefits': 24690}], ['control 5', {'gross': [['cy', 100000], ['di', 250000], ['ann', 1234]], 'ytd': {'cy': 15000000, 'di': 15000000, 'ann': 16800000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 2200, 'benefit': {'cy': 12345, 'di': 0, 'ann': 12345}}, {'wage_expense': 351234, 'tax_expense': 26870, 'cash': 227834, 'withholding': 125580, 'benefits': 24690}]], [['regression: medicare cap', {'gross': [['ann', 1234], ['bob', 100000], ['di', 50000], ['ann', 80000]], 'ytd': {'ann': 15000000, 'bob': 0, 'di': 17000000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 2200, 'benefit': {'ann': 0, 'bob': 12345, 'di': 12345}}, {'wage_expense': 231234, 'tax_expense': 14590, 'cash': 146515, 'withholding': 74619, 'benefits': 24690}], ['control 1', {'gross': [['cy', 50000], ['ann', 50000], ['di', 333333]], 'ytd': {'cy': 16700000, 'ann': 15000000, 'di': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'cy': 0, 'ann': 12345, 'di': 12345}}, {'wage_expense': 433333, 'tax_expense': 33150, 'cash': 334628, 'withholding': 107165, 'benefits': 24690}], ['control 2', {'gross': [['bob', 100000], ['ann', 250000]], 'ytd': {'bob': 15000000, 'ann': 15000000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'bob': 12345, 'ann': 5000}}, {'wage_expense': 350000, 'tax_expense': 26775, 'cash': 272614, 'withholding': 86816, 'benefits': 17345}], ['control 3', {'gross': [['bob', 50000], ['bob', 80000]], 'ytd': {'bob': 15000000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 2200, 'benefit': {'bob': 0}}, {'wage_expense': 130000, 'tax_expense': 9945, 'cash': 91455, 'withholding': 48490, 'benefits': 0}], ['control 4', {'gross': [['di', 250000]], 'ytd': {'di': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1200, 'benefit': {'di': 12345}}, {'wage_expense': 250000, 'tax_expense': 19125, 'cash': 190011, 'withholding': 66769, 'benefits': 12345}], ['control 5', {'gross': [['cy', 333333], ['cy', 80000]], 'ytd': {'cy': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1200, 'benefit': {'cy': 12345}}, {'wage_expense': 413333, 'tax_expense': 31620, 'cash': 310385, 'withholding': 109878, 'benefits': 24690}], ['control 6', {'gross': [['di', 100000], ['ann', 50000]], 'ytd': {'di': 15000000, 'ann': 16800000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'di': 12345, 'ann': 5000}}, {'wage_expense': 150000, 'tax_expense': 11475, 'cash': 107914, 'withholding': 36216, 'benefits': 17345}]], [['regression: medicare cap', {'gross': [['ann', 250000], ['di', 333333], ['ann', 200000]], 'ytd': {'ann': 17000000, 'di': 15000000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'ann': 5000, 'di': 12345}}, {'wage_expense': 783333, 'tax_expense': 32025, 'cash': 652864, 'withholding': 140149, 'benefits': 22345}], ['control 1', {'gross': [['ann', 50000], ['cy', 50000], ['bob', 100000]], 'ytd': {'ann': 0, 'cy': 0, 'bob': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1200, 'benefit': {'ann': 5000, 'cy': 5000, 'bob': 5000}}, {'wage_expense': 200000, 'tax_expense': 15300, 'cash': 147500, 'withholding': 52800, 'benefits': 15000}], ['control 2', {'gross': [['di', 50000], ['cy', 50000]], 'ytd': {'di': 16800000, 'cy': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1200, 'benefit': {'di': 5000, 'cy': 5000}}, {'wage_expense': 100000, 'tax_expense': 7650, 'cash': 71550, 'withholding': 26100, 'benefits': 10000}], ['control 3', {'gross': [['cy', 250000]], 'ytd': {'cy': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1200, 'benefit': {'cy': 0}}, {'wage_expense': 250000, 'tax_expense': 19125, 'cash': 200875, 'withholding': 68250, 'benefits': 0}], ['control 4', {'gross': [['bob', 333333]], 'ytd': {'bob': 15000000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1200, 'benefit': {'bob': 12345}}, {'wage_expense': 333333, 'tax_expense': 25500, 'cash': 256969, 'withholding': 89519, 'benefits': 12345}], ['control 5', {'gross': [['bob', 50000]], 'ytd': {'bob': 16800000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'bob': 5000}}, {'wage_expense': 50000, 'tax_expense': 3825, 'cash': 36675, 'withholding': 12150, 'benefits': 5000}], ['control 6', {'gross': [['ann', 50000]], 'ytd': {'ann': 16700000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 2200, 'benefit': {'ann': 12345}}, {'wage_expense': 50000, 'tax_expense': 3825, 'cash': 25546, 'withholding': 15934, 'benefits': 12345}]], [['regression: medicare cap', {'gross': [['ann', 100000], ['bob', 100000], ['cy', 250000]], 'ytd': {'ann': 16700000, 'bob': 17000000, 'cy': 16700000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 2200, 'benefit': {'ann': 12345, 'bob': 5000, 'cy': 0}}, {'wage_expense': 450000, 'tax_expense': 22645, 'cash': 314826, 'withholding': 140474, 'benefits': 17345}], ['control 1', {'gross': [['bob', 100000]], 'ytd': {'bob': 15000000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'bob': 5000}}, {'wage_expense': 100000, 'tax_expense': 7650, 'cash': 77850, 'withholding': 24800, 'benefits': 5000}], ['control 2', {'gross': [['cy', 100000]], 'ytd': {'cy': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'cy': 5000}}, {'wage_expense': 100000, 'tax_expense': 7650, 'cash': 77850, 'withholding': 24800, 'benefits': 5000}], ['control 3', {'gross': [['cy', 50000], ['bob', 50000], ['ann', 50000]], 'ytd': {'cy': 16700000, 'bob': 16800000, 'ann': 15000000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'cy': 0, 'bob': 12345, 'ann': 5000}}, {'wage_expense': 150000, 'tax_expense': 11475, 'cash': 107914, 'withholding': 36216, 'benefits': 17345}], ['control 4', {'gross': [['ann', 100000]], 'ytd': {'ann': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 2200, 'benefit': {'ann': 12345}}, {'wage_expense': 100000, 'tax_expense': 7650, 'cash': 60721, 'withholding': 34584, 'benefits': 12345}], ['control 5', {'gross': [['bob', 1234]], 'ytd': {'bob': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1200, 'benefit': {'bob': 5000}}, {'wage_expense': 1234, 'tax_expense': 95, 'cash': -3409, 'withholding': -262, 'benefits': 5000}], ['control 6', {'gross': [['bob', 250000]], 'ytd': {'bob': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 2200, 'benefit': {'bob': 5000}}, {'wage_expense': 250000, 'tax_expense': 19125, 'cash': 171975, 'withholding': 92150, 'benefits': 5000}]], [['regression: medicare cap', {'gross': [['ann', 333333], ['bob', 250000], ['cy', 1234]], 'ytd': {'ann': 0, 'bob': 16700000, 'cy': 16800000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 2200, 'benefit': {'ann': 5000, 'bob': 12345, 'cy': 0}}, {'wage_expense': 584567, 'tax_expense': 39140, 'cash': 403294, 'withholding': 203068, 'benefits': 17345}], ['regression: medicare cap, partial-repair probe', {'gross': [['di', 333333], ['bob', 100000], ['ann', 250000], ['di', 200000]], 'ytd': {'di': 17000000, 'bob': 17000000, 'ann': 16700000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'di': 5000, 'bob': 12345, 'ann': 12345}}, {'wage_expense': 883333, 'tax_expense': 22728, 'cash': 741050, 'withholding': 130321, 'benefits': 34690}], ['control 1', {'gross': [['di', 1234], ['bob', 333333], ['di', 80000]], 'ytd': {'di': 15000000, 'bob': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 2200, 'benefit': {'di': 0, 'bob': 0}}, {'wage_expense': 414567, 'tax_expense': 31715, 'cash': 291648, 'withholding': 154634, 'benefits': 0}], ['control 2', {'gross': [['di', 250000], ['di', 80000]], 'ytd': {'di': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1200, 'benefit': {'di': 5000}}, {'wage_expense': 330000, 'tax_expense': 25245, 'cash': 256355, 'withholding': 88890, 'benefits': 10000}], ['control 3', {'gross': [['di', 1234]], 'ytd': {'di': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1200, 'benefit': {'di': 5000}}, {'wage_expense': 1234, 'tax_expense': 95, 'cash': -3409, 'withholding': -262, 'benefits': 5000}], ['control 4', {'gross': [['di', 100000]], 'ytd': {'di': 16700000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1200, 'benefit': {'di': 5000}}, {'wage_expense': 100000, 'tax_expense': 7650, 'cash': 75950, 'withholding': 26700, 'benefits': 5000}], ['control 5', {'gross': [['bob', 333333], ['bob', 200000]], 'ytd': {'bob': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'bob': 0}}, {'wage_expense': 533333, 'tax_expense': 40800, 'cash': 439200, 'withholding': 134933, 'benefits': 0}]]]\nfor label, args, expected in fixtures[N-1]:\n    try:\n        actual = solve(args)\n    except Exception as exc:\n        actual = 'raised ' + type(exc).__name__\n    check(label, actual, 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":"1b0231bba6c8542430dd2129eac01398432e35e7ac7ebd0696d8188d7e14404a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    def rnd(n, d):\n        q, r = divmod(n, d)\n        return q + (1 if 2 * r >= d else 0)\n    ytd = dict(x['ytd'])\n    wage = tax_exp = cash = withholding = benefits = 0\n    for emp, g in x['gross']:\n        ben = x['benefit'].get(emp, 0)\n        social = min(g, max(0, x['wage_base'] - ytd.get(emp, 0)))\n        ytd[emp] = ytd.get(emp, 0) + g\n        ss = rnd(social * x['ss_bp'], 10000)\n        med = rnd(g * x['med_bp'], 10000)\n        itax = rnd((g - ben) * x['itax_bp'], 10000)\n        employer = ss + med\n        wage += g\n        tax_exp += employer\n        cash += g - ss - med - itax - ben\n        withholding += ss + med + itax + employer\n        benefits += ben\n    return {'wage_expense': wage, 'tax_expense': tax_exp, 'cash': cash, 'withholding': withholding, 'benefits': benefits}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: medicare cap', {'gross': [['bob', 100000]], 'ytd': {'bob': 16800000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1200, 'benefit': {'bob': 5000}}, {'wage_expense': 100000, 'tax_expense': 5170, 'cash': 78430, 'withholding': 21740, 'benefits': 5000}], ['regression: medicare cap, partial-repair probe', {'gross': [['ann', 333333], ['di', 100000], ['bob', 1234]], 'ytd': {'ann': 0, 'di': 17000000, 'bob': 16800000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'ann': 12345, 'di': 5000, 'bob': 5000}}, {'wage_expense': 434567, 'tax_expense': 27045, 'cash': 343955, 'withholding': 95312, 'benefits': 22345}], ['control 1', {'gross': [['di', 1234], ['cy', 50000], ['bob', 50000], ['di', 80000]], 'ytd': {'di': 15000000, 'cy': 16800000, 'bob': 16800000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 2200, 'benefit': {'di': 12345, 'cy': 0, 'bob': 5000}}, {'wage_expense': 181234, 'tax_expense': 13865, 'cash': 104339, 'withholding': 61070, 'benefits': 29690}], ['control 2', {'gross': [['bob', 100000], ['ann', 250000], ['bob', 80000]], 'ytd': {'bob': 0, 'ann': 15000000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 2200, 'benefit': {'bob': 5000, 'ann': 0}}, {'wage_expense': 430000, 'tax_expense': 32895, 'cash': 294705, 'withholding': 158190, 'benefits': 10000}], ['control 3', {'gross': [['di', 50000], ['ann', 50000], ['cy', 1234]], 'ytd': {'di': 16800000, 'ann': 16800000, 'cy': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'di': 12345, 'ann': 0, 'cy': 5000}}, {'wage_expense': 101234, 'tax_expense': 7745, 'cash': 67755, 'withholding': 23879, 'benefits': 17345}], ['control 4', {'gross': [['bob', 1234], ['cy', 333333], ['bob', 80000]], 'ytd': {'bob': 0, 'cy': 15000000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'bob': 12345, 'cy': 0}}, {'wage_expense': 414567, 'tax_expense': 31715, 'cash': 319174, 'withholding': 102418, 'benefits': 24690}], ['control 5', {'gross': [['cy', 100000], ['di', 250000], ['ann', 1234]], 'ytd': {'cy': 15000000, 'di': 15000000, 'ann': 16800000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 2200, 'benefit': {'cy': 12345, 'di': 0, 'ann': 12345}}, {'wage_expense': 351234, 'tax_expense': 26870, 'cash': 227834, 'withholding': 125580, 'benefits': 24690}]], [['regression: medicare cap', {'gross': [['ann', 1234], ['bob', 100000], ['di', 50000], ['ann', 80000]], 'ytd': {'ann': 15000000, 'bob': 0, 'di': 17000000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 2200, 'benefit': {'ann': 0, 'bob': 12345, 'di': 12345}}, {'wage_expense': 231234, 'tax_expense': 14590, 'cash': 146515, 'withholding': 74619, 'benefits': 24690}], ['control 1', {'gross': [['cy', 50000], ['ann', 50000], ['di', 333333]], 'ytd': {'cy': 16700000, 'ann': 15000000, 'di': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'cy': 0, 'ann': 12345, 'di': 12345}}, {'wage_expense': 433333, 'tax_expense': 33150, 'cash': 334628, 'withholding': 107165, 'benefits': 24690}], ['control 2', {'gross': [['bob', 100000], ['ann', 250000]], 'ytd': {'bob': 15000000, 'ann': 15000000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'bob': 12345, 'ann': 5000}}, {'wage_expense': 350000, 'tax_expense': 26775, 'cash': 272614, 'withholding': 86816, 'benefits': 17345}], ['control 3', {'gross': [['bob', 50000], ['bob', 80000]], 'ytd': {'bob': 15000000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 2200, 'benefit': {'bob': 0}}, {'wage_expense': 130000, 'tax_expense': 9945, 'cash': 91455, 'withholding': 48490, 'benefits': 0}], ['control 4', {'gross': [['di', 250000]], 'ytd': {'di': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1200, 'benefit': {'di': 12345}}, {'wage_expense': 250000, 'tax_expense': 19125, 'cash': 190011, 'withholding': 66769, 'benefits': 12345}], ['control 5', {'gross': [['cy', 333333], ['cy', 80000]], 'ytd': {'cy': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1200, 'benefit': {'cy': 12345}}, {'wage_expense': 413333, 'tax_expense': 31620, 'cash': 310385, 'withholding': 109878, 'benefits': 24690}], ['control 6', {'gross': [['di', 100000], ['ann', 50000]], 'ytd': {'di': 15000000, 'ann': 16800000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'di': 12345, 'ann': 5000}}, {'wage_expense': 150000, 'tax_expense': 11475, 'cash': 107914, 'withholding': 36216, 'benefits': 17345}]], [['regression: medicare cap', {'gross': [['ann', 250000], ['di', 333333], ['ann', 200000]], 'ytd': {'ann': 17000000, 'di': 15000000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'ann': 5000, 'di': 12345}}, {'wage_expense': 783333, 'tax_expense': 32025, 'cash': 652864, 'withholding': 140149, 'benefits': 22345}], ['control 1', {'gross': [['ann', 50000], ['cy', 50000], ['bob', 100000]], 'ytd': {'ann': 0, 'cy': 0, 'bob': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1200, 'benefit': {'ann': 5000, 'cy': 5000, 'bob': 5000}}, {'wage_expense': 200000, 'tax_expense': 15300, 'cash': 147500, 'withholding': 52800, 'benefits': 15000}], ['control 2', {'gross': [['di', 50000], ['cy', 50000]], 'ytd': {'di': 16800000, 'cy': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1200, 'benefit': {'di': 5000, 'cy': 5000}}, {'wage_expense': 100000, 'tax_expense': 7650, 'cash': 71550, 'withholding': 26100, 'benefits': 10000}], ['control 3', {'gross': [['cy', 250000]], 'ytd': {'cy': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1200, 'benefit': {'cy': 0}}, {'wage_expense': 250000, 'tax_expense': 19125, 'cash': 200875, 'withholding': 68250, 'benefits': 0}], ['control 4', {'gross': [['bob', 333333]], 'ytd': {'bob': 15000000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1200, 'benefit': {'bob': 12345}}, {'wage_expense': 333333, 'tax_expense': 25500, 'cash': 256969, 'withholding': 89519, 'benefits': 12345}], ['control 5', {'gross': [['bob', 50000]], 'ytd': {'bob': 16800000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'bob': 5000}}, {'wage_expense': 50000, 'tax_expense': 3825, 'cash': 36675, 'withholding': 12150, 'benefits': 5000}], ['control 6', {'gross': [['ann', 50000]], 'ytd': {'ann': 16700000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 2200, 'benefit': {'ann': 12345}}, {'wage_expense': 50000, 'tax_expense': 3825, 'cash': 25546, 'withholding': 15934, 'benefits': 12345}]], [['regression: medicare cap', {'gross': [['ann', 100000], ['bob', 100000], ['cy', 250000]], 'ytd': {'ann': 16700000, 'bob': 17000000, 'cy': 16700000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 2200, 'benefit': {'ann': 12345, 'bob': 5000, 'cy': 0}}, {'wage_expense': 450000, 'tax_expense': 22645, 'cash': 314826, 'withholding': 140474, 'benefits': 17345}], ['control 1', {'gross': [['bob', 100000]], 'ytd': {'bob': 15000000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'bob': 5000}}, {'wage_expense': 100000, 'tax_expense': 7650, 'cash': 77850, 'withholding': 24800, 'benefits': 5000}], ['control 2', {'gross': [['cy', 100000]], 'ytd': {'cy': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'cy': 5000}}, {'wage_expense': 100000, 'tax_expense': 7650, 'cash': 77850, 'withholding': 24800, 'benefits': 5000}], ['control 3', {'gross': [['cy', 50000], ['bob', 50000], ['ann', 50000]], 'ytd': {'cy': 16700000, 'bob': 16800000, 'ann': 15000000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'cy': 0, 'bob': 12345, 'ann': 5000}}, {'wage_expense': 150000, 'tax_expense': 11475, 'cash': 107914, 'withholding': 36216, 'benefits': 17345}], ['control 4', {'gross': [['ann', 100000]], 'ytd': {'ann': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 2200, 'benefit': {'ann': 12345}}, {'wage_expense': 100000, 'tax_expense': 7650, 'cash': 60721, 'withholding': 34584, 'benefits': 12345}], ['control 5', {'gross': [['bob', 1234]], 'ytd': {'bob': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1200, 'benefit': {'bob': 5000}}, {'wage_expense': 1234, 'tax_expense': 95, 'cash': -3409, 'withholding': -262, 'benefits': 5000}], ['control 6', {'gross': [['bob', 250000]], 'ytd': {'bob': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 2200, 'benefit': {'bob': 5000}}, {'wage_expense': 250000, 'tax_expense': 19125, 'cash': 171975, 'withholding': 92150, 'benefits': 5000}]], [['regression: medicare cap', {'gross': [['ann', 333333], ['bob', 250000], ['cy', 1234]], 'ytd': {'ann': 0, 'bob': 16700000, 'cy': 16800000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 2200, 'benefit': {'ann': 5000, 'bob': 12345, 'cy': 0}}, {'wage_expense': 584567, 'tax_expense': 39140, 'cash': 403294, 'withholding': 203068, 'benefits': 17345}], ['regression: medicare cap, partial-repair probe', {'gross': [['di', 333333], ['bob', 100000], ['ann', 250000], ['di', 200000]], 'ytd': {'di': 17000000, 'bob': 17000000, 'ann': 16700000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'di': 5000, 'bob': 12345, 'ann': 12345}}, {'wage_expense': 883333, 'tax_expense': 22728, 'cash': 741050, 'withholding': 130321, 'benefits': 34690}], ['control 1', {'gross': [['di', 1234], ['bob', 333333], ['di', 80000]], 'ytd': {'di': 15000000, 'bob': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 2200, 'benefit': {'di': 0, 'bob': 0}}, {'wage_expense': 414567, 'tax_expense': 31715, 'cash': 291648, 'withholding': 154634, 'benefits': 0}], ['control 2', {'gross': [['di', 250000], ['di', 80000]], 'ytd': {'di': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1200, 'benefit': {'di': 5000}}, {'wage_expense': 330000, 'tax_expense': 25245, 'cash': 256355, 'withholding': 88890, 'benefits': 10000}], ['control 3', {'gross': [['di', 1234]], 'ytd': {'di': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1200, 'benefit': {'di': 5000}}, {'wage_expense': 1234, 'tax_expense': 95, 'cash': -3409, 'withholding': -262, 'benefits': 5000}], ['control 4', {'gross': [['di', 100000]], 'ytd': {'di': 16700000}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1200, 'benefit': {'di': 5000}}, {'wage_expense': 100000, 'tax_expense': 7650, 'cash': 75950, 'withholding': 26700, 'benefits': 5000}], ['control 5', {'gross': [['bob', 333333], ['bob', 200000]], 'ytd': {'bob': 0}, 'wage_base': 16860000, 'ss_bp': 620, 'med_bp': 145, 'itax_bp': 1000, 'benefit': {'bob': 0}}, {'wage_expense': 533333, 'tax_expense': 40800, 'cash': 439200, 'withholding': 134933, 'benefits': 0}]]]\nfor label, args, expected in fixtures[N-1]:\n    try:\n        actual = solve(args)\n    except Exception as exc:\n        actual = 'raised ' + type(exc).__name__\n    check(label, actual, 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 stipulated toy bookkeeping rules stated in the contract; amounts are integer cents; it makes no claim of conformance to any accounting standard or product. 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-double-entry-ledger-accounting-payroll-journal-medicare-cap","generated_at":"2026-09-29T14:46:25.343235+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Ledger software must keep debits equal to credits and apply normal-balance, period and cutoff rules exactly; small sign or boundary slips silently misstate financial statements.","repair":"Compute medicare on full gross without a cap.","root_cause":"Medicare is computed on capped social wages.","sha256":"3e3f34305c82c5d9dc50d5746791aba356212751a7c6cd8df683776a546cb7c7","title":"Payroll journal entry: medicare cap · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.863,"exit_code":1,"observations":[{"actual":{"benefits":5000,"cash":78430,"tax_expense":5170,"wage_expense":100000,"withholding":21740},"check":"regression: medicare cap","expected":{"benefits":5000,"cash":78430,"tax_expense":5170,"wage_expense":100000,"withholding":21740},"passed":true},{"actual":{"benefits":22345,"cash":345405,"tax_expense":25595,"wage_expense":434567,"withholding":92412},"check":"regression: medicare cap, partial-repair probe","expected":{"benefits":22345,"cash":343955,"tax_expense":27045,"wage_expense":434567,"withholding":95312},"passed":false},{"actual":{"benefits":29690,"cash":104339,"tax_expense":13865,"wage_expense":181234,"withholding":61070},"check":"control 1","expected":{"benefits":29690,"cash":104339,"tax_expense":13865,"wage_expense":181234,"withholding":61070},"passed":true},{"actual":{"benefits":10000,"cash":294705,"tax_expense":32895,"wage_expense":430000,"withholding":158190},"check":"control 2","expected":{"benefits":10000,"cash":294705,"tax_expense":32895,"wage_expense":430000,"withholding":158190},"passed":true},{"actual":{"benefits":17345,"cash":67755,"tax_expense":7745,"wage_expense":101234,"withholding":23879},"check":"control 3","expected":{"benefits":17345,"cash":67755,"tax_expense":7745,"wage_expense":101234,"withholding":23879},"passed":true},{"actual":{"benefits":24690,"cash":319174,"tax_expense":31715,"wage_expense":414567,"withholding":102418},"check":"control 4","expected":{"benefits":24690,"cash":319174,"tax_expense":31715,"wage_expense":414567,"withholding":102418},"passed":true},{"actual":{"benefits":24690,"cash":227834,"tax_expense":26870,"wage_expense":351234,"withholding":125580},"check":"control 5","expected":{"benefits":24690,"cash":227834,"tax_expense":26870,"wage_expense":351234,"withholding":125580},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: medicare cap\", \"actual\": {\"wage_expense\": 100000, \"tax_expense\": 5170, \"cash\": 78430, \"withholding\": 21740, \"benefits\": 5000}, \"expected\": {\"wage_expense\": 100000, \"tax_expense\": 5170, \"cash\": 78430, \"withholding\": 21740, \"benefits\": 5000}, \"passed\": true}, {\"check\": \"regression: medicare cap, partial-repair probe\", \"actual\": {\"wage_expense\": 434567, \"tax_expense\": 25595, \"cash\": 345405, \"withholding\": 92412, \"benefits\": 22345}, \"expected\": {\"wage_expense\": 434567, \"tax_expense\": 27045, \"cash\": 343955, \"withholding\": 95312, \"benefits\": 22345}, \"passed\": false}, {\"check\": \"control 1\", \"actual\": {\"wage_expense\": 181234, \"tax_expense\": 13865, \"cash\": 104339, \"withholding\": 61070, \"benefits\": 29690}, \"expected\": {\"wage_expense\": 181234, \"tax_expense\": 13865, \"cash\": 104339, \"withholding\": 61070, \"benefits\": 29690}, \"passed\": true}, {\"check\": \"control 2\", \"actual\": {\"wage_expense\": 430000, \"tax_expense\": 32895, \"cash\": 294705, \"withholding\": 158190, \"benefits\": 10000}, \"expected\": {\"wage_expense\": 430000, \"tax_expense\": 32895, \"cash\": 294705, \"withholding\": 158190, \"benefits\": 10000}, \"passed\": true}, {\"check\": \"control 3\", \"actual\": {\"wage_expense\": 101234, \"tax_expense\": 7745, \"cash\": 67755, \"withholding\": 23879, \"benefits\": 17345}, \"expected\": {\"wage_expense\": 101234, \"tax_expense\": 7745, \"cash\": 67755, \"withholding\": 23879, \"benefits\": 17345}, \"passed\": true}, {\"check\": \"control 4\", \"actual\": {\"wage_expense\": 414567, \"tax_expense\": 31715, \"cash\": 319174, \"withholding\": 102418, \"benefits\": 24690}, \"expected\": {\"wage_expense\": 414567, \"tax_expense\": 31715, \"cash\": 319174, \"withholding\": 102418, \"benefits\": 24690}, \"passed\": true}, {\"check\": \"control 5\", \"actual\": {\"wage_expense\": 351234, \"tax_expense\": 26870, \"cash\": 227834, \"withholding\": 125580, \"benefits\": 24690}, \"expected\": {\"wage_expense\": 351234, \"tax_expense\": 26870, \"cash\": 227834, \"withholding\": 125580, \"benefits\": 24690}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.852,"exit_code":1,"observations":[{"actual":{"benefits":5000,"cash":79010,"tax_expense":4590,"wage_expense":100000,"withholding":20580},"check":"regression: medicare cap","expected":{"benefits":5000,"cash":78430,"tax_expense":5170,"wage_expense":100000,"withholding":21740},"passed":false},{"actual":{"benefits":22345,"cash":345405,"tax_expense":25595,"wage_expense":434567,"withholding":92412},"check":"regression: medicare cap, partial-repair probe","expected":{"benefits":22345,"cash":343955,"tax_expense":27045,"wage_expense":434567,"withholding":95312},"passed":false},{"actual":{"benefits":29690,"cash":104339,"tax_expense":13865,"wage_expense":181234,"withholding":61070},"check":"control 1","expected":{"benefits":29690,"cash":104339,"tax_expense":13865,"wage_expense":181234,"withholding":61070},"passed":true},{"actual":{"benefits":10000,"cash":294705,"tax_expense":32895,"wage_expense":430000,"withholding":158190},"check":"control 2","expected":{"benefits":10000,"cash":294705,"tax_expense":32895,"wage_expense":430000,"withholding":158190},"passed":true},{"actual":{"benefits":17345,"cash":67755,"tax_expense":7745,"wage_expense":101234,"withholding":23879},"check":"control 3","expected":{"benefits":17345,"cash":67755,"tax_expense":7745,"wage_expense":101234,"withholding":23879},"passed":true},{"actual":{"benefits":24690,"cash":319174,"tax_expense":31715,"wage_expense":414567,"withholding":102418},"check":"control 4","expected":{"benefits":24690,"cash":319174,"tax_expense":31715,"wage_expense":414567,"withholding":102418},"passed":true},{"actual":{"benefits":24690,"cash":227834,"tax_expense":26870,"wage_expense":351234,"withholding":125580},"check":"control 5","expected":{"benefits":24690,"cash":227834,"tax_expense":26870,"wage_expense":351234,"withholding":125580},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: medicare cap\", \"actual\": {\"wage_expense\": 100000, \"tax_expense\": 4590, \"cash\": 79010, \"withholding\": 20580, \"benefits\": 5000}, \"expected\": {\"wage_expense\": 100000, \"tax_expense\": 5170, \"cash\": 78430, \"withholding\": 21740, \"benefits\": 5000}, \"passed\": false}, {\"check\": \"regression: medicare cap, partial-repair probe\", \"actual\": {\"wage_expense\": 434567, \"tax_expense\": 25595, \"cash\": 345405, \"withholding\": 92412, \"benefits\": 22345}, \"expected\": {\"wage_expense\": 434567, \"tax_expense\": 27045, \"cash\": 343955, \"withholding\": 95312, \"benefits\": 22345}, \"passed\": false}, {\"check\": \"control 1\", \"actual\": {\"wage_expense\": 181234, \"tax_expense\": 13865, \"cash\": 104339, \"withholding\": 61070, \"benefits\": 29690}, \"expected\": {\"wage_expense\": 181234, \"tax_expense\": 13865, \"cash\": 104339, \"withholding\": 61070, \"benefits\": 29690}, \"passed\": true}, {\"check\": \"control 2\", \"actual\": {\"wage_expense\": 430000, \"tax_expense\": 32895, \"cash\": 294705, \"withholding\": 158190, \"benefits\": 10000}, \"expected\": {\"wage_expense\": 430000, \"tax_expense\": 32895, \"cash\": 294705, \"withholding\": 158190, \"benefits\": 10000}, \"passed\": true}, {\"check\": \"control 3\", \"actual\": {\"wage_expense\": 101234, \"tax_expense\": 7745, \"cash\": 67755, \"withholding\": 23879, \"benefits\": 17345}, \"expected\": {\"wage_expense\": 101234, \"tax_expense\": 7745, \"cash\": 67755, \"withholding\": 23879, \"benefits\": 17345}, \"passed\": true}, {\"check\": \"control 4\", \"actual\": {\"wage_expense\": 414567, \"tax_expense\": 31715, \"cash\": 319174, \"withholding\": 102418, \"benefits\": 24690}, \"expected\": {\"wage_expense\": 414567, \"tax_expense\": 31715, \"cash\": 319174, \"withholding\": 102418, \"benefits\": 24690}, \"passed\": true}, {\"check\": \"control 5\", \"actual\": {\"wage_expense\": 351234, \"tax_expense\": 26870, \"cash\": 227834, \"withholding\": 125580, \"benefits\": 24690}, \"expected\": {\"wage_expense\": 351234, \"tax_expense\": 26870, \"cash\": 227834, \"withholding\": 125580, \"benefits\": 24690}, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":43.004,"exit_code":0,"observations":[{"actual":{"benefits":5000,"cash":78430,"tax_expense":5170,"wage_expense":100000,"withholding":21740},"check":"regression: medicare cap","expected":{"benefits":5000,"cash":78430,"tax_expense":5170,"wage_expense":100000,"withholding":21740},"passed":true},{"actual":{"benefits":22345,"cash":343955,"tax_expense":27045,"wage_expense":434567,"withholding":95312},"check":"regression: medicare cap, partial-repair probe","expected":{"benefits":22345,"cash":343955,"tax_expense":27045,"wage_expense":434567,"withholding":95312},"passed":true},{"actual":{"benefits":29690,"cash":104339,"tax_expense":13865,"wage_expense":181234,"withholding":61070},"check":"control 1","expected":{"benefits":29690,"cash":104339,"tax_expense":13865,"wage_expense":181234,"withholding":61070},"passed":true},{"actual":{"benefits":10000,"cash":294705,"tax_expense":32895,"wage_expense":430000,"withholding":158190},"check":"control 2","expected":{"benefits":10000,"cash":294705,"tax_expense":32895,"wage_expense":430000,"withholding":158190},"passed":true},{"actual":{"benefits":17345,"cash":67755,"tax_expense":7745,"wage_expense":101234,"withholding":23879},"check":"control 3","expected":{"benefits":17345,"cash":67755,"tax_expense":7745,"wage_expense":101234,"withholding":23879},"passed":true},{"actual":{"benefits":24690,"cash":319174,"tax_expense":31715,"wage_expense":414567,"withholding":102418},"check":"control 4","expected":{"benefits":24690,"cash":319174,"tax_expense":31715,"wage_expense":414567,"withholding":102418},"passed":true},{"actual":{"benefits":24690,"cash":227834,"tax_expense":26870,"wage_expense":351234,"withholding":125580},"check":"control 5","expected":{"benefits":24690,"cash":227834,"tax_expense":26870,"wage_expense":351234,"withholding":125580},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: medicare cap\", \"actual\": {\"wage_expense\": 100000, \"tax_expense\": 5170, \"cash\": 78430, \"withholding\": 21740, \"benefits\": 5000}, \"expected\": {\"wage_expense\": 100000, \"tax_expense\": 5170, \"cash\": 78430, \"withholding\": 21740, \"benefits\": 5000}, \"passed\": true}, {\"check\": \"regression: medicare cap, partial-repair probe\", \"actual\": {\"wage_expense\": 434567, \"tax_expense\": 27045, \"cash\": 343955, \"withholding\": 95312, \"benefits\": 22345}, \"expected\": {\"wage_expense\": 434567, \"tax_expense\": 27045, \"cash\": 343955, \"withholding\": 95312, \"benefits\": 22345}, \"passed\": true}, {\"check\": \"control 1\", \"actual\": {\"wage_expense\": 181234, \"tax_expense\": 13865, \"cash\": 104339, \"withholding\": 61070, \"benefits\": 29690}, \"expected\": {\"wage_expense\": 181234, \"tax_expense\": 13865, \"cash\": 104339, \"withholding\": 61070, \"benefits\": 29690}, \"passed\": true}, {\"check\": \"control 2\", \"actual\": {\"wage_expense\": 430000, \"tax_expense\": 32895, \"cash\": 294705, \"withholding\": 158190, \"benefits\": 10000}, \"expected\": {\"wage_expense\": 430000, \"tax_expense\": 32895, \"cash\": 294705, \"withholding\": 158190, \"benefits\": 10000}, \"passed\": true}, {\"check\": \"control 3\", \"actual\": {\"wage_expense\": 101234, \"tax_expense\": 7745, \"cash\": 67755, \"withholding\": 23879, \"benefits\": 17345}, \"expected\": {\"wage_expense\": 101234, \"tax_expense\": 7745, \"cash\": 67755, \"withholding\": 23879, \"benefits\": 17345}, \"passed\": true}, {\"check\": \"control 4\", \"actual\": {\"wage_expense\": 414567, \"tax_expense\": 31715, \"cash\": 319174, \"withholding\": 102418, \"benefits\": 24690}, \"expected\": {\"wage_expense\": 414567, \"tax_expense\": 31715, \"cash\": 319174, \"withholding\": 102418, \"benefits\": 24690}, \"passed\": true}, {\"check\": \"control 5\", \"actual\": {\"wage_expense\": 351234, \"tax_expense\": 26870, \"cash\": 227834, \"withholding\": 125580, \"benefits\": 24690}, \"expected\": {\"wage_expense\": 351234, \"tax_expense\": 26870, \"cash\": 227834, \"withholding\": 125580, \"benefits\": 24690}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}