FAILURE MAP
← Case archive

FA-59021 / Payroll withholding rules / Open access

Resident and work-state withholding reciprocity: resident credit floor · case 01

Employees living in a lower-tax state get a negative resident withholding line.

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

ROOT CAUSE

The resident credit is not limited, so a work-state tax above the resident tax produces a negative line.

THE FAILURE

The resident credit is not limited, so a work-state tax above the resident tax produces a negative line.

Unsuccessful approach: The attempt takes the absolute difference, turning an excess credit into positive resident withholding.

Case contract

Input {wage, res, work, reciprocal:[sorted state pairs], rates:{state: basis points}, res_credit}. Tax for a state = wage*rate/10000 half-up. Same state: withhold only there. Reciprocal pair: withhold only the resident state. Otherwise withhold the work state; the resident state gets max(0, resident - work) when res_credit else its full tax; omit zero resident lines. Return {state: cents}.

Why this case matters

Multi-state withholding depends on reciprocity agreements and resident credits, and misplacing a state changes which agency is paid.

1 / The failure

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

N = 1
observations = []
def solve(x):
    rates = x['rates']
    w = x['wage']
    def tax(st):
        return (w * rates.get(st, 0) + 5000) // 10000
    res, work = x['res'], x['work']
    if res == work:
        return {work: tax(work)}
    pair = sorted([res, work])
    if pair in x['reciprocal']:
        return {res: tax(res)}
    work_tax = tax(work)
    res_tax = tax(res) - work_tax if x['res_credit'] else tax(res)
    out = {work: work_tax}
    if res_tax:
        out[res] = res_tax
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression', {'wage': 92630, 'res': 'PA', 'work': 'WV', 'reciprocal': [['NJ', 'PA'], ['IN', 'KY'], ['KY', 'OH']], 'rates': {'PA': 500, 'NJ': 425, 'OH': 0, 'MI': 0, 'IN': 425, 'KY': 425, 'WV': 637}, 'res_credit': True}, {'WV': 5901}), ('regression', {'wage': 348021, 'res': 'MI', 'work': 'KY', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['IN', 'KY']], 'rates': {'PA': 307, 'NJ': 355, 'OH': 0, 'MI': 254, 'IN': 425, 'KY': 350, 'WV': 425}, 'res_credit': True}, {'KY': 12181}), ('partial-repair probe', {'wage': 202229, 'res': 'KY', 'work': 'PA', 'reciprocal': [['NJ', 'PA'], ['KY', 'OH']], 'rates': {'PA': 350, 'NJ': 637, 'OH': 350, 'MI': 425, 'IN': 0, 'KY': 0, 'WV': 500}, 'res_credit': True}, {'PA': 7078}), ('partial-repair probe', {'wage': 353313, 'res': 'OH', 'work': 'IN', 'reciprocal': [['NJ', 'PA'], ['IN', 'KY']], 'rates': {'PA': 500, 'NJ': 425, 'OH': 159, 'MI': 637, 'IN': 500, 'KY': 500, 'WV': 425}, 'res_credit': True}, {'IN': 17666}), ('normal control', {'wage': 379815, 'res': 'MI', 'work': 'OH', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['IN', 'KY'], ['KY', 'OH']], 'rates': {'PA': 637, 'NJ': 637, 'OH': 0, 'MI': 637, 'IN': 350, 'KY': 307, 'WV': 242}, 'res_credit': True}, {'MI': 24194}), ('normal control', {'wage': 333788, 'res': 'NJ', 'work': 'NJ', 'reciprocal': [['IN', 'KY']], 'rates': {'PA': 637, 'NJ': 425, 'OH': 446, 'MI': 500, 'IN': 122, 'KY': 312, 'WV': 0}, 'res_credit': True}, {'NJ': 14186}), ('normal control', {'wage': 108935, 'res': 'MI', 'work': 'WV', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['KY', 'OH']], 'rates': {'PA': 637, 'NJ': 307, 'OH': 350, 'MI': 0, 'IN': 425, 'KY': 0, 'WV': 350}, 'res_credit': False}, {'WV': 3813}), ('normal control', {'wage': 267886, 'res': 'PA', 'work': 'IN', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['KY', 'OH']], 'rates': {'PA': 500, 'NJ': 425, 'OH': 425, 'MI': 637, 'IN': 637, 'KY': 0, 'WV': 637}, 'res_credit': False}, {'IN': 17064, 'PA': 13394})], [('regression', {'wage': 348021, 'res': 'MI', 'work': 'KY', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['IN', 'KY']], 'rates': {'PA': 307, 'NJ': 355, 'OH': 0, 'MI': 254, 'IN': 425, 'KY': 350, 'WV': 425}, 'res_credit': True}, {'KY': 12181}), ('regression', {'wage': 202229, 'res': 'KY', 'work': 'PA', 'reciprocal': [['NJ', 'PA'], ['KY', 'OH']], 'rates': {'PA': 350, 'NJ': 637, 'OH': 350, 'MI': 425, 'IN': 0, 'KY': 0, 'WV': 500}, 'res_credit': True}, {'PA': 7078}), ('partial-repair probe', {'wage': 353313, 'res': 'OH', 'work': 'IN', 'reciprocal': [['NJ', 'PA'], ['IN', 'KY']], 'rates': {'PA': 500, 'NJ': 425, 'OH': 159, 'MI': 637, 'IN': 500, 'KY': 500, 'WV': 425}, 'res_credit': True}, {'IN': 17666}), ('partial-repair probe', {'wage': 104553, 'res': 'PA', 'work': 'WV', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['KY', 'OH']], 'rates': {'PA': 307, 'NJ': 330, 'OH': 637, 'MI': 425, 'IN': 500, 'KY': 637, 'WV': 350}, 'res_credit': True}, {'WV': 3659}), ('normal control', {'wage': 243443, 'res': 'IN', 'work': 'IN', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['IN', 'KY']], 'rates': {'PA': 350, 'NJ': 425, 'OH': 0, 'MI': 0, 'IN': 637, 'KY': 307, 'WV': 425}, 'res_credit': True}, {'IN': 15507}), ('normal control', {'wage': 133100, 'res': 'KY', 'work': 'PA', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['KY', 'OH']], 'rates': {'PA': 307, 'NJ': 500, 'OH': 500, 'MI': 350, 'IN': 0, 'KY': 500, 'WV': 637}, 'res_credit': True}, {'PA': 4086, 'KY': 2569}), ('normal control', {'wage': 326976, 'res': 'OH', 'work': 'NJ', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['KY', 'OH']], 'rates': {'PA': 543, 'NJ': 500, 'OH': 500, 'MI': 0, 'IN': 350, 'KY': 500, 'WV': 350}, 'res_credit': True}, {'NJ': 16349}), ('normal control', {'wage': 373364, 'res': 'MI', 'work': 'WV', 'reciprocal': [['NJ', 'PA'], ['IN', 'KY']], 'rates': {'PA': 350, 'NJ': 611, 'OH': 307, 'MI': 637, 'IN': 0, 'KY': 500, 'WV': 637}, 'res_credit': False}, {'WV': 23783, 'MI': 23783})], [('regression', {'wage': 202229, 'res': 'KY', 'work': 'PA', 'reciprocal': [['NJ', 'PA'], ['KY', 'OH']], 'rates': {'PA': 350, 'NJ': 637, 'OH': 350, 'MI': 425, 'IN': 0, 'KY': 0, 'WV': 500}, 'res_credit': True}, {'PA': 7078}), ('regression', {'wage': 353313, 'res': 'OH', 'work': 'IN', 'reciprocal': [['NJ', 'PA'], ['IN', 'KY']], 'rates': {'PA': 500, 'NJ': 425, 'OH': 159, 'MI': 637, 'IN': 500, 'KY': 500, 'WV': 425}, 'res_credit': True}, {'IN': 17666}), ('partial-repair probe', {'wage': 104553, 'res': 'PA', 'work': 'WV', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['KY', 'OH']], 'rates': {'PA': 307, 'NJ': 330, 'OH': 637, 'MI': 425, 'IN': 500, 'KY': 637, 'WV': 350}, 'res_credit': True}, {'WV': 3659}), ('partial-repair probe', {'wage': 56393, 'res': 'KY', 'work': 'PA', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['IN', 'KY']], 'rates': {'PA': 363, 'NJ': 350, 'OH': 500, 'MI': 500, 'IN': 350, 'KY': 307, 'WV': 307}, 'res_credit': True}, {'PA': 2047}), ('normal control', {'wage': 391289, 'res': 'WV', 'work': 'KY', 'reciprocal': [['NJ', 'PA'], ['KY', 'OH']], 'rates': {'PA': 500, 'NJ': 0, 'OH': 500, 'MI': 350, 'IN': 425, 'KY': 350, 'WV': 350}, 'res_credit': True}, {'KY': 13695}), ('normal control', {'wage': 214002, 'res': 'KY', 'work': 'PA', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['KY', 'OH']], 'rates': {'PA': 239, 'NJ': 637, 'OH': 156, 'MI': 0, 'IN': 350, 'KY': 300, 'WV': 350}, 'res_credit': True}, {'PA': 5115, 'KY': 1305}), ('normal control', {'wage': 314004, 'res': 'IN', 'work': 'IN', 'reciprocal': [['NJ', 'PA'], ['KY', 'OH']], 'rates': {'PA': 0, 'NJ': 350, 'OH': 307, 'MI': 637, 'IN': 307, 'KY': 180, 'WV': 425}, 'res_credit': True}, {'IN': 9640}), ('normal control', {'wage': 190832, 'res': 'KY', 'work': 'OH', 'reciprocal': [['MI', 'OH']], 'rates': {'PA': 637, 'NJ': 0, 'OH': 425, 'MI': 425, 'IN': 637, 'KY': 500, 'WV': 425}, 'res_credit': True}, {'OH': 8110, 'KY': 1432})], [('regression', {'wage': 353313, 'res': 'OH', 'work': 'IN', 'reciprocal': [['NJ', 'PA'], ['IN', 'KY']], 'rates': {'PA': 500, 'NJ': 425, 'OH': 159, 'MI': 637, 'IN': 500, 'KY': 500, 'WV': 425}, 'res_credit': True}, {'IN': 17666}), ('regression', {'wage': 104553, 'res': 'PA', 'work': 'WV', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['KY', 'OH']], 'rates': {'PA': 307, 'NJ': 330, 'OH': 637, 'MI': 425, 'IN': 500, 'KY': 637, 'WV': 350}, 'res_credit': True}, {'WV': 3659}), ('partial-repair probe', {'wage': 290036, 'res': 'IN', 'work': 'WV', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['KY', 'OH']], 'rates': {'PA': 318, 'NJ': 0, 'OH': 46, 'MI': 425, 'IN': 500, 'KY': 164, 'WV': 637}, 'res_credit': True}, {'WV': 18475}), ('partial-repair probe', {'wage': 2279, 'res': 'WV', 'work': 'PA', 'reciprocal': [['MI', 'OH'], ['KY', 'OH']], 'rates': {'PA': 500, 'NJ': 0, 'OH': 0, 'MI': 350, 'IN': 500, 'KY': 350, 'WV': 321}, 'res_credit': True}, {'PA': 114}), ('normal control', {'wage': 51460, 'res': 'KY', 'work': 'NJ', 'reciprocal': [['NJ', 'PA'], ['IN', 'KY'], ['KY', 'OH']], 'rates': {'PA': 637, 'NJ': 307, 'OH': 425, 'MI': 350, 'IN': 637, 'KY': 652, 'WV': 0}, 'res_credit': True}, {'NJ': 1580, 'KY': 1775}), ('normal control', {'wage': 236355, 'res': 'PA', 'work': 'WV', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['IN', 'KY']], 'rates': {'PA': 425, 'NJ': 307, 'OH': 425, 'MI': 425, 'IN': 350, 'KY': 637, 'WV': 637}, 'res_credit': False}, {'WV': 15056, 'PA': 10045}), ('normal control', {'wage': 92712, 'res': 'MI', 'work': 'PA', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['IN', 'KY']], 'rates': {'PA': 0, 'NJ': 425, 'OH': 425, 'MI': 250, 'IN': 350, 'KY': 637, 'WV': 350}, 'res_credit': False}, {'PA': 0, 'MI': 2318}), ('normal control', {'wage': 91863, 'res': 'NJ', 'work': 'OH', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['IN', 'KY'], ['KY', 'OH']], 'rates': {'PA': 350, 'NJ': 307, 'OH': 350, 'MI': 549, 'IN': 307, 'KY': 637, 'WV': 590}, 'res_credit': False}, {'OH': 3215, 'NJ': 2820})], [('regression', {'wage': 104553, 'res': 'PA', 'work': 'WV', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['KY', 'OH']], 'rates': {'PA': 307, 'NJ': 330, 'OH': 637, 'MI': 425, 'IN': 500, 'KY': 637, 'WV': 350}, 'res_credit': True}, {'WV': 3659}), ('regression', {'wage': 56393, 'res': 'KY', 'work': 'PA', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['IN', 'KY']], 'rates': {'PA': 363, 'NJ': 350, 'OH': 500, 'MI': 500, 'IN': 350, 'KY': 307, 'WV': 307}, 'res_credit': True}, {'PA': 2047}), ('partial-repair probe', {'wage': 122807, 'res': 'KY', 'work': 'PA', 'reciprocal': [['MI', 'OH'], ['IN', 'KY'], ['KY', 'OH']], 'rates': {'PA': 307, 'NJ': 637, 'OH': 425, 'MI': 0, 'IN': 425, 'KY': 0, 'WV': 0}, 'res_credit': True}, {'PA': 3770}), ('partial-repair probe', {'wage': 321787, 'res': 'MI', 'work': 'PA', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['IN', 'KY']], 'rates': {'PA': 500, 'NJ': 637, 'OH': 307, 'MI': 350, 'IN': 0, 'KY': 500, 'WV': 350}, 'res_credit': True}, {'PA': 16089}), ('normal control', {'wage': 208890, 'res': 'KY', 'work': 'MI', 'reciprocal': [['NJ', 'PA'], ['KY', 'OH']], 'rates': {'PA': 0, 'NJ': 0, 'OH': 307, 'MI': 0, 'IN': 577, 'KY': 307, 'WV': 350}, 'res_credit': True}, {'MI': 0, 'KY': 6413}), ('normal control', {'wage': 70654, 'res': 'NJ', 'work': 'NJ', 'reciprocal': [['NJ', 'PA'], ['IN', 'KY']], 'rates': {'PA': 0, 'NJ': 637, 'OH': 458, 'MI': 637, 'IN': 425, 'KY': 307, 'WV': 71}, 'res_credit': False}, {'NJ': 4501}), ('normal control', {'wage': 369165, 'res': 'PA', 'work': 'WV', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['IN', 'KY'], ['KY', 'OH']], 'rates': {'PA': 307, 'NJ': 307, 'OH': 350, 'MI': 307, 'IN': 307, 'KY': 425, 'WV': 102}, 'res_credit': False}, {'WV': 3765, 'PA': 11333}), ('normal control', {'wage': 129954, 'res': 'PA', 'work': 'PA', 'reciprocal': [['IN', 'KY'], ['KY', 'OH']], 'rates': {'PA': 350, 'NJ': 651, 'OH': 637, 'MI': 0, 'IN': 0, 'KY': 623, 'WV': 0}, 'res_credit': True}, {'PA': 4548})]]
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 0{'PA': -1269, 'WV': 5901}{'WV': 5901}Failed
regression 1{'KY': 12181, 'MI': -3341}{'KY': 12181}Failed
partial-repair probe 2{'KY': -7078, 'PA': 7078}{'PA': 7078}Failed
partial-repair probe 3{'IN': 17666, 'OH': -12048}{'IN': 17666}Failed
normal control 4{'MI': 24194}{'MI': 24194}Passed
normal control 5{'NJ': 14186}{'NJ': 14186}Passed
normal control 6{'WV': 3813}{'WV': 3813}Passed
normal control 7{'IN': 17064, 'PA': 13394}{'IN': 17064, 'PA': 13394}Passed

SHA-256 / 87ccd418232edd31cf237d4bfc8931f55c9066465b00f730c53781c23b1bb86d

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(x):
    rates = x['rates']
    w = x['wage']
    def tax(st):
        return (w * rates.get(st, 0) + 5000) // 10000
    res, work = x['res'], x['work']
    if res == work:
        return {work: tax(work)}
    pair = sorted([res, work])
    if pair in x['reciprocal']:
        return {res: tax(res)}
    work_tax = tax(work)
    res_tax = abs(tax(res) - work_tax) if x['res_credit'] else tax(res)
    out = {work: work_tax}
    if res_tax:
        out[res] = res_tax
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression', {'wage': 92630, 'res': 'PA', 'work': 'WV', 'reciprocal': [['NJ', 'PA'], ['IN', 'KY'], ['KY', 'OH']], 'rates': {'PA': 500, 'NJ': 425, 'OH': 0, 'MI': 0, 'IN': 425, 'KY': 425, 'WV': 637}, 'res_credit': True}, {'WV': 5901}), ('regression', {'wage': 348021, 'res': 'MI', 'work': 'KY', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['IN', 'KY']], 'rates': {'PA': 307, 'NJ': 355, 'OH': 0, 'MI': 254, 'IN': 425, 'KY': 350, 'WV': 425}, 'res_credit': True}, {'KY': 12181}), ('partial-repair probe', {'wage': 202229, 'res': 'KY', 'work': 'PA', 'reciprocal': [['NJ', 'PA'], ['KY', 'OH']], 'rates': {'PA': 350, 'NJ': 637, 'OH': 350, 'MI': 425, 'IN': 0, 'KY': 0, 'WV': 500}, 'res_credit': True}, {'PA': 7078}), ('partial-repair probe', {'wage': 353313, 'res': 'OH', 'work': 'IN', 'reciprocal': [['NJ', 'PA'], ['IN', 'KY']], 'rates': {'PA': 500, 'NJ': 425, 'OH': 159, 'MI': 637, 'IN': 500, 'KY': 500, 'WV': 425}, 'res_credit': True}, {'IN': 17666}), ('normal control', {'wage': 379815, 'res': 'MI', 'work': 'OH', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['IN', 'KY'], ['KY', 'OH']], 'rates': {'PA': 637, 'NJ': 637, 'OH': 0, 'MI': 637, 'IN': 350, 'KY': 307, 'WV': 242}, 'res_credit': True}, {'MI': 24194}), ('normal control', {'wage': 333788, 'res': 'NJ', 'work': 'NJ', 'reciprocal': [['IN', 'KY']], 'rates': {'PA': 637, 'NJ': 425, 'OH': 446, 'MI': 500, 'IN': 122, 'KY': 312, 'WV': 0}, 'res_credit': True}, {'NJ': 14186}), ('normal control', {'wage': 108935, 'res': 'MI', 'work': 'WV', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['KY', 'OH']], 'rates': {'PA': 637, 'NJ': 307, 'OH': 350, 'MI': 0, 'IN': 425, 'KY': 0, 'WV': 350}, 'res_credit': False}, {'WV': 3813}), ('normal control', {'wage': 267886, 'res': 'PA', 'work': 'IN', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['KY', 'OH']], 'rates': {'PA': 500, 'NJ': 425, 'OH': 425, 'MI': 637, 'IN': 637, 'KY': 0, 'WV': 637}, 'res_credit': False}, {'IN': 17064, 'PA': 13394})], [('regression', {'wage': 348021, 'res': 'MI', 'work': 'KY', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['IN', 'KY']], 'rates': {'PA': 307, 'NJ': 355, 'OH': 0, 'MI': 254, 'IN': 425, 'KY': 350, 'WV': 425}, 'res_credit': True}, {'KY': 12181}), ('regression', {'wage': 202229, 'res': 'KY', 'work': 'PA', 'reciprocal': [['NJ', 'PA'], ['KY', 'OH']], 'rates': {'PA': 350, 'NJ': 637, 'OH': 350, 'MI': 425, 'IN': 0, 'KY': 0, 'WV': 500}, 'res_credit': True}, {'PA': 7078}), ('partial-repair probe', {'wage': 353313, 'res': 'OH', 'work': 'IN', 'reciprocal': [['NJ', 'PA'], ['IN', 'KY']], 'rates': {'PA': 500, 'NJ': 425, 'OH': 159, 'MI': 637, 'IN': 500, 'KY': 500, 'WV': 425}, 'res_credit': True}, {'IN': 17666}), ('partial-repair probe', {'wage': 104553, 'res': 'PA', 'work': 'WV', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['KY', 'OH']], 'rates': {'PA': 307, 'NJ': 330, 'OH': 637, 'MI': 425, 'IN': 500, 'KY': 637, 'WV': 350}, 'res_credit': True}, {'WV': 3659}), ('normal control', {'wage': 243443, 'res': 'IN', 'work': 'IN', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['IN', 'KY']], 'rates': {'PA': 350, 'NJ': 425, 'OH': 0, 'MI': 0, 'IN': 637, 'KY': 307, 'WV': 425}, 'res_credit': True}, {'IN': 15507}), ('normal control', {'wage': 133100, 'res': 'KY', 'work': 'PA', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['KY', 'OH']], 'rates': {'PA': 307, 'NJ': 500, 'OH': 500, 'MI': 350, 'IN': 0, 'KY': 500, 'WV': 637}, 'res_credit': True}, {'PA': 4086, 'KY': 2569}), ('normal control', {'wage': 326976, 'res': 'OH', 'work': 'NJ', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['KY', 'OH']], 'rates': {'PA': 543, 'NJ': 500, 'OH': 500, 'MI': 0, 'IN': 350, 'KY': 500, 'WV': 350}, 'res_credit': True}, {'NJ': 16349}), ('normal control', {'wage': 373364, 'res': 'MI', 'work': 'WV', 'reciprocal': [['NJ', 'PA'], ['IN', 'KY']], 'rates': {'PA': 350, 'NJ': 611, 'OH': 307, 'MI': 637, 'IN': 0, 'KY': 500, 'WV': 637}, 'res_credit': False}, {'WV': 23783, 'MI': 23783})], [('regression', {'wage': 202229, 'res': 'KY', 'work': 'PA', 'reciprocal': [['NJ', 'PA'], ['KY', 'OH']], 'rates': {'PA': 350, 'NJ': 637, 'OH': 350, 'MI': 425, 'IN': 0, 'KY': 0, 'WV': 500}, 'res_credit': True}, {'PA': 7078}), ('regression', {'wage': 353313, 'res': 'OH', 'work': 'IN', 'reciprocal': [['NJ', 'PA'], ['IN', 'KY']], 'rates': {'PA': 500, 'NJ': 425, 'OH': 159, 'MI': 637, 'IN': 500, 'KY': 500, 'WV': 425}, 'res_credit': True}, {'IN': 17666}), ('partial-repair probe', {'wage': 104553, 'res': 'PA', 'work': 'WV', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['KY', 'OH']], 'rates': {'PA': 307, 'NJ': 330, 'OH': 637, 'MI': 425, 'IN': 500, 'KY': 637, 'WV': 350}, 'res_credit': True}, {'WV': 3659}), ('partial-repair probe', {'wage': 56393, 'res': 'KY', 'work': 'PA', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['IN', 'KY']], 'rates': {'PA': 363, 'NJ': 350, 'OH': 500, 'MI': 500, 'IN': 350, 'KY': 307, 'WV': 307}, 'res_credit': True}, {'PA': 2047}), ('normal control', {'wage': 391289, 'res': 'WV', 'work': 'KY', 'reciprocal': [['NJ', 'PA'], ['KY', 'OH']], 'rates': {'PA': 500, 'NJ': 0, 'OH': 500, 'MI': 350, 'IN': 425, 'KY': 350, 'WV': 350}, 'res_credit': True}, {'KY': 13695}), ('normal control', {'wage': 214002, 'res': 'KY', 'work': 'PA', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['KY', 'OH']], 'rates': {'PA': 239, 'NJ': 637, 'OH': 156, 'MI': 0, 'IN': 350, 'KY': 300, 'WV': 350}, 'res_credit': True}, {'PA': 5115, 'KY': 1305}), ('normal control', {'wage': 314004, 'res': 'IN', 'work': 'IN', 'reciprocal': [['NJ', 'PA'], ['KY', 'OH']], 'rates': {'PA': 0, 'NJ': 350, 'OH': 307, 'MI': 637, 'IN': 307, 'KY': 180, 'WV': 425}, 'res_credit': True}, {'IN': 9640}), ('normal control', {'wage': 190832, 'res': 'KY', 'work': 'OH', 'reciprocal': [['MI', 'OH']], 'rates': {'PA': 637, 'NJ': 0, 'OH': 425, 'MI': 425, 'IN': 637, 'KY': 500, 'WV': 425}, 'res_credit': True}, {'OH': 8110, 'KY': 1432})], [('regression', {'wage': 353313, 'res': 'OH', 'work': 'IN', 'reciprocal': [['NJ', 'PA'], ['IN', 'KY']], 'rates': {'PA': 500, 'NJ': 425, 'OH': 159, 'MI': 637, 'IN': 500, 'KY': 500, 'WV': 425}, 'res_credit': True}, {'IN': 17666}), ('regression', {'wage': 104553, 'res': 'PA', 'work': 'WV', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['KY', 'OH']], 'rates': {'PA': 307, 'NJ': 330, 'OH': 637, 'MI': 425, 'IN': 500, 'KY': 637, 'WV': 350}, 'res_credit': True}, {'WV': 3659}), ('partial-repair probe', {'wage': 290036, 'res': 'IN', 'work': 'WV', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['KY', 'OH']], 'rates': {'PA': 318, 'NJ': 0, 'OH': 46, 'MI': 425, 'IN': 500, 'KY': 164, 'WV': 637}, 'res_credit': True}, {'WV': 18475}), ('partial-repair probe', {'wage': 2279, 'res': 'WV', 'work': 'PA', 'reciprocal': [['MI', 'OH'], ['KY', 'OH']], 'rates': {'PA': 500, 'NJ': 0, 'OH': 0, 'MI': 350, 'IN': 500, 'KY': 350, 'WV': 321}, 'res_credit': True}, {'PA': 114}), ('normal control', {'wage': 51460, 'res': 'KY', 'work': 'NJ', 'reciprocal': [['NJ', 'PA'], ['IN', 'KY'], ['KY', 'OH']], 'rates': {'PA': 637, 'NJ': 307, 'OH': 425, 'MI': 350, 'IN': 637, 'KY': 652, 'WV': 0}, 'res_credit': True}, {'NJ': 1580, 'KY': 1775}), ('normal control', {'wage': 236355, 'res': 'PA', 'work': 'WV', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['IN', 'KY']], 'rates': {'PA': 425, 'NJ': 307, 'OH': 425, 'MI': 425, 'IN': 350, 'KY': 637, 'WV': 637}, 'res_credit': False}, {'WV': 15056, 'PA': 10045}), ('normal control', {'wage': 92712, 'res': 'MI', 'work': 'PA', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['IN', 'KY']], 'rates': {'PA': 0, 'NJ': 425, 'OH': 425, 'MI': 250, 'IN': 350, 'KY': 637, 'WV': 350}, 'res_credit': False}, {'PA': 0, 'MI': 2318}), ('normal control', {'wage': 91863, 'res': 'NJ', 'work': 'OH', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['IN', 'KY'], ['KY', 'OH']], 'rates': {'PA': 350, 'NJ': 307, 'OH': 350, 'MI': 549, 'IN': 307, 'KY': 637, 'WV': 590}, 'res_credit': False}, {'OH': 3215, 'NJ': 2820})], [('regression', {'wage': 104553, 'res': 'PA', 'work': 'WV', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['KY', 'OH']], 'rates': {'PA': 307, 'NJ': 330, 'OH': 637, 'MI': 425, 'IN': 500, 'KY': 637, 'WV': 350}, 'res_credit': True}, {'WV': 3659}), ('regression', {'wage': 56393, 'res': 'KY', 'work': 'PA', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['IN', 'KY']], 'rates': {'PA': 363, 'NJ': 350, 'OH': 500, 'MI': 500, 'IN': 350, 'KY': 307, 'WV': 307}, 'res_credit': True}, {'PA': 2047}), ('partial-repair probe', {'wage': 122807, 'res': 'KY', 'work': 'PA', 'reciprocal': [['MI', 'OH'], ['IN', 'KY'], ['KY', 'OH']], 'rates': {'PA': 307, 'NJ': 637, 'OH': 425, 'MI': 0, 'IN': 425, 'KY': 0, 'WV': 0}, 'res_credit': True}, {'PA': 3770}), ('partial-repair probe', {'wage': 321787, 'res': 'MI', 'work': 'PA', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['IN', 'KY']], 'rates': {'PA': 500, 'NJ': 637, 'OH': 307, 'MI': 350, 'IN': 0, 'KY': 500, 'WV': 350}, 'res_credit': True}, {'PA': 16089}), ('normal control', {'wage': 208890, 'res': 'KY', 'work': 'MI', 'reciprocal': [['NJ', 'PA'], ['KY', 'OH']], 'rates': {'PA': 0, 'NJ': 0, 'OH': 307, 'MI': 0, 'IN': 577, 'KY': 307, 'WV': 350}, 'res_credit': True}, {'MI': 0, 'KY': 6413}), ('normal control', {'wage': 70654, 'res': 'NJ', 'work': 'NJ', 'reciprocal': [['NJ', 'PA'], ['IN', 'KY']], 'rates': {'PA': 0, 'NJ': 637, 'OH': 458, 'MI': 637, 'IN': 425, 'KY': 307, 'WV': 71}, 'res_credit': False}, {'NJ': 4501}), ('normal control', {'wage': 369165, 'res': 'PA', 'work': 'WV', 'reciprocal': [['NJ', 'PA'], ['MI', 'OH'], ['IN', 'KY'], ['KY', 'OH']], 'rates': {'PA': 307, 'NJ': 307, 'OH': 350, 'MI': 307, 'IN': 307, 'KY': 425, 'WV': 102}, 'res_credit': False}, {'WV': 3765, 'PA': 11333}), ('normal control', {'wage': 129954, 'res': 'PA', 'work': 'PA', 'reciprocal': [['IN', 'KY'], ['KY', 'OH']], 'rates': {'PA': 350, 'NJ': 651, 'OH': 637, 'MI': 0, 'IN': 0, 'KY': 623, 'WV': 0}, 'res_credit': True}, {'PA': 4548})]]
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 0{'PA': 1269, 'WV': 5901}{'WV': 5901}Failed
regression 1{'KY': 12181, 'MI': 3341}{'KY': 12181}Failed
partial-repair probe 2{'KY': 7078, 'PA': 7078}{'PA': 7078}Failed
partial-repair probe 3{'IN': 17666, 'OH': 12048}{'IN': 17666}Failed
normal control 4{'MI': 24194}{'MI': 24194}Passed
normal control 5{'NJ': 14186}{'NJ': 14186}Passed
normal control 6{'WV': 3813}{'WV': 3813}Passed
normal control 7{'IN': 17064, 'PA': 13394}{'IN': 17064, 'PA': 13394}Passed

SHA-256 / e72bb3be60f7ad6e03b9fe2d7590cfad778a93b92df2fc82380512777f7554c4

HELD IN THE MEMBER ARCHIVE

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

This mechanism has 8 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:32.189626+00:00.

Case digest / 7be52974e41fe3368c99cf54b3eb78f21a2ac89a56f7b8de2f72e53b2367bdd0