FA-59306 / Payroll withholding rules / Open access
Tip shortfall allocation by hours: hours share base · case 01
The wrong employees are selected for allocation because shares are too small.
ROOT CAUSE
Shares are computed from the shortfall rather than the full 8% target.
VERIFIED REPAIR
Restore the contract rule at the hours share base step: use `share = target * hrs / hours_total`.
Unsuccessful approach: The attempt splits the target equally, ignoring hours worked.
Case contract
Input {receipts, staff: [[name, hours, reported_tips]]} with positive total hours. Target = 8% of receipts. Shortfall = target - total reported; none -> {}. Each employee's share = target*hours/total_hours; employees reporting less than their share get deficit = share - reported. Shortfall is allocated in proportion to deficits, each rounded half-up. Return {name: cents}.
Why this case matters
Tip allocation assigns reported income on W-2s, and only employees under-reporting their share receive allocations.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
import math
N = 1
observations = []
def solve(x):
target = Fraction(x['receipts'] * 8, 100)
reported = sum(e[2] for e in x['staff'])
short = target - reported
if short <= 0:
return {}
hours_total = sum(e[1] for e in x['staff'])
deficits = {}
for name, hrs, rep in x['staff']:
share = short * hrs / hours_total
if rep < share:
deficits[name] = share - rep
dsum = sum(deficits.values())
out = {}
for name, d in deficits.items():
out[name] = math.floor(short * d / dsum + Fraction(1, 2))
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression', {'receipts': 1926229, 'staff': [['dee', 20, 0], ['eli', 23, 0], ['ben', 15, 23516], ['ana', 9, 0]]}, {'dee': 45999, 'eli': 52899, 'ben': 10984, 'ana': 20700}), ('regression', {'receipts': 1565828, 'staff': [['eli', 40, 65745], ['cy', 29, 58626]]}, {'eli': 895}), ('partial-repair probe', {'receipts': 580998, 'staff': [['ana', 8, 0], ['ben', 25, 18228]]}, {'ana': 11268, 'ben': 16984}), ('partial-repair probe', {'receipts': 2678857, 'staff': [['ana', 8, 35721], ['ben', 20, 0]]}, {'ana': 25510, 'ben': 153078}), ('normal control', {'receipts': 296732, 'staff': [['cy', 31, 25635], ['ben', 23, 0], ['ana', 23, 0]]}, {}), ('normal control', {'receipts': 550244, 'staff': [['cy', 19, 57024]]}, {}), ('normal control', {'receipts': 831709, 'staff': [['eli', 25, 0], ['dee', 27, 33872], ['cy', 8, 38931], ['ben', 2, 0]]}, {}), ('normal control', {'receipts': 1484874, 'staff': [['cy', 38, 0], ['dee', 4, 11025], ['eli', 23, 61900], ['ana', 1, 55590]]}, {})], [('regression', {'receipts': 1565828, 'staff': [['eli', 40, 65745], ['cy', 29, 58626]]}, {'eli': 895}), ('regression', {'receipts': 580998, 'staff': [['ana', 8, 0], ['ben', 25, 18228]]}, {'ana': 11268, 'ben': 16984}), ('partial-repair probe', {'receipts': 2678857, 'staff': [['ana', 8, 35721], ['ben', 20, 0]]}, {'ana': 25510, 'ben': 153078}), ('partial-repair probe', {'receipts': 213918, 'staff': [['ben', 40, 0], ['dee', 37, 0]]}, {'ben': 8890, 'dee': 8223}), ('normal control', {'receipts': 414394, 'staff': [['ben', 30, 72971], ['dee', 11, 50779], ['cy', 12, 57744], ['ana', 33, 0], ['eli', 37, 0]]}, {}), ('normal control', {'receipts': 15877, 'staff': [['dee', 2, 0], ['ben', 29, 36864], ['cy', 36, 367]]}, {}), ('normal control', {'receipts': 1019554, 'staff': [['dee', 11, 0]]}, {'dee': 81564}), ('normal control', {'receipts': 325470, 'staff': [['ana', 24, 0], ['dee', 18, 39572]]}, {})], [('regression', {'receipts': 580998, 'staff': [['ana', 8, 0], ['ben', 25, 18228]]}, {'ana': 11268, 'ben': 16984}), ('regression', {'receipts': 2678857, 'staff': [['ana', 8, 35721], ['ben', 20, 0]]}, {'ana': 25510, 'ben': 153078}), ('partial-repair probe', {'receipts': 213918, 'staff': [['ben', 40, 0], ['dee', 37, 0]]}, {'ben': 8890, 'dee': 8223}), ('partial-repair probe', {'receipts': 2631747, 'staff': [['eli', 6, 73067], ['ana', 26, 49452], ['cy', 10, 52106]]}, {'ana': 35915}), ('normal control', {'receipts': 1844273, 'staff': [['ben', 6, 9908], ['cy', 2, 35253], ['dee', 0, 47647], ['eli', 24, 54448], ['ana', 19, 60962]]}, {}), ('normal control', {'receipts': 985969, 'staff': [['dee', 16, 0]]}, {'dee': 78878}), ('normal control', {'receipts': 2260421, 'staff': [['cy', 25, 0]]}, {'cy': 180834}), ('normal control', {'receipts': 305915, 'staff': [['ben', 17, 0], ['cy', 35, 49832], ['dee', 14, 0]]}, {})], [('regression', {'receipts': 2678857, 'staff': [['ana', 8, 35721], ['ben', 20, 0]]}, {'ana': 25510, 'ben': 153078}), ('regression', {'receipts': 2631747, 'staff': [['eli', 6, 73067], ['ana', 26, 49452], ['cy', 10, 52106]]}, {'ana': 35915}), ('partial-repair probe', {'receipts': 377533, 'staff': [['ben', 14, 0], ['eli', 20, 18063], ['dee', 33, 0]]}, {'ben': 3616, 'dee': 8524}), ('partial-repair probe', {'receipts': 789350, 'staff': [['dee', 24, 0], ['ben', 32, 0], ['cy', 33, 0], ['ana', 25, 0]]}, {'dee': 13294, 'ben': 17726, 'cy': 18280, 'ana': 13848}), ('normal control', {'receipts': 97470, 'staff': [['ana', 8, 0], ['eli', 19, 14113], ['dee', 6, 49117], ['ben', 0, 0], ['cy', 33, 9103]]}, {}), ('normal control', {'receipts': 1562647, 'staff': [['dee', 25, 0], ['ana', 2, 45159], ['ben', 28, 79991], ['eli', 7, 0], ['cy', 29, 0]]}, {}), ('normal control', {'receipts': 498706, 'staff': [['dee', 17, 44639], ['ana', 25, 0], ['cy', 9, 0]]}, {}), ('normal control', {'receipts': 937562, 'staff': [['eli', 3, 44205], ['ana', 5, 63945], ['dee', 2, 72206], ['cy', 27, 6437]]}, {})], [('regression', {'receipts': 2631747, 'staff': [['eli', 6, 73067], ['ana', 26, 49452], ['cy', 10, 52106]]}, {'ana': 35915}), ('regression', {'receipts': 2458851, 'staff': [['cy', 31, 15683], ['ben', 27, 76376]]}, {'cy': 89454, 'ben': 15195}), ('partial-repair probe', {'receipts': 2589131, 'staff': [['cy', 0, 9383], ['ana', 9, 74166], ['dee', 1, 54844]]}, {'ana': 68737}), ('partial-repair probe', {'receipts': 2640630, 'staff': [['eli', 21, 16955], ['dee', 0, 76011]]}, {'eli': 118284}), ('normal control', {'receipts': 2072929, 'staff': [['dee', 16, 65338]]}, {'dee': 100496}), ('normal control', {'receipts': 2549094, 'staff': [['ben', 25, 0]]}, {'ben': 203928}), ('normal control', {'receipts': 1079780, 'staff': [['eli', 13, 55620], ['dee', 20, 0]]}, {'dee': 30762}), ('normal control', {'receipts': 207036, 'staff': [['ben', 34, 0], ['ana', 23, 0], ['dee', 36, 46201], ['cy', 28, 10127], ['eli', 18, 74356]]}, {})]]
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 | {'ana': 21394, 'ben': 6975, 'dee': 47541, 'eli': 54672} | {'ana': 20700, 'ben': 10984, 'dee': 45999, 'eli': 52899} | Failed |
| regression 1 | {} | {'eli': 895} | Failed |
| partial-repair probe 2 | {'ana': 19303, 'ben': 8948} | {'ana': 11268, 'ben': 16984} | Failed |
| partial-repair probe 3 | {'ana': 19130, 'ben': 159457} | {'ana': 25510, 'ben': 153078} | Failed |
| normal control 4 | {} | {} | Passed |
| normal control 5 | {} | {} | Passed |
| normal control 6 | {} | {} | Passed |
| normal control 7 | {} | {} | Passed |
SHA-256 / c7415461bb893da3adb7bb288721597c856b609c8b8544c956f7c74c574439f3
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
import math
N = 1
observations = []
def solve(x):
target = Fraction(x['receipts'] * 8, 100)
reported = sum(e[2] for e in x['staff'])
short = target - reported
if short <= 0:
return {}
hours_total = sum(e[1] for e in x['staff'])
deficits = {}
for name, hrs, rep in x['staff']:
share = target / len(x['staff'])
if rep < share:
deficits[name] = share - rep
dsum = sum(deficits.values())
out = {}
for name, d in deficits.items():
out[name] = math.floor(short * d / dsum + Fraction(1, 2))
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression', {'receipts': 1926229, 'staff': [['dee', 20, 0], ['eli', 23, 0], ['ben', 15, 23516], ['ana', 9, 0]]}, {'dee': 45999, 'eli': 52899, 'ben': 10984, 'ana': 20700}), ('regression', {'receipts': 1565828, 'staff': [['eli', 40, 65745], ['cy', 29, 58626]]}, {'eli': 895}), ('partial-repair probe', {'receipts': 580998, 'staff': [['ana', 8, 0], ['ben', 25, 18228]]}, {'ana': 11268, 'ben': 16984}), ('partial-repair probe', {'receipts': 2678857, 'staff': [['ana', 8, 35721], ['ben', 20, 0]]}, {'ana': 25510, 'ben': 153078}), ('normal control', {'receipts': 296732, 'staff': [['cy', 31, 25635], ['ben', 23, 0], ['ana', 23, 0]]}, {}), ('normal control', {'receipts': 550244, 'staff': [['cy', 19, 57024]]}, {}), ('normal control', {'receipts': 831709, 'staff': [['eli', 25, 0], ['dee', 27, 33872], ['cy', 8, 38931], ['ben', 2, 0]]}, {}), ('normal control', {'receipts': 1484874, 'staff': [['cy', 38, 0], ['dee', 4, 11025], ['eli', 23, 61900], ['ana', 1, 55590]]}, {})], [('regression', {'receipts': 1565828, 'staff': [['eli', 40, 65745], ['cy', 29, 58626]]}, {'eli': 895}), ('regression', {'receipts': 580998, 'staff': [['ana', 8, 0], ['ben', 25, 18228]]}, {'ana': 11268, 'ben': 16984}), ('partial-repair probe', {'receipts': 2678857, 'staff': [['ana', 8, 35721], ['ben', 20, 0]]}, {'ana': 25510, 'ben': 153078}), ('partial-repair probe', {'receipts': 213918, 'staff': [['ben', 40, 0], ['dee', 37, 0]]}, {'ben': 8890, 'dee': 8223}), ('normal control', {'receipts': 414394, 'staff': [['ben', 30, 72971], ['dee', 11, 50779], ['cy', 12, 57744], ['ana', 33, 0], ['eli', 37, 0]]}, {}), ('normal control', {'receipts': 15877, 'staff': [['dee', 2, 0], ['ben', 29, 36864], ['cy', 36, 367]]}, {}), ('normal control', {'receipts': 1019554, 'staff': [['dee', 11, 0]]}, {'dee': 81564}), ('normal control', {'receipts': 325470, 'staff': [['ana', 24, 0], ['dee', 18, 39572]]}, {})], [('regression', {'receipts': 580998, 'staff': [['ana', 8, 0], ['ben', 25, 18228]]}, {'ana': 11268, 'ben': 16984}), ('regression', {'receipts': 2678857, 'staff': [['ana', 8, 35721], ['ben', 20, 0]]}, {'ana': 25510, 'ben': 153078}), ('partial-repair probe', {'receipts': 213918, 'staff': [['ben', 40, 0], ['dee', 37, 0]]}, {'ben': 8890, 'dee': 8223}), ('partial-repair probe', {'receipts': 2631747, 'staff': [['eli', 6, 73067], ['ana', 26, 49452], ['cy', 10, 52106]]}, {'ana': 35915}), ('normal control', {'receipts': 1844273, 'staff': [['ben', 6, 9908], ['cy', 2, 35253], ['dee', 0, 47647], ['eli', 24, 54448], ['ana', 19, 60962]]}, {}), ('normal control', {'receipts': 985969, 'staff': [['dee', 16, 0]]}, {'dee': 78878}), ('normal control', {'receipts': 2260421, 'staff': [['cy', 25, 0]]}, {'cy': 180834}), ('normal control', {'receipts': 305915, 'staff': [['ben', 17, 0], ['cy', 35, 49832], ['dee', 14, 0]]}, {})], [('regression', {'receipts': 2678857, 'staff': [['ana', 8, 35721], ['ben', 20, 0]]}, {'ana': 25510, 'ben': 153078}), ('regression', {'receipts': 2631747, 'staff': [['eli', 6, 73067], ['ana', 26, 49452], ['cy', 10, 52106]]}, {'ana': 35915}), ('partial-repair probe', {'receipts': 377533, 'staff': [['ben', 14, 0], ['eli', 20, 18063], ['dee', 33, 0]]}, {'ben': 3616, 'dee': 8524}), ('partial-repair probe', {'receipts': 789350, 'staff': [['dee', 24, 0], ['ben', 32, 0], ['cy', 33, 0], ['ana', 25, 0]]}, {'dee': 13294, 'ben': 17726, 'cy': 18280, 'ana': 13848}), ('normal control', {'receipts': 97470, 'staff': [['ana', 8, 0], ['eli', 19, 14113], ['dee', 6, 49117], ['ben', 0, 0], ['cy', 33, 9103]]}, {}), ('normal control', {'receipts': 1562647, 'staff': [['dee', 25, 0], ['ana', 2, 45159], ['ben', 28, 79991], ['eli', 7, 0], ['cy', 29, 0]]}, {}), ('normal control', {'receipts': 498706, 'staff': [['dee', 17, 44639], ['ana', 25, 0], ['cy', 9, 0]]}, {}), ('normal control', {'receipts': 937562, 'staff': [['eli', 3, 44205], ['ana', 5, 63945], ['dee', 2, 72206], ['cy', 27, 6437]]}, {})], [('regression', {'receipts': 2631747, 'staff': [['eli', 6, 73067], ['ana', 26, 49452], ['cy', 10, 52106]]}, {'ana': 35915}), ('regression', {'receipts': 2458851, 'staff': [['cy', 31, 15683], ['ben', 27, 76376]]}, {'cy': 89454, 'ben': 15195}), ('partial-repair probe', {'receipts': 2589131, 'staff': [['cy', 0, 9383], ['ana', 9, 74166], ['dee', 1, 54844]]}, {'ana': 68737}), ('partial-repair probe', {'receipts': 2640630, 'staff': [['eli', 21, 16955], ['dee', 0, 76011]]}, {'eli': 118284}), ('normal control', {'receipts': 2072929, 'staff': [['dee', 16, 65338]]}, {'dee': 100496}), ('normal control', {'receipts': 2549094, 'staff': [['ben', 25, 0]]}, {'ben': 203928}), ('normal control', {'receipts': 1079780, 'staff': [['eli', 13, 55620], ['dee', 20, 0]]}, {'dee': 30762}), ('normal control', {'receipts': 207036, 'staff': [['ben', 34, 0], ['ana', 23, 0], ['dee', 36, 46201], ['cy', 28, 10127], ['eli', 18, 74356]]}, {})]]
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 | {'ana': 38525, 'ben': 15009, 'dee': 38525, 'eli': 38525} | {'ana': 20700, 'ben': 10984, 'dee': 45999, 'eli': 52899} | Failed |
| regression 1 | {'cy': 895} | {'eli': 895} | Failed |
| partial-repair probe 2 | {'ana': 23240, 'ben': 5012} | {'ana': 11268, 'ben': 16984} | Failed |
| partial-repair probe 3 | {'ana': 71433, 'ben': 107154} | {'ana': 25510, 'ben': 153078} | Failed |
| normal control 4 | {} | {} | Passed |
| normal control 5 | {} | {} | Passed |
| normal control 6 | {} | {} | Passed |
| normal control 7 | {} | {} | Passed |
SHA-256 / a147db9fca1bd6c13db6b9bba6ac0654b452636477cbef90bb7a96697cabc1f5
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
import math
N = 1
observations = []
def solve(x):
target = Fraction(x['receipts'] * 8, 100)
reported = sum(e[2] for e in x['staff'])
short = target - reported
if short <= 0:
return {}
hours_total = sum(e[1] for e in x['staff'])
deficits = {}
for name, hrs, rep in x['staff']:
share = target * hrs / hours_total
if rep < share:
deficits[name] = share - rep
dsum = sum(deficits.values())
out = {}
for name, d in deficits.items():
out[name] = math.floor(short * d / dsum + Fraction(1, 2))
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression', {'receipts': 1926229, 'staff': [['dee', 20, 0], ['eli', 23, 0], ['ben', 15, 23516], ['ana', 9, 0]]}, {'dee': 45999, 'eli': 52899, 'ben': 10984, 'ana': 20700}), ('regression', {'receipts': 1565828, 'staff': [['eli', 40, 65745], ['cy', 29, 58626]]}, {'eli': 895}), ('partial-repair probe', {'receipts': 580998, 'staff': [['ana', 8, 0], ['ben', 25, 18228]]}, {'ana': 11268, 'ben': 16984}), ('partial-repair probe', {'receipts': 2678857, 'staff': [['ana', 8, 35721], ['ben', 20, 0]]}, {'ana': 25510, 'ben': 153078}), ('normal control', {'receipts': 296732, 'staff': [['cy', 31, 25635], ['ben', 23, 0], ['ana', 23, 0]]}, {}), ('normal control', {'receipts': 550244, 'staff': [['cy', 19, 57024]]}, {}), ('normal control', {'receipts': 831709, 'staff': [['eli', 25, 0], ['dee', 27, 33872], ['cy', 8, 38931], ['ben', 2, 0]]}, {}), ('normal control', {'receipts': 1484874, 'staff': [['cy', 38, 0], ['dee', 4, 11025], ['eli', 23, 61900], ['ana', 1, 55590]]}, {})], [('regression', {'receipts': 1565828, 'staff': [['eli', 40, 65745], ['cy', 29, 58626]]}, {'eli': 895}), ('regression', {'receipts': 580998, 'staff': [['ana', 8, 0], ['ben', 25, 18228]]}, {'ana': 11268, 'ben': 16984}), ('partial-repair probe', {'receipts': 2678857, 'staff': [['ana', 8, 35721], ['ben', 20, 0]]}, {'ana': 25510, 'ben': 153078}), ('partial-repair probe', {'receipts': 213918, 'staff': [['ben', 40, 0], ['dee', 37, 0]]}, {'ben': 8890, 'dee': 8223}), ('normal control', {'receipts': 414394, 'staff': [['ben', 30, 72971], ['dee', 11, 50779], ['cy', 12, 57744], ['ana', 33, 0], ['eli', 37, 0]]}, {}), ('normal control', {'receipts': 15877, 'staff': [['dee', 2, 0], ['ben', 29, 36864], ['cy', 36, 367]]}, {}), ('normal control', {'receipts': 1019554, 'staff': [['dee', 11, 0]]}, {'dee': 81564}), ('normal control', {'receipts': 325470, 'staff': [['ana', 24, 0], ['dee', 18, 39572]]}, {})], [('regression', {'receipts': 580998, 'staff': [['ana', 8, 0], ['ben', 25, 18228]]}, {'ana': 11268, 'ben': 16984}), ('regression', {'receipts': 2678857, 'staff': [['ana', 8, 35721], ['ben', 20, 0]]}, {'ana': 25510, 'ben': 153078}), ('partial-repair probe', {'receipts': 213918, 'staff': [['ben', 40, 0], ['dee', 37, 0]]}, {'ben': 8890, 'dee': 8223}), ('partial-repair probe', {'receipts': 2631747, 'staff': [['eli', 6, 73067], ['ana', 26, 49452], ['cy', 10, 52106]]}, {'ana': 35915}), ('normal control', {'receipts': 1844273, 'staff': [['ben', 6, 9908], ['cy', 2, 35253], ['dee', 0, 47647], ['eli', 24, 54448], ['ana', 19, 60962]]}, {}), ('normal control', {'receipts': 985969, 'staff': [['dee', 16, 0]]}, {'dee': 78878}), ('normal control', {'receipts': 2260421, 'staff': [['cy', 25, 0]]}, {'cy': 180834}), ('normal control', {'receipts': 305915, 'staff': [['ben', 17, 0], ['cy', 35, 49832], ['dee', 14, 0]]}, {})], [('regression', {'receipts': 2678857, 'staff': [['ana', 8, 35721], ['ben', 20, 0]]}, {'ana': 25510, 'ben': 153078}), ('regression', {'receipts': 2631747, 'staff': [['eli', 6, 73067], ['ana', 26, 49452], ['cy', 10, 52106]]}, {'ana': 35915}), ('partial-repair probe', {'receipts': 377533, 'staff': [['ben', 14, 0], ['eli', 20, 18063], ['dee', 33, 0]]}, {'ben': 3616, 'dee': 8524}), ('partial-repair probe', {'receipts': 789350, 'staff': [['dee', 24, 0], ['ben', 32, 0], ['cy', 33, 0], ['ana', 25, 0]]}, {'dee': 13294, 'ben': 17726, 'cy': 18280, 'ana': 13848}), ('normal control', {'receipts': 97470, 'staff': [['ana', 8, 0], ['eli', 19, 14113], ['dee', 6, 49117], ['ben', 0, 0], ['cy', 33, 9103]]}, {}), ('normal control', {'receipts': 1562647, 'staff': [['dee', 25, 0], ['ana', 2, 45159], ['ben', 28, 79991], ['eli', 7, 0], ['cy', 29, 0]]}, {}), ('normal control', {'receipts': 498706, 'staff': [['dee', 17, 44639], ['ana', 25, 0], ['cy', 9, 0]]}, {}), ('normal control', {'receipts': 937562, 'staff': [['eli', 3, 44205], ['ana', 5, 63945], ['dee', 2, 72206], ['cy', 27, 6437]]}, {})], [('regression', {'receipts': 2631747, 'staff': [['eli', 6, 73067], ['ana', 26, 49452], ['cy', 10, 52106]]}, {'ana': 35915}), ('regression', {'receipts': 2458851, 'staff': [['cy', 31, 15683], ['ben', 27, 76376]]}, {'cy': 89454, 'ben': 15195}), ('partial-repair probe', {'receipts': 2589131, 'staff': [['cy', 0, 9383], ['ana', 9, 74166], ['dee', 1, 54844]]}, {'ana': 68737}), ('partial-repair probe', {'receipts': 2640630, 'staff': [['eli', 21, 16955], ['dee', 0, 76011]]}, {'eli': 118284}), ('normal control', {'receipts': 2072929, 'staff': [['dee', 16, 65338]]}, {'dee': 100496}), ('normal control', {'receipts': 2549094, 'staff': [['ben', 25, 0]]}, {'ben': 203928}), ('normal control', {'receipts': 1079780, 'staff': [['eli', 13, 55620], ['dee', 20, 0]]}, {'dee': 30762}), ('normal control', {'receipts': 207036, 'staff': [['ben', 34, 0], ['ana', 23, 0], ['dee', 36, 46201], ['cy', 28, 10127], ['eli', 18, 74356]]}, {})]]
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 | {'ana': 20700, 'ben': 10984, 'dee': 45999, 'eli': 52899} | {'ana': 20700, 'ben': 10984, 'dee': 45999, 'eli': 52899} | Passed |
| regression 1 | {'eli': 895} | {'eli': 895} | Passed |
| partial-repair probe 2 | {'ana': 11268, 'ben': 16984} | {'ana': 11268, 'ben': 16984} | Passed |
| partial-repair probe 3 | {'ana': 25510, 'ben': 153078} | {'ana': 25510, 'ben': 153078} | Passed |
| normal control 4 | {} | {} | Passed |
| normal control 5 | {} | {} | Passed |
| normal control 6 | {} | {} | Passed |
| normal control 7 | {} | {} | Passed |
SHA-256 / 5e57e3799580f49556ff7953f9f377d9df9f0d1386e7c97a513ee0204168c0fc
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:34.985708+00:00.
Case digest / ba9ca03e13ce6abc538a99e30e6f592ce70b8b65b6a98433dde11ac42dc6481c