FAILURE MAP
← Case archive

FA-58866 / Payroll withholding rules / Open access

Additional Medicare withholding threshold: threshold crossing portion · case 01

After the threshold is crossed, each paycheck applies the extra 0.9% to all year-to-date excess wages again.

Verified by executionVariant 1 · 10 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The additional wages use cumulative excess after this paycheck without subtracting excess already taxed on earlier paychecks.

THE FAILURE

The additional wages use cumulative excess after this paycheck without subtracting excess already taxed on earlier paychecks.

Unsuccessful approach: The attempt applies the extra rate to the entire crossing paycheck, including the part that was still under the threshold.

Case 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].

Why this case matters

The employer must begin the extra 0.9% exactly with the paycheck that crosses the threshold, and only on the excess portion.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    ytd, wages = x
    base_tax = (wages * 145 + 5000) // 10000
    over_before = max(0, ytd - 20000000)
    over_after = max(0, ytd + wages - 20000000)
    extra_wages = over_after
    extra = (extra_wages * 9 + 500) // 1000
    return [base_tax, extra_wages, base_tax + extra]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression (boundary)', [25000000, 12345], [179, 12345, 290]), ('regression', [20158685, 407195], [5904, 407195, 9569]), ('partial-repair probe (boundary)', [19950000, 100000], [1450, 50000, 1900]), ('partial-repair probe', [19681988, 1173456], [17015, 855444, 24714]), ('boundary control', [20000000, 100000], [1450, 100000, 2350]), ('boundary control', [0, 0], [0, 0, 0]), ('normal control', [20000000, 1829965], [26534, 1829965, 43004]), ('normal control', [7554383, 209883], [3043, 0, 3043]), ('normal control', [8001356, 2662166], [38601, 0, 38601]), ('normal control', [2439490, 49414], [717, 0, 717])], [('regression', [20158685, 407195], [5904, 407195, 9569]), ('regression', [20518887, 2208012], [32016, 2208012, 51888]), ('partial-repair probe', [19655408, 1735735], [25168, 1391143, 37688]), ('partial-repair probe', [19294581, 2127366], [30847, 1421947, 43645]), ('boundary control', [19999999, 1], [0, 0, 0]), ('boundary control', [20000000, 100000], [1450, 100000, 2350]), ('normal control', [19686537, 15872], [230, 0, 230]), ('normal control', [3879860, 1040777], [15091, 0, 15091]), ('normal control', [4213397, 2332986], [33828, 0, 33828]), ('normal control', [20000000, 654261], [9487, 654261, 15375])], [('regression', [20518887, 2208012], [32016, 2208012, 51888]), ('regression', [20723172, 31906], [463, 31906, 750]), ('partial-repair probe', [18969228, 1480792], [21471, 450020, 25521]), ('partial-repair probe', [19374794, 688164], [9978, 62958, 10545]), ('boundary control', [0, 0], [0, 0, 0]), ('boundary control', [19999999, 1], [0, 0, 0]), ('normal control', [20000000, 1204410], [17464, 1204410, 28304]), ('normal control', [624582, 1378603], [19990, 0, 19990]), ('normal control', [20000000, 35595], [516, 35595, 836]), ('normal control', [4705614, 33884], [491, 0, 491])], [('regression', [20723172, 31906], [463, 31906, 750]), ('regression', [20767841, 19138], [278, 19138, 450]), ('partial-repair probe', [19941228, 756160], [10964, 697388, 17240]), ('partial-repair probe', [19991624, 2672639], [38753, 2664263, 62731]), ('boundary control', [20000000, 100000], [1450, 100000, 2350]), ('boundary control', [0, 0], [0, 0, 0]), ('normal control', [19201069, 465833], [6755, 0, 6755]), ('normal control', [4401788, 1347616], [19540, 0, 19540]), ('normal control', [703223, 1018779], [14772, 0, 14772]), ('normal control', [916863, 25193], [365, 0, 365])], [('regression', [20767841, 19138], [278, 19138, 450]), ('regression', [20469014, 260626], [3779, 260626, 6125]), ('partial-repair probe', [19375910, 788766], [11437, 164676, 12919]), ('partial-repair probe', [19564065, 1766252], [25611, 1330317, 37584]), ('boundary control', [19999999, 1], [0, 0, 0]), ('boundary control', [20000000, 100000], [1450, 100000, 2350]), ('normal control', [20000000, 13601], [197, 13601, 319]), ('normal control', [10047708, 404743], [5869, 0, 5869]), ('normal control', [20000000, 211218], [3063, 211218, 4964]), ('normal control', [10176860, 61801], [896, 0, 896])]]
for i, (label, args, expected) in enumerate(fixtures[N-1]):
    check("%s %d" % (label, i), solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
regression (boundary) 0[179, 5012345, 45290][179, 12345, 290]Failed
regression 1[5904, 565880, 10997][5904, 407195, 9569]Failed
partial-repair probe (boundary) 2[1450, 50000, 1900][1450, 50000, 1900]Passed
partial-repair probe 3[17015, 855444, 24714][17015, 855444, 24714]Passed
boundary control 4[1450, 100000, 2350][1450, 100000, 2350]Passed
boundary control 5[0, 0, 0][0, 0, 0]Passed
normal control 6[26534, 1829965, 43004][26534, 1829965, 43004]Passed
normal control 7[3043, 0, 3043][3043, 0, 3043]Passed
normal control 8[38601, 0, 38601][38601, 0, 38601]Passed
normal control 9[717, 0, 717][717, 0, 717]Passed

SHA-256 / 9f88a9613eb02106b7c53b1774e9d01a014f91581530363b2169bf7135715599

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    ytd, wages = x
    base_tax = (wages * 145 + 5000) // 10000
    over_before = max(0, ytd - 20000000)
    over_after = max(0, ytd + wages - 20000000)
    extra_wages = wages if ytd + wages > 20000000 else 0
    extra = (extra_wages * 9 + 500) // 1000
    return [base_tax, extra_wages, base_tax + extra]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression (boundary)', [25000000, 12345], [179, 12345, 290]), ('regression', [20158685, 407195], [5904, 407195, 9569]), ('partial-repair probe (boundary)', [19950000, 100000], [1450, 50000, 1900]), ('partial-repair probe', [19681988, 1173456], [17015, 855444, 24714]), ('boundary control', [20000000, 100000], [1450, 100000, 2350]), ('boundary control', [0, 0], [0, 0, 0]), ('normal control', [20000000, 1829965], [26534, 1829965, 43004]), ('normal control', [7554383, 209883], [3043, 0, 3043]), ('normal control', [8001356, 2662166], [38601, 0, 38601]), ('normal control', [2439490, 49414], [717, 0, 717])], [('regression', [20158685, 407195], [5904, 407195, 9569]), ('regression', [20518887, 2208012], [32016, 2208012, 51888]), ('partial-repair probe', [19655408, 1735735], [25168, 1391143, 37688]), ('partial-repair probe', [19294581, 2127366], [30847, 1421947, 43645]), ('boundary control', [19999999, 1], [0, 0, 0]), ('boundary control', [20000000, 100000], [1450, 100000, 2350]), ('normal control', [19686537, 15872], [230, 0, 230]), ('normal control', [3879860, 1040777], [15091, 0, 15091]), ('normal control', [4213397, 2332986], [33828, 0, 33828]), ('normal control', [20000000, 654261], [9487, 654261, 15375])], [('regression', [20518887, 2208012], [32016, 2208012, 51888]), ('regression', [20723172, 31906], [463, 31906, 750]), ('partial-repair probe', [18969228, 1480792], [21471, 450020, 25521]), ('partial-repair probe', [19374794, 688164], [9978, 62958, 10545]), ('boundary control', [0, 0], [0, 0, 0]), ('boundary control', [19999999, 1], [0, 0, 0]), ('normal control', [20000000, 1204410], [17464, 1204410, 28304]), ('normal control', [624582, 1378603], [19990, 0, 19990]), ('normal control', [20000000, 35595], [516, 35595, 836]), ('normal control', [4705614, 33884], [491, 0, 491])], [('regression', [20723172, 31906], [463, 31906, 750]), ('regression', [20767841, 19138], [278, 19138, 450]), ('partial-repair probe', [19941228, 756160], [10964, 697388, 17240]), ('partial-repair probe', [19991624, 2672639], [38753, 2664263, 62731]), ('boundary control', [20000000, 100000], [1450, 100000, 2350]), ('boundary control', [0, 0], [0, 0, 0]), ('normal control', [19201069, 465833], [6755, 0, 6755]), ('normal control', [4401788, 1347616], [19540, 0, 19540]), ('normal control', [703223, 1018779], [14772, 0, 14772]), ('normal control', [916863, 25193], [365, 0, 365])], [('regression', [20767841, 19138], [278, 19138, 450]), ('regression', [20469014, 260626], [3779, 260626, 6125]), ('partial-repair probe', [19375910, 788766], [11437, 164676, 12919]), ('partial-repair probe', [19564065, 1766252], [25611, 1330317, 37584]), ('boundary control', [19999999, 1], [0, 0, 0]), ('boundary control', [20000000, 100000], [1450, 100000, 2350]), ('normal control', [20000000, 13601], [197, 13601, 319]), ('normal control', [10047708, 404743], [5869, 0, 5869]), ('normal control', [20000000, 211218], [3063, 211218, 4964]), ('normal control', [10176860, 61801], [896, 0, 896])]]
for i, (label, args, expected) in enumerate(fixtures[N-1]):
    check("%s %d" % (label, i), solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
regression (boundary) 0[179, 12345, 290][179, 12345, 290]Passed
regression 1[5904, 407195, 9569][5904, 407195, 9569]Passed
partial-repair probe (boundary) 2[1450, 100000, 2350][1450, 50000, 1900]Failed
partial-repair probe 3[17015, 1173456, 27576][17015, 855444, 24714]Failed
boundary control 4[1450, 100000, 2350][1450, 100000, 2350]Passed
boundary control 5[0, 0, 0][0, 0, 0]Passed
normal control 6[26534, 1829965, 43004][26534, 1829965, 43004]Passed
normal control 7[3043, 0, 3043][3043, 0, 3043]Passed
normal control 8[38601, 0, 38601][38601, 0, 38601]Passed
normal control 9[717, 0, 717][717, 0, 717]Passed

SHA-256 / b1abb0f62beb78e164d8e6e1ce7591d87ac3e8008e654719871a8c99ea3c31f3

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 10 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

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.

Observations recorded using Python 3.12.14 at 2026-09-29T14:46:30.833021+00:00.

Case digest / c2632bd5b4abcb55c8b4a67ba88d00d1ea058c6f156837b240a7b463822b1fc0