FAILURE MAP
← Case archive

FA-62741 / Tax bracket computation / Open access

All taxable income is taxed at the parent's rate once there is any net unearned income · case 01

A child with 2601 of unearned income and wages pays the parent's rate on everything.

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

ROOT CAUSE

The parent-rate portion switches to the whole taxable income instead of min(net unearned, taxable).

VERIFIED REPAIR

Tax only min(net unearned, taxable) at the parent's rate.

Unsuccessful approach: Using gross unearned income instead of net unearned income still over-applies 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 - 2600)
    at_parent = taxable if net_unearned > 0 else 0
    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-portion 1', (20000, 5000, '24'), 137600), ('regression parent-portion 2', (0, 5000, '32'), 89800),
  ('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-portion 1', (3000, 3000, '35'), 35500),
  ('regression parent-portion 2', (0, 60000, '37'), 2136800), ('partial repair guard 1', (0, 2000, '32'), 7000),
  ('control: earned only', (8000, 0, '22'), 0), ('control: unearned only', (0, 5000, '32'), 89800),
  ('control: working teen', (20000, 5000, '24'), 137600)],
 [('regression parent-portion 1', (8000, 5662, '22'), 88864),
  ('regression parent-portion 2', (1000, 60000, '22'), 1284300), ('partial repair guard 1', (0, 60000, '37'), 2136800),
  ('partial repair guard 2', (0, 2600, '22'), 13000), ('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-portion 1', (3000, 5000, '32'), 98300),
  ('regression parent-portion 2', (8000, 5000, '24'), 79100), ('partial repair guard 1', (8000, 5662, '22'), 88864),
  ('partial repair guard 2', (1000, 60000, '22'), 1284300), ('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-portion 1', (20000, 5000, '35'), 164000), ('regression parent-portion 2', (0, 5000, '22'), 65800),
  ('partial repair guard 1', (3000, 5000, '32'), 98300), ('partial repair guard 2', (3000, 1300, '24'), 8500),
  ('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 fixtureActualExpectedOutcome
regression parent-portion 1249600137600Failed
regression parent-portion 211840089800Failed
control: below threshold70007000Passed
control: mixed small8925035500Failed
control: large trust income21719002136800Failed
control: earned only00Passed

SHA-256 / ce8911ad7cde5861ddde0270720a8654ca076fc735527cd1088b5f770adb84c3

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 - 2600)
    at_parent = min(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-portion 1', (20000, 5000, '24'), 137600), ('regression parent-portion 2', (0, 5000, '32'), 89800),
  ('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-portion 1', (3000, 3000, '35'), 35500),
  ('regression parent-portion 2', (0, 60000, '37'), 2136800), ('partial repair guard 1', (0, 2000, '32'), 7000),
  ('control: earned only', (8000, 0, '22'), 0), ('control: unearned only', (0, 5000, '32'), 89800),
  ('control: working teen', (20000, 5000, '24'), 137600)],
 [('regression parent-portion 1', (8000, 5662, '22'), 88864),
  ('regression parent-portion 2', (1000, 60000, '22'), 1284300), ('partial repair guard 1', (0, 60000, '37'), 2136800),
  ('partial repair guard 2', (0, 2600, '22'), 13000), ('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-portion 1', (3000, 5000, '32'), 98300),
  ('regression parent-portion 2', (8000, 5000, '24'), 79100), ('partial repair guard 1', (8000, 5662, '22'), 88864),
  ('partial repair guard 2', (1000, 60000, '22'), 1284300), ('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-portion 1', (20000, 5000, '35'), 164000), ('regression parent-portion 2', (0, 5000, '22'), 65800),
  ('partial repair guard 1', (3000, 5000, '32'), 98300), ('partial repair guard 2', (3000, 1300, '24'), 8500),
  ('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 fixtureActualExpectedOutcome
regression parent-portion 1174000137600Failed
regression parent-portion 211840089800Failed
control: below threshold224007000Failed
control: mixed small8925035500Failed
control: large trust income21719002136800Failed
control: earned only00Passed

SHA-256 / e66fe9ebd8895f0ece00951af99661e20f2757de027dd19d248f054b8f2297de

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-portion 1', (20000, 5000, '24'), 137600), ('regression parent-portion 2', (0, 5000, '32'), 89800),
  ('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-portion 1', (3000, 3000, '35'), 35500),
  ('regression parent-portion 2', (0, 60000, '37'), 2136800), ('partial repair guard 1', (0, 2000, '32'), 7000),
  ('control: earned only', (8000, 0, '22'), 0), ('control: unearned only', (0, 5000, '32'), 89800),
  ('control: working teen', (20000, 5000, '24'), 137600)],
 [('regression parent-portion 1', (8000, 5662, '22'), 88864),
  ('regression parent-portion 2', (1000, 60000, '22'), 1284300), ('partial repair guard 1', (0, 60000, '37'), 2136800),
  ('partial repair guard 2', (0, 2600, '22'), 13000), ('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-portion 1', (3000, 5000, '32'), 98300),
  ('regression parent-portion 2', (8000, 5000, '24'), 79100), ('partial repair guard 1', (8000, 5662, '22'), 88864),
  ('partial repair guard 2', (1000, 60000, '22'), 1284300), ('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-portion 1', (20000, 5000, '35'), 164000), ('regression parent-portion 2', (0, 5000, '22'), 65800),
  ('partial repair guard 1', (3000, 5000, '32'), 98300), ('partial repair guard 2', (3000, 1300, '24'), 8500),
  ('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 fixtureActualExpectedOutcome
regression parent-portion 1137600137600Passed
regression parent-portion 28980089800Passed
control: below threshold70007000Passed
control: mixed small3550035500Passed
control: large trust income21368002136800Passed
control: earned only00Passed

SHA-256 / fd86f231ccf2eeb8f253df7f413de2cc1fa2204123c6d4e774b93837a1e0c09e

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

Case digest / be9f5e1d8f990b99521f32b0b83470562e2c37bcc88497129dfd2521a3d4473f