FA-59151 / Payroll withholding rules / Open access
Aggregate-method supplemental withholding: credit for actual withholding · case 01
Employees with W-4 extra withholding on regular pay are under-withheld on bonuses paid with that run.
ROOT CAUSE
The credit uses the table amount for regular wages instead of what was actually withheld.
VERIFIED REPAIR
Restore the contract rule at the credit for actual withholding step: use `already = x['regular_wh']`.
Unsuccessful approach: The attempt credits the smaller of the two, which is still wrong whenever actual withholding exceeds the table.
Case contract
Input {regular, supp, regular_wh or None, table: ascending [[threshold, base, pct]]}. f(w) uses the last row with threshold <= w: base + (w - threshold)*pct/100 half-up. Supplemental withholding = max(0, f(regular + supp) - already), where already is regular_wh when given, otherwise f(regular) (supplemental paid separately from the regular run). Return cents.
Why this case matters
The aggregate method withholds on combined wages, then credits what the regular payroll already withheld.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
def f(w):
base, thr, pct = 0, 0, 0
for t, b, p in x['table']:
if w >= t:
thr, base, pct = t, b, p
return base + ((w - thr) * pct + 50) // 100
if x['regular_wh'] is None:
already = f(x['regular'])
else:
already = f(x['regular'])
return max(0, f(x['regular'] + x['supp']) - already)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression', {'regular': 22582, 'supp': 82724, 'table': [[0, 0, 0], [67793, 0, 10], [153868, 8608, 12], [184592, 12295, 22], [250677, 26834, 24]], 'regular_wh': 22068}, 0), ('regression', {'regular': 312338, 'supp': 323072, 'table': [[0, 0, 0], [147945, 0, 10], [183116, 3517, 12], [328149, 20921, 22], [389786, 34481, 24]], 'regular_wh': 7933}, 85498), ('partial-repair probe', {'regular': 218340, 'supp': 389621, 'table': [[0, 0, 0], [59946, 0, 10], [144504, 8456, 12], [240644, 19993, 22], [365163, 47387, 24]], 'regular_wh': 27085}, 78574), ('partial-repair probe', {'regular': 67092, 'supp': 9466, 'table': [[0, 0, 0], [50546, 0, 10], [199313, 14877, 12], [277080, 24209, 22], [385100, 47973, 24]], 'regular_wh': 49707}, 0), ('normal control', {'regular': 196542, 'supp': 546874, 'table': [[0, 0, 0], [31780, 0, 10], [158572, 12679, 12], [237601, 22162, 22], [369467, 51173, 24]], 'regular_wh': None}, 123686), ('normal control', {'regular': 166905, 'supp': 563237, 'table': [[0, 0, 0], [97424, 0, 10], [210021, 11260, 12], [309042, 23143, 22], [367427, 35988, 24]], 'regular_wh': None}, 116092), ('normal control', {'regular': 271363, 'supp': 388264, 'table': [[0, 0, 0], [56082, 0, 10], [86741, 3066, 12], [182099, 14509, 22], [317188, 44229, 24]], 'regular_wh': None}, 92267), ('normal control', {'regular': 272166, 'supp': 283715, 'table': [[0, 0, 0], [119972, 0, 10], [188902, 6893, 12], [248092, 13996, 22], [315970, 28929, 24]], 'regular_wh': None}, 67216)], [('regression', {'regular': 218340, 'supp': 389621, 'table': [[0, 0, 0], [59946, 0, 10], [144504, 8456, 12], [240644, 19993, 22], [365163, 47387, 24]], 'regular_wh': 27085}, 78574), ('regression', {'regular': 22582, 'supp': 82724, 'table': [[0, 0, 0], [67793, 0, 10], [153868, 8608, 12], [184592, 12295, 22], [250677, 26834, 24]], 'regular_wh': 22068}, 0), ('partial-repair probe', {'regular': 67092, 'supp': 9466, 'table': [[0, 0, 0], [50546, 0, 10], [199313, 14877, 12], [277080, 24209, 22], [385100, 47973, 24]], 'regular_wh': 49707}, 0), ('partial-repair probe', {'regular': 230312, 'supp': 412759, 'table': [[0, 0, 0], [87909, 0, 10], [234168, 14626, 12], [277117, 19780, 22], [325269, 30373, 24]], 'regular_wh': 53200}, 53445), ('normal control', {'regular': 91078, 'supp': 50965, 'table': [[0, 0, 0], [129383, 0, 10], [180861, 5148, 12], [251715, 13650, 22], [346731, 34554, 24]], 'regular_wh': None}, 1266), ('normal control', {'regular': 332685, 'supp': 265440, 'table': [[0, 0, 0], [82800, 0, 10], [155250, 7245, 12], [280472, 22272, 22], [368552, 41650, 24]], 'regular_wh': None}, 62989), ('normal control', {'regular': 371035, 'supp': 231573, 'table': [[0, 0, 0], [62708, 0, 10], [162966, 10026, 12], [294122, 25765, 22], [404634, 50078, 24]], 'regular_wh': None}, 54906), ('normal control', {'regular': 139761, 'supp': 580903, 'table': [[0, 0, 0], [33224, 0, 10], [124697, 9147, 12], [177909, 15532, 22], [324717, 47830, 24]], 'regular_wh': None}, 131902)], [('regression', {'regular': 67092, 'supp': 9466, 'table': [[0, 0, 0], [50546, 0, 10], [199313, 14877, 12], [277080, 24209, 22], [385100, 47973, 24]], 'regular_wh': 49707}, 0), ('regression', {'regular': 317198, 'supp': 215674, 'table': [[0, 0, 0], [114323, 0, 10], [242963, 12864, 12], [288842, 18369, 22], [360034, 34031, 24]], 'regular_wh': 7312}, 68200), ('partial-repair probe', {'regular': 301375, 'supp': 257327, 'table': [[0, 0, 0], [104655, 0, 10], [206771, 10212, 12], [296267, 20952, 22], [346695, 32046, 24]], 'regular_wh': 42656}, 40272), ('partial-repair probe', {'regular': 138799, 'supp': 242337, 'table': [[0, 0, 0], [67403, 0, 10], [179799, 11240, 12], [251397, 19832, 22], [387828, 49847, 24]], 'regular_wh': 45497}, 2878), ('normal control', {'regular': 311741, 'supp': 533113, 'table': [[0, 0, 0], [137329, 0, 10], [282729, 14540, 12], [396442, 28186, 22], [532518, 58123, 24]], 'regular_wh': None}, 115063), ('normal control', {'regular': 376443, 'supp': 593003, 'table': [[0, 0, 0], [149063, 0, 10], [179956, 3089, 12], [266122, 13429, 22], [344153, 30596, 24]], 'regular_wh': None}, 142320), ('normal control', {'regular': 348176, 'supp': 89132, 'table': [[0, 0, 0], [125841, 0, 10], [173895, 4805, 12], [222871, 10682, 22], [276667, 22517, 24]], 'regular_wh': None}, 21392), ('normal control', {'regular': 176368, 'supp': 539007, 'table': [[0, 0, 0], [34750, 0, 10], [89874, 5512, 12], [222171, 21388, 22], [354493, 50499, 24]], 'regular_wh': None}, 121220)], [('regression', {'regular': 230312, 'supp': 412759, 'table': [[0, 0, 0], [87909, 0, 10], [234168, 14626, 12], [277117, 19780, 22], [325269, 30373, 24]], 'regular_wh': 53200}, 53445), ('regression', {'regular': 218340, 'supp': 389621, 'table': [[0, 0, 0], [59946, 0, 10], [144504, 8456, 12], [240644, 19993, 22], [365163, 47387, 24]], 'regular_wh': 27085}, 78574), ('partial-repair probe', {'regular': 282406, 'supp': 568743, 'table': [[0, 0, 0], [126319, 0, 10], [211110, 8479, 12], [332602, 23058, 22], [357109, 28450, 24]], 'regular_wh': 51500}, 95520), ('partial-repair probe', {'regular': 133684, 'supp': 525347, 'table': [[0, 0, 0], [48514, 0, 10], [163334, 11482, 12], [185105, 14095, 22], [247313, 27781, 24]], 'regular_wh': 48804}, 77789), ('normal control', {'regular': 154043, 'supp': 107955, 'table': [[0, 0, 0], [65291, 0, 10], [204262, 13897, 12], [338369, 29990, 22], [472754, 59555, 24]], 'regular_wh': None}, 11950), ('normal control', {'regular': 305173, 'supp': 536066, 'table': [[0, 0, 0], [86460, 0, 10], [179538, 9308, 12], [282113, 21617, 22], [389261, 45190, 24]], 'regular_wh': None}, 126975), ('normal control', {'regular': 123317, 'supp': 2427, 'table': [[0, 0, 0], [36593, 0, 10], [139048, 10246, 12], [231726, 21367, 22], [283287, 32710, 24]], 'regular_wh': None}, 243), ('normal control', {'regular': 45436, 'supp': 499099, 'table': [[0, 0, 0], [119668, 0, 10], [156650, 3698, 12], [228263, 12292, 22], [285280, 24836, 24]], 'regular_wh': None}, 87057)], [('regression', {'regular': 301375, 'supp': 257327, 'table': [[0, 0, 0], [104655, 0, 10], [206771, 10212, 12], [296267, 20952, 22], [346695, 32046, 24]], 'regular_wh': 42656}, 40272), ('regression', {'regular': 67092, 'supp': 9466, 'table': [[0, 0, 0], [50546, 0, 10], [199313, 14877, 12], [277080, 24209, 22], [385100, 47973, 24]], 'regular_wh': 49707}, 0), ('partial-repair probe', {'regular': 30801, 'supp': 257466, 'table': [[0, 0, 0], [111822, 0, 10], [184134, 7231, 12], [244754, 14505, 22], [338743, 35183, 24]], 'regular_wh': 42625}, 0), ('partial-repair probe', {'regular': 141294, 'supp': 528346, 'table': [[0, 0, 0], [34928, 0, 10], [149354, 11443, 12], [262856, 25063, 22], [303394, 33981, 24]], 'regular_wh': 22556}, 99324), ('normal control', {'regular': 398070, 'supp': 398441, 'table': [[0, 0, 0], [80259, 0, 10], [126225, 4597, 12], [224289, 16365, 22], [264168, 25138, 24]], 'regular_wh': None}, 95626), ('normal control', {'regular': 6755, 'supp': 478748, 'table': [[0, 0, 0], [101638, 0, 10], [146837, 4520, 12], [189797, 9675, 22], [210942, 14327, 24]], 'regular_wh': None}, 80222), ('normal control', {'regular': 174696, 'supp': 196512, 'table': [[0, 0, 0], [45315, 0, 10], [105709, 6039, 12], [224263, 20265, 22], [295174, 35865, 24]], 'regular_wh': None}, 39796), ('normal control', {'regular': 152527, 'supp': 18424, 'table': [[0, 0, 0], [106961, 0, 10], [180698, 7374, 12], [201376, 9855, 22], [237701, 17847, 24]], 'regular_wh': None}, 1842)]]
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 | 3751 | 0 | Failed |
| regression 1 | 74407 | 85498 | Failed |
| partial-repair probe 2 | 88343 | 78574 | Failed |
| partial-repair probe 3 | 946 | 0 | Failed |
| normal control 4 | 123686 | 123686 | Passed |
| normal control 5 | 116092 | 116092 | Passed |
| normal control 6 | 92267 | 92267 | Passed |
| normal control 7 | 67216 | 67216 | Passed |
SHA-256 / 868f1e580c674374ed0e9f1f675ddebd5ccc1bb54351173acade6ae3ecbb6e90
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
def f(w):
base, thr, pct = 0, 0, 0
for t, b, p in x['table']:
if w >= t:
thr, base, pct = t, b, p
return base + ((w - thr) * pct + 50) // 100
if x['regular_wh'] is None:
already = f(x['regular'])
else:
already = min(x['regular_wh'], f(x['regular']))
return max(0, f(x['regular'] + x['supp']) - already)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression', {'regular': 22582, 'supp': 82724, 'table': [[0, 0, 0], [67793, 0, 10], [153868, 8608, 12], [184592, 12295, 22], [250677, 26834, 24]], 'regular_wh': 22068}, 0), ('regression', {'regular': 312338, 'supp': 323072, 'table': [[0, 0, 0], [147945, 0, 10], [183116, 3517, 12], [328149, 20921, 22], [389786, 34481, 24]], 'regular_wh': 7933}, 85498), ('partial-repair probe', {'regular': 218340, 'supp': 389621, 'table': [[0, 0, 0], [59946, 0, 10], [144504, 8456, 12], [240644, 19993, 22], [365163, 47387, 24]], 'regular_wh': 27085}, 78574), ('partial-repair probe', {'regular': 67092, 'supp': 9466, 'table': [[0, 0, 0], [50546, 0, 10], [199313, 14877, 12], [277080, 24209, 22], [385100, 47973, 24]], 'regular_wh': 49707}, 0), ('normal control', {'regular': 196542, 'supp': 546874, 'table': [[0, 0, 0], [31780, 0, 10], [158572, 12679, 12], [237601, 22162, 22], [369467, 51173, 24]], 'regular_wh': None}, 123686), ('normal control', {'regular': 166905, 'supp': 563237, 'table': [[0, 0, 0], [97424, 0, 10], [210021, 11260, 12], [309042, 23143, 22], [367427, 35988, 24]], 'regular_wh': None}, 116092), ('normal control', {'regular': 271363, 'supp': 388264, 'table': [[0, 0, 0], [56082, 0, 10], [86741, 3066, 12], [182099, 14509, 22], [317188, 44229, 24]], 'regular_wh': None}, 92267), ('normal control', {'regular': 272166, 'supp': 283715, 'table': [[0, 0, 0], [119972, 0, 10], [188902, 6893, 12], [248092, 13996, 22], [315970, 28929, 24]], 'regular_wh': None}, 67216)], [('regression', {'regular': 218340, 'supp': 389621, 'table': [[0, 0, 0], [59946, 0, 10], [144504, 8456, 12], [240644, 19993, 22], [365163, 47387, 24]], 'regular_wh': 27085}, 78574), ('regression', {'regular': 22582, 'supp': 82724, 'table': [[0, 0, 0], [67793, 0, 10], [153868, 8608, 12], [184592, 12295, 22], [250677, 26834, 24]], 'regular_wh': 22068}, 0), ('partial-repair probe', {'regular': 67092, 'supp': 9466, 'table': [[0, 0, 0], [50546, 0, 10], [199313, 14877, 12], [277080, 24209, 22], [385100, 47973, 24]], 'regular_wh': 49707}, 0), ('partial-repair probe', {'regular': 230312, 'supp': 412759, 'table': [[0, 0, 0], [87909, 0, 10], [234168, 14626, 12], [277117, 19780, 22], [325269, 30373, 24]], 'regular_wh': 53200}, 53445), ('normal control', {'regular': 91078, 'supp': 50965, 'table': [[0, 0, 0], [129383, 0, 10], [180861, 5148, 12], [251715, 13650, 22], [346731, 34554, 24]], 'regular_wh': None}, 1266), ('normal control', {'regular': 332685, 'supp': 265440, 'table': [[0, 0, 0], [82800, 0, 10], [155250, 7245, 12], [280472, 22272, 22], [368552, 41650, 24]], 'regular_wh': None}, 62989), ('normal control', {'regular': 371035, 'supp': 231573, 'table': [[0, 0, 0], [62708, 0, 10], [162966, 10026, 12], [294122, 25765, 22], [404634, 50078, 24]], 'regular_wh': None}, 54906), ('normal control', {'regular': 139761, 'supp': 580903, 'table': [[0, 0, 0], [33224, 0, 10], [124697, 9147, 12], [177909, 15532, 22], [324717, 47830, 24]], 'regular_wh': None}, 131902)], [('regression', {'regular': 67092, 'supp': 9466, 'table': [[0, 0, 0], [50546, 0, 10], [199313, 14877, 12], [277080, 24209, 22], [385100, 47973, 24]], 'regular_wh': 49707}, 0), ('regression', {'regular': 317198, 'supp': 215674, 'table': [[0, 0, 0], [114323, 0, 10], [242963, 12864, 12], [288842, 18369, 22], [360034, 34031, 24]], 'regular_wh': 7312}, 68200), ('partial-repair probe', {'regular': 301375, 'supp': 257327, 'table': [[0, 0, 0], [104655, 0, 10], [206771, 10212, 12], [296267, 20952, 22], [346695, 32046, 24]], 'regular_wh': 42656}, 40272), ('partial-repair probe', {'regular': 138799, 'supp': 242337, 'table': [[0, 0, 0], [67403, 0, 10], [179799, 11240, 12], [251397, 19832, 22], [387828, 49847, 24]], 'regular_wh': 45497}, 2878), ('normal control', {'regular': 311741, 'supp': 533113, 'table': [[0, 0, 0], [137329, 0, 10], [282729, 14540, 12], [396442, 28186, 22], [532518, 58123, 24]], 'regular_wh': None}, 115063), ('normal control', {'regular': 376443, 'supp': 593003, 'table': [[0, 0, 0], [149063, 0, 10], [179956, 3089, 12], [266122, 13429, 22], [344153, 30596, 24]], 'regular_wh': None}, 142320), ('normal control', {'regular': 348176, 'supp': 89132, 'table': [[0, 0, 0], [125841, 0, 10], [173895, 4805, 12], [222871, 10682, 22], [276667, 22517, 24]], 'regular_wh': None}, 21392), ('normal control', {'regular': 176368, 'supp': 539007, 'table': [[0, 0, 0], [34750, 0, 10], [89874, 5512, 12], [222171, 21388, 22], [354493, 50499, 24]], 'regular_wh': None}, 121220)], [('regression', {'regular': 230312, 'supp': 412759, 'table': [[0, 0, 0], [87909, 0, 10], [234168, 14626, 12], [277117, 19780, 22], [325269, 30373, 24]], 'regular_wh': 53200}, 53445), ('regression', {'regular': 218340, 'supp': 389621, 'table': [[0, 0, 0], [59946, 0, 10], [144504, 8456, 12], [240644, 19993, 22], [365163, 47387, 24]], 'regular_wh': 27085}, 78574), ('partial-repair probe', {'regular': 282406, 'supp': 568743, 'table': [[0, 0, 0], [126319, 0, 10], [211110, 8479, 12], [332602, 23058, 22], [357109, 28450, 24]], 'regular_wh': 51500}, 95520), ('partial-repair probe', {'regular': 133684, 'supp': 525347, 'table': [[0, 0, 0], [48514, 0, 10], [163334, 11482, 12], [185105, 14095, 22], [247313, 27781, 24]], 'regular_wh': 48804}, 77789), ('normal control', {'regular': 154043, 'supp': 107955, 'table': [[0, 0, 0], [65291, 0, 10], [204262, 13897, 12], [338369, 29990, 22], [472754, 59555, 24]], 'regular_wh': None}, 11950), ('normal control', {'regular': 305173, 'supp': 536066, 'table': [[0, 0, 0], [86460, 0, 10], [179538, 9308, 12], [282113, 21617, 22], [389261, 45190, 24]], 'regular_wh': None}, 126975), ('normal control', {'regular': 123317, 'supp': 2427, 'table': [[0, 0, 0], [36593, 0, 10], [139048, 10246, 12], [231726, 21367, 22], [283287, 32710, 24]], 'regular_wh': None}, 243), ('normal control', {'regular': 45436, 'supp': 499099, 'table': [[0, 0, 0], [119668, 0, 10], [156650, 3698, 12], [228263, 12292, 22], [285280, 24836, 24]], 'regular_wh': None}, 87057)], [('regression', {'regular': 301375, 'supp': 257327, 'table': [[0, 0, 0], [104655, 0, 10], [206771, 10212, 12], [296267, 20952, 22], [346695, 32046, 24]], 'regular_wh': 42656}, 40272), ('regression', {'regular': 67092, 'supp': 9466, 'table': [[0, 0, 0], [50546, 0, 10], [199313, 14877, 12], [277080, 24209, 22], [385100, 47973, 24]], 'regular_wh': 49707}, 0), ('partial-repair probe', {'regular': 30801, 'supp': 257466, 'table': [[0, 0, 0], [111822, 0, 10], [184134, 7231, 12], [244754, 14505, 22], [338743, 35183, 24]], 'regular_wh': 42625}, 0), ('partial-repair probe', {'regular': 141294, 'supp': 528346, 'table': [[0, 0, 0], [34928, 0, 10], [149354, 11443, 12], [262856, 25063, 22], [303394, 33981, 24]], 'regular_wh': 22556}, 99324), ('normal control', {'regular': 398070, 'supp': 398441, 'table': [[0, 0, 0], [80259, 0, 10], [126225, 4597, 12], [224289, 16365, 22], [264168, 25138, 24]], 'regular_wh': None}, 95626), ('normal control', {'regular': 6755, 'supp': 478748, 'table': [[0, 0, 0], [101638, 0, 10], [146837, 4520, 12], [189797, 9675, 22], [210942, 14327, 24]], 'regular_wh': None}, 80222), ('normal control', {'regular': 174696, 'supp': 196512, 'table': [[0, 0, 0], [45315, 0, 10], [105709, 6039, 12], [224263, 20265, 22], [295174, 35865, 24]], 'regular_wh': None}, 39796), ('normal control', {'regular': 152527, 'supp': 18424, 'table': [[0, 0, 0], [106961, 0, 10], [180698, 7374, 12], [201376, 9855, 22], [237701, 17847, 24]], 'regular_wh': None}, 1842)]]
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 | 3751 | 0 | Failed |
| regression 1 | 85498 | 85498 | Passed |
| partial-repair probe 2 | 88343 | 78574 | Failed |
| partial-repair probe 3 | 946 | 0 | Failed |
| normal control 4 | 123686 | 123686 | Passed |
| normal control 5 | 116092 | 116092 | Passed |
| normal control 6 | 92267 | 92267 | Passed |
| normal control 7 | 67216 | 67216 | Passed |
SHA-256 / e4e2c6a010fd2f4935c8143b9466b56e2a3070140262a6be1e9632bdd008d541
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
def f(w):
base, thr, pct = 0, 0, 0
for t, b, p in x['table']:
if w >= t:
thr, base, pct = t, b, p
return base + ((w - thr) * pct + 50) // 100
if x['regular_wh'] is None:
already = f(x['regular'])
else:
already = x['regular_wh']
return max(0, f(x['regular'] + x['supp']) - already)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression', {'regular': 22582, 'supp': 82724, 'table': [[0, 0, 0], [67793, 0, 10], [153868, 8608, 12], [184592, 12295, 22], [250677, 26834, 24]], 'regular_wh': 22068}, 0), ('regression', {'regular': 312338, 'supp': 323072, 'table': [[0, 0, 0], [147945, 0, 10], [183116, 3517, 12], [328149, 20921, 22], [389786, 34481, 24]], 'regular_wh': 7933}, 85498), ('partial-repair probe', {'regular': 218340, 'supp': 389621, 'table': [[0, 0, 0], [59946, 0, 10], [144504, 8456, 12], [240644, 19993, 22], [365163, 47387, 24]], 'regular_wh': 27085}, 78574), ('partial-repair probe', {'regular': 67092, 'supp': 9466, 'table': [[0, 0, 0], [50546, 0, 10], [199313, 14877, 12], [277080, 24209, 22], [385100, 47973, 24]], 'regular_wh': 49707}, 0), ('normal control', {'regular': 196542, 'supp': 546874, 'table': [[0, 0, 0], [31780, 0, 10], [158572, 12679, 12], [237601, 22162, 22], [369467, 51173, 24]], 'regular_wh': None}, 123686), ('normal control', {'regular': 166905, 'supp': 563237, 'table': [[0, 0, 0], [97424, 0, 10], [210021, 11260, 12], [309042, 23143, 22], [367427, 35988, 24]], 'regular_wh': None}, 116092), ('normal control', {'regular': 271363, 'supp': 388264, 'table': [[0, 0, 0], [56082, 0, 10], [86741, 3066, 12], [182099, 14509, 22], [317188, 44229, 24]], 'regular_wh': None}, 92267), ('normal control', {'regular': 272166, 'supp': 283715, 'table': [[0, 0, 0], [119972, 0, 10], [188902, 6893, 12], [248092, 13996, 22], [315970, 28929, 24]], 'regular_wh': None}, 67216)], [('regression', {'regular': 218340, 'supp': 389621, 'table': [[0, 0, 0], [59946, 0, 10], [144504, 8456, 12], [240644, 19993, 22], [365163, 47387, 24]], 'regular_wh': 27085}, 78574), ('regression', {'regular': 22582, 'supp': 82724, 'table': [[0, 0, 0], [67793, 0, 10], [153868, 8608, 12], [184592, 12295, 22], [250677, 26834, 24]], 'regular_wh': 22068}, 0), ('partial-repair probe', {'regular': 67092, 'supp': 9466, 'table': [[0, 0, 0], [50546, 0, 10], [199313, 14877, 12], [277080, 24209, 22], [385100, 47973, 24]], 'regular_wh': 49707}, 0), ('partial-repair probe', {'regular': 230312, 'supp': 412759, 'table': [[0, 0, 0], [87909, 0, 10], [234168, 14626, 12], [277117, 19780, 22], [325269, 30373, 24]], 'regular_wh': 53200}, 53445), ('normal control', {'regular': 91078, 'supp': 50965, 'table': [[0, 0, 0], [129383, 0, 10], [180861, 5148, 12], [251715, 13650, 22], [346731, 34554, 24]], 'regular_wh': None}, 1266), ('normal control', {'regular': 332685, 'supp': 265440, 'table': [[0, 0, 0], [82800, 0, 10], [155250, 7245, 12], [280472, 22272, 22], [368552, 41650, 24]], 'regular_wh': None}, 62989), ('normal control', {'regular': 371035, 'supp': 231573, 'table': [[0, 0, 0], [62708, 0, 10], [162966, 10026, 12], [294122, 25765, 22], [404634, 50078, 24]], 'regular_wh': None}, 54906), ('normal control', {'regular': 139761, 'supp': 580903, 'table': [[0, 0, 0], [33224, 0, 10], [124697, 9147, 12], [177909, 15532, 22], [324717, 47830, 24]], 'regular_wh': None}, 131902)], [('regression', {'regular': 67092, 'supp': 9466, 'table': [[0, 0, 0], [50546, 0, 10], [199313, 14877, 12], [277080, 24209, 22], [385100, 47973, 24]], 'regular_wh': 49707}, 0), ('regression', {'regular': 317198, 'supp': 215674, 'table': [[0, 0, 0], [114323, 0, 10], [242963, 12864, 12], [288842, 18369, 22], [360034, 34031, 24]], 'regular_wh': 7312}, 68200), ('partial-repair probe', {'regular': 301375, 'supp': 257327, 'table': [[0, 0, 0], [104655, 0, 10], [206771, 10212, 12], [296267, 20952, 22], [346695, 32046, 24]], 'regular_wh': 42656}, 40272), ('partial-repair probe', {'regular': 138799, 'supp': 242337, 'table': [[0, 0, 0], [67403, 0, 10], [179799, 11240, 12], [251397, 19832, 22], [387828, 49847, 24]], 'regular_wh': 45497}, 2878), ('normal control', {'regular': 311741, 'supp': 533113, 'table': [[0, 0, 0], [137329, 0, 10], [282729, 14540, 12], [396442, 28186, 22], [532518, 58123, 24]], 'regular_wh': None}, 115063), ('normal control', {'regular': 376443, 'supp': 593003, 'table': [[0, 0, 0], [149063, 0, 10], [179956, 3089, 12], [266122, 13429, 22], [344153, 30596, 24]], 'regular_wh': None}, 142320), ('normal control', {'regular': 348176, 'supp': 89132, 'table': [[0, 0, 0], [125841, 0, 10], [173895, 4805, 12], [222871, 10682, 22], [276667, 22517, 24]], 'regular_wh': None}, 21392), ('normal control', {'regular': 176368, 'supp': 539007, 'table': [[0, 0, 0], [34750, 0, 10], [89874, 5512, 12], [222171, 21388, 22], [354493, 50499, 24]], 'regular_wh': None}, 121220)], [('regression', {'regular': 230312, 'supp': 412759, 'table': [[0, 0, 0], [87909, 0, 10], [234168, 14626, 12], [277117, 19780, 22], [325269, 30373, 24]], 'regular_wh': 53200}, 53445), ('regression', {'regular': 218340, 'supp': 389621, 'table': [[0, 0, 0], [59946, 0, 10], [144504, 8456, 12], [240644, 19993, 22], [365163, 47387, 24]], 'regular_wh': 27085}, 78574), ('partial-repair probe', {'regular': 282406, 'supp': 568743, 'table': [[0, 0, 0], [126319, 0, 10], [211110, 8479, 12], [332602, 23058, 22], [357109, 28450, 24]], 'regular_wh': 51500}, 95520), ('partial-repair probe', {'regular': 133684, 'supp': 525347, 'table': [[0, 0, 0], [48514, 0, 10], [163334, 11482, 12], [185105, 14095, 22], [247313, 27781, 24]], 'regular_wh': 48804}, 77789), ('normal control', {'regular': 154043, 'supp': 107955, 'table': [[0, 0, 0], [65291, 0, 10], [204262, 13897, 12], [338369, 29990, 22], [472754, 59555, 24]], 'regular_wh': None}, 11950), ('normal control', {'regular': 305173, 'supp': 536066, 'table': [[0, 0, 0], [86460, 0, 10], [179538, 9308, 12], [282113, 21617, 22], [389261, 45190, 24]], 'regular_wh': None}, 126975), ('normal control', {'regular': 123317, 'supp': 2427, 'table': [[0, 0, 0], [36593, 0, 10], [139048, 10246, 12], [231726, 21367, 22], [283287, 32710, 24]], 'regular_wh': None}, 243), ('normal control', {'regular': 45436, 'supp': 499099, 'table': [[0, 0, 0], [119668, 0, 10], [156650, 3698, 12], [228263, 12292, 22], [285280, 24836, 24]], 'regular_wh': None}, 87057)], [('regression', {'regular': 301375, 'supp': 257327, 'table': [[0, 0, 0], [104655, 0, 10], [206771, 10212, 12], [296267, 20952, 22], [346695, 32046, 24]], 'regular_wh': 42656}, 40272), ('regression', {'regular': 67092, 'supp': 9466, 'table': [[0, 0, 0], [50546, 0, 10], [199313, 14877, 12], [277080, 24209, 22], [385100, 47973, 24]], 'regular_wh': 49707}, 0), ('partial-repair probe', {'regular': 30801, 'supp': 257466, 'table': [[0, 0, 0], [111822, 0, 10], [184134, 7231, 12], [244754, 14505, 22], [338743, 35183, 24]], 'regular_wh': 42625}, 0), ('partial-repair probe', {'regular': 141294, 'supp': 528346, 'table': [[0, 0, 0], [34928, 0, 10], [149354, 11443, 12], [262856, 25063, 22], [303394, 33981, 24]], 'regular_wh': 22556}, 99324), ('normal control', {'regular': 398070, 'supp': 398441, 'table': [[0, 0, 0], [80259, 0, 10], [126225, 4597, 12], [224289, 16365, 22], [264168, 25138, 24]], 'regular_wh': None}, 95626), ('normal control', {'regular': 6755, 'supp': 478748, 'table': [[0, 0, 0], [101638, 0, 10], [146837, 4520, 12], [189797, 9675, 22], [210942, 14327, 24]], 'regular_wh': None}, 80222), ('normal control', {'regular': 174696, 'supp': 196512, 'table': [[0, 0, 0], [45315, 0, 10], [105709, 6039, 12], [224263, 20265, 22], [295174, 35865, 24]], 'regular_wh': None}, 39796), ('normal control', {'regular': 152527, 'supp': 18424, 'table': [[0, 0, 0], [106961, 0, 10], [180698, 7374, 12], [201376, 9855, 22], [237701, 17847, 24]], 'regular_wh': None}, 1842)]]
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 | 0 | 0 | Passed |
| regression 1 | 85498 | 85498 | Passed |
| partial-repair probe 2 | 78574 | 78574 | Passed |
| partial-repair probe 3 | 0 | 0 | Passed |
| normal control 4 | 123686 | 123686 | Passed |
| normal control 5 | 116092 | 116092 | Passed |
| normal control 6 | 92267 | 92267 | Passed |
| normal control 7 | 67216 | 67216 | Passed |
SHA-256 / 3245f99752189522e62f5d81a5317984236b495a737a40c8de006594ef792b1e
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:33.487539+00:00.
Case digest / effd5ad16fd0ac7a10438289dc9328c95b929ce3d33d7abf8b0ed7263343ff13