FA-59261 / Payroll withholding rules / Open access
Daily, weekly and seventh-day overtime split: daily overtime window · case 01
Very long days count hours past twelve as both overtime and double time.
ROOT CAUSE
The 1.5x window is not capped at twelve hours.
VERIFIED REPAIR
Restore the contract rule at the daily overtime window step: use `d_ot = max(0, min(h, 12) - 8)`.
Unsuccessful approach: The attempt removes all 1.5x hours on days over twelve hours.
Case contract
Input seven daily hour counts (workweek order). If all seven days are worked, day 7 hours are 1.5x up to 8 and double beyond 8. Other days: first 8 regular, 8-12 at 1.5x, over 12 double; regular hours beyond a weekly total of 40 regular hours become 1.5x. Return [regular, overtime, double].
Why this case matters
Stacked daily and weekly overtime rules must not double count hours or miss the seventh consecutive day.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
hours = x
reg = ot = dt = 0
worked_all = all(h > 0 for h in hours)
for i, h in enumerate(hours):
if i == 6 and worked_all:
ot += min(h, 8)
dt += max(0, h - 8)
continue
d_reg = min(h, 8)
d_ot = max(0, h - 8)
d_dt = max(0, h - 12)
room = max(0, 40 - reg)
if d_reg > room:
d_ot += d_reg - room
d_reg = room
reg += d_reg
ot += d_ot
dt += d_dt
return [reg, ot, dt]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression (boundary)', [0, 0, 0, 0, 0, 0, 13], [8, 4, 1]), ('regression', [8, 7, 14, 0, 12, 0, 8], [39, 8, 2]), ('partial-repair probe', [14, 9, 8, 7, 0, 12, 0], [39, 9, 2]), ('partial-repair probe', [12, 0, 8, 0, 12, 0, 13], [32, 12, 1]), ('boundary control', [8, 8, 8, 8, 8, 8, 8], [40, 16, 0]), ('boundary control', [10, 10, 10, 10, 10, 0, 0], [40, 10, 0]), ('normal control', [12, 12, 8, 7, 0, 8, 0], [39, 8, 0]), ('normal control', [6, 8, 9, 0, 8, 3, 8], [40, 2, 0]), ('normal control', [0, 12, 10, 8, 8, 12, 0], [40, 10, 0]), ('normal control', [10, 8, 6, 12, 9, 10, 0], [40, 15, 0])], [('regression', [8, 7, 14, 0, 12, 0, 8], [39, 8, 2]), ('regression', [14, 9, 8, 7, 0, 12, 0], [39, 9, 2]), ('partial-repair probe', [12, 0, 8, 0, 12, 0, 13], [32, 12, 1]), ('partial-repair probe', [14, 10, 12, 6, 12, 0, 0], [38, 14, 2]), ('boundary control', [8, 8, 8, 8, 8, 8, 8], [40, 16, 0]), ('boundary control', [10, 10, 10, 10, 10, 0, 0], [40, 10, 0]), ('normal control', [12, 8, 3, 0, 12, 4, 12], [39, 12, 0]), ('normal control', [0, 0, 0, 8, 0, 0, 8], [16, 0, 0]), ('normal control', [8, 2, 8, 0, 12, 9, 7], [40, 6, 0]), ('normal control', [9, 8, 8, 0, 12, 8, 12], [40, 17, 0])], [('regression', [14, 9, 8, 7, 0, 12, 0], [39, 9, 2]), ('regression', [12, 0, 8, 0, 12, 0, 13], [32, 12, 1]), ('partial-repair probe', [14, 10, 12, 6, 12, 0, 0], [38, 14, 2]), ('partial-repair probe', [8, 8, 7, 8, 0, 14, 6], [40, 9, 2]), ('boundary control', [8, 8, 8, 8, 8, 8, 8], [40, 16, 0]), ('boundary control', [10, 10, 10, 10, 10, 0, 0], [40, 10, 0]), ('normal control', [0, 8, 0, 1, 6, 7, 6], [28, 0, 0]), ('normal control', [0, 8, 0, 6, 0, 0, 12], [22, 4, 0]), ('normal control', [0, 0, 0, 7, 10, 8, 0], [23, 2, 0]), ('normal control', [8, 8, 5, 0, 0, 10, 0], [29, 2, 0])], [('regression', [12, 0, 8, 0, 12, 0, 13], [32, 12, 1]), ('regression', [14, 10, 12, 6, 12, 0, 0], [38, 14, 2]), ('partial-repair probe', [13, 8, 0, 0, 12, 14, 8], [40, 12, 3]), ('partial-repair probe', [12, 9, 0, 0, 0, 12, 14], [32, 13, 2]), ('boundary control', [8, 8, 8, 8, 8, 8, 8], [40, 16, 0]), ('boundary control', [10, 10, 10, 10, 10, 0, 0], [40, 10, 0]), ('normal control', [0, 7, 12, 8, 0, 7, 0], [30, 4, 0]), ('normal control', [0, 4, 4, 9, 8, 8, 0], [32, 1, 0]), ('normal control', [0, 10, 12, 8, 10, 12, 9], [40, 21, 0]), ('normal control', [0, 12, 0, 0, 10, 8, 0], [24, 6, 0])], [('regression', [14, 10, 12, 6, 12, 0, 0], [38, 14, 2]), ('regression', [8, 8, 7, 8, 0, 14, 6], [40, 9, 2]), ('partial-repair probe', [0, 12, 0, 12, 12, 0, 14], [32, 16, 2]), ('partial-repair probe', [12, 6, 0, 14, 0, 7, 0], [29, 8, 2]), ('boundary control', [8, 8, 8, 8, 8, 8, 8], [40, 16, 0]), ('boundary control', [10, 10, 10, 10, 10, 0, 0], [40, 10, 0]), ('normal control', [0, 0, 12, 12, 0, 12, 12], [32, 16, 0]), ('normal control', [0, 0, 7, 0, 6, 8, 12], [29, 4, 0]), ('normal control', [12, 7, 12, 0, 8, 8, 0], [39, 8, 0]), ('normal control', [0, 12, 8, 0, 7, 0, 8], [31, 4, 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 (boundary) 0 | [8, 5, 1] | [8, 4, 1] | Failed |
| regression 1 | [39, 10, 2] | [39, 8, 2] | Failed |
| partial-repair probe 2 | [39, 11, 2] | [39, 9, 2] | Failed |
| partial-repair probe 3 | [32, 13, 1] | [32, 12, 1] | Failed |
| boundary control 4 | [40, 16, 0] | [40, 16, 0] | Passed |
| boundary control 5 | [40, 10, 0] | [40, 10, 0] | Passed |
| normal control 6 | [39, 8, 0] | [39, 8, 0] | Passed |
| normal control 7 | [40, 2, 0] | [40, 2, 0] | Passed |
| normal control 8 | [40, 10, 0] | [40, 10, 0] | Passed |
| normal control 9 | [40, 15, 0] | [40, 15, 0] | Passed |
SHA-256 / 9bd2b5d09f6b8a39354530d37b96b76d7f58a8793f416b398a5aa9569e80f42c
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
hours = x
reg = ot = dt = 0
worked_all = all(h > 0 for h in hours)
for i, h in enumerate(hours):
if i == 6 and worked_all:
ot += min(h, 8)
dt += max(0, h - 8)
continue
d_reg = min(h, 8)
d_ot = max(0, min(h, 12) - 8) if h <= 12 else 0
d_dt = max(0, h - 12)
room = max(0, 40 - reg)
if d_reg > room:
d_ot += d_reg - room
d_reg = room
reg += d_reg
ot += d_ot
dt += d_dt
return [reg, ot, dt]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression (boundary)', [0, 0, 0, 0, 0, 0, 13], [8, 4, 1]), ('regression', [8, 7, 14, 0, 12, 0, 8], [39, 8, 2]), ('partial-repair probe', [14, 9, 8, 7, 0, 12, 0], [39, 9, 2]), ('partial-repair probe', [12, 0, 8, 0, 12, 0, 13], [32, 12, 1]), ('boundary control', [8, 8, 8, 8, 8, 8, 8], [40, 16, 0]), ('boundary control', [10, 10, 10, 10, 10, 0, 0], [40, 10, 0]), ('normal control', [12, 12, 8, 7, 0, 8, 0], [39, 8, 0]), ('normal control', [6, 8, 9, 0, 8, 3, 8], [40, 2, 0]), ('normal control', [0, 12, 10, 8, 8, 12, 0], [40, 10, 0]), ('normal control', [10, 8, 6, 12, 9, 10, 0], [40, 15, 0])], [('regression', [8, 7, 14, 0, 12, 0, 8], [39, 8, 2]), ('regression', [14, 9, 8, 7, 0, 12, 0], [39, 9, 2]), ('partial-repair probe', [12, 0, 8, 0, 12, 0, 13], [32, 12, 1]), ('partial-repair probe', [14, 10, 12, 6, 12, 0, 0], [38, 14, 2]), ('boundary control', [8, 8, 8, 8, 8, 8, 8], [40, 16, 0]), ('boundary control', [10, 10, 10, 10, 10, 0, 0], [40, 10, 0]), ('normal control', [12, 8, 3, 0, 12, 4, 12], [39, 12, 0]), ('normal control', [0, 0, 0, 8, 0, 0, 8], [16, 0, 0]), ('normal control', [8, 2, 8, 0, 12, 9, 7], [40, 6, 0]), ('normal control', [9, 8, 8, 0, 12, 8, 12], [40, 17, 0])], [('regression', [14, 9, 8, 7, 0, 12, 0], [39, 9, 2]), ('regression', [12, 0, 8, 0, 12, 0, 13], [32, 12, 1]), ('partial-repair probe', [14, 10, 12, 6, 12, 0, 0], [38, 14, 2]), ('partial-repair probe', [8, 8, 7, 8, 0, 14, 6], [40, 9, 2]), ('boundary control', [8, 8, 8, 8, 8, 8, 8], [40, 16, 0]), ('boundary control', [10, 10, 10, 10, 10, 0, 0], [40, 10, 0]), ('normal control', [0, 8, 0, 1, 6, 7, 6], [28, 0, 0]), ('normal control', [0, 8, 0, 6, 0, 0, 12], [22, 4, 0]), ('normal control', [0, 0, 0, 7, 10, 8, 0], [23, 2, 0]), ('normal control', [8, 8, 5, 0, 0, 10, 0], [29, 2, 0])], [('regression', [12, 0, 8, 0, 12, 0, 13], [32, 12, 1]), ('regression', [14, 10, 12, 6, 12, 0, 0], [38, 14, 2]), ('partial-repair probe', [13, 8, 0, 0, 12, 14, 8], [40, 12, 3]), ('partial-repair probe', [12, 9, 0, 0, 0, 12, 14], [32, 13, 2]), ('boundary control', [8, 8, 8, 8, 8, 8, 8], [40, 16, 0]), ('boundary control', [10, 10, 10, 10, 10, 0, 0], [40, 10, 0]), ('normal control', [0, 7, 12, 8, 0, 7, 0], [30, 4, 0]), ('normal control', [0, 4, 4, 9, 8, 8, 0], [32, 1, 0]), ('normal control', [0, 10, 12, 8, 10, 12, 9], [40, 21, 0]), ('normal control', [0, 12, 0, 0, 10, 8, 0], [24, 6, 0])], [('regression', [14, 10, 12, 6, 12, 0, 0], [38, 14, 2]), ('regression', [8, 8, 7, 8, 0, 14, 6], [40, 9, 2]), ('partial-repair probe', [0, 12, 0, 12, 12, 0, 14], [32, 16, 2]), ('partial-repair probe', [12, 6, 0, 14, 0, 7, 0], [29, 8, 2]), ('boundary control', [8, 8, 8, 8, 8, 8, 8], [40, 16, 0]), ('boundary control', [10, 10, 10, 10, 10, 0, 0], [40, 10, 0]), ('normal control', [0, 0, 12, 12, 0, 12, 12], [32, 16, 0]), ('normal control', [0, 0, 7, 0, 6, 8, 12], [29, 4, 0]), ('normal control', [12, 7, 12, 0, 8, 8, 0], [39, 8, 0]), ('normal control', [0, 12, 8, 0, 7, 0, 8], [31, 4, 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 (boundary) 0 | [8, 0, 1] | [8, 4, 1] | Failed |
| regression 1 | [39, 4, 2] | [39, 8, 2] | Failed |
| partial-repair probe 2 | [39, 5, 2] | [39, 9, 2] | Failed |
| partial-repair probe 3 | [32, 8, 1] | [32, 12, 1] | Failed |
| boundary control 4 | [40, 16, 0] | [40, 16, 0] | Passed |
| boundary control 5 | [40, 10, 0] | [40, 10, 0] | Passed |
| normal control 6 | [39, 8, 0] | [39, 8, 0] | Passed |
| normal control 7 | [40, 2, 0] | [40, 2, 0] | Passed |
| normal control 8 | [40, 10, 0] | [40, 10, 0] | Passed |
| normal control 9 | [40, 15, 0] | [40, 15, 0] | Passed |
SHA-256 / 58de8218dc1faa446a749aa637689a1e50a00525fe1b811768845651afce9d80
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
hours = x
reg = ot = dt = 0
worked_all = all(h > 0 for h in hours)
for i, h in enumerate(hours):
if i == 6 and worked_all:
ot += min(h, 8)
dt += max(0, h - 8)
continue
d_reg = min(h, 8)
d_ot = max(0, min(h, 12) - 8)
d_dt = max(0, h - 12)
room = max(0, 40 - reg)
if d_reg > room:
d_ot += d_reg - room
d_reg = room
reg += d_reg
ot += d_ot
dt += d_dt
return [reg, ot, dt]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression (boundary)', [0, 0, 0, 0, 0, 0, 13], [8, 4, 1]), ('regression', [8, 7, 14, 0, 12, 0, 8], [39, 8, 2]), ('partial-repair probe', [14, 9, 8, 7, 0, 12, 0], [39, 9, 2]), ('partial-repair probe', [12, 0, 8, 0, 12, 0, 13], [32, 12, 1]), ('boundary control', [8, 8, 8, 8, 8, 8, 8], [40, 16, 0]), ('boundary control', [10, 10, 10, 10, 10, 0, 0], [40, 10, 0]), ('normal control', [12, 12, 8, 7, 0, 8, 0], [39, 8, 0]), ('normal control', [6, 8, 9, 0, 8, 3, 8], [40, 2, 0]), ('normal control', [0, 12, 10, 8, 8, 12, 0], [40, 10, 0]), ('normal control', [10, 8, 6, 12, 9, 10, 0], [40, 15, 0])], [('regression', [8, 7, 14, 0, 12, 0, 8], [39, 8, 2]), ('regression', [14, 9, 8, 7, 0, 12, 0], [39, 9, 2]), ('partial-repair probe', [12, 0, 8, 0, 12, 0, 13], [32, 12, 1]), ('partial-repair probe', [14, 10, 12, 6, 12, 0, 0], [38, 14, 2]), ('boundary control', [8, 8, 8, 8, 8, 8, 8], [40, 16, 0]), ('boundary control', [10, 10, 10, 10, 10, 0, 0], [40, 10, 0]), ('normal control', [12, 8, 3, 0, 12, 4, 12], [39, 12, 0]), ('normal control', [0, 0, 0, 8, 0, 0, 8], [16, 0, 0]), ('normal control', [8, 2, 8, 0, 12, 9, 7], [40, 6, 0]), ('normal control', [9, 8, 8, 0, 12, 8, 12], [40, 17, 0])], [('regression', [14, 9, 8, 7, 0, 12, 0], [39, 9, 2]), ('regression', [12, 0, 8, 0, 12, 0, 13], [32, 12, 1]), ('partial-repair probe', [14, 10, 12, 6, 12, 0, 0], [38, 14, 2]), ('partial-repair probe', [8, 8, 7, 8, 0, 14, 6], [40, 9, 2]), ('boundary control', [8, 8, 8, 8, 8, 8, 8], [40, 16, 0]), ('boundary control', [10, 10, 10, 10, 10, 0, 0], [40, 10, 0]), ('normal control', [0, 8, 0, 1, 6, 7, 6], [28, 0, 0]), ('normal control', [0, 8, 0, 6, 0, 0, 12], [22, 4, 0]), ('normal control', [0, 0, 0, 7, 10, 8, 0], [23, 2, 0]), ('normal control', [8, 8, 5, 0, 0, 10, 0], [29, 2, 0])], [('regression', [12, 0, 8, 0, 12, 0, 13], [32, 12, 1]), ('regression', [14, 10, 12, 6, 12, 0, 0], [38, 14, 2]), ('partial-repair probe', [13, 8, 0, 0, 12, 14, 8], [40, 12, 3]), ('partial-repair probe', [12, 9, 0, 0, 0, 12, 14], [32, 13, 2]), ('boundary control', [8, 8, 8, 8, 8, 8, 8], [40, 16, 0]), ('boundary control', [10, 10, 10, 10, 10, 0, 0], [40, 10, 0]), ('normal control', [0, 7, 12, 8, 0, 7, 0], [30, 4, 0]), ('normal control', [0, 4, 4, 9, 8, 8, 0], [32, 1, 0]), ('normal control', [0, 10, 12, 8, 10, 12, 9], [40, 21, 0]), ('normal control', [0, 12, 0, 0, 10, 8, 0], [24, 6, 0])], [('regression', [14, 10, 12, 6, 12, 0, 0], [38, 14, 2]), ('regression', [8, 8, 7, 8, 0, 14, 6], [40, 9, 2]), ('partial-repair probe', [0, 12, 0, 12, 12, 0, 14], [32, 16, 2]), ('partial-repair probe', [12, 6, 0, 14, 0, 7, 0], [29, 8, 2]), ('boundary control', [8, 8, 8, 8, 8, 8, 8], [40, 16, 0]), ('boundary control', [10, 10, 10, 10, 10, 0, 0], [40, 10, 0]), ('normal control', [0, 0, 12, 12, 0, 12, 12], [32, 16, 0]), ('normal control', [0, 0, 7, 0, 6, 8, 12], [29, 4, 0]), ('normal control', [12, 7, 12, 0, 8, 8, 0], [39, 8, 0]), ('normal control', [0, 12, 8, 0, 7, 0, 8], [31, 4, 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 (boundary) 0 | [8, 4, 1] | [8, 4, 1] | Passed |
| regression 1 | [39, 8, 2] | [39, 8, 2] | Passed |
| partial-repair probe 2 | [39, 9, 2] | [39, 9, 2] | Passed |
| partial-repair probe 3 | [32, 12, 1] | [32, 12, 1] | Passed |
| boundary control 4 | [40, 16, 0] | [40, 16, 0] | Passed |
| boundary control 5 | [40, 10, 0] | [40, 10, 0] | Passed |
| normal control 6 | [39, 8, 0] | [39, 8, 0] | Passed |
| normal control 7 | [40, 2, 0] | [40, 2, 0] | Passed |
| normal control 8 | [40, 10, 0] | [40, 10, 0] | Passed |
| normal control 9 | [40, 15, 0] | [40, 15, 0] | Passed |
SHA-256 / e1c07f31d47d5cb4810c0e2b6e8f910da5ab4b71a46c50f5b058ebf651865ad4
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.552279+00:00.
Case digest / 0c8715d6a98dc0e35c96a4118e0281c7d3a95e2a519ac404d8050c118175dc35