FAILURE MAP
← Case archive

FA-59301 / Payroll withholding rules / Open access

Tip shortfall allocation by hours: allocation eligibility · case 01

Employees who reported exactly their share are listed with zero-cent allocations.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The eligibility test includes employees whose reported tips equal their share.

VERIFIED REPAIR

Restore the contract rule at the allocation eligibility step: use `if rep < share:`.

Unsuccessful approach: The attempt excludes employees who reported no tips at all, the ones most in deficit.

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 = 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': 404460, 'staff': [['ben', 32, 0], ['cy', 0, 0]]}, {'ben': 32357}), ('regression', {'receipts': 2293403, 'staff': [['eli', 2, 18937], ['dee', 32, 0], ['cy', 0, 0]]}, {'dee': 164535}), ('partial-repair probe', {'receipts': 1926229, 'staff': [['dee', 20, 0], ['eli', 23, 0], ['ben', 15, 23516], ['ana', 9, 0]]}, {'dee': 45999, 'eli': 52899, 'ben': 10984, 'ana': 20700}), ('partial-repair probe', {'receipts': 580998, 'staff': [['ana', 8, 0], ['ben', 25, 18228]]}, {'ana': 11268, 'ben': 16984}), ('normal control', {'receipts': 1565828, 'staff': [['eli', 40, 65745], ['cy', 29, 58626]]}, {'eli': 895}), ('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]]}, {})], [('regression', {'receipts': 2293403, 'staff': [['eli', 2, 18937], ['dee', 32, 0], ['cy', 0, 0]]}, {'dee': 164535}), ('regression', {'receipts': 2880982, 'staff': [['dee', 30, 65246], ['eli', 0, 0], ['ana', 39, 55839], ['cy', 37, 0], ['ben', 1, 0]]}, {'ana': 28007, 'cy': 79245, 'ben': 2142}), ('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': 2631747, 'staff': [['eli', 6, 73067], ['ana', 26, 49452], ['cy', 10, 52106]]}, {'ana': 35915}), ('normal control', {'receipts': 2458851, 'staff': [['cy', 31, 15683], ['ben', 27, 76376]]}, {'cy': 89454, 'ben': 15195}), ('normal control', {'receipts': 2589131, 'staff': [['cy', 0, 9383], ['ana', 9, 74166], ['dee', 1, 54844]]}, {'ana': 68737}), ('normal control', {'receipts': 2640630, 'staff': [['eli', 21, 16955], ['dee', 0, 76011]]}, {'eli': 118284})], [('regression', {'receipts': 2880982, 'staff': [['dee', 30, 65246], ['eli', 0, 0], ['ana', 39, 55839], ['cy', 37, 0], ['ben', 1, 0]]}, {'ana': 28007, 'cy': 79245, 'ben': 2142}), ('regression', {'receipts': 1122488, 'staff': [['ben', 2, 31588], ['eli', 0, 0], ['dee', 15, 0]]}, {'dee': 58211}), ('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': 1484874, 'staff': [['cy', 38, 0], ['dee', 4, 11025], ['eli', 23, 61900], ['ana', 1, 55590]]}, {}), ('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': 325470, 'staff': [['ana', 24, 0], ['dee', 18, 39572]]}, {})], [('regression', {'receipts': 1122488, 'staff': [['ben', 2, 31588], ['eli', 0, 0], ['dee', 15, 0]]}, {'dee': 58211}), ('regression', {'receipts': 751513, 'staff': [['dee', 11, 23705], ['ana', 0, 0], ['cy', 8, 0]]}, {'dee': 11102, 'cy': 25314}), ('partial-repair probe', {'receipts': 1043666, 'staff': [['dee', 21, 0], ['eli', 31, 46444]]}, {'dee': 33718, 'eli': 3331}), ('partial-repair probe', {'receipts': 2921186, 'staff': [['cy', 25, 21684], ['dee', 15, 2874], ['eli', 3, 0], ['ana', 20, 0]]}, {'cy': 71052, 'dee': 52768, 'eli': 11128, 'ana': 74189}), ('normal control', {'receipts': 1844273, 'staff': [['ben', 6, 9908], ['cy', 2, 35253], ['dee', 0, 47647], ['eli', 24, 54448], ['ana', 19, 60962]]}, {}), ('normal control', {'receipts': 305915, 'staff': [['ben', 17, 0], ['cy', 35, 49832], ['dee', 14, 0]]}, {}), ('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]]}, {})], [('regression', {'receipts': 751513, 'staff': [['dee', 11, 23705], ['ana', 0, 0], ['cy', 8, 0]]}, {'dee': 11102, 'cy': 25314}), ('regression', {'receipts': 2167152, 'staff': [['ana', 0, 0], ['ben', 8, 8970], ['dee', 8, 0]]}, {'ben': 77716, 'dee': 86686}), ('partial-repair probe', {'receipts': 588846, 'staff': [['ana', 19, 0], ['cy', 28, 19233], ['eli', 8, 0]]}, {'ana': 16274, 'cy': 4749, 'eli': 6852}), ('partial-repair probe', {'receipts': 1019554, 'staff': [['dee', 11, 0]]}, {'dee': 81564}), ('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]]}, {}), ('normal control', {'receipts': 1576485, 'staff': [['ben', 34, 8023], ['dee', 32, 3525]]}, {'ben': 56947, 'dee': 57624}), ('normal control', {'receipts': 2072929, 'staff': [['dee', 16, 65338]]}, {'dee': 100496})]]
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 fixtureActualExpectedOutcome
regression 0{'ben': 32357, 'cy': 0}{'ben': 32357}Failed
regression 1{'cy': 0, 'dee': 164535}{'dee': 164535}Failed
partial-repair probe 2{'ana': 20700, 'ben': 10984, 'dee': 45999, 'eli': 52899}{'ana': 20700, 'ben': 10984, 'dee': 45999, 'eli': 52899}Passed
partial-repair probe 3{'ana': 11268, 'ben': 16984}{'ana': 11268, 'ben': 16984}Passed
normal control 4{'eli': 895}{'eli': 895}Passed
normal control 5{}{}Passed
normal control 6{}{}Passed
normal control 7{}{}Passed

SHA-256 / 6356248896c65ae0b8cb9e00599c37d15c35e431f15d5df9392a00260f10d975

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 * hrs / hours_total
        if rep < share and rep > 0:
            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': 404460, 'staff': [['ben', 32, 0], ['cy', 0, 0]]}, {'ben': 32357}), ('regression', {'receipts': 2293403, 'staff': [['eli', 2, 18937], ['dee', 32, 0], ['cy', 0, 0]]}, {'dee': 164535}), ('partial-repair probe', {'receipts': 1926229, 'staff': [['dee', 20, 0], ['eli', 23, 0], ['ben', 15, 23516], ['ana', 9, 0]]}, {'dee': 45999, 'eli': 52899, 'ben': 10984, 'ana': 20700}), ('partial-repair probe', {'receipts': 580998, 'staff': [['ana', 8, 0], ['ben', 25, 18228]]}, {'ana': 11268, 'ben': 16984}), ('normal control', {'receipts': 1565828, 'staff': [['eli', 40, 65745], ['cy', 29, 58626]]}, {'eli': 895}), ('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]]}, {})], [('regression', {'receipts': 2293403, 'staff': [['eli', 2, 18937], ['dee', 32, 0], ['cy', 0, 0]]}, {'dee': 164535}), ('regression', {'receipts': 2880982, 'staff': [['dee', 30, 65246], ['eli', 0, 0], ['ana', 39, 55839], ['cy', 37, 0], ['ben', 1, 0]]}, {'ana': 28007, 'cy': 79245, 'ben': 2142}), ('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': 2631747, 'staff': [['eli', 6, 73067], ['ana', 26, 49452], ['cy', 10, 52106]]}, {'ana': 35915}), ('normal control', {'receipts': 2458851, 'staff': [['cy', 31, 15683], ['ben', 27, 76376]]}, {'cy': 89454, 'ben': 15195}), ('normal control', {'receipts': 2589131, 'staff': [['cy', 0, 9383], ['ana', 9, 74166], ['dee', 1, 54844]]}, {'ana': 68737}), ('normal control', {'receipts': 2640630, 'staff': [['eli', 21, 16955], ['dee', 0, 76011]]}, {'eli': 118284})], [('regression', {'receipts': 2880982, 'staff': [['dee', 30, 65246], ['eli', 0, 0], ['ana', 39, 55839], ['cy', 37, 0], ['ben', 1, 0]]}, {'ana': 28007, 'cy': 79245, 'ben': 2142}), ('regression', {'receipts': 1122488, 'staff': [['ben', 2, 31588], ['eli', 0, 0], ['dee', 15, 0]]}, {'dee': 58211}), ('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': 1484874, 'staff': [['cy', 38, 0], ['dee', 4, 11025], ['eli', 23, 61900], ['ana', 1, 55590]]}, {}), ('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': 325470, 'staff': [['ana', 24, 0], ['dee', 18, 39572]]}, {})], [('regression', {'receipts': 1122488, 'staff': [['ben', 2, 31588], ['eli', 0, 0], ['dee', 15, 0]]}, {'dee': 58211}), ('regression', {'receipts': 751513, 'staff': [['dee', 11, 23705], ['ana', 0, 0], ['cy', 8, 0]]}, {'dee': 11102, 'cy': 25314}), ('partial-repair probe', {'receipts': 1043666, 'staff': [['dee', 21, 0], ['eli', 31, 46444]]}, {'dee': 33718, 'eli': 3331}), ('partial-repair probe', {'receipts': 2921186, 'staff': [['cy', 25, 21684], ['dee', 15, 2874], ['eli', 3, 0], ['ana', 20, 0]]}, {'cy': 71052, 'dee': 52768, 'eli': 11128, 'ana': 74189}), ('normal control', {'receipts': 1844273, 'staff': [['ben', 6, 9908], ['cy', 2, 35253], ['dee', 0, 47647], ['eli', 24, 54448], ['ana', 19, 60962]]}, {}), ('normal control', {'receipts': 305915, 'staff': [['ben', 17, 0], ['cy', 35, 49832], ['dee', 14, 0]]}, {}), ('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]]}, {})], [('regression', {'receipts': 751513, 'staff': [['dee', 11, 23705], ['ana', 0, 0], ['cy', 8, 0]]}, {'dee': 11102, 'cy': 25314}), ('regression', {'receipts': 2167152, 'staff': [['ana', 0, 0], ['ben', 8, 8970], ['dee', 8, 0]]}, {'ben': 77716, 'dee': 86686}), ('partial-repair probe', {'receipts': 588846, 'staff': [['ana', 19, 0], ['cy', 28, 19233], ['eli', 8, 0]]}, {'ana': 16274, 'cy': 4749, 'eli': 6852}), ('partial-repair probe', {'receipts': 1019554, 'staff': [['dee', 11, 0]]}, {'dee': 81564}), ('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]]}, {}), ('normal control', {'receipts': 1576485, 'staff': [['ben', 34, 8023], ['dee', 32, 3525]]}, {'ben': 56947, 'dee': 57624}), ('normal control', {'receipts': 2072929, 'staff': [['dee', 16, 65338]]}, {'dee': 100496})]]
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 fixtureActualExpectedOutcome
regression 0{}{'ben': 32357}Failed
regression 1{}{'dee': 164535}Failed
partial-repair probe 2{'ben': 130582}{'ana': 20700, 'ben': 10984, 'dee': 45999, 'eli': 52899}Failed
partial-repair probe 3{'ben': 28252}{'ana': 11268, 'ben': 16984}Failed
normal control 4{'eli': 895}{'eli': 895}Passed
normal control 5{}{}Passed
normal control 6{}{}Passed
normal control 7{}{}Passed

SHA-256 / 490948baabb5f71b052f56f5f31d6b191ac21a284ec50a84a39befc08462307d

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': 404460, 'staff': [['ben', 32, 0], ['cy', 0, 0]]}, {'ben': 32357}), ('regression', {'receipts': 2293403, 'staff': [['eli', 2, 18937], ['dee', 32, 0], ['cy', 0, 0]]}, {'dee': 164535}), ('partial-repair probe', {'receipts': 1926229, 'staff': [['dee', 20, 0], ['eli', 23, 0], ['ben', 15, 23516], ['ana', 9, 0]]}, {'dee': 45999, 'eli': 52899, 'ben': 10984, 'ana': 20700}), ('partial-repair probe', {'receipts': 580998, 'staff': [['ana', 8, 0], ['ben', 25, 18228]]}, {'ana': 11268, 'ben': 16984}), ('normal control', {'receipts': 1565828, 'staff': [['eli', 40, 65745], ['cy', 29, 58626]]}, {'eli': 895}), ('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]]}, {})], [('regression', {'receipts': 2293403, 'staff': [['eli', 2, 18937], ['dee', 32, 0], ['cy', 0, 0]]}, {'dee': 164535}), ('regression', {'receipts': 2880982, 'staff': [['dee', 30, 65246], ['eli', 0, 0], ['ana', 39, 55839], ['cy', 37, 0], ['ben', 1, 0]]}, {'ana': 28007, 'cy': 79245, 'ben': 2142}), ('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': 2631747, 'staff': [['eli', 6, 73067], ['ana', 26, 49452], ['cy', 10, 52106]]}, {'ana': 35915}), ('normal control', {'receipts': 2458851, 'staff': [['cy', 31, 15683], ['ben', 27, 76376]]}, {'cy': 89454, 'ben': 15195}), ('normal control', {'receipts': 2589131, 'staff': [['cy', 0, 9383], ['ana', 9, 74166], ['dee', 1, 54844]]}, {'ana': 68737}), ('normal control', {'receipts': 2640630, 'staff': [['eli', 21, 16955], ['dee', 0, 76011]]}, {'eli': 118284})], [('regression', {'receipts': 2880982, 'staff': [['dee', 30, 65246], ['eli', 0, 0], ['ana', 39, 55839], ['cy', 37, 0], ['ben', 1, 0]]}, {'ana': 28007, 'cy': 79245, 'ben': 2142}), ('regression', {'receipts': 1122488, 'staff': [['ben', 2, 31588], ['eli', 0, 0], ['dee', 15, 0]]}, {'dee': 58211}), ('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': 1484874, 'staff': [['cy', 38, 0], ['dee', 4, 11025], ['eli', 23, 61900], ['ana', 1, 55590]]}, {}), ('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': 325470, 'staff': [['ana', 24, 0], ['dee', 18, 39572]]}, {})], [('regression', {'receipts': 1122488, 'staff': [['ben', 2, 31588], ['eli', 0, 0], ['dee', 15, 0]]}, {'dee': 58211}), ('regression', {'receipts': 751513, 'staff': [['dee', 11, 23705], ['ana', 0, 0], ['cy', 8, 0]]}, {'dee': 11102, 'cy': 25314}), ('partial-repair probe', {'receipts': 1043666, 'staff': [['dee', 21, 0], ['eli', 31, 46444]]}, {'dee': 33718, 'eli': 3331}), ('partial-repair probe', {'receipts': 2921186, 'staff': [['cy', 25, 21684], ['dee', 15, 2874], ['eli', 3, 0], ['ana', 20, 0]]}, {'cy': 71052, 'dee': 52768, 'eli': 11128, 'ana': 74189}), ('normal control', {'receipts': 1844273, 'staff': [['ben', 6, 9908], ['cy', 2, 35253], ['dee', 0, 47647], ['eli', 24, 54448], ['ana', 19, 60962]]}, {}), ('normal control', {'receipts': 305915, 'staff': [['ben', 17, 0], ['cy', 35, 49832], ['dee', 14, 0]]}, {}), ('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]]}, {})], [('regression', {'receipts': 751513, 'staff': [['dee', 11, 23705], ['ana', 0, 0], ['cy', 8, 0]]}, {'dee': 11102, 'cy': 25314}), ('regression', {'receipts': 2167152, 'staff': [['ana', 0, 0], ['ben', 8, 8970], ['dee', 8, 0]]}, {'ben': 77716, 'dee': 86686}), ('partial-repair probe', {'receipts': 588846, 'staff': [['ana', 19, 0], ['cy', 28, 19233], ['eli', 8, 0]]}, {'ana': 16274, 'cy': 4749, 'eli': 6852}), ('partial-repair probe', {'receipts': 1019554, 'staff': [['dee', 11, 0]]}, {'dee': 81564}), ('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]]}, {}), ('normal control', {'receipts': 1576485, 'staff': [['ben', 34, 8023], ['dee', 32, 3525]]}, {'ben': 56947, 'dee': 57624}), ('normal control', {'receipts': 2072929, 'staff': [['dee', 16, 65338]]}, {'dee': 100496})]]
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 fixtureActualExpectedOutcome
regression 0{'ben': 32357}{'ben': 32357}Passed
regression 1{'dee': 164535}{'dee': 164535}Passed
partial-repair probe 2{'ana': 20700, 'ben': 10984, 'dee': 45999, 'eli': 52899}{'ana': 20700, 'ben': 10984, 'dee': 45999, 'eli': 52899}Passed
partial-repair probe 3{'ana': 11268, 'ben': 16984}{'ana': 11268, 'ben': 16984}Passed
normal control 4{'eli': 895}{'eli': 895}Passed
normal control 5{}{}Passed
normal control 6{}{}Passed
normal control 7{}{}Passed

SHA-256 / 55bdabe8e157ecfbd5a32fc3cb47e01b3ac10be72699035a120e29a6071e9c32

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.901949+00:00.

Case digest / a55947bbed63cf659d559bfb3bcf57a9cfd1917110a42a8926189397f9ed5745