FAILURE MAP
← Case archive

FA-62751 / Tax bracket computation / Open access

The second-tier formula omits the amount included in the first tier · case 01

Income above the second base amount includes less benefit than stipulated.

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

ROOT CAUSE

The upper-tier formula lacks the + min(benefits/2, (b2 - b1)/2) term.

VERIFIED REPAIR

Add the lesser of half the benefits and half the gap between base amounts.

Unsuccessful approach: Adding the full half-gap without comparing to half the benefits over-includes small benefits.

Case contract

solve(agi, exempt_interest, benefits, status): stipulated benefit inclusion. Provisional income PI = agi + exempt_interest + benefits/2. Base amounts (b1, b2): single (25000, 34000), mfj (32000, 44000), mfs (0, 0). If PI <= b1 nothing is included; if PI <= b2, include min(benefits/2, (PI - b1)/2); otherwise include min(0.85*benefits, 0.85*(PI - b2) + min(benefits/2, (b2 - b1)/2)). Return the included amount rounded down to whole dollars.

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(agi, exempt_interest, benefits, status):
    b1, b2 = {'single': (25000, 34000), 'mfj': (32000, 44000), 'mfs': (0, 0)}[status]
    B = Fraction(benefits)
    pi = agi + exempt_interest + B / 2
    if pi <= b1: t = Fraction(0)
    elif pi <= b2: t = min(B / 2, (pi - b1) / 2)
    else: t = min(B * 85 / 100, (pi - b2) * 85 / 100)
    return int(t)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression second-tier-carry 1', (40000, 0, 20000, 'single'), 17000),
  ('regression second-tier-carry 2', (35000, 0, 4000, 'single'), 3400),
  ('partial repair guard 1', (30000, 1000, 8000, 'single'), 4850),
  ('partial repair guard 2', (30775, 1000, 8000, 'single'), 5508),
  ('control: first tier', (20000, 0, 12000, 'single'), 500), ('control: below base', (10000, 0, 10000, 'single'), 0),
  ('control: joint with exempt interest', (30000, 1000, 20000, 'mfj'), 4500),
  ('control: separate filer', (5000, 0, 8000, 'mfs'), 6800)],
 [('regression second-tier-carry 1', (45000, 0, 30934, 'mfj'), 19996),
  ('regression second-tier-carry 2', (30000, 1000, 8000, 'single'), 4850),
  ('partial repair guard 2', (30775, 1000, 8000, 'single'), 5508),
  ('control: joint with exempt interest', (30000, 1000, 20000, 'mfj'), 4500),
  ('control: separate filer', (5000, 0, 8000, 'mfs'), 6800),
  ('control: small benefit first tier', (28000, 0, 2000, 'single'), 1000),
  ('control: large income', (150000, 5000, 40000, 'mfj'), 34000)],
 [('regression second-tier-carry 1', (20000, 1000, 45562, 'single'), 12813),
  ('regression second-tier-carry 2', (30000, 1000, 42192, 'mfj'), 12881),
  ('partial repair guard 1', (30000, 1000, 8000, 'single'), 4850),
  ('partial repair guard 2', (30775, 1000, 8000, 'single'), 5508),
  ('control: large income', (150000, 5000, 40000, 'mfj'), 34000),
  ('control: first tier', (20000, 0, 12000, 'single'), 500),
  ('control: second tier', (40000, 0, 20000, 'single'), 17000),
  ('control: below base', (10000, 0, 10000, 'single'), 0)],
 [('regression second-tier-carry 1', (30000, 0, 20000, 'single'), 9600),
  ('regression second-tier-carry 2', (45000, 1000, 40000, 'single'), 31700),
  ('partial repair guard 1', (30000, 1000, 8000, 'single'), 4850),
  ('partial repair guard 2', (30775, 1000, 8000, 'single'), 5508),
  ('control: below base', (10000, 0, 10000, 'single'), 0),
  ('control: joint with exempt interest', (30000, 1000, 20000, 'mfj'), 4500),
  ('control: separate filer', (5000, 0, 8000, 'mfs'), 6800),
  ('control: small benefit first tier', (28000, 0, 2000, 'single'), 1000)],
 [('regression second-tier-carry 1', (45000, 0, 41916, 'single'), 31664),
  ('regression second-tier-carry 2', (30000, 0, 40000, 'mfj'), 11100),
  ('partial repair guard 1', (30000, 1000, 8000, 'single'), 4850),
  ('partial repair guard 2', (30775, 1000, 8000, 'single'), 5508),
  ('control: small benefit first tier', (28000, 0, 2000, 'single'), 1000),
  ('control: large income', (150000, 5000, 40000, 'mfj'), 34000),
  ('control: first tier', (20000, 0, 12000, 'single'), 500),
  ('control: second tier', (40000, 0, 20000, 'single'), 17000)]]
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 second-tier-carry 11360017000Failed
regression second-tier-carry 225503400Failed
partial repair guard 18504850Failed
partial repair guard 215085508Failed
control: first tier500500Passed
control: below base00Passed
control: joint with exempt interest45004500Passed
control: separate filer68006800Passed

SHA-256 / 44c799e254f55aaa0b8f91cef988150fdf767e8dc25a9ed305f11b5fe8d1e43a

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(agi, exempt_interest, benefits, status):
    b1, b2 = {'single': (25000, 34000), 'mfj': (32000, 44000), 'mfs': (0, 0)}[status]
    B = Fraction(benefits)
    pi = agi + exempt_interest + B / 2
    if pi <= b1: t = Fraction(0)
    elif pi <= b2: t = min(B / 2, (pi - b1) / 2)
    else: t = min(B * 85 / 100, (pi - b2) * 85 / 100 + Fraction(b2 - b1, 2))
    return int(t)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression second-tier-carry 1', (40000, 0, 20000, 'single'), 17000),
  ('regression second-tier-carry 2', (35000, 0, 4000, 'single'), 3400),
  ('partial repair guard 1', (30000, 1000, 8000, 'single'), 4850),
  ('partial repair guard 2', (30775, 1000, 8000, 'single'), 5508),
  ('control: first tier', (20000, 0, 12000, 'single'), 500), ('control: below base', (10000, 0, 10000, 'single'), 0),
  ('control: joint with exempt interest', (30000, 1000, 20000, 'mfj'), 4500),
  ('control: separate filer', (5000, 0, 8000, 'mfs'), 6800)],
 [('regression second-tier-carry 1', (45000, 0, 30934, 'mfj'), 19996),
  ('regression second-tier-carry 2', (30000, 1000, 8000, 'single'), 4850),
  ('partial repair guard 2', (30775, 1000, 8000, 'single'), 5508),
  ('control: joint with exempt interest', (30000, 1000, 20000, 'mfj'), 4500),
  ('control: separate filer', (5000, 0, 8000, 'mfs'), 6800),
  ('control: small benefit first tier', (28000, 0, 2000, 'single'), 1000),
  ('control: large income', (150000, 5000, 40000, 'mfj'), 34000)],
 [('regression second-tier-carry 1', (20000, 1000, 45562, 'single'), 12813),
  ('regression second-tier-carry 2', (30000, 1000, 42192, 'mfj'), 12881),
  ('partial repair guard 1', (30000, 1000, 8000, 'single'), 4850),
  ('partial repair guard 2', (30775, 1000, 8000, 'single'), 5508),
  ('control: large income', (150000, 5000, 40000, 'mfj'), 34000),
  ('control: first tier', (20000, 0, 12000, 'single'), 500),
  ('control: second tier', (40000, 0, 20000, 'single'), 17000),
  ('control: below base', (10000, 0, 10000, 'single'), 0)],
 [('regression second-tier-carry 1', (30000, 0, 20000, 'single'), 9600),
  ('regression second-tier-carry 2', (45000, 1000, 40000, 'single'), 31700),
  ('partial repair guard 1', (30000, 1000, 8000, 'single'), 4850),
  ('partial repair guard 2', (30775, 1000, 8000, 'single'), 5508),
  ('control: below base', (10000, 0, 10000, 'single'), 0),
  ('control: joint with exempt interest', (30000, 1000, 20000, 'mfj'), 4500),
  ('control: separate filer', (5000, 0, 8000, 'mfs'), 6800),
  ('control: small benefit first tier', (28000, 0, 2000, 'single'), 1000)],
 [('regression second-tier-carry 1', (45000, 0, 41916, 'single'), 31664),
  ('regression second-tier-carry 2', (30000, 0, 40000, 'mfj'), 11100),
  ('partial repair guard 1', (30000, 1000, 8000, 'single'), 4850),
  ('partial repair guard 2', (30775, 1000, 8000, 'single'), 5508),
  ('control: small benefit first tier', (28000, 0, 2000, 'single'), 1000),
  ('control: large income', (150000, 5000, 40000, 'mfj'), 34000),
  ('control: first tier', (20000, 0, 12000, 'single'), 500),
  ('control: second tier', (40000, 0, 20000, 'single'), 17000)]]
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 second-tier-carry 11700017000Passed
regression second-tier-carry 234003400Passed
partial repair guard 153504850Failed
partial repair guard 260085508Failed
control: first tier500500Passed
control: below base00Passed
control: joint with exempt interest45004500Passed
control: separate filer68006800Passed

SHA-256 / eb589ba816cdb8422e8e563aaf46977a32b31ee53cae1422c4c938aa33e7864d

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(agi, exempt_interest, benefits, status):
    b1, b2 = {'single': (25000, 34000), 'mfj': (32000, 44000), 'mfs': (0, 0)}[status]
    B = Fraction(benefits)
    pi = agi + exempt_interest + B / 2
    if pi <= b1: t = Fraction(0)
    elif pi <= b2: t = min(B / 2, (pi - b1) / 2)
    else: t = min(B * 85 / 100, (pi - b2) * 85 / 100 + min(B / 2, Fraction(b2 - b1, 2)))
    return int(t)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression second-tier-carry 1', (40000, 0, 20000, 'single'), 17000),
  ('regression second-tier-carry 2', (35000, 0, 4000, 'single'), 3400),
  ('partial repair guard 1', (30000, 1000, 8000, 'single'), 4850),
  ('partial repair guard 2', (30775, 1000, 8000, 'single'), 5508),
  ('control: first tier', (20000, 0, 12000, 'single'), 500), ('control: below base', (10000, 0, 10000, 'single'), 0),
  ('control: joint with exempt interest', (30000, 1000, 20000, 'mfj'), 4500),
  ('control: separate filer', (5000, 0, 8000, 'mfs'), 6800)],
 [('regression second-tier-carry 1', (45000, 0, 30934, 'mfj'), 19996),
  ('regression second-tier-carry 2', (30000, 1000, 8000, 'single'), 4850),
  ('partial repair guard 2', (30775, 1000, 8000, 'single'), 5508),
  ('control: joint with exempt interest', (30000, 1000, 20000, 'mfj'), 4500),
  ('control: separate filer', (5000, 0, 8000, 'mfs'), 6800),
  ('control: small benefit first tier', (28000, 0, 2000, 'single'), 1000),
  ('control: large income', (150000, 5000, 40000, 'mfj'), 34000)],
 [('regression second-tier-carry 1', (20000, 1000, 45562, 'single'), 12813),
  ('regression second-tier-carry 2', (30000, 1000, 42192, 'mfj'), 12881),
  ('partial repair guard 1', (30000, 1000, 8000, 'single'), 4850),
  ('partial repair guard 2', (30775, 1000, 8000, 'single'), 5508),
  ('control: large income', (150000, 5000, 40000, 'mfj'), 34000),
  ('control: first tier', (20000, 0, 12000, 'single'), 500),
  ('control: second tier', (40000, 0, 20000, 'single'), 17000),
  ('control: below base', (10000, 0, 10000, 'single'), 0)],
 [('regression second-tier-carry 1', (30000, 0, 20000, 'single'), 9600),
  ('regression second-tier-carry 2', (45000, 1000, 40000, 'single'), 31700),
  ('partial repair guard 1', (30000, 1000, 8000, 'single'), 4850),
  ('partial repair guard 2', (30775, 1000, 8000, 'single'), 5508),
  ('control: below base', (10000, 0, 10000, 'single'), 0),
  ('control: joint with exempt interest', (30000, 1000, 20000, 'mfj'), 4500),
  ('control: separate filer', (5000, 0, 8000, 'mfs'), 6800),
  ('control: small benefit first tier', (28000, 0, 2000, 'single'), 1000)],
 [('regression second-tier-carry 1', (45000, 0, 41916, 'single'), 31664),
  ('regression second-tier-carry 2', (30000, 0, 40000, 'mfj'), 11100),
  ('partial repair guard 1', (30000, 1000, 8000, 'single'), 4850),
  ('partial repair guard 2', (30775, 1000, 8000, 'single'), 5508),
  ('control: small benefit first tier', (28000, 0, 2000, 'single'), 1000),
  ('control: large income', (150000, 5000, 40000, 'mfj'), 34000),
  ('control: first tier', (20000, 0, 12000, 'single'), 500),
  ('control: second tier', (40000, 0, 20000, 'single'), 17000)]]
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 second-tier-carry 11700017000Passed
regression second-tier-carry 234003400Passed
partial repair guard 148504850Passed
partial repair guard 255085508Passed
control: first tier500500Passed
control: below base00Passed
control: joint with exempt interest45004500Passed
control: separate filer68006800Passed

SHA-256 / f2a84698f6929c211f98c21b7aebc225a579d758aee74b6a85da73a3bbbbb2b2

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

Case digest / 2fd5712a02636d2d227de26c23826cbb84a0b66a973f1283155217ab9f7cf2d4