FA-59321 / Payroll withholding rules / Open access
Nonresident alien wage add-on: form vintage table · case 01
Employees with a 2020 form get the pre-2020 add-on amount.
ROOT CAUSE
The new add-on table starts after 2020 instead of with 2020 forms.
VERIFIED REPAIR
Restore the contract rule at the form vintage table step: use `if x['w4_year'] >= 2020 else`.
Unsuccessful approach: The attempt moves the cutover to 2019, applying the new table to old forms.
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': 162523, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2020, 'visa': 'H', 'years_present': 5}, [207943, 162523]), ('regression', {'wage': 181833, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2020, 'visa': None, 'years_present': 1}, [227253, 181833]), ('partial-repair probe', {'wage': 392169, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2019, 'visa': 'F', 'years_present': 1}, [424869, 0]), ('partial-repair probe', {'wage': 210010, 'freq': 'biweekly', 'nra': True, 'w4_year': 2019, 'visa': None, 'years_present': 1}, [240210, 210010]), ('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]), ('normal control', {'wage': 2124, 'freq': 'monthly', 'nra': True, 'w4_year': 2024, 'visa': 'H', 'years_present': 6}, [92954, 2124])], [('regression', {'wage': 181833, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2020, 'visa': None, 'years_present': 1}, [227253, 181833]), ('regression', {'wage': 114598, 'freq': 'weekly', 'nra': True, 'w4_year': 2020, 'visa': 'H', 'years_present': 5}, [135558, 114598]), ('partial-repair probe', {'wage': 437685, 'freq': 'weekly', 'nra': True, 'w4_year': 2019, 'visa': 'J', 'years_present': 4}, [452785, 0]), ('partial-repair probe', {'wage': 21555, 'freq': 'biweekly', 'nra': True, 'w4_year': 2019, 'visa': 'J', 'years_present': 6}, [51755, 21555]), ('normal control', {'wage': 314655, 'freq': 'monthly', 'nra': False, 'w4_year': 2024, 'visa': 'J', 'years_present': 1}, [314655, 0]), ('normal control', {'wage': 350530, 'freq': 'weekly', 'nra': False, 'w4_year': 2018, 'visa': None, 'years_present': 1}, [350530, 350530]), ('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])], [('regression', {'wage': 114598, 'freq': 'weekly', 'nra': True, 'w4_year': 2020, 'visa': 'H', 'years_present': 5}, [135558, 114598]), ('regression', {'wage': 498322, 'freq': 'biweekly', 'nra': True, 'w4_year': 2020, 'visa': None, 'years_present': 5}, [540242, 498322]), ('partial-repair probe', {'wage': 89672, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2019, 'visa': 'H', 'years_present': 4}, [122372, 89672]), ('partial-repair probe', {'wage': 2221, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2019, 'visa': 'H', 'years_present': 5}, [34921, 2221]), ('normal control', {'wage': 179956, 'freq': 'monthly', 'nra': True, 'w4_year': 2021, 'visa': 'J', 'years_present': 5}, [270786, 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])], [('regression', {'wage': 498322, 'freq': 'biweekly', 'nra': True, 'w4_year': 2020, 'visa': None, 'years_present': 5}, [540242, 498322]), ('regression', {'wage': 73846, 'freq': 'weekly', 'nra': True, 'w4_year': 2020, 'visa': None, 'years_present': 8}, [94806, 73846]), ('partial-repair probe', {'wage': 244355, 'freq': 'monthly', 'nra': True, 'w4_year': 2019, 'visa': None, 'years_present': 5}, [309755, 244355]), ('partial-repair probe', {'wage': 55206, 'freq': 'monthly', 'nra': True, 'w4_year': 2019, 'visa': 'H', 'years_present': 1}, [120606, 55206]), ('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]), ('normal control', {'wage': 178971, 'freq': 'biweekly', 'nra': True, 'w4_year': 2018, 'visa': 'F', 'years_present': 1}, [209171, 0])], [('regression', {'wage': 73846, 'freq': 'weekly', 'nra': True, 'w4_year': 2020, 'visa': None, 'years_present': 8}, [94806, 73846]), ('regression', {'wage': 131463, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2020, 'visa': 'H', 'years_present': 5}, [176883, 131463]), ('partial-repair probe', {'wage': 486395, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2019, 'visa': 'H', 'years_present': 1}, [519095, 486395]), ('partial-repair probe', {'wage': 485186, 'freq': 'weekly', 'nra': True, 'w4_year': 2019, 'visa': None, 'years_present': 8}, [500286, 485186]), ('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': 487495, 'freq': 'biweekly', 'nra': True, 'w4_year': 2021, 'visa': None, 'years_present': 6}, [529415, 487495]), ('normal control', {'wage': 135055, 'freq': 'monthly', 'nra': False, 'w4_year': 2020, 'visa': None, 'years_present': 8}, [135055, 135055])]]
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 | [195223, 162523] | [207943, 162523] | Failed |
| regression 1 | [214533, 181833] | [227253, 181833] | Failed |
| partial-repair probe 2 | [424869, 0] | [424869, 0] | Passed |
| partial-repair probe 3 | [240210, 210010] | [240210, 210010] | Passed |
| normal control 4 | [245306, 245306] | [245306, 245306] | 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 / 09c0a32f6b760e017efd8ff01242c6006ba1d17cd067957fd5fc01888c11d680
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'] >= 2019 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': 162523, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2020, 'visa': 'H', 'years_present': 5}, [207943, 162523]), ('regression', {'wage': 181833, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2020, 'visa': None, 'years_present': 1}, [227253, 181833]), ('partial-repair probe', {'wage': 392169, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2019, 'visa': 'F', 'years_present': 1}, [424869, 0]), ('partial-repair probe', {'wage': 210010, 'freq': 'biweekly', 'nra': True, 'w4_year': 2019, 'visa': None, 'years_present': 1}, [240210, 210010]), ('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]), ('normal control', {'wage': 2124, 'freq': 'monthly', 'nra': True, 'w4_year': 2024, 'visa': 'H', 'years_present': 6}, [92954, 2124])], [('regression', {'wage': 181833, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2020, 'visa': None, 'years_present': 1}, [227253, 181833]), ('regression', {'wage': 114598, 'freq': 'weekly', 'nra': True, 'w4_year': 2020, 'visa': 'H', 'years_present': 5}, [135558, 114598]), ('partial-repair probe', {'wage': 437685, 'freq': 'weekly', 'nra': True, 'w4_year': 2019, 'visa': 'J', 'years_present': 4}, [452785, 0]), ('partial-repair probe', {'wage': 21555, 'freq': 'biweekly', 'nra': True, 'w4_year': 2019, 'visa': 'J', 'years_present': 6}, [51755, 21555]), ('normal control', {'wage': 314655, 'freq': 'monthly', 'nra': False, 'w4_year': 2024, 'visa': 'J', 'years_present': 1}, [314655, 0]), ('normal control', {'wage': 350530, 'freq': 'weekly', 'nra': False, 'w4_year': 2018, 'visa': None, 'years_present': 1}, [350530, 350530]), ('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])], [('regression', {'wage': 114598, 'freq': 'weekly', 'nra': True, 'w4_year': 2020, 'visa': 'H', 'years_present': 5}, [135558, 114598]), ('regression', {'wage': 498322, 'freq': 'biweekly', 'nra': True, 'w4_year': 2020, 'visa': None, 'years_present': 5}, [540242, 498322]), ('partial-repair probe', {'wage': 89672, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2019, 'visa': 'H', 'years_present': 4}, [122372, 89672]), ('partial-repair probe', {'wage': 2221, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2019, 'visa': 'H', 'years_present': 5}, [34921, 2221]), ('normal control', {'wage': 179956, 'freq': 'monthly', 'nra': True, 'w4_year': 2021, 'visa': 'J', 'years_present': 5}, [270786, 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])], [('regression', {'wage': 498322, 'freq': 'biweekly', 'nra': True, 'w4_year': 2020, 'visa': None, 'years_present': 5}, [540242, 498322]), ('regression', {'wage': 73846, 'freq': 'weekly', 'nra': True, 'w4_year': 2020, 'visa': None, 'years_present': 8}, [94806, 73846]), ('partial-repair probe', {'wage': 244355, 'freq': 'monthly', 'nra': True, 'w4_year': 2019, 'visa': None, 'years_present': 5}, [309755, 244355]), ('partial-repair probe', {'wage': 55206, 'freq': 'monthly', 'nra': True, 'w4_year': 2019, 'visa': 'H', 'years_present': 1}, [120606, 55206]), ('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]), ('normal control', {'wage': 178971, 'freq': 'biweekly', 'nra': True, 'w4_year': 2018, 'visa': 'F', 'years_present': 1}, [209171, 0])], [('regression', {'wage': 73846, 'freq': 'weekly', 'nra': True, 'w4_year': 2020, 'visa': None, 'years_present': 8}, [94806, 73846]), ('regression', {'wage': 131463, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2020, 'visa': 'H', 'years_present': 5}, [176883, 131463]), ('partial-repair probe', {'wage': 486395, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2019, 'visa': 'H', 'years_present': 1}, [519095, 486395]), ('partial-repair probe', {'wage': 485186, 'freq': 'weekly', 'nra': True, 'w4_year': 2019, 'visa': None, 'years_present': 8}, [500286, 485186]), ('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': 487495, 'freq': 'biweekly', 'nra': True, 'w4_year': 2021, 'visa': None, 'years_present': 6}, [529415, 487495]), ('normal control', {'wage': 135055, 'freq': 'monthly', 'nra': False, 'w4_year': 2020, 'visa': None, 'years_present': 8}, [135055, 135055])]]
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 | [207943, 162523] | [207943, 162523] | Passed |
| regression 1 | [227253, 181833] | [227253, 181833] | Passed |
| partial-repair probe 2 | [437589, 0] | [424869, 0] | Failed |
| partial-repair probe 3 | [251930, 210010] | [240210, 210010] | Failed |
| normal control 4 | [245306, 245306] | [245306, 245306] | 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 / d45cf293ece2c23d253b4f60b19b7ccae629a703a6d148248a20e97b11da302a
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': 162523, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2020, 'visa': 'H', 'years_present': 5}, [207943, 162523]), ('regression', {'wage': 181833, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2020, 'visa': None, 'years_present': 1}, [227253, 181833]), ('partial-repair probe', {'wage': 392169, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2019, 'visa': 'F', 'years_present': 1}, [424869, 0]), ('partial-repair probe', {'wage': 210010, 'freq': 'biweekly', 'nra': True, 'w4_year': 2019, 'visa': None, 'years_present': 1}, [240210, 210010]), ('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]), ('normal control', {'wage': 2124, 'freq': 'monthly', 'nra': True, 'w4_year': 2024, 'visa': 'H', 'years_present': 6}, [92954, 2124])], [('regression', {'wage': 181833, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2020, 'visa': None, 'years_present': 1}, [227253, 181833]), ('regression', {'wage': 114598, 'freq': 'weekly', 'nra': True, 'w4_year': 2020, 'visa': 'H', 'years_present': 5}, [135558, 114598]), ('partial-repair probe', {'wage': 437685, 'freq': 'weekly', 'nra': True, 'w4_year': 2019, 'visa': 'J', 'years_present': 4}, [452785, 0]), ('partial-repair probe', {'wage': 21555, 'freq': 'biweekly', 'nra': True, 'w4_year': 2019, 'visa': 'J', 'years_present': 6}, [51755, 21555]), ('normal control', {'wage': 314655, 'freq': 'monthly', 'nra': False, 'w4_year': 2024, 'visa': 'J', 'years_present': 1}, [314655, 0]), ('normal control', {'wage': 350530, 'freq': 'weekly', 'nra': False, 'w4_year': 2018, 'visa': None, 'years_present': 1}, [350530, 350530]), ('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])], [('regression', {'wage': 114598, 'freq': 'weekly', 'nra': True, 'w4_year': 2020, 'visa': 'H', 'years_present': 5}, [135558, 114598]), ('regression', {'wage': 498322, 'freq': 'biweekly', 'nra': True, 'w4_year': 2020, 'visa': None, 'years_present': 5}, [540242, 498322]), ('partial-repair probe', {'wage': 89672, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2019, 'visa': 'H', 'years_present': 4}, [122372, 89672]), ('partial-repair probe', {'wage': 2221, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2019, 'visa': 'H', 'years_present': 5}, [34921, 2221]), ('normal control', {'wage': 179956, 'freq': 'monthly', 'nra': True, 'w4_year': 2021, 'visa': 'J', 'years_present': 5}, [270786, 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])], [('regression', {'wage': 498322, 'freq': 'biweekly', 'nra': True, 'w4_year': 2020, 'visa': None, 'years_present': 5}, [540242, 498322]), ('regression', {'wage': 73846, 'freq': 'weekly', 'nra': True, 'w4_year': 2020, 'visa': None, 'years_present': 8}, [94806, 73846]), ('partial-repair probe', {'wage': 244355, 'freq': 'monthly', 'nra': True, 'w4_year': 2019, 'visa': None, 'years_present': 5}, [309755, 244355]), ('partial-repair probe', {'wage': 55206, 'freq': 'monthly', 'nra': True, 'w4_year': 2019, 'visa': 'H', 'years_present': 1}, [120606, 55206]), ('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]), ('normal control', {'wage': 178971, 'freq': 'biweekly', 'nra': True, 'w4_year': 2018, 'visa': 'F', 'years_present': 1}, [209171, 0])], [('regression', {'wage': 73846, 'freq': 'weekly', 'nra': True, 'w4_year': 2020, 'visa': None, 'years_present': 8}, [94806, 73846]), ('regression', {'wage': 131463, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2020, 'visa': 'H', 'years_present': 5}, [176883, 131463]), ('partial-repair probe', {'wage': 486395, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2019, 'visa': 'H', 'years_present': 1}, [519095, 486395]), ('partial-repair probe', {'wage': 485186, 'freq': 'weekly', 'nra': True, 'w4_year': 2019, 'visa': None, 'years_present': 8}, [500286, 485186]), ('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': 487495, 'freq': 'biweekly', 'nra': True, 'w4_year': 2021, 'visa': None, 'years_present': 6}, [529415, 487495]), ('normal control', {'wage': 135055, 'freq': 'monthly', 'nra': False, 'w4_year': 2020, 'visa': None, 'years_present': 8}, [135055, 135055])]]
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 | [207943, 162523] | [207943, 162523] | Passed |
| regression 1 | [227253, 181833] | [227253, 181833] | Passed |
| partial-repair probe 2 | [424869, 0] | [424869, 0] | Passed |
| partial-repair probe 3 | [240210, 210010] | [240210, 210010] | Passed |
| normal control 4 | [245306, 245306] | [245306, 245306] | 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 / 62ad1523a89d029be3919a1438d055f01d1af0b5b9e88783fbaba0595fd7c7dc
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.184594+00:00.
Case digest / 5903e665a8761d4de9e7ccc0cf2f8a2115b440c1c039b87f247dd0f58a51c699