FAILURE MAP
← Case archive

FA-58881 / Payroll withholding rules / Open access

Additional Medicare withholding threshold: additional rate unit · case 01

Additional Medicare withholding is ten times too large once the threshold is crossed.

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

ROOT CAUSE

The 0.9% rate is applied as 9% because the denominator drops one power of ten.

VERIFIED REPAIR

Restore the contract rule at the additional rate unit step: use `extra = (extra_wages * 9 + 500) // 1000`.

Unsuccessful approach: The attempt overcorrects to 0.09%, withholding a tenth of the required additional tax.

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 - over_before
    extra = (extra_wages * 9 + 50) // 100
    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)', [20000000, 100000], [1450, 100000, 2350]), ('regression (boundary)', [19950000, 100000], [1450, 50000, 1900]), ('partial-repair probe (boundary)', [25000000, 12345], [179, 12345, 290]), ('partial-repair probe', [20158685, 407195], [5904, 407195, 9569]), ('boundary control', [0, 0], [0, 0, 0]), ('boundary control', [19999999, 1], [0, 0, 0]), ('normal control', [7554383, 209883], [3043, 0, 3043]), ('normal control', [8001356, 2662166], [38601, 0, 38601]), ('normal control', [2439490, 49414], [717, 0, 717]), ('normal control', [19686537, 15872], [230, 0, 230])], [('regression (boundary)', [19950000, 100000], [1450, 50000, 1900]), ('regression (boundary)', [25000000, 12345], [179, 12345, 290]), ('partial-repair probe', [20158685, 407195], [5904, 407195, 9569]), ('partial-repair probe', [20518887, 2208012], [32016, 2208012, 51888]), ('boundary control', [0, 0], [0, 0, 0]), ('boundary control', [19999999, 1], [0, 0, 0]), ('normal control', [3879860, 1040777], [15091, 0, 15091]), ('normal control', [4213397, 2332986], [33828, 0, 33828]), ('normal control', [624582, 1378603], [19990, 0, 19990]), ('normal control', [4705614, 33884], [491, 0, 491])], [('regression (boundary)', [25000000, 12345], [179, 12345, 290]), ('regression', [20158685, 407195], [5904, 407195, 9569]), ('partial-repair probe', [20518887, 2208012], [32016, 2208012, 51888]), ('partial-repair probe', [20000000, 1829965], [26534, 1829965, 43004]), ('boundary control', [0, 0], [0, 0, 0]), ('boundary control', [19999999, 1], [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', [20158685, 407195], [5904, 407195, 9569]), ('regression', [20518887, 2208012], [32016, 2208012, 51888]), ('partial-repair probe', [19681988, 1173456], [17015, 855444, 24714]), ('partial-repair probe', [19655408, 1735735], [25168, 1391143, 37688]), ('boundary control', [0, 0], [0, 0, 0]), ('boundary control', [19999999, 1], [0, 0, 0]), ('normal control', [10047708, 404743], [5869, 0, 5869]), ('normal control', [10176860, 61801], [896, 0, 896]), ('normal control', [10855940, 2686693], [38957, 0, 38957]), ('normal control', [19631063, 17474], [253, 0, 253])], [('regression', [20518887, 2208012], [32016, 2208012, 51888]), ('regression', [20000000, 1829965], [26534, 1829965, 43004]), ('partial-repair probe', [20723172, 31906], [463, 31906, 750]), ('partial-repair probe', [20767841, 19138], [278, 19138, 450]), ('boundary control', [0, 0], [0, 0, 0]), ('boundary control', [19999999, 1], [0, 0, 0]), ('normal control', [14097993, 22841], [331, 0, 331]), ('normal control', [8593667, 1082072], [15690, 0, 15690]), ('normal control', [3135753, 2538919], [36814, 0, 36814]), ('normal control', [8401894, 797881], [11569, 0, 11569])]]
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[1450, 100000, 10450][1450, 100000, 2350]Failed
regression (boundary) 1[1450, 50000, 5950][1450, 50000, 1900]Failed
partial-repair probe (boundary) 2[179, 12345, 1290][179, 12345, 290]Failed
partial-repair probe 3[5904, 407195, 42552][5904, 407195, 9569]Failed
boundary control 4[0, 0, 0][0, 0, 0]Passed
boundary control 5[0, 0, 0][0, 0, 0]Passed
normal control 6[3043, 0, 3043][3043, 0, 3043]Passed
normal control 7[38601, 0, 38601][38601, 0, 38601]Passed
normal control 8[717, 0, 717][717, 0, 717]Passed
normal control 9[230, 0, 230][230, 0, 230]Passed

SHA-256 / d0ad26700286389f56e109d06fd4ca231e6ecb49eb53572539b336642ffda624

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 = over_after - over_before
    extra = (extra_wages * 9 + 5000) // 10000
    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)', [20000000, 100000], [1450, 100000, 2350]), ('regression (boundary)', [19950000, 100000], [1450, 50000, 1900]), ('partial-repair probe (boundary)', [25000000, 12345], [179, 12345, 290]), ('partial-repair probe', [20158685, 407195], [5904, 407195, 9569]), ('boundary control', [0, 0], [0, 0, 0]), ('boundary control', [19999999, 1], [0, 0, 0]), ('normal control', [7554383, 209883], [3043, 0, 3043]), ('normal control', [8001356, 2662166], [38601, 0, 38601]), ('normal control', [2439490, 49414], [717, 0, 717]), ('normal control', [19686537, 15872], [230, 0, 230])], [('regression (boundary)', [19950000, 100000], [1450, 50000, 1900]), ('regression (boundary)', [25000000, 12345], [179, 12345, 290]), ('partial-repair probe', [20158685, 407195], [5904, 407195, 9569]), ('partial-repair probe', [20518887, 2208012], [32016, 2208012, 51888]), ('boundary control', [0, 0], [0, 0, 0]), ('boundary control', [19999999, 1], [0, 0, 0]), ('normal control', [3879860, 1040777], [15091, 0, 15091]), ('normal control', [4213397, 2332986], [33828, 0, 33828]), ('normal control', [624582, 1378603], [19990, 0, 19990]), ('normal control', [4705614, 33884], [491, 0, 491])], [('regression (boundary)', [25000000, 12345], [179, 12345, 290]), ('regression', [20158685, 407195], [5904, 407195, 9569]), ('partial-repair probe', [20518887, 2208012], [32016, 2208012, 51888]), ('partial-repair probe', [20000000, 1829965], [26534, 1829965, 43004]), ('boundary control', [0, 0], [0, 0, 0]), ('boundary control', [19999999, 1], [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', [20158685, 407195], [5904, 407195, 9569]), ('regression', [20518887, 2208012], [32016, 2208012, 51888]), ('partial-repair probe', [19681988, 1173456], [17015, 855444, 24714]), ('partial-repair probe', [19655408, 1735735], [25168, 1391143, 37688]), ('boundary control', [0, 0], [0, 0, 0]), ('boundary control', [19999999, 1], [0, 0, 0]), ('normal control', [10047708, 404743], [5869, 0, 5869]), ('normal control', [10176860, 61801], [896, 0, 896]), ('normal control', [10855940, 2686693], [38957, 0, 38957]), ('normal control', [19631063, 17474], [253, 0, 253])], [('regression', [20518887, 2208012], [32016, 2208012, 51888]), ('regression', [20000000, 1829965], [26534, 1829965, 43004]), ('partial-repair probe', [20723172, 31906], [463, 31906, 750]), ('partial-repair probe', [20767841, 19138], [278, 19138, 450]), ('boundary control', [0, 0], [0, 0, 0]), ('boundary control', [19999999, 1], [0, 0, 0]), ('normal control', [14097993, 22841], [331, 0, 331]), ('normal control', [8593667, 1082072], [15690, 0, 15690]), ('normal control', [3135753, 2538919], [36814, 0, 36814]), ('normal control', [8401894, 797881], [11569, 0, 11569])]]
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[1450, 100000, 1540][1450, 100000, 2350]Failed
regression (boundary) 1[1450, 50000, 1495][1450, 50000, 1900]Failed
partial-repair probe (boundary) 2[179, 12345, 190][179, 12345, 290]Failed
partial-repair probe 3[5904, 407195, 6270][5904, 407195, 9569]Failed
boundary control 4[0, 0, 0][0, 0, 0]Passed
boundary control 5[0, 0, 0][0, 0, 0]Passed
normal control 6[3043, 0, 3043][3043, 0, 3043]Passed
normal control 7[38601, 0, 38601][38601, 0, 38601]Passed
normal control 8[717, 0, 717][717, 0, 717]Passed
normal control 9[230, 0, 230][230, 0, 230]Passed

SHA-256 / f6e49ff5993d7b92b36a9d004093a1548ad25166a01114ac4ef8b85203b8f2bb

3 / The verified repair

Exit 0
"""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 - over_before
    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)', [20000000, 100000], [1450, 100000, 2350]), ('regression (boundary)', [19950000, 100000], [1450, 50000, 1900]), ('partial-repair probe (boundary)', [25000000, 12345], [179, 12345, 290]), ('partial-repair probe', [20158685, 407195], [5904, 407195, 9569]), ('boundary control', [0, 0], [0, 0, 0]), ('boundary control', [19999999, 1], [0, 0, 0]), ('normal control', [7554383, 209883], [3043, 0, 3043]), ('normal control', [8001356, 2662166], [38601, 0, 38601]), ('normal control', [2439490, 49414], [717, 0, 717]), ('normal control', [19686537, 15872], [230, 0, 230])], [('regression (boundary)', [19950000, 100000], [1450, 50000, 1900]), ('regression (boundary)', [25000000, 12345], [179, 12345, 290]), ('partial-repair probe', [20158685, 407195], [5904, 407195, 9569]), ('partial-repair probe', [20518887, 2208012], [32016, 2208012, 51888]), ('boundary control', [0, 0], [0, 0, 0]), ('boundary control', [19999999, 1], [0, 0, 0]), ('normal control', [3879860, 1040777], [15091, 0, 15091]), ('normal control', [4213397, 2332986], [33828, 0, 33828]), ('normal control', [624582, 1378603], [19990, 0, 19990]), ('normal control', [4705614, 33884], [491, 0, 491])], [('regression (boundary)', [25000000, 12345], [179, 12345, 290]), ('regression', [20158685, 407195], [5904, 407195, 9569]), ('partial-repair probe', [20518887, 2208012], [32016, 2208012, 51888]), ('partial-repair probe', [20000000, 1829965], [26534, 1829965, 43004]), ('boundary control', [0, 0], [0, 0, 0]), ('boundary control', [19999999, 1], [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', [20158685, 407195], [5904, 407195, 9569]), ('regression', [20518887, 2208012], [32016, 2208012, 51888]), ('partial-repair probe', [19681988, 1173456], [17015, 855444, 24714]), ('partial-repair probe', [19655408, 1735735], [25168, 1391143, 37688]), ('boundary control', [0, 0], [0, 0, 0]), ('boundary control', [19999999, 1], [0, 0, 0]), ('normal control', [10047708, 404743], [5869, 0, 5869]), ('normal control', [10176860, 61801], [896, 0, 896]), ('normal control', [10855940, 2686693], [38957, 0, 38957]), ('normal control', [19631063, 17474], [253, 0, 253])], [('regression', [20518887, 2208012], [32016, 2208012, 51888]), ('regression', [20000000, 1829965], [26534, 1829965, 43004]), ('partial-repair probe', [20723172, 31906], [463, 31906, 750]), ('partial-repair probe', [20767841, 19138], [278, 19138, 450]), ('boundary control', [0, 0], [0, 0, 0]), ('boundary control', [19999999, 1], [0, 0, 0]), ('normal control', [14097993, 22841], [331, 0, 331]), ('normal control', [8593667, 1082072], [15690, 0, 15690]), ('normal control', [3135753, 2538919], [36814, 0, 36814]), ('normal control', [8401894, 797881], [11569, 0, 11569])]]
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[1450, 100000, 2350][1450, 100000, 2350]Passed
regression (boundary) 1[1450, 50000, 1900][1450, 50000, 1900]Passed
partial-repair probe (boundary) 2[179, 12345, 290][179, 12345, 290]Passed
partial-repair probe 3[5904, 407195, 9569][5904, 407195, 9569]Passed
boundary control 4[0, 0, 0][0, 0, 0]Passed
boundary control 5[0, 0, 0][0, 0, 0]Passed
normal control 6[3043, 0, 3043][3043, 0, 3043]Passed
normal control 7[38601, 0, 38601][38601, 0, 38601]Passed
normal control 8[717, 0, 717][717, 0, 717]Passed
normal control 9[230, 0, 230][230, 0, 230]Passed

SHA-256 / 27844e4b413540299bd7d31bbb879b49e5722643471e984f0c81048007a16f55

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.874647+00:00.

Case digest / 67db1c8799a3901766c4ec647550f26c7b906f812db4b407981dfdba458d38ea