FA-59326 / Payroll withholding rules / Open access
Nonresident alien wage add-on: nonresident-only add-on · case 01
Citizens and resident aliens are over-withheld by the nonresident add-on.
ROOT CAUSE
The add-on is applied to every employee regardless of nonresident status.
VERIFIED REPAIR
Restore the contract rule at the nonresident-only add-on step: use `fit = x['wage'] + (add if x['nra'] else 0)`.
Unsuccessful approach: The attempt applies it to any visa holder, including resident aliens who hold visas.
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
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': 245306, 'freq': 'weekly', 'nra': False, 'w4_year': 2020, 'visa': 'F', 'years_present': 6}, [245306, 245306]), ('regression', {'wage': 314655, 'freq': 'monthly', 'nra': False, 'w4_year': 2024, 'visa': 'J', 'years_present': 1}, [314655, 0]), ('partial-repair probe', {'wage': 352005, 'freq': 'semimonthly', 'nra': False, 'w4_year': 2018, 'visa': 'H', 'years_present': 5}, [352005, 352005]), ('partial-repair probe', {'wage': 345401, 'freq': 'weekly', 'nra': False, 'w4_year': 2021, 'visa': 'J', 'years_present': 8}, [345401, 345401]), ('normal control', {'wage': 392169, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2019, 'visa': 'F', 'years_present': 1}, [424869, 0]), ('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]), ('normal control', {'wage': 2124, 'freq': 'monthly', 'nra': True, 'w4_year': 2024, 'visa': 'H', 'years_present': 6}, [92954, 2124])], [('regression', {'wage': 314655, 'freq': 'monthly', 'nra': False, 'w4_year': 2024, 'visa': 'J', 'years_present': 1}, [314655, 0]), ('regression', {'wage': 350530, 'freq': 'weekly', 'nra': False, 'w4_year': 2018, 'visa': None, 'years_present': 1}, [350530, 350530]), ('partial-repair probe', {'wage': 352005, 'freq': 'semimonthly', 'nra': False, 'w4_year': 2018, 'visa': 'H', 'years_present': 5}, [352005, 352005]), ('partial-repair probe', {'wage': 345401, 'freq': 'weekly', 'nra': False, 'w4_year': 2021, 'visa': 'J', 'years_present': 8}, [345401, 345401]), ('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]), ('normal control', {'wage': 40274, 'freq': 'monthly', 'nra': True, 'w4_year': 2018, 'visa': 'F', 'years_present': 5}, [105674, 0]), ('normal control', {'wage': 179956, 'freq': 'monthly', 'nra': True, 'w4_year': 2021, 'visa': 'J', 'years_present': 5}, [270786, 0])], [('regression', {'wage': 352005, 'freq': 'semimonthly', 'nra': False, 'w4_year': 2018, 'visa': 'H', 'years_present': 5}, [352005, 352005]), ('regression', {'wage': 350530, 'freq': 'weekly', 'nra': False, 'w4_year': 2018, 'visa': None, 'years_present': 1}, [350530, 350530]), ('partial-repair probe', {'wage': 356715, 'freq': 'weekly', 'nra': False, 'w4_year': 2024, 'visa': 'F', 'years_present': 6}, [356715, 356715]), ('partial-repair probe', {'wage': 62573, 'freq': 'monthly', 'nra': False, 'w4_year': 2018, 'visa': 'F', 'years_present': 6}, [62573, 62573]), ('normal control', {'wage': 162523, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2020, 'visa': 'H', 'years_present': 5}, [207943, 162523]), ('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])], [('regression', {'wage': 345401, 'freq': 'weekly', 'nra': False, 'w4_year': 2021, 'visa': 'J', 'years_present': 8}, [345401, 345401]), ('regression', {'wage': 279817, 'freq': 'biweekly', 'nra': False, 'w4_year': 2019, 'visa': None, 'years_present': 8}, [279817, 279817]), ('partial-repair probe', {'wage': 287286, 'freq': 'weekly', 'nra': False, 'w4_year': 2020, 'visa': 'F', 'years_present': 1}, [287286, 0]), ('partial-repair probe', {'wage': 102873, 'freq': 'weekly', 'nra': False, 'w4_year': 2024, 'visa': 'H', 'years_present': 8}, [102873, 102873]), ('normal control', {'wage': 437685, 'freq': 'weekly', 'nra': True, 'w4_year': 2019, 'visa': 'J', 'years_present': 4}, [452785, 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])], [('regression', {'wage': 356715, 'freq': 'weekly', 'nra': False, 'w4_year': 2024, 'visa': 'F', 'years_present': 6}, [356715, 356715]), ('regression', {'wage': 352005, 'freq': 'semimonthly', 'nra': False, 'w4_year': 2018, 'visa': 'H', 'years_present': 5}, [352005, 352005]), ('partial-repair probe', {'wage': 325245, 'freq': 'weekly', 'nra': False, 'w4_year': 2018, 'visa': 'H', 'years_present': 5}, [325245, 325245]), ('partial-repair probe', {'wage': 458461, 'freq': 'semimonthly', 'nra': False, 'w4_year': 2019, 'visa': 'H', 'years_present': 1}, [458461, 458461]), ('normal control', {'wage': 498322, 'freq': 'biweekly', 'nra': True, 'w4_year': 2020, 'visa': None, 'years_present': 5}, [540242, 498322]), ('normal control', {'wage': 295891, 'freq': 'monthly', 'nra': True, 'w4_year': 2021, 'visa': 'J', 'years_present': 8}, [386721, 295891]), ('normal control', {'wage': 411503, 'freq': 'monthly', 'nra': True, 'w4_year': 2021, 'visa': 'H', 'years_present': 6}, [502333, 411503]), ('normal control', {'wage': 89672, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2019, 'visa': 'H', 'years_present': 4}, [122372, 89672])]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 0 | [266266, 245306] | [245306, 245306] | Failed |
| regression 1 | [405485, 0] | [314655, 0] | Failed |
| partial-repair probe 2 | [384705, 352005] | [352005, 352005] | Failed |
| partial-repair probe 3 | [366361, 345401] | [345401, 345401] | Failed |
| normal control 4 | [424869, 0] | [424869, 0] | Passed |
| normal control 5 | [273429, 252469] | [273429, 252469] | Passed |
| normal control 6 | [376984, 286154] | [376984, 286154] | Passed |
| normal control 7 | [92954, 2124] | [92954, 2124] | Passed |
SHA-256 / b4ccd778a6e73169c80294c5d494e25d38e7b8ca8afa893481397bc8657e3f81
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'] or x['visa'] 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': 245306, 'freq': 'weekly', 'nra': False, 'w4_year': 2020, 'visa': 'F', 'years_present': 6}, [245306, 245306]), ('regression', {'wage': 314655, 'freq': 'monthly', 'nra': False, 'w4_year': 2024, 'visa': 'J', 'years_present': 1}, [314655, 0]), ('partial-repair probe', {'wage': 352005, 'freq': 'semimonthly', 'nra': False, 'w4_year': 2018, 'visa': 'H', 'years_present': 5}, [352005, 352005]), ('partial-repair probe', {'wage': 345401, 'freq': 'weekly', 'nra': False, 'w4_year': 2021, 'visa': 'J', 'years_present': 8}, [345401, 345401]), ('normal control', {'wage': 392169, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2019, 'visa': 'F', 'years_present': 1}, [424869, 0]), ('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]), ('normal control', {'wage': 2124, 'freq': 'monthly', 'nra': True, 'w4_year': 2024, 'visa': 'H', 'years_present': 6}, [92954, 2124])], [('regression', {'wage': 314655, 'freq': 'monthly', 'nra': False, 'w4_year': 2024, 'visa': 'J', 'years_present': 1}, [314655, 0]), ('regression', {'wage': 350530, 'freq': 'weekly', 'nra': False, 'w4_year': 2018, 'visa': None, 'years_present': 1}, [350530, 350530]), ('partial-repair probe', {'wage': 352005, 'freq': 'semimonthly', 'nra': False, 'w4_year': 2018, 'visa': 'H', 'years_present': 5}, [352005, 352005]), ('partial-repair probe', {'wage': 345401, 'freq': 'weekly', 'nra': False, 'w4_year': 2021, 'visa': 'J', 'years_present': 8}, [345401, 345401]), ('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]), ('normal control', {'wage': 40274, 'freq': 'monthly', 'nra': True, 'w4_year': 2018, 'visa': 'F', 'years_present': 5}, [105674, 0]), ('normal control', {'wage': 179956, 'freq': 'monthly', 'nra': True, 'w4_year': 2021, 'visa': 'J', 'years_present': 5}, [270786, 0])], [('regression', {'wage': 352005, 'freq': 'semimonthly', 'nra': False, 'w4_year': 2018, 'visa': 'H', 'years_present': 5}, [352005, 352005]), ('regression', {'wage': 350530, 'freq': 'weekly', 'nra': False, 'w4_year': 2018, 'visa': None, 'years_present': 1}, [350530, 350530]), ('partial-repair probe', {'wage': 356715, 'freq': 'weekly', 'nra': False, 'w4_year': 2024, 'visa': 'F', 'years_present': 6}, [356715, 356715]), ('partial-repair probe', {'wage': 62573, 'freq': 'monthly', 'nra': False, 'w4_year': 2018, 'visa': 'F', 'years_present': 6}, [62573, 62573]), ('normal control', {'wage': 162523, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2020, 'visa': 'H', 'years_present': 5}, [207943, 162523]), ('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])], [('regression', {'wage': 345401, 'freq': 'weekly', 'nra': False, 'w4_year': 2021, 'visa': 'J', 'years_present': 8}, [345401, 345401]), ('regression', {'wage': 279817, 'freq': 'biweekly', 'nra': False, 'w4_year': 2019, 'visa': None, 'years_present': 8}, [279817, 279817]), ('partial-repair probe', {'wage': 287286, 'freq': 'weekly', 'nra': False, 'w4_year': 2020, 'visa': 'F', 'years_present': 1}, [287286, 0]), ('partial-repair probe', {'wage': 102873, 'freq': 'weekly', 'nra': False, 'w4_year': 2024, 'visa': 'H', 'years_present': 8}, [102873, 102873]), ('normal control', {'wage': 437685, 'freq': 'weekly', 'nra': True, 'w4_year': 2019, 'visa': 'J', 'years_present': 4}, [452785, 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])], [('regression', {'wage': 356715, 'freq': 'weekly', 'nra': False, 'w4_year': 2024, 'visa': 'F', 'years_present': 6}, [356715, 356715]), ('regression', {'wage': 352005, 'freq': 'semimonthly', 'nra': False, 'w4_year': 2018, 'visa': 'H', 'years_present': 5}, [352005, 352005]), ('partial-repair probe', {'wage': 325245, 'freq': 'weekly', 'nra': False, 'w4_year': 2018, 'visa': 'H', 'years_present': 5}, [325245, 325245]), ('partial-repair probe', {'wage': 458461, 'freq': 'semimonthly', 'nra': False, 'w4_year': 2019, 'visa': 'H', 'years_present': 1}, [458461, 458461]), ('normal control', {'wage': 498322, 'freq': 'biweekly', 'nra': True, 'w4_year': 2020, 'visa': None, 'years_present': 5}, [540242, 498322]), ('normal control', {'wage': 295891, 'freq': 'monthly', 'nra': True, 'w4_year': 2021, 'visa': 'J', 'years_present': 8}, [386721, 295891]), ('normal control', {'wage': 411503, 'freq': 'monthly', 'nra': True, 'w4_year': 2021, 'visa': 'H', 'years_present': 6}, [502333, 411503]), ('normal control', {'wage': 89672, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2019, 'visa': 'H', 'years_present': 4}, [122372, 89672])]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 0 | [266266, 245306] | [245306, 245306] | Failed |
| regression 1 | [405485, 0] | [314655, 0] | Failed |
| partial-repair probe 2 | [384705, 352005] | [352005, 352005] | Failed |
| partial-repair probe 3 | [366361, 345401] | [345401, 345401] | Failed |
| normal control 4 | [424869, 0] | [424869, 0] | Passed |
| normal control 5 | [273429, 252469] | [273429, 252469] | Passed |
| normal control 6 | [376984, 286154] | [376984, 286154] | Passed |
| normal control 7 | [92954, 2124] | [92954, 2124] | Passed |
SHA-256 / 23007129d709e8bee20cda4664bcc1c779fe9e74caf4ce5ef7edc30fcb0e36d9
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': 245306, 'freq': 'weekly', 'nra': False, 'w4_year': 2020, 'visa': 'F', 'years_present': 6}, [245306, 245306]), ('regression', {'wage': 314655, 'freq': 'monthly', 'nra': False, 'w4_year': 2024, 'visa': 'J', 'years_present': 1}, [314655, 0]), ('partial-repair probe', {'wage': 352005, 'freq': 'semimonthly', 'nra': False, 'w4_year': 2018, 'visa': 'H', 'years_present': 5}, [352005, 352005]), ('partial-repair probe', {'wage': 345401, 'freq': 'weekly', 'nra': False, 'w4_year': 2021, 'visa': 'J', 'years_present': 8}, [345401, 345401]), ('normal control', {'wage': 392169, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2019, 'visa': 'F', 'years_present': 1}, [424869, 0]), ('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]), ('normal control', {'wage': 2124, 'freq': 'monthly', 'nra': True, 'w4_year': 2024, 'visa': 'H', 'years_present': 6}, [92954, 2124])], [('regression', {'wage': 314655, 'freq': 'monthly', 'nra': False, 'w4_year': 2024, 'visa': 'J', 'years_present': 1}, [314655, 0]), ('regression', {'wage': 350530, 'freq': 'weekly', 'nra': False, 'w4_year': 2018, 'visa': None, 'years_present': 1}, [350530, 350530]), ('partial-repair probe', {'wage': 352005, 'freq': 'semimonthly', 'nra': False, 'w4_year': 2018, 'visa': 'H', 'years_present': 5}, [352005, 352005]), ('partial-repair probe', {'wage': 345401, 'freq': 'weekly', 'nra': False, 'w4_year': 2021, 'visa': 'J', 'years_present': 8}, [345401, 345401]), ('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]), ('normal control', {'wage': 40274, 'freq': 'monthly', 'nra': True, 'w4_year': 2018, 'visa': 'F', 'years_present': 5}, [105674, 0]), ('normal control', {'wage': 179956, 'freq': 'monthly', 'nra': True, 'w4_year': 2021, 'visa': 'J', 'years_present': 5}, [270786, 0])], [('regression', {'wage': 352005, 'freq': 'semimonthly', 'nra': False, 'w4_year': 2018, 'visa': 'H', 'years_present': 5}, [352005, 352005]), ('regression', {'wage': 350530, 'freq': 'weekly', 'nra': False, 'w4_year': 2018, 'visa': None, 'years_present': 1}, [350530, 350530]), ('partial-repair probe', {'wage': 356715, 'freq': 'weekly', 'nra': False, 'w4_year': 2024, 'visa': 'F', 'years_present': 6}, [356715, 356715]), ('partial-repair probe', {'wage': 62573, 'freq': 'monthly', 'nra': False, 'w4_year': 2018, 'visa': 'F', 'years_present': 6}, [62573, 62573]), ('normal control', {'wage': 162523, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2020, 'visa': 'H', 'years_present': 5}, [207943, 162523]), ('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])], [('regression', {'wage': 345401, 'freq': 'weekly', 'nra': False, 'w4_year': 2021, 'visa': 'J', 'years_present': 8}, [345401, 345401]), ('regression', {'wage': 279817, 'freq': 'biweekly', 'nra': False, 'w4_year': 2019, 'visa': None, 'years_present': 8}, [279817, 279817]), ('partial-repair probe', {'wage': 287286, 'freq': 'weekly', 'nra': False, 'w4_year': 2020, 'visa': 'F', 'years_present': 1}, [287286, 0]), ('partial-repair probe', {'wage': 102873, 'freq': 'weekly', 'nra': False, 'w4_year': 2024, 'visa': 'H', 'years_present': 8}, [102873, 102873]), ('normal control', {'wage': 437685, 'freq': 'weekly', 'nra': True, 'w4_year': 2019, 'visa': 'J', 'years_present': 4}, [452785, 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])], [('regression', {'wage': 356715, 'freq': 'weekly', 'nra': False, 'w4_year': 2024, 'visa': 'F', 'years_present': 6}, [356715, 356715]), ('regression', {'wage': 352005, 'freq': 'semimonthly', 'nra': False, 'w4_year': 2018, 'visa': 'H', 'years_present': 5}, [352005, 352005]), ('partial-repair probe', {'wage': 325245, 'freq': 'weekly', 'nra': False, 'w4_year': 2018, 'visa': 'H', 'years_present': 5}, [325245, 325245]), ('partial-repair probe', {'wage': 458461, 'freq': 'semimonthly', 'nra': False, 'w4_year': 2019, 'visa': 'H', 'years_present': 1}, [458461, 458461]), ('normal control', {'wage': 498322, 'freq': 'biweekly', 'nra': True, 'w4_year': 2020, 'visa': None, 'years_present': 5}, [540242, 498322]), ('normal control', {'wage': 295891, 'freq': 'monthly', 'nra': True, 'w4_year': 2021, 'visa': 'J', 'years_present': 8}, [386721, 295891]), ('normal control', {'wage': 411503, 'freq': 'monthly', 'nra': True, 'w4_year': 2021, 'visa': 'H', 'years_present': 6}, [502333, 411503]), ('normal control', {'wage': 89672, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2019, 'visa': 'H', 'years_present': 4}, [122372, 89672])]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 0 | [245306, 245306] | [245306, 245306] | Passed |
| regression 1 | [314655, 0] | [314655, 0] | Passed |
| partial-repair probe 2 | [352005, 352005] | [352005, 352005] | Passed |
| partial-repair probe 3 | [345401, 345401] | [345401, 345401] | Passed |
| normal control 4 | [424869, 0] | [424869, 0] | Passed |
| normal control 5 | [273429, 252469] | [273429, 252469] | Passed |
| normal control 6 | [376984, 286154] | [376984, 286154] | Passed |
| normal control 7 | [92954, 2124] | [92954, 2124] | Passed |
SHA-256 / e936fd45a6551184a4c7b2d266ddf4a244f9ad23bd1f6da2d9c15bb7ce6c06f4
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.187208+00:00.
Case digest / 8ed56b0bf8112d67688315a20ec48abe72f5e768e28e287b38bbb5344e096b83