FAILURE MAP
← Case archive

FA-62756 / Tax bracket computation / Open access

Included benefits are not capped at 85% of benefits · case 01

High-income retirees include more than 85% of their benefits.

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

ROOT CAUSE

The upper tier omits min(0.85*benefits, ...).

VERIFIED REPAIR

Cap the included amount at 85% of benefits.

Unsuccessful approach: Capping at 50% of benefits confuses the first-tier cap with the overall cap.

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 * 10, (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 eighty-five-cap 1', (150000, 5000, 40000, 'mfj'), 34000),
  ('regression eighty-five-cap 2', (5000, 0, 8000, 'mfs'), 6800),
  ('control: first tier', (20000, 0, 12000, 'single'), 500),
  ('control: second tier', (40000, 0, 20000, 'single'), 17000), ('control: below base', (10000, 0, 10000, 'single'), 0),
  ('control: joint with exempt interest', (30000, 1000, 20000, 'mfj'), 4500)],
 [('regression eighty-five-cap 1', (40000, 0, 20000, 'single'), 17000),
  ('regression eighty-five-cap 2', (90000, 0, 20000, 'single'), 17000),
  ('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 eighty-five-cap 1', (10000, 0, 2000, 'mfs'), 1700),
  ('regression eighty-five-cap 2', (16953, 1000, 8000, 'mfs'), 6800),
  ('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 eighty-five-cap 1', (90000, 0, 20000, 'mfj'), 17000),
  ('regression eighty-five-cap 2', (90000, 1000, 20000, 'mfs'), 17000),
  ('partial repair guard 1', (45000, 0, 30934, 'mfj'), 19996),
  ('partial repair guard 2', (30000, 1000, 8000, 'single'), 4850),
  ('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 eighty-five-cap 1', (30000, 0, 20000, 'mfs'), 17000),
  ('regression eighty-five-cap 2', (57417, 0, 20000, 'mfs'), 17000),
  ('partial repair guard 1', (90000, 0, 20000, 'mfj'), 17000),
  ('partial repair guard 2', (90000, 1000, 20000, 'mfs'), 17000),
  ('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 eighty-five-cap 111735034000Failed
regression eighty-five-cap 276506800Failed
control: first tier500500Passed
control: second tier1810017000Failed
control: below base00Passed
control: joint with exempt interest45004500Passed

SHA-256 / 979ca3f1c04765636690cd564f08e688c136470339e42954623b09ab889a0e47

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 / 2, (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 eighty-five-cap 1', (150000, 5000, 40000, 'mfj'), 34000),
  ('regression eighty-five-cap 2', (5000, 0, 8000, 'mfs'), 6800),
  ('control: first tier', (20000, 0, 12000, 'single'), 500),
  ('control: second tier', (40000, 0, 20000, 'single'), 17000), ('control: below base', (10000, 0, 10000, 'single'), 0),
  ('control: joint with exempt interest', (30000, 1000, 20000, 'mfj'), 4500)],
 [('regression eighty-five-cap 1', (40000, 0, 20000, 'single'), 17000),
  ('regression eighty-five-cap 2', (90000, 0, 20000, 'single'), 17000),
  ('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 eighty-five-cap 1', (10000, 0, 2000, 'mfs'), 1700),
  ('regression eighty-five-cap 2', (16953, 1000, 8000, 'mfs'), 6800),
  ('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 eighty-five-cap 1', (90000, 0, 20000, 'mfj'), 17000),
  ('regression eighty-five-cap 2', (90000, 1000, 20000, 'mfs'), 17000),
  ('partial repair guard 1', (45000, 0, 30934, 'mfj'), 19996),
  ('partial repair guard 2', (30000, 1000, 8000, 'single'), 4850),
  ('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 eighty-five-cap 1', (30000, 0, 20000, 'mfs'), 17000),
  ('regression eighty-five-cap 2', (57417, 0, 20000, 'mfs'), 17000),
  ('partial repair guard 1', (90000, 0, 20000, 'mfj'), 17000),
  ('partial repair guard 2', (90000, 1000, 20000, 'mfs'), 17000),
  ('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 eighty-five-cap 12000034000Failed
regression eighty-five-cap 240006800Failed
control: first tier500500Passed
control: second tier1000017000Failed
control: below base00Passed
control: joint with exempt interest45004500Passed

SHA-256 / 6e1af3d6bd6a72b93f2ed33253cb541117ed2c3628d3b436e50190577730eb9f

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 eighty-five-cap 1', (150000, 5000, 40000, 'mfj'), 34000),
  ('regression eighty-five-cap 2', (5000, 0, 8000, 'mfs'), 6800),
  ('control: first tier', (20000, 0, 12000, 'single'), 500),
  ('control: second tier', (40000, 0, 20000, 'single'), 17000), ('control: below base', (10000, 0, 10000, 'single'), 0),
  ('control: joint with exempt interest', (30000, 1000, 20000, 'mfj'), 4500)],
 [('regression eighty-five-cap 1', (40000, 0, 20000, 'single'), 17000),
  ('regression eighty-five-cap 2', (90000, 0, 20000, 'single'), 17000),
  ('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 eighty-five-cap 1', (10000, 0, 2000, 'mfs'), 1700),
  ('regression eighty-five-cap 2', (16953, 1000, 8000, 'mfs'), 6800),
  ('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 eighty-five-cap 1', (90000, 0, 20000, 'mfj'), 17000),
  ('regression eighty-five-cap 2', (90000, 1000, 20000, 'mfs'), 17000),
  ('partial repair guard 1', (45000, 0, 30934, 'mfj'), 19996),
  ('partial repair guard 2', (30000, 1000, 8000, 'single'), 4850),
  ('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 eighty-five-cap 1', (30000, 0, 20000, 'mfs'), 17000),
  ('regression eighty-five-cap 2', (57417, 0, 20000, 'mfs'), 17000),
  ('partial repair guard 1', (90000, 0, 20000, 'mfj'), 17000),
  ('partial repair guard 2', (90000, 1000, 20000, 'mfs'), 17000),
  ('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 eighty-five-cap 13400034000Passed
regression eighty-five-cap 268006800Passed
control: first tier500500Passed
control: second tier1700017000Passed
control: below base00Passed
control: joint with exempt interest45004500Passed

SHA-256 / 08773da4808d40d787ddab91deaa9c09523d4b3f9d9f1ec6b426cd27cb0d9602

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

Case digest / 12130c9a50d3bece1c8e220b6f82808c098d8658a1c7d8b4db6d39bcb6f5f11d