FAILURE MAP
← Case archive

FA-58976 / Payroll withholding rules / Open access

Tip credit and minimum-wage makeup: tip credit cap · case 01

Employees with a very low cash rate have more tip credit claimed than the jurisdiction maximum.

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

ROOT CAUSE

The credit per hour is the full gap to minimum wage without applying the maximum credit cap.

THE FAILURE

The credit per hour is the full gap to minimum wage without applying the maximum credit cap.

Unsuccessful approach: The attempt always claims the maximum credit, even when the cash rate leaves a smaller gap.

Case contract

Input weekly {hours, cash_rate, tips, min_wage (even cents), tip_credit_max}. Tip credit per hour = max(0, min(min_wage - cash_rate, tip_credit_max)). Hours over 40 are paid at 1.5*min_wage minus the same credit. Credit actually taken = min(tips, hours*credit); the unmet credit is paid as makeup. Return [cash_wages, makeup].

Why this case matters

Tip credits are capped by tips actually received and do not grow on overtime hours.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    h = x['hours']
    mw = x['min_wage']
    cash = x['cash_rate']
    reg = min(h, 40)
    ot = max(0, h - 40)
    credit_rate = max(0, mw - cash)
    credit_total = min(x['tips'], h * credit_rate)
    makeup = h * credit_rate - credit_total
    cash_wages = reg * (mw - credit_rate) + ot * (mw * 3 // 2 - credit_rate) + makeup
    return [cash_wages, makeup]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression', {'hours': 42, 'cash_rate': 300, 'tips': 0, 'min_wage': 1600, 'tip_credit_max': 800}, [68800, 33600]), ('regression', {'hours': 21, 'cash_rate': 500, 'tips': 46641, 'min_wage': 1200, 'tip_credit_max': 512}, [14448, 0]), ('partial-repair probe', {'hours': 47, 'cash_rate': 1200, 'tips': 1983, 'min_wage': 1200, 'tip_credit_max': 300}, [60600, 0]), ('partial-repair probe', {'hours': 23, 'cash_rate': 776, 'tips': 1403, 'min_wage': 726, 'tip_credit_max': 800}, [16698, 0]), ('normal control', {'hours': 0, 'cash_rate': 500, 'tips': 17501, 'min_wage': 1600, 'tip_credit_max': 300}, [0, 0]), ('normal control', {'hours': 0, 'cash_rate': 213, 'tips': 48885, 'min_wage': 1000, 'tip_credit_max': 800}, [0, 0]), ('normal control', {'hours': 0, 'cash_rate': 1600, 'tips': 15944, 'min_wage': 1600, 'tip_credit_max': 800}, [0, 0]), ('normal control', {'hours': 0, 'cash_rate': 300, 'tips': 2628, 'min_wage': 1600, 'tip_credit_max': 300}, [0, 0])], [('regression', {'hours': 21, 'cash_rate': 500, 'tips': 46641, 'min_wage': 1200, 'tip_credit_max': 512}, [14448, 0]), ('regression', {'hours': 58, 'cash_rate': 300, 'tips': 43606, 'min_wage': 1200, 'tip_credit_max': 300}, [63000, 0]), ('partial-repair probe', {'hours': 27, 'cash_rate': 726, 'tips': 397, 'min_wage': 726, 'tip_credit_max': 300}, [19602, 0]), ('partial-repair probe', {'hours': 40, 'cash_rate': 1600, 'tips': 1562, 'min_wage': 1600, 'tip_credit_max': 300}, [64000, 0]), ('normal control', {'hours': 0, 'cash_rate': 300, 'tips': 2732, 'min_wage': 1600, 'tip_credit_max': 512}, [0, 0]), ('normal control', {'hours': 0, 'cash_rate': 500, 'tips': 17501, 'min_wage': 1600, 'tip_credit_max': 300}, [0, 0]), ('normal control', {'hours': 0, 'cash_rate': 213, 'tips': 48885, 'min_wage': 1000, 'tip_credit_max': 800}, [0, 0]), ('normal control', {'hours': 0, 'cash_rate': 1600, 'tips': 15944, 'min_wage': 1600, 'tip_credit_max': 800}, [0, 0])], [('regression', {'hours': 58, 'cash_rate': 300, 'tips': 43606, 'min_wage': 1200, 'tip_credit_max': 300}, [63000, 0]), ('regression', {'hours': 52, 'cash_rate': 213, 'tips': 42918, 'min_wage': 1200, 'tip_credit_max': 300}, [54000, 0]), ('partial-repair probe', {'hours': 19, 'cash_rate': 300, 'tips': 3831, 'min_wage': 726, 'tip_credit_max': 512}, [9963, 4263]), ('partial-repair probe', {'hours': 56, 'cash_rate': 213, 'tips': 464, 'min_wage': 1000, 'tip_credit_max': 800}, [63536, 43608]), ('normal control', {'hours': 0, 'cash_rate': 300, 'tips': 2628, 'min_wage': 1600, 'tip_credit_max': 300}, [0, 0]), ('normal control', {'hours': 0, 'cash_rate': 300, 'tips': 2732, 'min_wage': 1600, 'tip_credit_max': 512}, [0, 0]), ('normal control', {'hours': 0, 'cash_rate': 500, 'tips': 17501, 'min_wage': 1600, 'tip_credit_max': 300}, [0, 0]), ('normal control', {'hours': 0, 'cash_rate': 213, 'tips': 48885, 'min_wage': 1000, 'tip_credit_max': 800}, [0, 0])], [('regression', {'hours': 52, 'cash_rate': 213, 'tips': 42918, 'min_wage': 1200, 'tip_credit_max': 300}, [54000, 0]), ('regression', {'hours': 40, 'cash_rate': 213, 'tips': 0, 'min_wage': 1000, 'tip_credit_max': 300}, [40000, 12000]), ('partial-repair probe', {'hours': 22, 'cash_rate': 1200, 'tips': 48563, 'min_wage': 1200, 'tip_credit_max': 300}, [26400, 0]), ('partial-repair probe', {'hours': 52, 'cash_rate': 300, 'tips': 13052, 'min_wage': 1000, 'tip_credit_max': 800}, [44948, 23348]), ('normal control', {'hours': 0, 'cash_rate': 1600, 'tips': 15944, 'min_wage': 1600, 'tip_credit_max': 800}, [0, 0]), ('normal control', {'hours': 0, 'cash_rate': 300, 'tips': 2628, 'min_wage': 1600, 'tip_credit_max': 300}, [0, 0]), ('normal control', {'hours': 0, 'cash_rate': 300, 'tips': 2732, 'min_wage': 1600, 'tip_credit_max': 512}, [0, 0]), ('normal control', {'hours': 0, 'cash_rate': 500, 'tips': 17501, 'min_wage': 1600, 'tip_credit_max': 300}, [0, 0])], [('regression', {'hours': 40, 'cash_rate': 213, 'tips': 0, 'min_wage': 1000, 'tip_credit_max': 300}, [40000, 12000]), ('regression', {'hours': 13, 'cash_rate': 300, 'tips': 3600, 'min_wage': 1600, 'tip_credit_max': 512}, [17200, 3056]), ('partial-repair probe', {'hours': 15, 'cash_rate': 300, 'tips': 777, 'min_wage': 726, 'tip_credit_max': 800}, [10113, 5613]), ('partial-repair probe', {'hours': 47, 'cash_rate': 1650, 'tips': 42376, 'min_wage': 1600, 'tip_credit_max': 300}, [80800, 0]), ('normal control', {'hours': 0, 'cash_rate': 213, 'tips': 48885, 'min_wage': 1000, 'tip_credit_max': 800}, [0, 0]), ('normal control', {'hours': 0, 'cash_rate': 1600, 'tips': 15944, 'min_wage': 1600, 'tip_credit_max': 800}, [0, 0]), ('normal control', {'hours': 0, 'cash_rate': 300, 'tips': 2628, 'min_wage': 1600, 'tip_credit_max': 300}, [0, 0]), ('normal control', {'hours': 0, 'cash_rate': 300, 'tips': 2732, 'min_wage': 1600, 'tip_credit_max': 512}, [0, 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 fixtureActualExpectedOutcome
regression 0[68800, 54600][68800, 33600]Failed
regression 1[10500, 0][14448, 0]Failed
partial-repair probe 2[60600, 0][60600, 0]Passed
partial-repair probe 3[16698, 0][16698, 0]Passed
normal control 4[0, 0][0, 0]Passed
normal control 5[0, 0][0, 0]Passed
normal control 6[0, 0][0, 0]Passed
normal control 7[0, 0][0, 0]Passed

SHA-256 / 428a6c1220cee288d47da32d9037fa38dabc22008b4b807660ade6cf927485b0

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    h = x['hours']
    mw = x['min_wage']
    cash = x['cash_rate']
    reg = min(h, 40)
    ot = max(0, h - 40)
    credit_rate = max(0, x['tip_credit_max'])
    credit_total = min(x['tips'], h * credit_rate)
    makeup = h * credit_rate - credit_total
    cash_wages = reg * (mw - credit_rate) + ot * (mw * 3 // 2 - credit_rate) + makeup
    return [cash_wages, makeup]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression', {'hours': 42, 'cash_rate': 300, 'tips': 0, 'min_wage': 1600, 'tip_credit_max': 800}, [68800, 33600]), ('regression', {'hours': 21, 'cash_rate': 500, 'tips': 46641, 'min_wage': 1200, 'tip_credit_max': 512}, [14448, 0]), ('partial-repair probe', {'hours': 47, 'cash_rate': 1200, 'tips': 1983, 'min_wage': 1200, 'tip_credit_max': 300}, [60600, 0]), ('partial-repair probe', {'hours': 23, 'cash_rate': 776, 'tips': 1403, 'min_wage': 726, 'tip_credit_max': 800}, [16698, 0]), ('normal control', {'hours': 0, 'cash_rate': 500, 'tips': 17501, 'min_wage': 1600, 'tip_credit_max': 300}, [0, 0]), ('normal control', {'hours': 0, 'cash_rate': 213, 'tips': 48885, 'min_wage': 1000, 'tip_credit_max': 800}, [0, 0]), ('normal control', {'hours': 0, 'cash_rate': 1600, 'tips': 15944, 'min_wage': 1600, 'tip_credit_max': 800}, [0, 0]), ('normal control', {'hours': 0, 'cash_rate': 300, 'tips': 2628, 'min_wage': 1600, 'tip_credit_max': 300}, [0, 0])], [('regression', {'hours': 21, 'cash_rate': 500, 'tips': 46641, 'min_wage': 1200, 'tip_credit_max': 512}, [14448, 0]), ('regression', {'hours': 58, 'cash_rate': 300, 'tips': 43606, 'min_wage': 1200, 'tip_credit_max': 300}, [63000, 0]), ('partial-repair probe', {'hours': 27, 'cash_rate': 726, 'tips': 397, 'min_wage': 726, 'tip_credit_max': 300}, [19602, 0]), ('partial-repair probe', {'hours': 40, 'cash_rate': 1600, 'tips': 1562, 'min_wage': 1600, 'tip_credit_max': 300}, [64000, 0]), ('normal control', {'hours': 0, 'cash_rate': 300, 'tips': 2732, 'min_wage': 1600, 'tip_credit_max': 512}, [0, 0]), ('normal control', {'hours': 0, 'cash_rate': 500, 'tips': 17501, 'min_wage': 1600, 'tip_credit_max': 300}, [0, 0]), ('normal control', {'hours': 0, 'cash_rate': 213, 'tips': 48885, 'min_wage': 1000, 'tip_credit_max': 800}, [0, 0]), ('normal control', {'hours': 0, 'cash_rate': 1600, 'tips': 15944, 'min_wage': 1600, 'tip_credit_max': 800}, [0, 0])], [('regression', {'hours': 58, 'cash_rate': 300, 'tips': 43606, 'min_wage': 1200, 'tip_credit_max': 300}, [63000, 0]), ('regression', {'hours': 52, 'cash_rate': 213, 'tips': 42918, 'min_wage': 1200, 'tip_credit_max': 300}, [54000, 0]), ('partial-repair probe', {'hours': 19, 'cash_rate': 300, 'tips': 3831, 'min_wage': 726, 'tip_credit_max': 512}, [9963, 4263]), ('partial-repair probe', {'hours': 56, 'cash_rate': 213, 'tips': 464, 'min_wage': 1000, 'tip_credit_max': 800}, [63536, 43608]), ('normal control', {'hours': 0, 'cash_rate': 300, 'tips': 2628, 'min_wage': 1600, 'tip_credit_max': 300}, [0, 0]), ('normal control', {'hours': 0, 'cash_rate': 300, 'tips': 2732, 'min_wage': 1600, 'tip_credit_max': 512}, [0, 0]), ('normal control', {'hours': 0, 'cash_rate': 500, 'tips': 17501, 'min_wage': 1600, 'tip_credit_max': 300}, [0, 0]), ('normal control', {'hours': 0, 'cash_rate': 213, 'tips': 48885, 'min_wage': 1000, 'tip_credit_max': 800}, [0, 0])], [('regression', {'hours': 52, 'cash_rate': 213, 'tips': 42918, 'min_wage': 1200, 'tip_credit_max': 300}, [54000, 0]), ('regression', {'hours': 40, 'cash_rate': 213, 'tips': 0, 'min_wage': 1000, 'tip_credit_max': 300}, [40000, 12000]), ('partial-repair probe', {'hours': 22, 'cash_rate': 1200, 'tips': 48563, 'min_wage': 1200, 'tip_credit_max': 300}, [26400, 0]), ('partial-repair probe', {'hours': 52, 'cash_rate': 300, 'tips': 13052, 'min_wage': 1000, 'tip_credit_max': 800}, [44948, 23348]), ('normal control', {'hours': 0, 'cash_rate': 1600, 'tips': 15944, 'min_wage': 1600, 'tip_credit_max': 800}, [0, 0]), ('normal control', {'hours': 0, 'cash_rate': 300, 'tips': 2628, 'min_wage': 1600, 'tip_credit_max': 300}, [0, 0]), ('normal control', {'hours': 0, 'cash_rate': 300, 'tips': 2732, 'min_wage': 1600, 'tip_credit_max': 512}, [0, 0]), ('normal control', {'hours': 0, 'cash_rate': 500, 'tips': 17501, 'min_wage': 1600, 'tip_credit_max': 300}, [0, 0])], [('regression', {'hours': 40, 'cash_rate': 213, 'tips': 0, 'min_wage': 1000, 'tip_credit_max': 300}, [40000, 12000]), ('regression', {'hours': 13, 'cash_rate': 300, 'tips': 3600, 'min_wage': 1600, 'tip_credit_max': 512}, [17200, 3056]), ('partial-repair probe', {'hours': 15, 'cash_rate': 300, 'tips': 777, 'min_wage': 726, 'tip_credit_max': 800}, [10113, 5613]), ('partial-repair probe', {'hours': 47, 'cash_rate': 1650, 'tips': 42376, 'min_wage': 1600, 'tip_credit_max': 300}, [80800, 0]), ('normal control', {'hours': 0, 'cash_rate': 213, 'tips': 48885, 'min_wage': 1000, 'tip_credit_max': 800}, [0, 0]), ('normal control', {'hours': 0, 'cash_rate': 1600, 'tips': 15944, 'min_wage': 1600, 'tip_credit_max': 800}, [0, 0]), ('normal control', {'hours': 0, 'cash_rate': 300, 'tips': 2628, 'min_wage': 1600, 'tip_credit_max': 300}, [0, 0]), ('normal control', {'hours': 0, 'cash_rate': 300, 'tips': 2732, 'min_wage': 1600, 'tip_credit_max': 512}, [0, 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 fixtureActualExpectedOutcome
regression 0[68800, 33600][68800, 33600]Passed
regression 1[14448, 0][14448, 0]Passed
partial-repair probe 2[58617, 12117][60600, 0]Failed
partial-repair probe 3[15295, 16997][16698, 0]Failed
normal control 4[0, 0][0, 0]Passed
normal control 5[0, 0][0, 0]Passed
normal control 6[0, 0][0, 0]Passed
normal control 7[0, 0][0, 0]Passed

SHA-256 / 17af783dd31200df0417e61b8026d2704780a7bb643c6693f445acde4e449ec0

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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

Case digest / dd9ce6619edbbc3e32fe4c624638ea5b36314d21ee217357b31585aac6042edd