FA-59311 / Payroll withholding rules / Open access
Nonresident alien wage add-on: FICA base excludes add-on · case 01
Nonresident employees have social security and Medicare withheld on money they never earned.
ROOT CAUSE
The FICA wage base uses the income-tax wages that include the nonresident add-on.
VERIFIED REPAIR
Restore the contract rule at the FICA base excludes add-on step: use `fica = 0 if exempt else x['wage']`.
Unsuccessful approach: The attempt only fixes newer forms, still adding the amount to FICA wages for pre-2020 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 fit
return [fit, fica]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression', {'wage': 210010, 'freq': 'biweekly', 'nra': True, 'w4_year': 2019, 'visa': None, 'years_present': 1}, [240210, 210010]), ('regression', {'wage': 252469, 'freq': 'weekly', 'nra': True, 'w4_year': 2021, 'visa': None, 'years_present': 8}, [273429, 252469]), ('partial-repair probe', {'wage': 141591, 'freq': 'biweekly', 'nra': True, 'w4_year': 2018, 'visa': 'H', 'years_present': 4}, [171791, 141591]), ('partial-repair probe', {'wage': 21555, 'freq': 'biweekly', 'nra': True, 'w4_year': 2019, 'visa': 'J', 'years_present': 6}, [51755, 21555]), ('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': 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])], [('regression', {'wage': 141591, 'freq': 'biweekly', 'nra': True, 'w4_year': 2018, 'visa': 'H', 'years_present': 4}, [171791, 141591]), ('regression', {'wage': 286154, 'freq': 'monthly', 'nra': True, 'w4_year': 2024, 'visa': 'H', 'years_present': 1}, [376984, 286154]), ('partial-repair probe', {'wage': 21555, 'freq': 'biweekly', 'nra': True, 'w4_year': 2019, 'visa': 'J', 'years_present': 6}, [51755, 21555]), ('partial-repair probe', {'wage': 89672, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2019, 'visa': 'H', 'years_present': 4}, [122372, 89672]), ('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]), ('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])], [('regression', {'wage': 21555, 'freq': 'biweekly', 'nra': True, 'w4_year': 2019, 'visa': 'J', 'years_present': 6}, [51755, 21555]), ('regression', {'wage': 2124, 'freq': 'monthly', 'nra': True, 'w4_year': 2024, 'visa': 'H', 'years_present': 6}, [92954, 2124]), ('partial-repair probe', {'wage': 2221, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2019, 'visa': 'H', 'years_present': 5}, [34921, 2221]), ('partial-repair probe', {'wage': 244355, 'freq': 'monthly', 'nra': True, 'w4_year': 2019, 'visa': None, 'years_present': 5}, [309755, 244355]), ('normal control', {'wage': 328051, 'freq': 'weekly', 'nra': False, 'w4_year': 2024, 'visa': None, 'years_present': 5}, [328051, 328051]), ('normal control', {'wage': 437685, 'freq': 'weekly', 'nra': True, 'w4_year': 2019, 'visa': 'J', 'years_present': 4}, [452785, 0]), ('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': 89672, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2019, 'visa': 'H', 'years_present': 4}, [122372, 89672]), ('regression', {'wage': 210010, 'freq': 'biweekly', 'nra': True, 'w4_year': 2019, 'visa': None, 'years_present': 1}, [240210, 210010]), ('partial-repair probe', {'wage': 55206, 'freq': 'monthly', 'nra': True, 'w4_year': 2019, 'visa': 'H', 'years_present': 1}, [120606, 55206]), ('partial-repair probe', {'wage': 486395, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2019, 'visa': 'H', 'years_present': 1}, [519095, 486395]), ('normal control', {'wage': 135055, 'freq': 'monthly', 'nra': False, 'w4_year': 2020, 'visa': None, 'years_present': 8}, [135055, 135055]), ('normal control', {'wage': 146242, 'freq': 'monthly', 'nra': True, 'w4_year': 2021, 'visa': 'F', 'years_present': 4}, [237072, 0]), ('normal control', {'wage': 474591, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2021, 'visa': 'J', 'years_present': 4}, [520011, 0]), ('normal control', {'wage': 345401, 'freq': 'weekly', 'nra': False, 'w4_year': 2021, 'visa': 'J', 'years_present': 8}, [345401, 345401])], [('regression', {'wage': 2221, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2019, 'visa': 'H', 'years_present': 5}, [34921, 2221]), ('regression', {'wage': 436984, 'freq': 'biweekly', 'nra': True, 'w4_year': 2021, 'visa': 'J', 'years_present': 8}, [478904, 436984]), ('partial-repair probe', {'wage': 176371, 'freq': 'biweekly', 'nra': True, 'w4_year': 2018, 'visa': None, 'years_present': 5}, [206571, 176371]), ('partial-repair probe', {'wage': 485186, 'freq': 'weekly', 'nra': True, 'w4_year': 2019, 'visa': None, 'years_present': 8}, [500286, 485186]), ('normal control', {'wage': 356715, 'freq': 'weekly', 'nra': False, 'w4_year': 2024, 'visa': 'F', 'years_present': 6}, [356715, 356715]), ('normal control', {'wage': 62573, 'freq': 'monthly', 'nra': False, 'w4_year': 2018, 'visa': 'F', 'years_present': 6}, [62573, 62573]), ('normal control', {'wage': 54168, 'freq': 'weekly', 'nra': True, 'w4_year': 2018, 'visa': 'J', 'years_present': 4}, [69268, 0]), ('normal control', {'wage': 287286, 'freq': 'weekly', 'nra': False, 'w4_year': 2020, 'visa': 'F', 'years_present': 1}, [287286, 0])]]
for i, (label, args, expected) in enumerate(fixtures[N-1]):
check("%s %d" % (label, i), solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 0 | [240210, 240210] | [240210, 210010] | Failed |
| regression 1 | [273429, 273429] | [273429, 252469] | Failed |
| partial-repair probe 2 | [171791, 171791] | [171791, 141591] | Failed |
| partial-repair probe 3 | [51755, 51755] | [51755, 21555] | Failed |
| normal control 4 | [424869, 0] | [424869, 0] | Passed |
| normal control 5 | [245306, 245306] | [245306, 245306] | Passed |
| normal control 6 | [314655, 0] | [314655, 0] | Passed |
| normal control 7 | [350530, 350530] | [350530, 350530] | Passed |
SHA-256 / 290d827f3542c1cdc98a530bcc55e5ae6dea561e226451c8dc31e2c3be158fad
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
fica = 0 if exempt else (fit if x['w4_year'] < 2020 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': 210010, 'freq': 'biweekly', 'nra': True, 'w4_year': 2019, 'visa': None, 'years_present': 1}, [240210, 210010]), ('regression', {'wage': 252469, 'freq': 'weekly', 'nra': True, 'w4_year': 2021, 'visa': None, 'years_present': 8}, [273429, 252469]), ('partial-repair probe', {'wage': 141591, 'freq': 'biweekly', 'nra': True, 'w4_year': 2018, 'visa': 'H', 'years_present': 4}, [171791, 141591]), ('partial-repair probe', {'wage': 21555, 'freq': 'biweekly', 'nra': True, 'w4_year': 2019, 'visa': 'J', 'years_present': 6}, [51755, 21555]), ('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': 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])], [('regression', {'wage': 141591, 'freq': 'biweekly', 'nra': True, 'w4_year': 2018, 'visa': 'H', 'years_present': 4}, [171791, 141591]), ('regression', {'wage': 286154, 'freq': 'monthly', 'nra': True, 'w4_year': 2024, 'visa': 'H', 'years_present': 1}, [376984, 286154]), ('partial-repair probe', {'wage': 21555, 'freq': 'biweekly', 'nra': True, 'w4_year': 2019, 'visa': 'J', 'years_present': 6}, [51755, 21555]), ('partial-repair probe', {'wage': 89672, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2019, 'visa': 'H', 'years_present': 4}, [122372, 89672]), ('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]), ('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])], [('regression', {'wage': 21555, 'freq': 'biweekly', 'nra': True, 'w4_year': 2019, 'visa': 'J', 'years_present': 6}, [51755, 21555]), ('regression', {'wage': 2124, 'freq': 'monthly', 'nra': True, 'w4_year': 2024, 'visa': 'H', 'years_present': 6}, [92954, 2124]), ('partial-repair probe', {'wage': 2221, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2019, 'visa': 'H', 'years_present': 5}, [34921, 2221]), ('partial-repair probe', {'wage': 244355, 'freq': 'monthly', 'nra': True, 'w4_year': 2019, 'visa': None, 'years_present': 5}, [309755, 244355]), ('normal control', {'wage': 328051, 'freq': 'weekly', 'nra': False, 'w4_year': 2024, 'visa': None, 'years_present': 5}, [328051, 328051]), ('normal control', {'wage': 437685, 'freq': 'weekly', 'nra': True, 'w4_year': 2019, 'visa': 'J', 'years_present': 4}, [452785, 0]), ('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': 89672, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2019, 'visa': 'H', 'years_present': 4}, [122372, 89672]), ('regression', {'wage': 210010, 'freq': 'biweekly', 'nra': True, 'w4_year': 2019, 'visa': None, 'years_present': 1}, [240210, 210010]), ('partial-repair probe', {'wage': 55206, 'freq': 'monthly', 'nra': True, 'w4_year': 2019, 'visa': 'H', 'years_present': 1}, [120606, 55206]), ('partial-repair probe', {'wage': 486395, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2019, 'visa': 'H', 'years_present': 1}, [519095, 486395]), ('normal control', {'wage': 135055, 'freq': 'monthly', 'nra': False, 'w4_year': 2020, 'visa': None, 'years_present': 8}, [135055, 135055]), ('normal control', {'wage': 146242, 'freq': 'monthly', 'nra': True, 'w4_year': 2021, 'visa': 'F', 'years_present': 4}, [237072, 0]), ('normal control', {'wage': 474591, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2021, 'visa': 'J', 'years_present': 4}, [520011, 0]), ('normal control', {'wage': 345401, 'freq': 'weekly', 'nra': False, 'w4_year': 2021, 'visa': 'J', 'years_present': 8}, [345401, 345401])], [('regression', {'wage': 2221, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2019, 'visa': 'H', 'years_present': 5}, [34921, 2221]), ('regression', {'wage': 436984, 'freq': 'biweekly', 'nra': True, 'w4_year': 2021, 'visa': 'J', 'years_present': 8}, [478904, 436984]), ('partial-repair probe', {'wage': 176371, 'freq': 'biweekly', 'nra': True, 'w4_year': 2018, 'visa': None, 'years_present': 5}, [206571, 176371]), ('partial-repair probe', {'wage': 485186, 'freq': 'weekly', 'nra': True, 'w4_year': 2019, 'visa': None, 'years_present': 8}, [500286, 485186]), ('normal control', {'wage': 356715, 'freq': 'weekly', 'nra': False, 'w4_year': 2024, 'visa': 'F', 'years_present': 6}, [356715, 356715]), ('normal control', {'wage': 62573, 'freq': 'monthly', 'nra': False, 'w4_year': 2018, 'visa': 'F', 'years_present': 6}, [62573, 62573]), ('normal control', {'wage': 54168, 'freq': 'weekly', 'nra': True, 'w4_year': 2018, 'visa': 'J', 'years_present': 4}, [69268, 0]), ('normal control', {'wage': 287286, 'freq': 'weekly', 'nra': False, 'w4_year': 2020, 'visa': 'F', 'years_present': 1}, [287286, 0])]]
for i, (label, args, expected) in enumerate(fixtures[N-1]):
check("%s %d" % (label, i), solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 0 | [240210, 240210] | [240210, 210010] | Failed |
| regression 1 | [273429, 252469] | [273429, 252469] | Passed |
| partial-repair probe 2 | [171791, 171791] | [171791, 141591] | Failed |
| partial-repair probe 3 | [51755, 51755] | [51755, 21555] | Failed |
| normal control 4 | [424869, 0] | [424869, 0] | Passed |
| normal control 5 | [245306, 245306] | [245306, 245306] | Passed |
| normal control 6 | [314655, 0] | [314655, 0] | Passed |
| normal control 7 | [350530, 350530] | [350530, 350530] | Passed |
SHA-256 / a9b41b1c7de7548f1a669df31e261c8511bfdd6fea9378931aab00d21d09f4ba
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': 210010, 'freq': 'biweekly', 'nra': True, 'w4_year': 2019, 'visa': None, 'years_present': 1}, [240210, 210010]), ('regression', {'wage': 252469, 'freq': 'weekly', 'nra': True, 'w4_year': 2021, 'visa': None, 'years_present': 8}, [273429, 252469]), ('partial-repair probe', {'wage': 141591, 'freq': 'biweekly', 'nra': True, 'w4_year': 2018, 'visa': 'H', 'years_present': 4}, [171791, 141591]), ('partial-repair probe', {'wage': 21555, 'freq': 'biweekly', 'nra': True, 'w4_year': 2019, 'visa': 'J', 'years_present': 6}, [51755, 21555]), ('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': 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])], [('regression', {'wage': 141591, 'freq': 'biweekly', 'nra': True, 'w4_year': 2018, 'visa': 'H', 'years_present': 4}, [171791, 141591]), ('regression', {'wage': 286154, 'freq': 'monthly', 'nra': True, 'w4_year': 2024, 'visa': 'H', 'years_present': 1}, [376984, 286154]), ('partial-repair probe', {'wage': 21555, 'freq': 'biweekly', 'nra': True, 'w4_year': 2019, 'visa': 'J', 'years_present': 6}, [51755, 21555]), ('partial-repair probe', {'wage': 89672, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2019, 'visa': 'H', 'years_present': 4}, [122372, 89672]), ('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]), ('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])], [('regression', {'wage': 21555, 'freq': 'biweekly', 'nra': True, 'w4_year': 2019, 'visa': 'J', 'years_present': 6}, [51755, 21555]), ('regression', {'wage': 2124, 'freq': 'monthly', 'nra': True, 'w4_year': 2024, 'visa': 'H', 'years_present': 6}, [92954, 2124]), ('partial-repair probe', {'wage': 2221, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2019, 'visa': 'H', 'years_present': 5}, [34921, 2221]), ('partial-repair probe', {'wage': 244355, 'freq': 'monthly', 'nra': True, 'w4_year': 2019, 'visa': None, 'years_present': 5}, [309755, 244355]), ('normal control', {'wage': 328051, 'freq': 'weekly', 'nra': False, 'w4_year': 2024, 'visa': None, 'years_present': 5}, [328051, 328051]), ('normal control', {'wage': 437685, 'freq': 'weekly', 'nra': True, 'w4_year': 2019, 'visa': 'J', 'years_present': 4}, [452785, 0]), ('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': 89672, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2019, 'visa': 'H', 'years_present': 4}, [122372, 89672]), ('regression', {'wage': 210010, 'freq': 'biweekly', 'nra': True, 'w4_year': 2019, 'visa': None, 'years_present': 1}, [240210, 210010]), ('partial-repair probe', {'wage': 55206, 'freq': 'monthly', 'nra': True, 'w4_year': 2019, 'visa': 'H', 'years_present': 1}, [120606, 55206]), ('partial-repair probe', {'wage': 486395, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2019, 'visa': 'H', 'years_present': 1}, [519095, 486395]), ('normal control', {'wage': 135055, 'freq': 'monthly', 'nra': False, 'w4_year': 2020, 'visa': None, 'years_present': 8}, [135055, 135055]), ('normal control', {'wage': 146242, 'freq': 'monthly', 'nra': True, 'w4_year': 2021, 'visa': 'F', 'years_present': 4}, [237072, 0]), ('normal control', {'wage': 474591, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2021, 'visa': 'J', 'years_present': 4}, [520011, 0]), ('normal control', {'wage': 345401, 'freq': 'weekly', 'nra': False, 'w4_year': 2021, 'visa': 'J', 'years_present': 8}, [345401, 345401])], [('regression', {'wage': 2221, 'freq': 'semimonthly', 'nra': True, 'w4_year': 2019, 'visa': 'H', 'years_present': 5}, [34921, 2221]), ('regression', {'wage': 436984, 'freq': 'biweekly', 'nra': True, 'w4_year': 2021, 'visa': 'J', 'years_present': 8}, [478904, 436984]), ('partial-repair probe', {'wage': 176371, 'freq': 'biweekly', 'nra': True, 'w4_year': 2018, 'visa': None, 'years_present': 5}, [206571, 176371]), ('partial-repair probe', {'wage': 485186, 'freq': 'weekly', 'nra': True, 'w4_year': 2019, 'visa': None, 'years_present': 8}, [500286, 485186]), ('normal control', {'wage': 356715, 'freq': 'weekly', 'nra': False, 'w4_year': 2024, 'visa': 'F', 'years_present': 6}, [356715, 356715]), ('normal control', {'wage': 62573, 'freq': 'monthly', 'nra': False, 'w4_year': 2018, 'visa': 'F', 'years_present': 6}, [62573, 62573]), ('normal control', {'wage': 54168, 'freq': 'weekly', 'nra': True, 'w4_year': 2018, 'visa': 'J', 'years_present': 4}, [69268, 0]), ('normal control', {'wage': 287286, 'freq': 'weekly', 'nra': False, 'w4_year': 2020, 'visa': 'F', 'years_present': 1}, [287286, 0])]]
for i, (label, args, expected) in enumerate(fixtures[N-1]):
check("%s %d" % (label, i), solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 0 | [240210, 210010] | [240210, 210010] | Passed |
| regression 1 | [273429, 252469] | [273429, 252469] | Passed |
| partial-repair probe 2 | [171791, 141591] | [171791, 141591] | Passed |
| partial-repair probe 3 | [51755, 21555] | [51755, 21555] | Passed |
| normal control 4 | [424869, 0] | [424869, 0] | Passed |
| normal control 5 | [245306, 245306] | [245306, 245306] | Passed |
| normal control 6 | [314655, 0] | [314655, 0] | Passed |
| normal control 7 | [350530, 350530] | [350530, 350530] | Passed |
SHA-256 / d0ae6cc7c0d152c5736acf8ce0ecc8e8c6fb80ffe541ba03e9ea163f6f846cec
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.029368+00:00.
Case digest / 01814d7a7cf7a2664d31798cfacce0207ba423358742ed771a85bd37b2dd46ca