{"abstract":"Employees below the threshold get additional Medicare wages larger than the paycheck itself.","category":"Payroll withholding rules","checks":9,"contract":"Input [ytd_wages, wages] in cents. Regular Medicare is 1.45% of wages rounded half-up. Additional Medicare is 0.9% of the part of this paycheck that pushes year-to-date wages above 200,000.00, rounded half-up separately. Return [medicare, additional_wages, medicare + additional].","contract_signature":"x","evaluation_group":"w2-payroll-withholding-additional-medicare","failed_approach":"The attempt floors the prior excess but subtracts the current paycheck from year-to-date as if it were already included, double-counting the crossing paycheck.","family":"w2-payroll-withholding-additional-medicare-prior-excess-measurement","id":"FA-58871","implementations":{"attempt":{"sha256":"20542187388bf68e4501330b1dce819991e5f8ebbb2809d682a1f1ac64c91cde","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    ytd, wages = x\n    base_tax = (wages * 145 + 5000) // 10000\n    over_before = max(0, ytd - wages - 20000000)\n    over_after = max(0, ytd + wages - 20000000)\n    extra_wages = over_after - over_before\n    extra = (extra_wages * 9 + 500) // 1000\n    return [base_tax, extra_wages, base_tax + extra]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression (boundary)', [19950000, 100000], [1450, 50000, 1900]), ('regression (boundary)', [0, 0], [0, 0, 0]), ('partial-repair probe (boundary)', [25000000, 12345], [179, 12345, 290]), ('partial-repair probe', [20158685, 407195], [5904, 407195, 9569]), ('boundary control', [20000000, 100000], [1450, 100000, 2350]), ('normal control', [20000000, 1829965], [26534, 1829965, 43004]), ('normal control', [20000000, 654261], [9487, 654261, 15375]), ('normal control', [20000000, 1204410], [17464, 1204410, 28304]), ('normal control', [20000000, 35595], [516, 35595, 836])], [('regression (boundary)', [0, 0], [0, 0, 0]), ('regression (boundary)', [19999999, 1], [0, 0, 0]), ('partial-repair probe', [20518887, 2208012], [32016, 2208012, 51888]), ('partial-repair probe', [20723172, 31906], [463, 31906, 750]), ('boundary control', [20000000, 100000], [1450, 100000, 2350]), ('normal control', [20000000, 13601], [197, 13601, 319]), ('normal control', [20000000, 211218], [3063, 211218, 4964]), ('normal control', [20000000, 541335], [7849, 541335, 12721]), ('normal control', [20000000, 14262], [207, 14262, 335])], [('regression (boundary)', [19999999, 1], [0, 0, 0]), ('regression', [7554383, 209883], [3043, 0, 3043]), ('partial-repair probe', [20767841, 19138], [278, 19138, 450]), ('partial-repair probe', [20469014, 260626], [3779, 260626, 6125]), ('boundary control', [20000000, 100000], [1450, 100000, 2350]), ('normal control', [20000000, 15560], [226, 15560, 366]), ('normal control', [20000000, 46156], [669, 46156, 1084]), ('normal control', [20000000, 8435], [122, 8435, 198]), ('normal control', [20000000, 12860], [186, 12860, 302])], [('regression', [7554383, 209883], [3043, 0, 3043]), ('regression', [8001356, 2662166], [38601, 0, 38601]), ('partial-repair probe', [23912137, 659488], [9563, 659488, 15498]), ('partial-repair probe', [21835663, 1842418], [26715, 1842418, 43297]), ('boundary control', [20000000, 100000], [1450, 100000, 2350]), ('normal control', [20000000, 2376741], [34463, 2376741, 55854]), ('normal control', [20000000, 808350], [11721, 808350, 18996]), ('normal control', [20000000, 9624], [140, 9624, 227]), ('normal control', [20000000, 1041041], [15095, 1041041, 24464])], [('regression', [8001356, 2662166], [38601, 0, 38601]), ('regression', [2439490, 49414], [717, 0, 717]), ('partial-repair probe', [20631534, 41656], [604, 41656, 979]), ('partial-repair probe', [20609547, 21397], [310, 21397, 503]), ('boundary control', [20000000, 100000], [1450, 100000, 2350]), ('normal control', [20000000, 325488], [4720, 325488, 7649]), ('normal control', [20000000, 229558], [3329, 229558, 5395]), ('normal control', [20000000, 2962928], [42962, 2962928, 69628]), ('normal control', [20000000, 1917303], [27801, 1917303, 45057])]]\nfor i, (label, args, expected) in enumerate(fixtures[N-1]):\n    check(\"%s %d\" % (label, i), 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":"d240e780094e98d6d762b5b1e1c3538bbd429f5335ad4c7b22f5b84e8021f42a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    ytd, wages = x\n    base_tax = (wages * 145 + 5000) // 10000\n    over_before = ytd - 20000000\n    over_after = max(0, ytd + wages - 20000000)\n    extra_wages = over_after - over_before\n    extra = (extra_wages * 9 + 500) // 1000\n    return [base_tax, extra_wages, base_tax + extra]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression (boundary)', [19950000, 100000], [1450, 50000, 1900]), ('regression (boundary)', [0, 0], [0, 0, 0]), ('partial-repair probe (boundary)', [25000000, 12345], [179, 12345, 290]), ('partial-repair probe', [20158685, 407195], [5904, 407195, 9569]), ('boundary control', [20000000, 100000], [1450, 100000, 2350]), ('normal control', [20000000, 1829965], [26534, 1829965, 43004]), ('normal control', [20000000, 654261], [9487, 654261, 15375]), ('normal control', [20000000, 1204410], [17464, 1204410, 28304]), ('normal control', [20000000, 35595], [516, 35595, 836])], [('regression (boundary)', [0, 0], [0, 0, 0]), ('regression (boundary)', [19999999, 1], [0, 0, 0]), ('partial-repair probe', [20518887, 2208012], [32016, 2208012, 51888]), ('partial-repair probe', [20723172, 31906], [463, 31906, 750]), ('boundary control', [20000000, 100000], [1450, 100000, 2350]), ('normal control', [20000000, 13601], [197, 13601, 319]), ('normal control', [20000000, 211218], [3063, 211218, 4964]), ('normal control', [20000000, 541335], [7849, 541335, 12721]), ('normal control', [20000000, 14262], [207, 14262, 335])], [('regression (boundary)', [19999999, 1], [0, 0, 0]), ('regression', [7554383, 209883], [3043, 0, 3043]), ('partial-repair probe', [20767841, 19138], [278, 19138, 450]), ('partial-repair probe', [20469014, 260626], [3779, 260626, 6125]), ('boundary control', [20000000, 100000], [1450, 100000, 2350]), ('normal control', [20000000, 15560], [226, 15560, 366]), ('normal control', [20000000, 46156], [669, 46156, 1084]), ('normal control', [20000000, 8435], [122, 8435, 198]), ('normal control', [20000000, 12860], [186, 12860, 302])], [('regression', [7554383, 209883], [3043, 0, 3043]), ('regression', [8001356, 2662166], [38601, 0, 38601]), ('partial-repair probe', [23912137, 659488], [9563, 659488, 15498]), ('partial-repair probe', [21835663, 1842418], [26715, 1842418, 43297]), ('boundary control', [20000000, 100000], [1450, 100000, 2350]), ('normal control', [20000000, 2376741], [34463, 2376741, 55854]), ('normal control', [20000000, 808350], [11721, 808350, 18996]), ('normal control', [20000000, 9624], [140, 9624, 227]), ('normal control', [20000000, 1041041], [15095, 1041041, 24464])], [('regression', [8001356, 2662166], [38601, 0, 38601]), ('regression', [2439490, 49414], [717, 0, 717]), ('partial-repair probe', [20631534, 41656], [604, 41656, 979]), ('partial-repair probe', [20609547, 21397], [310, 21397, 503]), ('boundary control', [20000000, 100000], [1450, 100000, 2350]), ('normal control', [20000000, 325488], [4720, 325488, 7649]), ('normal control', [20000000, 229558], [3329, 229558, 5395]), ('normal control', [20000000, 2962928], [42962, 2962928, 69628]), ('normal control', [20000000, 1917303], [27801, 1917303, 45057])]]\nfor i, (label, args, expected) in enumerate(fixtures[N-1]):\n    check(\"%s %d\" % (label, i), 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 teaching model of a stipulated payroll rule with toy thresholds and rates. It makes no claim of conformance to any tax authority, statute or jurisdiction and is not payroll software. 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-payroll-withholding-additional-medicare-prior-excess-measurement","generated_at":"2026-09-29T14:46:30.829820+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"The employer must begin the extra 0.9% exactly with the paycheck that crosses the threshold, and only on the excess portion.","root_cause":"The excess before this paycheck is not floored at zero, so a negative prior excess inflates the difference.","sha256":"3ee579255dd3789a260d873126d3e1470bcfd9dfc6927e08beef83e7011e4ecf","title":"Additional Medicare withholding threshold: prior excess measurement · 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":41.35,"exit_code":1,"observations":[{"actual":[1450,50000,1900],"check":"regression (boundary) 0","expected":[1450,50000,1900],"passed":true},{"actual":[0,0,0],"check":"regression (boundary) 1","expected":[0,0,0],"passed":true},{"actual":[179,24690,401],"check":"partial-repair probe (boundary) 2","expected":[179,12345,290],"passed":false},{"actual":[5904,565880,10997],"check":"partial-repair probe 3","expected":[5904,407195,9569],"passed":false},{"actual":[1450,100000,2350],"check":"boundary control 4","expected":[1450,100000,2350],"passed":true},{"actual":[26534,1829965,43004],"check":"normal control 5","expected":[26534,1829965,43004],"passed":true},{"actual":[9487,654261,15375],"check":"normal control 6","expected":[9487,654261,15375],"passed":true},{"actual":[17464,1204410,28304],"check":"normal control 7","expected":[17464,1204410,28304],"passed":true},{"actual":[516,35595,836],"check":"normal control 8","expected":[516,35595,836],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression (boundary) 0\", \"actual\": [1450, 50000, 1900], \"expected\": [1450, 50000, 1900], \"passed\": true}, {\"check\": \"regression (boundary) 1\", \"actual\": [0, 0, 0], \"expected\": [0, 0, 0], \"passed\": true}, {\"check\": \"partial-repair probe (boundary) 2\", \"actual\": [179, 24690, 401], \"expected\": [179, 12345, 290], \"passed\": false}, {\"check\": \"partial-repair probe 3\", \"actual\": [5904, 565880, 10997], \"expected\": [5904, 407195, 9569], \"passed\": false}, {\"check\": \"boundary control 4\", \"actual\": [1450, 100000, 2350], \"expected\": [1450, 100000, 2350], \"passed\": true}, {\"check\": \"normal control 5\", \"actual\": [26534, 1829965, 43004], \"expected\": [26534, 1829965, 43004], \"passed\": true}, {\"check\": \"normal control 6\", \"actual\": [9487, 654261, 15375], \"expected\": [9487, 654261, 15375], \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": [17464, 1204410, 28304], \"expected\": [17464, 1204410, 28304], \"passed\": true}, {\"check\": \"normal control 8\", \"actual\": [516, 35595, 836], \"expected\": [516, 35595, 836], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.562,"exit_code":1,"observations":[{"actual":[1450,100000,2350],"check":"regression (boundary) 0","expected":[1450,50000,1900],"passed":false},{"actual":[0,20000000,180000],"check":"regression (boundary) 1","expected":[0,0,0],"passed":false},{"actual":[179,12345,290],"check":"partial-repair probe (boundary) 2","expected":[179,12345,290],"passed":true},{"actual":[5904,407195,9569],"check":"partial-repair probe 3","expected":[5904,407195,9569],"passed":true},{"actual":[1450,100000,2350],"check":"boundary control 4","expected":[1450,100000,2350],"passed":true},{"actual":[26534,1829965,43004],"check":"normal control 5","expected":[26534,1829965,43004],"passed":true},{"actual":[9487,654261,15375],"check":"normal control 6","expected":[9487,654261,15375],"passed":true},{"actual":[17464,1204410,28304],"check":"normal control 7","expected":[17464,1204410,28304],"passed":true},{"actual":[516,35595,836],"check":"normal control 8","expected":[516,35595,836],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression (boundary) 0\", \"actual\": [1450, 100000, 2350], \"expected\": [1450, 50000, 1900], \"passed\": false}, {\"check\": \"regression (boundary) 1\", \"actual\": [0, 20000000, 180000], \"expected\": [0, 0, 0], \"passed\": false}, {\"check\": \"partial-repair probe (boundary) 2\", \"actual\": [179, 12345, 290], \"expected\": [179, 12345, 290], \"passed\": true}, {\"check\": \"partial-repair probe 3\", \"actual\": [5904, 407195, 9569], \"expected\": [5904, 407195, 9569], \"passed\": true}, {\"check\": \"boundary control 4\", \"actual\": [1450, 100000, 2350], \"expected\": [1450, 100000, 2350], \"passed\": true}, {\"check\": \"normal control 5\", \"actual\": [26534, 1829965, 43004], \"expected\": [26534, 1829965, 43004], \"passed\": true}, {\"check\": \"normal control 6\", \"actual\": [9487, 654261, 15375], \"expected\": [9487, 654261, 15375], \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": [17464, 1204410, 28304], \"expected\": [17464, 1204410, 28304], \"passed\": true}, {\"check\": \"normal control 8\", \"actual\": [516, 35595, 836], \"expected\": [516, 35595, 836], \"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."}}