FAILURE MAP
← Case archive

FA-58856 / Payroll withholding rules / Open access

Social security wage-base withholding: taxable wage cap · case 01

Paychecks that cross the wage base withhold on the full paycheck instead of only the portion below the base.

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

ROOT CAUSE

The paycheck is capped at the whole annual base rather than at the room left after year-to-date wages.

VERIFIED REPAIR

Restore the contract rule at the taxable wage cap step: use `taxable = min(fica, room)`.

Unsuccessful approach: The attempt subtracts year-to-date wages from the capped paycheck, which erases tax on ordinary mid-year paychecks.

Case contract

Input {ytd, lines:[[kind, cents]], base, exempt}. Social security wages are reg+ot+bonus+tips minus sec125 (401k deferrals do not reduce them), floored at 0. Exempt employees owe nothing ([0,0]). Taxable = min(wages, max(0, base-ytd)); tax = 6.2% rounded half-up to the cent. Return [taxable, tax].

Why this case matters

Employee social security withholding must stop exactly at the annual wage base and use the FICA wage definition, not the income-tax one.

1 / The failure

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

N = 1
observations = []
def solve(x):
    lines = x['lines']
    fica = 0
    for kind, amt in lines:
        if kind in ('reg', 'ot', 'bonus', 'tips'):
            fica += amt
        elif kind == 'sec125':
            fica -= amt
    fica = max(0, fica)
    if x['exempt']:
        return [0, 0]
    room = max(0, x['base'] - x['ytd'])
    taxable = min(fica, x['base'])
    tax = (taxable * 62 + 500) // 1000
    return [taxable, tax]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression (boundary)', {'ytd': 16800000, 'lines': [['reg', 100000], ['401k', 5000]], 'base': 16860000, 'exempt': False}, [60000, 3720]), ('regression (boundary)', {'ytd': 16860000, 'lines': [['reg', 100000]], 'base': 16860000, 'exempt': False}, [0, 0]), ('partial-repair probe', {'ytd': 16856079, 'lines': [['ot', 1416], ['401k', 15045]], 'base': 16860000, 'exempt': False}, [1416, 88]), ('partial-repair probe', {'ytd': 8981578, 'lines': [['sec125', 35], ['ot', 4702], ['sec125', 74887], ['tips', 226998]], 'base': 17610000, 'exempt': False}, [156778, 9720]), ('boundary control', {'ytd': 0, 'lines': [['sec125', 10000], ['reg', 5000]], 'base': 16860000, 'exempt': False}, [0, 0]), ('boundary control', {'ytd': 0, 'lines': [['reg', 12345]], 'base': 16860000, 'exempt': True}, [0, 0]), ('normal control', {'ytd': 16598376, 'lines': [['401k', 17815], ['sec125', 6865]], 'base': 16860000, 'exempt': False}, [0, 0]), ('normal control', {'ytd': 17473948, 'lines': [['sec125', 1367], ['sec125', 805]], 'base': 17610000, 'exempt': True}, [0, 0]), ('normal control', {'ytd': 16862120, 'lines': [['401k', 4852]], 'base': 16860000, 'exempt': False}, [0, 0]), ('normal control', {'ytd': 17429873, 'lines': [['reg', 14135], ['sec125', 260961], ['ot', 187839]], 'base': 17610000, 'exempt': False}, [0, 0])], [('regression', {'ytd': 789375, 'lines': [['tips', 9625], ['bonus', 237249]], 'base': 1000000, 'exempt': False}, [210625, 13059]), ('regression (boundary)', {'ytd': 16800000, 'lines': [['reg', 100000], ['401k', 5000]], 'base': 16860000, 'exempt': False}, [60000, 3720]), ('partial-repair probe', {'ytd': 8981578, 'lines': [['sec125', 35], ['ot', 4702], ['sec125', 74887], ['tips', 226998]], 'base': 17610000, 'exempt': False}, [156778, 9720]), ('partial-repair probe', {'ytd': 6205542, 'lines': [['ot', 2254], ['reg', 6550], ['tips', 10665], ['sec125', 2193]], 'base': 17610000, 'exempt': False}, [17276, 1071]), ('boundary control', {'ytd': 0, 'lines': [['sec125', 10000], ['reg', 5000]], 'base': 16860000, 'exempt': False}, [0, 0]), ('boundary control', {'ytd': 0, 'lines': [['reg', 12345]], 'base': 16860000, 'exempt': True}, [0, 0]), ('normal control', {'ytd': 17365173, 'lines': [['401k', 1322]], 'base': 17610000, 'exempt': False}, [0, 0]), ('normal control', {'ytd': 16863463, 'lines': [['sec125', 37799], ['reg', 9785]], 'base': 16860000, 'exempt': False}, [0, 0]), ('normal control', {'ytd': 17613197, 'lines': [['sec125', 92109], ['ot', 11145], ['401k', 6145], ['tips', 1513]], 'base': 17610000, 'exempt': True}, [0, 0]), ('normal control', {'ytd': 17386310, 'lines': [['401k', 2353]], 'base': 17610000, 'exempt': False}, [0, 0])], [('regression', {'ytd': 17609450, 'lines': [['bonus', 11635], ['401k', 226117]], 'base': 17610000, 'exempt': False}, [550, 34]), ('regression', {'ytd': 1002361, 'lines': [['bonus', 5955]], 'base': 1000000, 'exempt': False}, [0, 0]), ('partial-repair probe', {'ytd': 888135, 'lines': [['reg', 4773]], 'base': 1000000, 'exempt': False}, [4773, 296]), ('partial-repair probe', {'ytd': 3381968, 'lines': [['401k', 4345], ['ot', 6225]], 'base': 17610000, 'exempt': False}, [6225, 386]), ('boundary control', {'ytd': 0, 'lines': [['sec125', 10000], ['reg', 5000]], 'base': 16860000, 'exempt': False}, [0, 0]), ('boundary control', {'ytd': 0, 'lines': [['reg', 12345]], 'base': 16860000, 'exempt': True}, [0, 0]), ('normal control', {'ytd': 16863311, 'lines': [['tips', 19505]], 'base': 16860000, 'exempt': True}, [0, 0]), ('normal control', {'ytd': 4871884, 'lines': [['401k', 9525]], 'base': 17610000, 'exempt': False}, [0, 0]), ('normal control', {'ytd': 16860000, 'lines': [['sec125', 187425]], 'base': 16860000, 'exempt': False}, [0, 0]), ('normal control', {'ytd': 16778428, 'lines': [['sec125', 16475]], 'base': 16860000, 'exempt': False}, [0, 0])], [('regression', {'ytd': 891566, 'lines': [['sec125', 4183], ['bonus', 171839], ['bonus', 197531]], 'base': 1000000, 'exempt': False}, [108434, 6723]), ('regression', {'ytd': 1004946, 'lines': [['bonus', 48], ['ot', 3255]], 'base': 1000000, 'exempt': False}, [0, 0]), ('partial-repair probe', {'ytd': 16617084, 'lines': [['reg', 4712], ['reg', 365692], ['sec125', 340208]], 'base': 16860000, 'exempt': False}, [30196, 1872]), ('partial-repair probe', {'ytd': 17543362, 'lines': [['401k', 1330], ['ot', 1995], ['bonus', 366]], 'base': 17610000, 'exempt': False}, [2361, 146]), ('boundary control', {'ytd': 0, 'lines': [['sec125', 10000], ['reg', 5000]], 'base': 16860000, 'exempt': False}, [0, 0]), ('boundary control', {'ytd': 0, 'lines': [['reg', 12345]], 'base': 16860000, 'exempt': True}, [0, 0]), ('normal control', {'ytd': 6681616, 'lines': [['401k', 7785], ['ot', 63049], ['401k', 3512], ['sec125', 271794]], 'base': 16860000, 'exempt': True}, [0, 0]), ('normal control', {'ytd': 16674229, 'lines': [['reg', 272699]], 'base': 16860000, 'exempt': True}, [0, 0]), ('normal control', {'ytd': 1004258, 'lines': [['sec125', 572]], 'base': 1000000, 'exempt': False}, [0, 0]), ('normal control', {'ytd': 16606444, 'lines': [['sec125', 230940]], 'base': 16860000, 'exempt': False}, [0, 0])], [('regression', {'ytd': 864974, 'lines': [['tips', 18765], ['401k', 1429], ['ot', 289833], ['ot', 1800]], 'base': 1000000, 'exempt': False}, [135026, 8372]), ('regression', {'ytd': 1000562, 'lines': [['ot', 19155], ['sec125', 716], ['bonus', 9555], ['ot', 607]], 'base': 1000000, 'exempt': False}, [0, 0]), ('partial-repair probe', {'ytd': 4027320, 'lines': [['tips', 88262], ['bonus', 963], ['sec125', 1621], ['ot', 9375]], 'base': 17610000, 'exempt': False}, [96979, 6013]), ('partial-repair probe', {'ytd': 789375, 'lines': [['tips', 9625], ['bonus', 237249]], 'base': 1000000, 'exempt': False}, [210625, 13059]), ('boundary control', {'ytd': 0, 'lines': [['sec125', 10000], ['reg', 5000]], 'base': 16860000, 'exempt': False}, [0, 0]), ('boundary control', {'ytd': 0, 'lines': [['reg', 12345]], 'base': 16860000, 'exempt': True}, [0, 0]), ('normal control', {'ytd': 16730293, 'lines': [['sec125', 114556]], 'base': 17610000, 'exempt': False}, [0, 0]), ('normal control', {'ytd': 772136, 'lines': [['bonus', 91140], ['bonus', 2377], ['bonus', 1344], ['sec125', 189513]], 'base': 1000000, 'exempt': False}, [0, 0]), ('normal control', {'ytd': 10874291, 'lines': [['401k', 674]], 'base': 16860000, 'exempt': False}, [0, 0]), ('normal control', {'ytd': 17614738, 'lines': [['sec125', 160]], 'base': 17610000, 'exempt': False}, [0, 0])]]
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[100000, 6200][60000, 3720]Failed
regression (boundary) 1[100000, 6200][0, 0]Failed
partial-repair probe 2[1416, 88][1416, 88]Passed
partial-repair probe 3[156778, 9720][156778, 9720]Passed
boundary control 4[0, 0][0, 0]Passed
boundary control 5[0, 0][0, 0]Passed
normal control 6[0, 0][0, 0]Passed
normal control 7[0, 0][0, 0]Passed
normal control 8[0, 0][0, 0]Passed
normal control 9[0, 0][0, 0]Passed

SHA-256 / c861740b000ceb140f3d88909066e7c4244b9fd65198ddf16afdb4f629631b9e

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(x):
    lines = x['lines']
    fica = 0
    for kind, amt in lines:
        if kind in ('reg', 'ot', 'bonus', 'tips'):
            fica += amt
        elif kind == 'sec125':
            fica -= amt
    fica = max(0, fica)
    if x['exempt']:
        return [0, 0]
    room = max(0, x['base'] - x['ytd'])
    taxable = max(0, min(fica, x['base']) - x['ytd'])
    tax = (taxable * 62 + 500) // 1000
    return [taxable, tax]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression (boundary)', {'ytd': 16800000, 'lines': [['reg', 100000], ['401k', 5000]], 'base': 16860000, 'exempt': False}, [60000, 3720]), ('regression (boundary)', {'ytd': 16860000, 'lines': [['reg', 100000]], 'base': 16860000, 'exempt': False}, [0, 0]), ('partial-repair probe', {'ytd': 16856079, 'lines': [['ot', 1416], ['401k', 15045]], 'base': 16860000, 'exempt': False}, [1416, 88]), ('partial-repair probe', {'ytd': 8981578, 'lines': [['sec125', 35], ['ot', 4702], ['sec125', 74887], ['tips', 226998]], 'base': 17610000, 'exempt': False}, [156778, 9720]), ('boundary control', {'ytd': 0, 'lines': [['sec125', 10000], ['reg', 5000]], 'base': 16860000, 'exempt': False}, [0, 0]), ('boundary control', {'ytd': 0, 'lines': [['reg', 12345]], 'base': 16860000, 'exempt': True}, [0, 0]), ('normal control', {'ytd': 16598376, 'lines': [['401k', 17815], ['sec125', 6865]], 'base': 16860000, 'exempt': False}, [0, 0]), ('normal control', {'ytd': 17473948, 'lines': [['sec125', 1367], ['sec125', 805]], 'base': 17610000, 'exempt': True}, [0, 0]), ('normal control', {'ytd': 16862120, 'lines': [['401k', 4852]], 'base': 16860000, 'exempt': False}, [0, 0]), ('normal control', {'ytd': 17429873, 'lines': [['reg', 14135], ['sec125', 260961], ['ot', 187839]], 'base': 17610000, 'exempt': False}, [0, 0])], [('regression', {'ytd': 789375, 'lines': [['tips', 9625], ['bonus', 237249]], 'base': 1000000, 'exempt': False}, [210625, 13059]), ('regression (boundary)', {'ytd': 16800000, 'lines': [['reg', 100000], ['401k', 5000]], 'base': 16860000, 'exempt': False}, [60000, 3720]), ('partial-repair probe', {'ytd': 8981578, 'lines': [['sec125', 35], ['ot', 4702], ['sec125', 74887], ['tips', 226998]], 'base': 17610000, 'exempt': False}, [156778, 9720]), ('partial-repair probe', {'ytd': 6205542, 'lines': [['ot', 2254], ['reg', 6550], ['tips', 10665], ['sec125', 2193]], 'base': 17610000, 'exempt': False}, [17276, 1071]), ('boundary control', {'ytd': 0, 'lines': [['sec125', 10000], ['reg', 5000]], 'base': 16860000, 'exempt': False}, [0, 0]), ('boundary control', {'ytd': 0, 'lines': [['reg', 12345]], 'base': 16860000, 'exempt': True}, [0, 0]), ('normal control', {'ytd': 17365173, 'lines': [['401k', 1322]], 'base': 17610000, 'exempt': False}, [0, 0]), ('normal control', {'ytd': 16863463, 'lines': [['sec125', 37799], ['reg', 9785]], 'base': 16860000, 'exempt': False}, [0, 0]), ('normal control', {'ytd': 17613197, 'lines': [['sec125', 92109], ['ot', 11145], ['401k', 6145], ['tips', 1513]], 'base': 17610000, 'exempt': True}, [0, 0]), ('normal control', {'ytd': 17386310, 'lines': [['401k', 2353]], 'base': 17610000, 'exempt': False}, [0, 0])], [('regression', {'ytd': 17609450, 'lines': [['bonus', 11635], ['401k', 226117]], 'base': 17610000, 'exempt': False}, [550, 34]), ('regression', {'ytd': 1002361, 'lines': [['bonus', 5955]], 'base': 1000000, 'exempt': False}, [0, 0]), ('partial-repair probe', {'ytd': 888135, 'lines': [['reg', 4773]], 'base': 1000000, 'exempt': False}, [4773, 296]), ('partial-repair probe', {'ytd': 3381968, 'lines': [['401k', 4345], ['ot', 6225]], 'base': 17610000, 'exempt': False}, [6225, 386]), ('boundary control', {'ytd': 0, 'lines': [['sec125', 10000], ['reg', 5000]], 'base': 16860000, 'exempt': False}, [0, 0]), ('boundary control', {'ytd': 0, 'lines': [['reg', 12345]], 'base': 16860000, 'exempt': True}, [0, 0]), ('normal control', {'ytd': 16863311, 'lines': [['tips', 19505]], 'base': 16860000, 'exempt': True}, [0, 0]), ('normal control', {'ytd': 4871884, 'lines': [['401k', 9525]], 'base': 17610000, 'exempt': False}, [0, 0]), ('normal control', {'ytd': 16860000, 'lines': [['sec125', 187425]], 'base': 16860000, 'exempt': False}, [0, 0]), ('normal control', {'ytd': 16778428, 'lines': [['sec125', 16475]], 'base': 16860000, 'exempt': False}, [0, 0])], [('regression', {'ytd': 891566, 'lines': [['sec125', 4183], ['bonus', 171839], ['bonus', 197531]], 'base': 1000000, 'exempt': False}, [108434, 6723]), ('regression', {'ytd': 1004946, 'lines': [['bonus', 48], ['ot', 3255]], 'base': 1000000, 'exempt': False}, [0, 0]), ('partial-repair probe', {'ytd': 16617084, 'lines': [['reg', 4712], ['reg', 365692], ['sec125', 340208]], 'base': 16860000, 'exempt': False}, [30196, 1872]), ('partial-repair probe', {'ytd': 17543362, 'lines': [['401k', 1330], ['ot', 1995], ['bonus', 366]], 'base': 17610000, 'exempt': False}, [2361, 146]), ('boundary control', {'ytd': 0, 'lines': [['sec125', 10000], ['reg', 5000]], 'base': 16860000, 'exempt': False}, [0, 0]), ('boundary control', {'ytd': 0, 'lines': [['reg', 12345]], 'base': 16860000, 'exempt': True}, [0, 0]), ('normal control', {'ytd': 6681616, 'lines': [['401k', 7785], ['ot', 63049], ['401k', 3512], ['sec125', 271794]], 'base': 16860000, 'exempt': True}, [0, 0]), ('normal control', {'ytd': 16674229, 'lines': [['reg', 272699]], 'base': 16860000, 'exempt': True}, [0, 0]), ('normal control', {'ytd': 1004258, 'lines': [['sec125', 572]], 'base': 1000000, 'exempt': False}, [0, 0]), ('normal control', {'ytd': 16606444, 'lines': [['sec125', 230940]], 'base': 16860000, 'exempt': False}, [0, 0])], [('regression', {'ytd': 864974, 'lines': [['tips', 18765], ['401k', 1429], ['ot', 289833], ['ot', 1800]], 'base': 1000000, 'exempt': False}, [135026, 8372]), ('regression', {'ytd': 1000562, 'lines': [['ot', 19155], ['sec125', 716], ['bonus', 9555], ['ot', 607]], 'base': 1000000, 'exempt': False}, [0, 0]), ('partial-repair probe', {'ytd': 4027320, 'lines': [['tips', 88262], ['bonus', 963], ['sec125', 1621], ['ot', 9375]], 'base': 17610000, 'exempt': False}, [96979, 6013]), ('partial-repair probe', {'ytd': 789375, 'lines': [['tips', 9625], ['bonus', 237249]], 'base': 1000000, 'exempt': False}, [210625, 13059]), ('boundary control', {'ytd': 0, 'lines': [['sec125', 10000], ['reg', 5000]], 'base': 16860000, 'exempt': False}, [0, 0]), ('boundary control', {'ytd': 0, 'lines': [['reg', 12345]], 'base': 16860000, 'exempt': True}, [0, 0]), ('normal control', {'ytd': 16730293, 'lines': [['sec125', 114556]], 'base': 17610000, 'exempt': False}, [0, 0]), ('normal control', {'ytd': 772136, 'lines': [['bonus', 91140], ['bonus', 2377], ['bonus', 1344], ['sec125', 189513]], 'base': 1000000, 'exempt': False}, [0, 0]), ('normal control', {'ytd': 10874291, 'lines': [['401k', 674]], 'base': 16860000, 'exempt': False}, [0, 0]), ('normal control', {'ytd': 17614738, 'lines': [['sec125', 160]], 'base': 17610000, 'exempt': False}, [0, 0])]]
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[0, 0][60000, 3720]Failed
regression (boundary) 1[0, 0][0, 0]Passed
partial-repair probe 2[0, 0][1416, 88]Failed
partial-repair probe 3[0, 0][156778, 9720]Failed
boundary control 4[0, 0][0, 0]Passed
boundary control 5[0, 0][0, 0]Passed
normal control 6[0, 0][0, 0]Passed
normal control 7[0, 0][0, 0]Passed
normal control 8[0, 0][0, 0]Passed
normal control 9[0, 0][0, 0]Passed

SHA-256 / a5ca06ae66c2cbbe8903ae8ed419ddd35e7376973d58f9275604416993424b5b

3 / The verified repair

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

N = 1
observations = []
def solve(x):
    lines = x['lines']
    fica = 0
    for kind, amt in lines:
        if kind in ('reg', 'ot', 'bonus', 'tips'):
            fica += amt
        elif kind == 'sec125':
            fica -= amt
    fica = max(0, fica)
    if x['exempt']:
        return [0, 0]
    room = max(0, x['base'] - x['ytd'])
    taxable = min(fica, room)
    tax = (taxable * 62 + 500) // 1000
    return [taxable, tax]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression (boundary)', {'ytd': 16800000, 'lines': [['reg', 100000], ['401k', 5000]], 'base': 16860000, 'exempt': False}, [60000, 3720]), ('regression (boundary)', {'ytd': 16860000, 'lines': [['reg', 100000]], 'base': 16860000, 'exempt': False}, [0, 0]), ('partial-repair probe', {'ytd': 16856079, 'lines': [['ot', 1416], ['401k', 15045]], 'base': 16860000, 'exempt': False}, [1416, 88]), ('partial-repair probe', {'ytd': 8981578, 'lines': [['sec125', 35], ['ot', 4702], ['sec125', 74887], ['tips', 226998]], 'base': 17610000, 'exempt': False}, [156778, 9720]), ('boundary control', {'ytd': 0, 'lines': [['sec125', 10000], ['reg', 5000]], 'base': 16860000, 'exempt': False}, [0, 0]), ('boundary control', {'ytd': 0, 'lines': [['reg', 12345]], 'base': 16860000, 'exempt': True}, [0, 0]), ('normal control', {'ytd': 16598376, 'lines': [['401k', 17815], ['sec125', 6865]], 'base': 16860000, 'exempt': False}, [0, 0]), ('normal control', {'ytd': 17473948, 'lines': [['sec125', 1367], ['sec125', 805]], 'base': 17610000, 'exempt': True}, [0, 0]), ('normal control', {'ytd': 16862120, 'lines': [['401k', 4852]], 'base': 16860000, 'exempt': False}, [0, 0]), ('normal control', {'ytd': 17429873, 'lines': [['reg', 14135], ['sec125', 260961], ['ot', 187839]], 'base': 17610000, 'exempt': False}, [0, 0])], [('regression', {'ytd': 789375, 'lines': [['tips', 9625], ['bonus', 237249]], 'base': 1000000, 'exempt': False}, [210625, 13059]), ('regression (boundary)', {'ytd': 16800000, 'lines': [['reg', 100000], ['401k', 5000]], 'base': 16860000, 'exempt': False}, [60000, 3720]), ('partial-repair probe', {'ytd': 8981578, 'lines': [['sec125', 35], ['ot', 4702], ['sec125', 74887], ['tips', 226998]], 'base': 17610000, 'exempt': False}, [156778, 9720]), ('partial-repair probe', {'ytd': 6205542, 'lines': [['ot', 2254], ['reg', 6550], ['tips', 10665], ['sec125', 2193]], 'base': 17610000, 'exempt': False}, [17276, 1071]), ('boundary control', {'ytd': 0, 'lines': [['sec125', 10000], ['reg', 5000]], 'base': 16860000, 'exempt': False}, [0, 0]), ('boundary control', {'ytd': 0, 'lines': [['reg', 12345]], 'base': 16860000, 'exempt': True}, [0, 0]), ('normal control', {'ytd': 17365173, 'lines': [['401k', 1322]], 'base': 17610000, 'exempt': False}, [0, 0]), ('normal control', {'ytd': 16863463, 'lines': [['sec125', 37799], ['reg', 9785]], 'base': 16860000, 'exempt': False}, [0, 0]), ('normal control', {'ytd': 17613197, 'lines': [['sec125', 92109], ['ot', 11145], ['401k', 6145], ['tips', 1513]], 'base': 17610000, 'exempt': True}, [0, 0]), ('normal control', {'ytd': 17386310, 'lines': [['401k', 2353]], 'base': 17610000, 'exempt': False}, [0, 0])], [('regression', {'ytd': 17609450, 'lines': [['bonus', 11635], ['401k', 226117]], 'base': 17610000, 'exempt': False}, [550, 34]), ('regression', {'ytd': 1002361, 'lines': [['bonus', 5955]], 'base': 1000000, 'exempt': False}, [0, 0]), ('partial-repair probe', {'ytd': 888135, 'lines': [['reg', 4773]], 'base': 1000000, 'exempt': False}, [4773, 296]), ('partial-repair probe', {'ytd': 3381968, 'lines': [['401k', 4345], ['ot', 6225]], 'base': 17610000, 'exempt': False}, [6225, 386]), ('boundary control', {'ytd': 0, 'lines': [['sec125', 10000], ['reg', 5000]], 'base': 16860000, 'exempt': False}, [0, 0]), ('boundary control', {'ytd': 0, 'lines': [['reg', 12345]], 'base': 16860000, 'exempt': True}, [0, 0]), ('normal control', {'ytd': 16863311, 'lines': [['tips', 19505]], 'base': 16860000, 'exempt': True}, [0, 0]), ('normal control', {'ytd': 4871884, 'lines': [['401k', 9525]], 'base': 17610000, 'exempt': False}, [0, 0]), ('normal control', {'ytd': 16860000, 'lines': [['sec125', 187425]], 'base': 16860000, 'exempt': False}, [0, 0]), ('normal control', {'ytd': 16778428, 'lines': [['sec125', 16475]], 'base': 16860000, 'exempt': False}, [0, 0])], [('regression', {'ytd': 891566, 'lines': [['sec125', 4183], ['bonus', 171839], ['bonus', 197531]], 'base': 1000000, 'exempt': False}, [108434, 6723]), ('regression', {'ytd': 1004946, 'lines': [['bonus', 48], ['ot', 3255]], 'base': 1000000, 'exempt': False}, [0, 0]), ('partial-repair probe', {'ytd': 16617084, 'lines': [['reg', 4712], ['reg', 365692], ['sec125', 340208]], 'base': 16860000, 'exempt': False}, [30196, 1872]), ('partial-repair probe', {'ytd': 17543362, 'lines': [['401k', 1330], ['ot', 1995], ['bonus', 366]], 'base': 17610000, 'exempt': False}, [2361, 146]), ('boundary control', {'ytd': 0, 'lines': [['sec125', 10000], ['reg', 5000]], 'base': 16860000, 'exempt': False}, [0, 0]), ('boundary control', {'ytd': 0, 'lines': [['reg', 12345]], 'base': 16860000, 'exempt': True}, [0, 0]), ('normal control', {'ytd': 6681616, 'lines': [['401k', 7785], ['ot', 63049], ['401k', 3512], ['sec125', 271794]], 'base': 16860000, 'exempt': True}, [0, 0]), ('normal control', {'ytd': 16674229, 'lines': [['reg', 272699]], 'base': 16860000, 'exempt': True}, [0, 0]), ('normal control', {'ytd': 1004258, 'lines': [['sec125', 572]], 'base': 1000000, 'exempt': False}, [0, 0]), ('normal control', {'ytd': 16606444, 'lines': [['sec125', 230940]], 'base': 16860000, 'exempt': False}, [0, 0])], [('regression', {'ytd': 864974, 'lines': [['tips', 18765], ['401k', 1429], ['ot', 289833], ['ot', 1800]], 'base': 1000000, 'exempt': False}, [135026, 8372]), ('regression', {'ytd': 1000562, 'lines': [['ot', 19155], ['sec125', 716], ['bonus', 9555], ['ot', 607]], 'base': 1000000, 'exempt': False}, [0, 0]), ('partial-repair probe', {'ytd': 4027320, 'lines': [['tips', 88262], ['bonus', 963], ['sec125', 1621], ['ot', 9375]], 'base': 17610000, 'exempt': False}, [96979, 6013]), ('partial-repair probe', {'ytd': 789375, 'lines': [['tips', 9625], ['bonus', 237249]], 'base': 1000000, 'exempt': False}, [210625, 13059]), ('boundary control', {'ytd': 0, 'lines': [['sec125', 10000], ['reg', 5000]], 'base': 16860000, 'exempt': False}, [0, 0]), ('boundary control', {'ytd': 0, 'lines': [['reg', 12345]], 'base': 16860000, 'exempt': True}, [0, 0]), ('normal control', {'ytd': 16730293, 'lines': [['sec125', 114556]], 'base': 17610000, 'exempt': False}, [0, 0]), ('normal control', {'ytd': 772136, 'lines': [['bonus', 91140], ['bonus', 2377], ['bonus', 1344], ['sec125', 189513]], 'base': 1000000, 'exempt': False}, [0, 0]), ('normal control', {'ytd': 10874291, 'lines': [['401k', 674]], 'base': 16860000, 'exempt': False}, [0, 0]), ('normal control', {'ytd': 17614738, 'lines': [['sec125', 160]], 'base': 17610000, 'exempt': False}, [0, 0])]]
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[60000, 3720][60000, 3720]Passed
regression (boundary) 1[0, 0][0, 0]Passed
partial-repair probe 2[1416, 88][1416, 88]Passed
partial-repair probe 3[156778, 9720][156778, 9720]Passed
boundary control 4[0, 0][0, 0]Passed
boundary control 5[0, 0][0, 0]Passed
normal control 6[0, 0][0, 0]Passed
normal control 7[0, 0][0, 0]Passed
normal control 8[0, 0][0, 0]Passed
normal control 9[0, 0][0, 0]Passed

SHA-256 / c762f98271ccc837fa7afd2d7977e41a09cb89f5114af070e6fa27053d799e09

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

Case digest / d98d401d4445bf42057bf97b0e726519a9938bf33e9b52998c9c4c5e332a822b