FAILURE MAP
← Case archive

FA-59316 / Payroll withholding rules / Open access

Nonresident alien wage add-on: student exemption window · case 01

Students in their fifth year lose their FICA exemption early.

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

ROOT CAUSE

The exemption window excludes the fifth year.

VERIFIED REPAIR

Restore the contract rule at the student exemption window step: use `x['years_present'] <= 5`.

Unsuccessful approach: The attempt keeps five years but drops J-visa scholars from the exemption.

Case contract

Input {wage, freq, nra, w4_year, visa, years_present}. Nonresident aliens add a per-period amount to wages for income-tax withholding only (2020+ forms: weekly 209.60, biweekly 419.20, semimonthly 454.20, monthly 908.30; older forms: 151.00, 302.00, 327.00, 654.00). FICA wages are the actual wages, or 0 for F and J visa holders present 5 years or fewer. Return [fit_wages, fica_wages].

Why this case matters

The nonresident add-on inflates only the income-tax base; student and scholar FICA exemptions are time-limited.

1 / The failure

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

N = 1
observations = []
def solve(x):
    new = {'weekly': 20960, 'biweekly': 41920, 'semimonthly': 45420, 'monthly': 90830}
    old = {'weekly': 15100, 'biweekly': 30200, 'semimonthly': 32700, 'monthly': 65400}
    add = new[x['freq']] if x['w4_year'] >= 2020 else old[x['freq']]
    fit = x['wage'] + (add if x['nra'] else 0)
    exempt = x['visa'] in ('F', 'J') and x['years_present'] < 5
    fica = 0 if exempt else x['wage']
    return [fit, fica]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression', {'wage': 179956, 'freq': 'monthly', 'nra': True, 'w4_year': 2021, 'visa': 'J', 'years_present': 5}, [270786, 0]), ('regression', {'wage': 40274, 'freq': 'monthly', 'nra': True, 'w4_year': 2018, 'visa': 'F', 'years_present': 5}, [105674, 0]), ('partial-repair probe', {'wage': 314655, 'freq': 'monthly', 'nra': False, 'w4_year': 2024, 'visa': 'J', 'years_present': 1}, [314655, 0]), ('partial-repair probe', {'wage': 437685, 'freq': 'weekly', 'nra': True, 'w4_year': 2019, 'visa': 'J', 'years_present': 4}, [452785, 0]), ('normal control', {'wage': 392169, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2019, 'visa': 'F', 'years_present': 1}, [424869, 0]), ('normal control', {'wage': 245306, 'freq': 'weekly', 'nra': False, 'w4_year': 2020, 'visa': 'F', 'years_present': 6}, [245306, 245306]), ('normal control', {'wage': 252469, 'freq': 'weekly', 'nra': True, 'w4_year': 2021, 'visa': None, 'years_present': 8}, [273429, 252469]), ('normal control', {'wage': 286154, 'freq': 'monthly', 'nra': True, 'w4_year': 2024, 'visa': 'H', 'years_present': 1}, [376984, 286154])], [('regression', {'wage': 217618, 'freq': 'biweekly', 'nra': False, 'w4_year': 2019, 'visa': 'J', 'years_present': 5}, [217618, 0]), ('regression', {'wage': 179956, 'freq': 'monthly', 'nra': True, 'w4_year': 2021, 'visa': 'J', 'years_present': 5}, [270786, 0]), ('partial-repair probe', {'wage': 437685, 'freq': 'weekly', 'nra': True, 'w4_year': 2019, 'visa': 'J', 'years_present': 4}, [452785, 0]), ('partial-repair probe', {'wage': 474591, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2021, 'visa': 'J', 'years_present': 4}, [520011, 0]), ('normal control', {'wage': 2124, 'freq': 'monthly', 'nra': True, 'w4_year': 2024, 'visa': 'H', 'years_present': 6}, [92954, 2124]), ('normal control', {'wage': 350530, 'freq': 'weekly', 'nra': False, 'w4_year': 2018, 'visa': None, 'years_present': 1}, [350530, 350530]), ('normal control', {'wage': 210010, 'freq': 'biweekly', 'nra': True, 'w4_year': 2019, 'visa': None, 'years_present': 1}, [240210, 210010]), ('normal control', {'wage': 436984, 'freq': 'biweekly', 'nra': True, 'w4_year': 2021, 'visa': 'J', 'years_present': 8}, [478904, 436984])], [('regression', {'wage': 310614, 'freq': 'weekly', 'nra': False, 'w4_year': 2019, 'visa': 'J', 'years_present': 5}, [310614, 0]), ('regression', {'wage': 217618, 'freq': 'biweekly', 'nra': False, 'w4_year': 2019, 'visa': 'J', 'years_present': 5}, [217618, 0]), ('partial-repair probe', {'wage': 54168, 'freq': 'weekly', 'nra': True, 'w4_year': 2018, 'visa': 'J', 'years_present': 4}, [69268, 0]), ('partial-repair probe', {'wage': 419635, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2018, 'visa': 'J', 'years_present': 4}, [452335, 0]), ('normal control', {'wage': 279817, 'freq': 'biweekly', 'nra': False, 'w4_year': 2019, 'visa': None, 'years_present': 8}, [279817, 279817]), ('normal control', {'wage': 352005, 'freq': 'semimonthly', 'nra': False, 'w4_year': 2018, 'visa': 'H', 'years_present': 5}, [352005, 352005]), ('normal control', {'wage': 328051, 'freq': 'weekly', 'nra': False, 'w4_year': 2024, 'visa': None, 'years_present': 5}, [328051, 328051]), ('normal control', {'wage': 162523, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2020, 'visa': 'H', 'years_present': 5}, [207943, 162523])], [('regression', {'wage': 464578, 'freq': 'monthly', 'nra': False, 'w4_year': 2018, 'visa': 'J', 'years_present': 5}, [464578, 0]), ('regression', {'wage': 310614, 'freq': 'weekly', 'nra': False, 'w4_year': 2019, 'visa': 'J', 'years_present': 5}, [310614, 0]), ('partial-repair probe', {'wage': 76351, 'freq': 'semimonthly', 'nra': False, 'w4_year': 2019, 'visa': 'J', 'years_present': 1}, [76351, 0]), ('partial-repair probe', {'wage': 367989, 'freq': 'biweekly', 'nra': True, 'w4_year': 2021, 'visa': 'J', 'years_present': 4}, [409909, 0]), ('normal control', {'wage': 181833, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2020, 'visa': None, 'years_present': 1}, [227253, 181833]), ('normal control', {'wage': 141591, 'freq': 'biweekly', 'nra': True, 'w4_year': 2018, 'visa': 'H', 'years_present': 4}, [171791, 141591]), ('normal control', {'wage': 416568, 'freq': 'weekly', 'nra': True, 'w4_year': 2021, 'visa': 'H', 'years_present': 8}, [437528, 416568]), ('normal control', {'wage': 434085, 'freq': 'weekly', 'nra': False, 'w4_year': 2020, 'visa': None, 'years_present': 6}, [434085, 434085])], [('regression', {'wage': 64348, 'freq': 'biweekly', 'nra': False, 'w4_year': 2019, 'visa': 'J', 'years_present': 5}, [64348, 0]), ('regression', {'wage': 148120, 'freq': 'monthly', 'nra': False, 'w4_year': 2019, 'visa': 'F', 'years_present': 5}, [148120, 0]), ('partial-repair probe', {'wage': 217618, 'freq': 'biweekly', 'nra': False, 'w4_year': 2019, 'visa': 'J', 'years_present': 5}, [217618, 0]), ('partial-repair probe', {'wage': 310614, 'freq': 'weekly', 'nra': False, 'w4_year': 2019, 'visa': 'J', 'years_present': 5}, [310614, 0]), ('normal control', {'wage': 114598, 'freq': 'weekly', 'nra': True, 'w4_year': 2020, 'visa': 'H', 'years_present': 5}, [135558, 114598]), ('normal control', {'wage': 178971, 'freq': 'biweekly', 'nra': True, 'w4_year': 2018, 'visa': 'F', 'years_present': 1}, [209171, 0]), ('normal control', {'wage': 21555, 'freq': 'biweekly', 'nra': True, 'w4_year': 2019, 'visa': 'J', 'years_present': 6}, [51755, 21555]), ('normal control', {'wage': 498322, 'freq': 'biweekly', 'nra': True, 'w4_year': 2020, 'visa': None, 'years_present': 5}, [540242, 498322])]]
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[270786, 179956][270786, 0]Failed
regression 1[105674, 40274][105674, 0]Failed
partial-repair probe 2[314655, 0][314655, 0]Passed
partial-repair probe 3[452785, 0][452785, 0]Passed
normal control 4[424869, 0][424869, 0]Passed
normal control 5[245306, 245306][245306, 245306]Passed
normal control 6[273429, 252469][273429, 252469]Passed
normal control 7[376984, 286154][376984, 286154]Passed

SHA-256 / 49925d0202a9b2998709306b295ccbb21465dfdd849d7b6440f5b0e1e3435669

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(x):
    new = {'weekly': 20960, 'biweekly': 41920, 'semimonthly': 45420, 'monthly': 90830}
    old = {'weekly': 15100, 'biweekly': 30200, 'semimonthly': 32700, 'monthly': 65400}
    add = new[x['freq']] if x['w4_year'] >= 2020 else old[x['freq']]
    fit = x['wage'] + (add if x['nra'] else 0)
    exempt = x['visa'] in ('F', 'J') and x['years_present'] <= 5 and x['visa'] == 'F'
    fica = 0 if exempt else x['wage']
    return [fit, fica]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression', {'wage': 179956, 'freq': 'monthly', 'nra': True, 'w4_year': 2021, 'visa': 'J', 'years_present': 5}, [270786, 0]), ('regression', {'wage': 40274, 'freq': 'monthly', 'nra': True, 'w4_year': 2018, 'visa': 'F', 'years_present': 5}, [105674, 0]), ('partial-repair probe', {'wage': 314655, 'freq': 'monthly', 'nra': False, 'w4_year': 2024, 'visa': 'J', 'years_present': 1}, [314655, 0]), ('partial-repair probe', {'wage': 437685, 'freq': 'weekly', 'nra': True, 'w4_year': 2019, 'visa': 'J', 'years_present': 4}, [452785, 0]), ('normal control', {'wage': 392169, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2019, 'visa': 'F', 'years_present': 1}, [424869, 0]), ('normal control', {'wage': 245306, 'freq': 'weekly', 'nra': False, 'w4_year': 2020, 'visa': 'F', 'years_present': 6}, [245306, 245306]), ('normal control', {'wage': 252469, 'freq': 'weekly', 'nra': True, 'w4_year': 2021, 'visa': None, 'years_present': 8}, [273429, 252469]), ('normal control', {'wage': 286154, 'freq': 'monthly', 'nra': True, 'w4_year': 2024, 'visa': 'H', 'years_present': 1}, [376984, 286154])], [('regression', {'wage': 217618, 'freq': 'biweekly', 'nra': False, 'w4_year': 2019, 'visa': 'J', 'years_present': 5}, [217618, 0]), ('regression', {'wage': 179956, 'freq': 'monthly', 'nra': True, 'w4_year': 2021, 'visa': 'J', 'years_present': 5}, [270786, 0]), ('partial-repair probe', {'wage': 437685, 'freq': 'weekly', 'nra': True, 'w4_year': 2019, 'visa': 'J', 'years_present': 4}, [452785, 0]), ('partial-repair probe', {'wage': 474591, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2021, 'visa': 'J', 'years_present': 4}, [520011, 0]), ('normal control', {'wage': 2124, 'freq': 'monthly', 'nra': True, 'w4_year': 2024, 'visa': 'H', 'years_present': 6}, [92954, 2124]), ('normal control', {'wage': 350530, 'freq': 'weekly', 'nra': False, 'w4_year': 2018, 'visa': None, 'years_present': 1}, [350530, 350530]), ('normal control', {'wage': 210010, 'freq': 'biweekly', 'nra': True, 'w4_year': 2019, 'visa': None, 'years_present': 1}, [240210, 210010]), ('normal control', {'wage': 436984, 'freq': 'biweekly', 'nra': True, 'w4_year': 2021, 'visa': 'J', 'years_present': 8}, [478904, 436984])], [('regression', {'wage': 310614, 'freq': 'weekly', 'nra': False, 'w4_year': 2019, 'visa': 'J', 'years_present': 5}, [310614, 0]), ('regression', {'wage': 217618, 'freq': 'biweekly', 'nra': False, 'w4_year': 2019, 'visa': 'J', 'years_present': 5}, [217618, 0]), ('partial-repair probe', {'wage': 54168, 'freq': 'weekly', 'nra': True, 'w4_year': 2018, 'visa': 'J', 'years_present': 4}, [69268, 0]), ('partial-repair probe', {'wage': 419635, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2018, 'visa': 'J', 'years_present': 4}, [452335, 0]), ('normal control', {'wage': 279817, 'freq': 'biweekly', 'nra': False, 'w4_year': 2019, 'visa': None, 'years_present': 8}, [279817, 279817]), ('normal control', {'wage': 352005, 'freq': 'semimonthly', 'nra': False, 'w4_year': 2018, 'visa': 'H', 'years_present': 5}, [352005, 352005]), ('normal control', {'wage': 328051, 'freq': 'weekly', 'nra': False, 'w4_year': 2024, 'visa': None, 'years_present': 5}, [328051, 328051]), ('normal control', {'wage': 162523, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2020, 'visa': 'H', 'years_present': 5}, [207943, 162523])], [('regression', {'wage': 464578, 'freq': 'monthly', 'nra': False, 'w4_year': 2018, 'visa': 'J', 'years_present': 5}, [464578, 0]), ('regression', {'wage': 310614, 'freq': 'weekly', 'nra': False, 'w4_year': 2019, 'visa': 'J', 'years_present': 5}, [310614, 0]), ('partial-repair probe', {'wage': 76351, 'freq': 'semimonthly', 'nra': False, 'w4_year': 2019, 'visa': 'J', 'years_present': 1}, [76351, 0]), ('partial-repair probe', {'wage': 367989, 'freq': 'biweekly', 'nra': True, 'w4_year': 2021, 'visa': 'J', 'years_present': 4}, [409909, 0]), ('normal control', {'wage': 181833, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2020, 'visa': None, 'years_present': 1}, [227253, 181833]), ('normal control', {'wage': 141591, 'freq': 'biweekly', 'nra': True, 'w4_year': 2018, 'visa': 'H', 'years_present': 4}, [171791, 141591]), ('normal control', {'wage': 416568, 'freq': 'weekly', 'nra': True, 'w4_year': 2021, 'visa': 'H', 'years_present': 8}, [437528, 416568]), ('normal control', {'wage': 434085, 'freq': 'weekly', 'nra': False, 'w4_year': 2020, 'visa': None, 'years_present': 6}, [434085, 434085])], [('regression', {'wage': 64348, 'freq': 'biweekly', 'nra': False, 'w4_year': 2019, 'visa': 'J', 'years_present': 5}, [64348, 0]), ('regression', {'wage': 148120, 'freq': 'monthly', 'nra': False, 'w4_year': 2019, 'visa': 'F', 'years_present': 5}, [148120, 0]), ('partial-repair probe', {'wage': 217618, 'freq': 'biweekly', 'nra': False, 'w4_year': 2019, 'visa': 'J', 'years_present': 5}, [217618, 0]), ('partial-repair probe', {'wage': 310614, 'freq': 'weekly', 'nra': False, 'w4_year': 2019, 'visa': 'J', 'years_present': 5}, [310614, 0]), ('normal control', {'wage': 114598, 'freq': 'weekly', 'nra': True, 'w4_year': 2020, 'visa': 'H', 'years_present': 5}, [135558, 114598]), ('normal control', {'wage': 178971, 'freq': 'biweekly', 'nra': True, 'w4_year': 2018, 'visa': 'F', 'years_present': 1}, [209171, 0]), ('normal control', {'wage': 21555, 'freq': 'biweekly', 'nra': True, 'w4_year': 2019, 'visa': 'J', 'years_present': 6}, [51755, 21555]), ('normal control', {'wage': 498322, 'freq': 'biweekly', 'nra': True, 'w4_year': 2020, 'visa': None, 'years_present': 5}, [540242, 498322])]]
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[270786, 179956][270786, 0]Failed
regression 1[105674, 0][105674, 0]Passed
partial-repair probe 2[314655, 314655][314655, 0]Failed
partial-repair probe 3[452785, 437685][452785, 0]Failed
normal control 4[424869, 0][424869, 0]Passed
normal control 5[245306, 245306][245306, 245306]Passed
normal control 6[273429, 252469][273429, 252469]Passed
normal control 7[376984, 286154][376984, 286154]Passed

SHA-256 / 3c444451a878100a2c5ddde3f3ae386c21a926fef7efe6de7c714f2e0f628ee1

3 / The verified repair

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

N = 1
observations = []
def solve(x):
    new = {'weekly': 20960, 'biweekly': 41920, 'semimonthly': 45420, 'monthly': 90830}
    old = {'weekly': 15100, 'biweekly': 30200, 'semimonthly': 32700, 'monthly': 65400}
    add = new[x['freq']] if x['w4_year'] >= 2020 else old[x['freq']]
    fit = x['wage'] + (add if x['nra'] else 0)
    exempt = x['visa'] in ('F', 'J') and x['years_present'] <= 5
    fica = 0 if exempt else x['wage']
    return [fit, fica]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression', {'wage': 179956, 'freq': 'monthly', 'nra': True, 'w4_year': 2021, 'visa': 'J', 'years_present': 5}, [270786, 0]), ('regression', {'wage': 40274, 'freq': 'monthly', 'nra': True, 'w4_year': 2018, 'visa': 'F', 'years_present': 5}, [105674, 0]), ('partial-repair probe', {'wage': 314655, 'freq': 'monthly', 'nra': False, 'w4_year': 2024, 'visa': 'J', 'years_present': 1}, [314655, 0]), ('partial-repair probe', {'wage': 437685, 'freq': 'weekly', 'nra': True, 'w4_year': 2019, 'visa': 'J', 'years_present': 4}, [452785, 0]), ('normal control', {'wage': 392169, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2019, 'visa': 'F', 'years_present': 1}, [424869, 0]), ('normal control', {'wage': 245306, 'freq': 'weekly', 'nra': False, 'w4_year': 2020, 'visa': 'F', 'years_present': 6}, [245306, 245306]), ('normal control', {'wage': 252469, 'freq': 'weekly', 'nra': True, 'w4_year': 2021, 'visa': None, 'years_present': 8}, [273429, 252469]), ('normal control', {'wage': 286154, 'freq': 'monthly', 'nra': True, 'w4_year': 2024, 'visa': 'H', 'years_present': 1}, [376984, 286154])], [('regression', {'wage': 217618, 'freq': 'biweekly', 'nra': False, 'w4_year': 2019, 'visa': 'J', 'years_present': 5}, [217618, 0]), ('regression', {'wage': 179956, 'freq': 'monthly', 'nra': True, 'w4_year': 2021, 'visa': 'J', 'years_present': 5}, [270786, 0]), ('partial-repair probe', {'wage': 437685, 'freq': 'weekly', 'nra': True, 'w4_year': 2019, 'visa': 'J', 'years_present': 4}, [452785, 0]), ('partial-repair probe', {'wage': 474591, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2021, 'visa': 'J', 'years_present': 4}, [520011, 0]), ('normal control', {'wage': 2124, 'freq': 'monthly', 'nra': True, 'w4_year': 2024, 'visa': 'H', 'years_present': 6}, [92954, 2124]), ('normal control', {'wage': 350530, 'freq': 'weekly', 'nra': False, 'w4_year': 2018, 'visa': None, 'years_present': 1}, [350530, 350530]), ('normal control', {'wage': 210010, 'freq': 'biweekly', 'nra': True, 'w4_year': 2019, 'visa': None, 'years_present': 1}, [240210, 210010]), ('normal control', {'wage': 436984, 'freq': 'biweekly', 'nra': True, 'w4_year': 2021, 'visa': 'J', 'years_present': 8}, [478904, 436984])], [('regression', {'wage': 310614, 'freq': 'weekly', 'nra': False, 'w4_year': 2019, 'visa': 'J', 'years_present': 5}, [310614, 0]), ('regression', {'wage': 217618, 'freq': 'biweekly', 'nra': False, 'w4_year': 2019, 'visa': 'J', 'years_present': 5}, [217618, 0]), ('partial-repair probe', {'wage': 54168, 'freq': 'weekly', 'nra': True, 'w4_year': 2018, 'visa': 'J', 'years_present': 4}, [69268, 0]), ('partial-repair probe', {'wage': 419635, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2018, 'visa': 'J', 'years_present': 4}, [452335, 0]), ('normal control', {'wage': 279817, 'freq': 'biweekly', 'nra': False, 'w4_year': 2019, 'visa': None, 'years_present': 8}, [279817, 279817]), ('normal control', {'wage': 352005, 'freq': 'semimonthly', 'nra': False, 'w4_year': 2018, 'visa': 'H', 'years_present': 5}, [352005, 352005]), ('normal control', {'wage': 328051, 'freq': 'weekly', 'nra': False, 'w4_year': 2024, 'visa': None, 'years_present': 5}, [328051, 328051]), ('normal control', {'wage': 162523, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2020, 'visa': 'H', 'years_present': 5}, [207943, 162523])], [('regression', {'wage': 464578, 'freq': 'monthly', 'nra': False, 'w4_year': 2018, 'visa': 'J', 'years_present': 5}, [464578, 0]), ('regression', {'wage': 310614, 'freq': 'weekly', 'nra': False, 'w4_year': 2019, 'visa': 'J', 'years_present': 5}, [310614, 0]), ('partial-repair probe', {'wage': 76351, 'freq': 'semimonthly', 'nra': False, 'w4_year': 2019, 'visa': 'J', 'years_present': 1}, [76351, 0]), ('partial-repair probe', {'wage': 367989, 'freq': 'biweekly', 'nra': True, 'w4_year': 2021, 'visa': 'J', 'years_present': 4}, [409909, 0]), ('normal control', {'wage': 181833, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2020, 'visa': None, 'years_present': 1}, [227253, 181833]), ('normal control', {'wage': 141591, 'freq': 'biweekly', 'nra': True, 'w4_year': 2018, 'visa': 'H', 'years_present': 4}, [171791, 141591]), ('normal control', {'wage': 416568, 'freq': 'weekly', 'nra': True, 'w4_year': 2021, 'visa': 'H', 'years_present': 8}, [437528, 416568]), ('normal control', {'wage': 434085, 'freq': 'weekly', 'nra': False, 'w4_year': 2020, 'visa': None, 'years_present': 6}, [434085, 434085])], [('regression', {'wage': 64348, 'freq': 'biweekly', 'nra': False, 'w4_year': 2019, 'visa': 'J', 'years_present': 5}, [64348, 0]), ('regression', {'wage': 148120, 'freq': 'monthly', 'nra': False, 'w4_year': 2019, 'visa': 'F', 'years_present': 5}, [148120, 0]), ('partial-repair probe', {'wage': 217618, 'freq': 'biweekly', 'nra': False, 'w4_year': 2019, 'visa': 'J', 'years_present': 5}, [217618, 0]), ('partial-repair probe', {'wage': 310614, 'freq': 'weekly', 'nra': False, 'w4_year': 2019, 'visa': 'J', 'years_present': 5}, [310614, 0]), ('normal control', {'wage': 114598, 'freq': 'weekly', 'nra': True, 'w4_year': 2020, 'visa': 'H', 'years_present': 5}, [135558, 114598]), ('normal control', {'wage': 178971, 'freq': 'biweekly', 'nra': True, 'w4_year': 2018, 'visa': 'F', 'years_present': 1}, [209171, 0]), ('normal control', {'wage': 21555, 'freq': 'biweekly', 'nra': True, 'w4_year': 2019, 'visa': 'J', 'years_present': 6}, [51755, 21555]), ('normal control', {'wage': 498322, 'freq': 'biweekly', 'nra': True, 'w4_year': 2020, 'visa': None, 'years_present': 5}, [540242, 498322])]]
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[270786, 0][270786, 0]Passed
regression 1[105674, 0][105674, 0]Passed
partial-repair probe 2[314655, 0][314655, 0]Passed
partial-repair probe 3[452785, 0][452785, 0]Passed
normal control 4[424869, 0][424869, 0]Passed
normal control 5[245306, 245306][245306, 245306]Passed
normal control 6[273429, 252469][273429, 252469]Passed
normal control 7[376984, 286154][376984, 286154]Passed

SHA-256 / 9d9a29cda2260eb0bb38eb55b5f2a97bc876202653be8692cff6fed294dffcfd

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

Case digest / 94d9cf8c9aa996d5e14f00e9b7033f1f6154bf43ae9bc28cbfa7b2935708905f