FA-62726 / Tax bracket computation / Open access
Unearned income above the first deduction tier is taxed at the parent's rate · case 01
Unearned income between 1300 and 2600 is taxed at the parent's rate instead of the child's.
ROOT CAUSE
Net unearned income is measured over 1300 instead of 2600.
VERIFIED REPAIR
Only unearned income above 2600 is net unearned income.
Unsuccessful approach: Updating the threshold to a stale prior-year figure of 2500 still pulls 100 of unearned income into the parent's rate.
Case contract
solve(earned, unearned, parent_rate): stipulated child unearned-income rule, whole dollars. Standard deduction = min(14600, max(1300, earned + 450)); taxable = max(0, earned + unearned - std). Net unearned income = max(0, unearned - 2600); the part of taxable income taxed at the parent's rate (percent string) is min(net unearned, taxable); the rest is taxed at 10%. Return integer cents half-up.
Why this case matters
Tax computations hinge on which slice, threshold, ordering and rounding rule applies at each step; a misplaced boundary silently misstates liabilities.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(earned, unearned, parent_rate):
def prog(x, br):
tax, lower = Fraction(0), 0
for upper, rate in br:
top = x if upper is None else min(x, upper)
if top > lower: tax += (top - lower) * Fraction(rate) / 100
if upper is None or x <= upper: break
lower = upper
return tax
def cents(v):
v = v * 100
return int(v + Fraction(1, 2)) if v >= 0 else -int(-v + Fraction(1, 2))
std = min(14600, max(1300, earned + 450))
taxable = max(0, earned + unearned - std)
net_unearned = max(0, unearned - 1300)
at_parent = min(net_unearned, taxable)
tax = at_parent * Fraction(parent_rate) / 100 + (taxable - at_parent) * Fraction(10, 100)
return cents(tax)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression parent-rate-threshold 1', (0, 5000, '32'), 89800),
('regression parent-rate-threshold 2', (20000, 5000, '24'), 137600),
('control: below threshold', (0, 2000, '32'), 7000), ('control: mixed small', (3000, 3000, '35'), 35500),
('control: large trust income', (0, 60000, '37'), 2136800), ('control: earned only', (8000, 0, '22'), 0)],
[('regression parent-rate-threshold 1', (0, 2000, '32'), 7000),
('regression parent-rate-threshold 2', (3000, 3000, '35'), 35500),
('partial repair guard 2', (0, 60000, '37'), 2136800), ('control: earned only', (8000, 0, '22'), 0),
('control: unearned only', (0, 5000, '32'), 89800), ('control: working teen', (20000, 5000, '24'), 137600)],
[('regression parent-rate-threshold 1', (0, 60000, '37'), 2136800),
('regression parent-rate-threshold 2', (0, 2600, '22'), 13000), ('partial repair guard 2', (8000, 5662, '22'), 88864),
('control: unearned only', (0, 5000, '32'), 89800), ('control: below threshold', (0, 2000, '32'), 7000),
('control: working teen', (20000, 5000, '24'), 137600), ('control: mixed small', (3000, 3000, '35'), 35500)],
[('regression parent-rate-threshold 1', (8000, 5662, '22'), 88864),
('regression parent-rate-threshold 2', (1000, 60000, '22'), 1284300),
('partial repair guard 2', (3000, 5000, '32'), 98300), ('control: mixed small', (3000, 3000, '35'), 35500),
('control: large trust income', (0, 60000, '37'), 2136800), ('control: earned only', (8000, 0, '22'), 0),
('control: unearned only', (0, 5000, '32'), 89800)],
[('regression parent-rate-threshold 1', (3000, 5000, '32'), 98300),
('regression parent-rate-threshold 2', (8000, 5000, '24'), 79100),
('partial repair guard 2', (20000, 5000, '35'), 164000), ('control: unearned only', (0, 5000, '32'), 89800),
('control: below threshold', (0, 2000, '32'), 7000), ('control: working teen', (20000, 5000, '24'), 137600),
('control: mixed small', (3000, 3000, '35'), 35500)]]
for label, args, expected in cases[N - 1]:
check(label, 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 parent-rate-threshold 1 | 118400 | 89800 | Failed |
| regression parent-rate-threshold 2 | 155800 | 137600 | Failed |
| control: below threshold | 22400 | 7000 | Failed |
| control: mixed small | 68000 | 35500 | Failed |
| control: large trust income | 2171900 | 2136800 | Failed |
| control: earned only | 0 | 0 | Passed |
SHA-256 / 86aece53923644c4200b8f2345b2add31c44628103498320a87e3b465c4f6393
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(earned, unearned, parent_rate):
def prog(x, br):
tax, lower = Fraction(0), 0
for upper, rate in br:
top = x if upper is None else min(x, upper)
if top > lower: tax += (top - lower) * Fraction(rate) / 100
if upper is None or x <= upper: break
lower = upper
return tax
def cents(v):
v = v * 100
return int(v + Fraction(1, 2)) if v >= 0 else -int(-v + Fraction(1, 2))
std = min(14600, max(1300, earned + 450))
taxable = max(0, earned + unearned - std)
net_unearned = max(0, unearned - 2500)
at_parent = min(net_unearned, taxable)
tax = at_parent * Fraction(parent_rate) / 100 + (taxable - at_parent) * Fraction(10, 100)
return cents(tax)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression parent-rate-threshold 1', (0, 5000, '32'), 89800),
('regression parent-rate-threshold 2', (20000, 5000, '24'), 137600),
('control: below threshold', (0, 2000, '32'), 7000), ('control: mixed small', (3000, 3000, '35'), 35500),
('control: large trust income', (0, 60000, '37'), 2136800), ('control: earned only', (8000, 0, '22'), 0)],
[('regression parent-rate-threshold 1', (0, 2000, '32'), 7000),
('regression parent-rate-threshold 2', (3000, 3000, '35'), 35500),
('partial repair guard 2', (0, 60000, '37'), 2136800), ('control: earned only', (8000, 0, '22'), 0),
('control: unearned only', (0, 5000, '32'), 89800), ('control: working teen', (20000, 5000, '24'), 137600)],
[('regression parent-rate-threshold 1', (0, 60000, '37'), 2136800),
('regression parent-rate-threshold 2', (0, 2600, '22'), 13000), ('partial repair guard 2', (8000, 5662, '22'), 88864),
('control: unearned only', (0, 5000, '32'), 89800), ('control: below threshold', (0, 2000, '32'), 7000),
('control: working teen', (20000, 5000, '24'), 137600), ('control: mixed small', (3000, 3000, '35'), 35500)],
[('regression parent-rate-threshold 1', (8000, 5662, '22'), 88864),
('regression parent-rate-threshold 2', (1000, 60000, '22'), 1284300),
('partial repair guard 2', (3000, 5000, '32'), 98300), ('control: mixed small', (3000, 3000, '35'), 35500),
('control: large trust income', (0, 60000, '37'), 2136800), ('control: earned only', (8000, 0, '22'), 0),
('control: unearned only', (0, 5000, '32'), 89800)],
[('regression parent-rate-threshold 1', (3000, 5000, '32'), 98300),
('regression parent-rate-threshold 2', (8000, 5000, '24'), 79100),
('partial repair guard 2', (20000, 5000, '35'), 164000), ('control: unearned only', (0, 5000, '32'), 89800),
('control: below threshold', (0, 2000, '32'), 7000), ('control: working teen', (20000, 5000, '24'), 137600),
('control: mixed small', (3000, 3000, '35'), 35500)]]
for label, args, expected in cases[N - 1]:
check(label, 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 parent-rate-threshold 1 | 92000 | 89800 | Failed |
| regression parent-rate-threshold 2 | 139000 | 137600 | Failed |
| control: below threshold | 7000 | 7000 | Passed |
| control: mixed small | 38000 | 35500 | Failed |
| control: large trust income | 2139500 | 2136800 | Failed |
| control: earned only | 0 | 0 | Passed |
SHA-256 / b1055b3988a3fa20d29b5845f9dd6d2c76b0d22bc6513594d976cb8aaf5a1872
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(earned, unearned, parent_rate):
def prog(x, br):
tax, lower = Fraction(0), 0
for upper, rate in br:
top = x if upper is None else min(x, upper)
if top > lower: tax += (top - lower) * Fraction(rate) / 100
if upper is None or x <= upper: break
lower = upper
return tax
def cents(v):
v = v * 100
return int(v + Fraction(1, 2)) if v >= 0 else -int(-v + Fraction(1, 2))
std = min(14600, max(1300, earned + 450))
taxable = max(0, earned + unearned - std)
net_unearned = max(0, unearned - 2600)
at_parent = min(net_unearned, taxable)
tax = at_parent * Fraction(parent_rate) / 100 + (taxable - at_parent) * Fraction(10, 100)
return cents(tax)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression parent-rate-threshold 1', (0, 5000, '32'), 89800),
('regression parent-rate-threshold 2', (20000, 5000, '24'), 137600),
('control: below threshold', (0, 2000, '32'), 7000), ('control: mixed small', (3000, 3000, '35'), 35500),
('control: large trust income', (0, 60000, '37'), 2136800), ('control: earned only', (8000, 0, '22'), 0)],
[('regression parent-rate-threshold 1', (0, 2000, '32'), 7000),
('regression parent-rate-threshold 2', (3000, 3000, '35'), 35500),
('partial repair guard 2', (0, 60000, '37'), 2136800), ('control: earned only', (8000, 0, '22'), 0),
('control: unearned only', (0, 5000, '32'), 89800), ('control: working teen', (20000, 5000, '24'), 137600)],
[('regression parent-rate-threshold 1', (0, 60000, '37'), 2136800),
('regression parent-rate-threshold 2', (0, 2600, '22'), 13000), ('partial repair guard 2', (8000, 5662, '22'), 88864),
('control: unearned only', (0, 5000, '32'), 89800), ('control: below threshold', (0, 2000, '32'), 7000),
('control: working teen', (20000, 5000, '24'), 137600), ('control: mixed small', (3000, 3000, '35'), 35500)],
[('regression parent-rate-threshold 1', (8000, 5662, '22'), 88864),
('regression parent-rate-threshold 2', (1000, 60000, '22'), 1284300),
('partial repair guard 2', (3000, 5000, '32'), 98300), ('control: mixed small', (3000, 3000, '35'), 35500),
('control: large trust income', (0, 60000, '37'), 2136800), ('control: earned only', (8000, 0, '22'), 0),
('control: unearned only', (0, 5000, '32'), 89800)],
[('regression parent-rate-threshold 1', (3000, 5000, '32'), 98300),
('regression parent-rate-threshold 2', (8000, 5000, '24'), 79100),
('partial repair guard 2', (20000, 5000, '35'), 164000), ('control: unearned only', (0, 5000, '32'), 89800),
('control: below threshold', (0, 2000, '32'), 7000), ('control: working teen', (20000, 5000, '24'), 137600),
('control: mixed small', (3000, 3000, '35'), 35500)]]
for label, args, expected in cases[N - 1]:
check(label, 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 parent-rate-threshold 1 | 89800 | 89800 | Passed |
| regression parent-rate-threshold 2 | 137600 | 137600 | Passed |
| control: below threshold | 7000 | 7000 | Passed |
| control: mixed small | 35500 | 35500 | Passed |
| control: large trust income | 2136800 | 2136800 | Passed |
| control: earned only | 0 | 0 | Passed |
SHA-256 / 98e032614e8d9f75d0fc12df5ec7a60feafdcec0dbc7d370b8626a45771f1721
Verification & scope
A deterministic, bounded teaching model with a stipulated toy contract; it makes no claim of conformance to any real regulation, standard, or institution's rules. 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:47:07.328365+00:00.
Case digest / 62618c2159952be63a8953b0d524912000c2d714b002c7fc0fca369b0b040d26