FAILURE MAP
← Case archive

FA-62566 / Tax bracket computation / Open access

Separate filers use the joint threshold · case 01

Married-filing-separately returns escape the surtax up to 250000.

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

ROOT CAUSE

The threshold table maps mfs to 250000.

VERIFIED REPAIR

Use 125000 for married filing separately.

Unsuccessful approach: Using the single threshold for separate filers is still too high.

Case contract

solve(nii, magi, status): stipulated 3.8% surtax on the lesser of net investment income and MAGI above the status threshold (single 200000, mfj 250000, mfs 125000), where neither amount counts below zero. Amounts are whole dollars; return the surtax in integer cents rounded 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(nii, magi, status):
    thr = {'single': 200000, 'mfj': 250000, 'mfs': 250000}[status]
    base = max(0, min(nii, magi - thr))
    return int(base * Fraction(38, 10) + Fraction(1, 2))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression status-threshold 1', (5001, 130000, 'mfs'), 19000),
  ('regression status-threshold 2', (13, 125001, 'mfs'), 4),
  ('control: excess binding', (50000, 230000, 'single'), 114000),
  ('control: nii binding', (20000, 300000, 'mfj'), 76000), ('control: investment loss', (-4000, 400000, 'single'), 0),
  ('control: below threshold', (10000, 190000, 'single'), 0)],
 [('regression status-threshold 1', (7, 250001, 'mfs'), 27), ('regression status-threshold 2', (13, 250001, 'mfs'), 49),
  ('partial repair guard 1', (7, 200001, 'mfs'), 27), ('partial repair guard 2', (34287, 200001, 'mfs'), 130291),
  ('control: investment loss', (-4000, 400000, 'single'), 0),
  ('control: below threshold', (10000, 190000, 'single'), 0), ('control: odd dollars', (7, 400000, 'mfj'), 27),
  ('control: excess binding', (50000, 230000, 'single'), 114000)],
 [('regression status-threshold 1', (7, 200001, 'mfs'), 27),
  ('regression status-threshold 2', (34287, 200001, 'mfs'), 130291),
  ('partial repair guard 1', (13, 166865, 'mfs'), 49), ('partial repair guard 2', (13, 200001, 'mfs'), 49),
  ('control: excess binding', (50000, 230000, 'single'), 114000),
  ('control: nii binding', (20000, 300000, 'mfj'), 76000), ('control: separate filer', (5001, 130000, 'mfs'), 19000),
  ('control: investment loss', (-4000, 400000, 'single'), 0)],
 [('regression status-threshold 1', (13, 166865, 'mfs'), 49),
  ('regression status-threshold 2', (13, 200001, 'mfs'), 49),
  ('partial repair guard 1', (119220, 200001, 'mfs'), 285004), ('partial repair guard 2', (7, 169672, 'mfs'), 27),
  ('control: investment loss', (-4000, 400000, 'single'), 0),
  ('control: below threshold', (10000, 190000, 'single'), 0), ('control: odd dollars', (7, 400000, 'mfj'), 27),
  ('control: excess binding', (50000, 230000, 'single'), 114000)],
 [('regression status-threshold 1', (119220, 200001, 'mfs'), 285004),
  ('regression status-threshold 2', (7, 169672, 'mfs'), 27),
  ('partial repair guard 1', (177822, 250001, 'mfs'), 475004), ('partial repair guard 2', (158618, 125001, 'mfs'), 4),
  ('control: excess binding', (50000, 230000, 'single'), 114000),
  ('control: nii binding', (20000, 300000, 'mfj'), 76000), ('control: separate filer', (5001, 130000, 'mfs'), 19000),
  ('control: investment loss', (-4000, 400000, 'single'), 0)]]
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 status-threshold 1019000Failed
regression status-threshold 204Failed
control: excess binding114000114000Passed
control: nii binding7600076000Passed
control: investment loss00Passed
control: below threshold00Passed

SHA-256 / d446f4d11a3b44346cd5de4c217853a18dd2f0f3120e09fbf20db7aa8fe66162

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(nii, magi, status):
    thr = {'single': 200000, 'mfj': 250000, 'mfs': 200000}[status]
    base = max(0, min(nii, magi - thr))
    return int(base * Fraction(38, 10) + Fraction(1, 2))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression status-threshold 1', (5001, 130000, 'mfs'), 19000),
  ('regression status-threshold 2', (13, 125001, 'mfs'), 4),
  ('control: excess binding', (50000, 230000, 'single'), 114000),
  ('control: nii binding', (20000, 300000, 'mfj'), 76000), ('control: investment loss', (-4000, 400000, 'single'), 0),
  ('control: below threshold', (10000, 190000, 'single'), 0)],
 [('regression status-threshold 1', (7, 250001, 'mfs'), 27), ('regression status-threshold 2', (13, 250001, 'mfs'), 49),
  ('partial repair guard 1', (7, 200001, 'mfs'), 27), ('partial repair guard 2', (34287, 200001, 'mfs'), 130291),
  ('control: investment loss', (-4000, 400000, 'single'), 0),
  ('control: below threshold', (10000, 190000, 'single'), 0), ('control: odd dollars', (7, 400000, 'mfj'), 27),
  ('control: excess binding', (50000, 230000, 'single'), 114000)],
 [('regression status-threshold 1', (7, 200001, 'mfs'), 27),
  ('regression status-threshold 2', (34287, 200001, 'mfs'), 130291),
  ('partial repair guard 1', (13, 166865, 'mfs'), 49), ('partial repair guard 2', (13, 200001, 'mfs'), 49),
  ('control: excess binding', (50000, 230000, 'single'), 114000),
  ('control: nii binding', (20000, 300000, 'mfj'), 76000), ('control: separate filer', (5001, 130000, 'mfs'), 19000),
  ('control: investment loss', (-4000, 400000, 'single'), 0)],
 [('regression status-threshold 1', (13, 166865, 'mfs'), 49),
  ('regression status-threshold 2', (13, 200001, 'mfs'), 49),
  ('partial repair guard 1', (119220, 200001, 'mfs'), 285004), ('partial repair guard 2', (7, 169672, 'mfs'), 27),
  ('control: investment loss', (-4000, 400000, 'single'), 0),
  ('control: below threshold', (10000, 190000, 'single'), 0), ('control: odd dollars', (7, 400000, 'mfj'), 27),
  ('control: excess binding', (50000, 230000, 'single'), 114000)],
 [('regression status-threshold 1', (119220, 200001, 'mfs'), 285004),
  ('regression status-threshold 2', (7, 169672, 'mfs'), 27),
  ('partial repair guard 1', (177822, 250001, 'mfs'), 475004), ('partial repair guard 2', (158618, 125001, 'mfs'), 4),
  ('control: excess binding', (50000, 230000, 'single'), 114000),
  ('control: nii binding', (20000, 300000, 'mfj'), 76000), ('control: separate filer', (5001, 130000, 'mfs'), 19000),
  ('control: investment loss', (-4000, 400000, 'single'), 0)]]
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 status-threshold 1019000Failed
regression status-threshold 204Failed
control: excess binding114000114000Passed
control: nii binding7600076000Passed
control: investment loss00Passed
control: below threshold00Passed

SHA-256 / 04ac880f3dcf244a3f28f73f8053c61ef7684353fcc3b9d831a8f77a720b46d7

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(nii, magi, status):
    thr = {'single': 200000, 'mfj': 250000, 'mfs': 125000}[status]
    base = max(0, min(nii, magi - thr))
    return int(base * Fraction(38, 10) + Fraction(1, 2))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression status-threshold 1', (5001, 130000, 'mfs'), 19000),
  ('regression status-threshold 2', (13, 125001, 'mfs'), 4),
  ('control: excess binding', (50000, 230000, 'single'), 114000),
  ('control: nii binding', (20000, 300000, 'mfj'), 76000), ('control: investment loss', (-4000, 400000, 'single'), 0),
  ('control: below threshold', (10000, 190000, 'single'), 0)],
 [('regression status-threshold 1', (7, 250001, 'mfs'), 27), ('regression status-threshold 2', (13, 250001, 'mfs'), 49),
  ('partial repair guard 1', (7, 200001, 'mfs'), 27), ('partial repair guard 2', (34287, 200001, 'mfs'), 130291),
  ('control: investment loss', (-4000, 400000, 'single'), 0),
  ('control: below threshold', (10000, 190000, 'single'), 0), ('control: odd dollars', (7, 400000, 'mfj'), 27),
  ('control: excess binding', (50000, 230000, 'single'), 114000)],
 [('regression status-threshold 1', (7, 200001, 'mfs'), 27),
  ('regression status-threshold 2', (34287, 200001, 'mfs'), 130291),
  ('partial repair guard 1', (13, 166865, 'mfs'), 49), ('partial repair guard 2', (13, 200001, 'mfs'), 49),
  ('control: excess binding', (50000, 230000, 'single'), 114000),
  ('control: nii binding', (20000, 300000, 'mfj'), 76000), ('control: separate filer', (5001, 130000, 'mfs'), 19000),
  ('control: investment loss', (-4000, 400000, 'single'), 0)],
 [('regression status-threshold 1', (13, 166865, 'mfs'), 49),
  ('regression status-threshold 2', (13, 200001, 'mfs'), 49),
  ('partial repair guard 1', (119220, 200001, 'mfs'), 285004), ('partial repair guard 2', (7, 169672, 'mfs'), 27),
  ('control: investment loss', (-4000, 400000, 'single'), 0),
  ('control: below threshold', (10000, 190000, 'single'), 0), ('control: odd dollars', (7, 400000, 'mfj'), 27),
  ('control: excess binding', (50000, 230000, 'single'), 114000)],
 [('regression status-threshold 1', (119220, 200001, 'mfs'), 285004),
  ('regression status-threshold 2', (7, 169672, 'mfs'), 27),
  ('partial repair guard 1', (177822, 250001, 'mfs'), 475004), ('partial repair guard 2', (158618, 125001, 'mfs'), 4),
  ('control: excess binding', (50000, 230000, 'single'), 114000),
  ('control: nii binding', (20000, 300000, 'mfj'), 76000), ('control: separate filer', (5001, 130000, 'mfs'), 19000),
  ('control: investment loss', (-4000, 400000, 'single'), 0)]]
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 status-threshold 11900019000Passed
regression status-threshold 244Passed
control: excess binding114000114000Passed
control: nii binding7600076000Passed
control: investment loss00Passed
control: below threshold00Passed

SHA-256 / 14dd3744a2a8280627712575689f7374f2cbbd92b0e429c937ac633b41779b25

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

Case digest / e99c7363c07be2b5b13a9f7c87fab1df0123bd841e206272203a183d12d14be2