FAILURE MAP
← Case archive

FA-62831 / Tax bracket computation / Open access

The refundable portion ignores the credit already used against tax · case 01

A filer receives a refund of credit that already reduced their tax.

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

ROOT CAUSE

The refundable portion is limited by the full credit instead of the unused credit.

THE FAILURE

The refundable portion is limited by the full credit instead of the unused credit.

Unsuccessful approach: Using the unused credit but dropping the per-child cap still refunds too much.

Case contract

solve(kids, others, magi, status, tax, earned): stipulated child credit, whole dollars. Credit = 2000 per child + 500 per other dependent, reduced by 50 for each 1000 or fraction thereof of MAGI above the threshold (single 200000, mfj 400000), floored at 0. The credit first offsets tax (used = min(credit, tax)); the refundable portion is min(credit - used, 1700 per child, 15% of earned income above 2500 rounded down, floored at 0). Return [credit, used, refundable].

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

N = 1
observations = []
def solve(kids, others, magi, status, tax, earned):
    thr = {'single': 200000, 'mfj': 400000}[status]
    credit = 2000 * kids + 500 * others
    if magi > thr: credit = max(0, credit - 50 * (-(-(magi - thr) // 1000)))
    used = min(credit, tax)
    refundable = min(credit, 1700 * kids, max(0, (earned - 2500) * 15 // 100))
    return [credit, used, refundable]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression refundable-after-offset 1', (2, 0, 150000, 'single', 1000, 30000), [4000, 1000, 3000]),
  ('regression refundable-after-offset 2', (1, 0, 30000, 'mfj', 1500, 30000), [2000, 1500, 500]),
  ('partial repair guard 1', (3, 2, 410500, 'mfj', 1000, 410500), [6450, 1000, 5100]),
  ('partial repair guard 2', (0, 3, 50000, 'single', 0, 50000), [1500, 0, 0]),
  ('control: fraction thereof', (2, 1, 201001, 'single', 10000, 200000), [4400, 4400, 0]),
  ('control: earned limit', (1, 0, 30000, 'mfj', 0, 10000), [2000, 0, 1125]),
  ('control: fully phased', (1, 0, 450000, 'mfj', 5000, 450000), [0, 0, 0]),
  ('control: low earner', (2, 0, 2000, 'single', 0, 2000), [4000, 0, 0])],
 [('regression refundable-after-offset 1', (2, 1, 201001, 'single', 10000, 200000), [4400, 4400, 0]),
  ('regression refundable-after-offset 2', (2, 0, 450000, 'mfj', 10000, 30481), [1500, 1500, 0]),
  ('partial repair guard 1', (0, 2, 400001, 'mfj', 500, 3000), [950, 500, 0]),
  ('partial repair guard 2', (2, 0, 201000, 'mfj', 500, 30000), [4000, 500, 3400]),
  ('control: fully phased', (1, 0, 450000, 'mfj', 5000, 450000), [0, 0, 0]),
  ('control: joint partial phase-out', (3, 2, 410500, 'mfj', 1000, 410500), [6450, 1000, 5100]),
  ('control: other dependents only', (0, 3, 50000, 'single', 0, 50000), [1500, 0, 0]),
  ('control: low earner', (2, 0, 2000, 'single', 0, 2000), [4000, 0, 0])],
 [('regression refundable-after-offset 1', (3, 0, 200001, 'mfj', 10000, 24871), [6000, 6000, 0]),
  ('regression refundable-after-offset 2', (3, 0, 200001, 'single', 1000, 47030), [5950, 1000, 4950]),
  ('partial repair guard 1', (1, 0, 400001, 'mfj', 0, 30000), [1950, 0, 1700]),
  ('partial repair guard 2', (0, 1, 136686, 'single', 0, 8248), [500, 0, 0]),
  ('control: low earner', (2, 0, 2000, 'single', 0, 2000), [4000, 0, 0]),
  ('control: refund limited by child cap', (2, 0, 150000, 'single', 1000, 30000), [4000, 1000, 3000]),
  ('control: fraction thereof', (2, 1, 201001, 'single', 10000, 200000), [4400, 4400, 0]),
  ('control: earned limit', (1, 0, 30000, 'mfj', 0, 10000), [2000, 0, 1125])],
 [('regression refundable-after-offset 1', (3, 0, 200001, 'mfj', 10000, 30000), [6000, 6000, 0]),
  ('regression refundable-after-offset 2', (1, 0, 17494, 'mfj', 5000, 30000), [2000, 2000, 0]),
  ('partial repair guard 1', (0, 1, 150314, 'single', 0, 30000), [500, 0, 0]),
  ('partial repair guard 2', (0, 1, 200001, 'mfj', 0, 30000), [500, 0, 0]),
  ('control: earned limit', (1, 0, 30000, 'mfj', 0, 10000), [2000, 0, 1125]),
  ('control: fully phased', (1, 0, 450000, 'mfj', 5000, 450000), [0, 0, 0]),
  ('control: joint partial phase-out', (3, 2, 410500, 'mfj', 1000, 410500), [6450, 1000, 5100]),
  ('control: other dependents only', (0, 3, 50000, 'single', 0, 50000), [1500, 0, 0])],
 [('regression refundable-after-offset 1', (1, 0, 201000, 'mfj', 5000, 10000), [2000, 2000, 0]),
  ('regression refundable-after-offset 2', (3, 2, 200001, 'single', 10000, 3000), [6950, 6950, 0]),
  ('partial repair guard 1', (2, 0, 357237, 'mfj', 500, 89964), [4000, 500, 3400]),
  ('partial repair guard 2', (2, 0, 200001, 'single', 0, 93156), [3950, 0, 3400]),
  ('control: other dependents only', (0, 3, 50000, 'single', 0, 50000), [1500, 0, 0]),
  ('control: low earner', (2, 0, 2000, 'single', 0, 2000), [4000, 0, 0]),
  ('control: refund limited by child cap', (2, 0, 150000, 'single', 1000, 30000), [4000, 1000, 3000]),
  ('control: fraction thereof', (2, 1, 201001, 'single', 10000, 200000), [4400, 4400, 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 refundable-after-offset 1[4000, 1000, 3400][4000, 1000, 3000]Failed
regression refundable-after-offset 2[2000, 1500, 1700][2000, 1500, 500]Failed
partial repair guard 1[6450, 1000, 5100][6450, 1000, 5100]Passed
partial repair guard 2[1500, 0, 0][1500, 0, 0]Passed
control: fraction thereof[4400, 4400, 3400][4400, 4400, 0]Failed
control: earned limit[2000, 0, 1125][2000, 0, 1125]Passed
control: fully phased[0, 0, 0][0, 0, 0]Passed
control: low earner[4000, 0, 0][4000, 0, 0]Passed

SHA-256 / b951b94a9e938dd8a3204a2b7e8e5f7501454d2af64ee79f78dad8ea699168be

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(kids, others, magi, status, tax, earned):
    thr = {'single': 200000, 'mfj': 400000}[status]
    credit = 2000 * kids + 500 * others
    if magi > thr: credit = max(0, credit - 50 * (-(-(magi - thr) // 1000)))
    used = min(credit, tax)
    refundable = min(credit - used, max(0, (earned - 2500) * 15 // 100))
    return [credit, used, refundable]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression refundable-after-offset 1', (2, 0, 150000, 'single', 1000, 30000), [4000, 1000, 3000]),
  ('regression refundable-after-offset 2', (1, 0, 30000, 'mfj', 1500, 30000), [2000, 1500, 500]),
  ('partial repair guard 1', (3, 2, 410500, 'mfj', 1000, 410500), [6450, 1000, 5100]),
  ('partial repair guard 2', (0, 3, 50000, 'single', 0, 50000), [1500, 0, 0]),
  ('control: fraction thereof', (2, 1, 201001, 'single', 10000, 200000), [4400, 4400, 0]),
  ('control: earned limit', (1, 0, 30000, 'mfj', 0, 10000), [2000, 0, 1125]),
  ('control: fully phased', (1, 0, 450000, 'mfj', 5000, 450000), [0, 0, 0]),
  ('control: low earner', (2, 0, 2000, 'single', 0, 2000), [4000, 0, 0])],
 [('regression refundable-after-offset 1', (2, 1, 201001, 'single', 10000, 200000), [4400, 4400, 0]),
  ('regression refundable-after-offset 2', (2, 0, 450000, 'mfj', 10000, 30481), [1500, 1500, 0]),
  ('partial repair guard 1', (0, 2, 400001, 'mfj', 500, 3000), [950, 500, 0]),
  ('partial repair guard 2', (2, 0, 201000, 'mfj', 500, 30000), [4000, 500, 3400]),
  ('control: fully phased', (1, 0, 450000, 'mfj', 5000, 450000), [0, 0, 0]),
  ('control: joint partial phase-out', (3, 2, 410500, 'mfj', 1000, 410500), [6450, 1000, 5100]),
  ('control: other dependents only', (0, 3, 50000, 'single', 0, 50000), [1500, 0, 0]),
  ('control: low earner', (2, 0, 2000, 'single', 0, 2000), [4000, 0, 0])],
 [('regression refundable-after-offset 1', (3, 0, 200001, 'mfj', 10000, 24871), [6000, 6000, 0]),
  ('regression refundable-after-offset 2', (3, 0, 200001, 'single', 1000, 47030), [5950, 1000, 4950]),
  ('partial repair guard 1', (1, 0, 400001, 'mfj', 0, 30000), [1950, 0, 1700]),
  ('partial repair guard 2', (0, 1, 136686, 'single', 0, 8248), [500, 0, 0]),
  ('control: low earner', (2, 0, 2000, 'single', 0, 2000), [4000, 0, 0]),
  ('control: refund limited by child cap', (2, 0, 150000, 'single', 1000, 30000), [4000, 1000, 3000]),
  ('control: fraction thereof', (2, 1, 201001, 'single', 10000, 200000), [4400, 4400, 0]),
  ('control: earned limit', (1, 0, 30000, 'mfj', 0, 10000), [2000, 0, 1125])],
 [('regression refundable-after-offset 1', (3, 0, 200001, 'mfj', 10000, 30000), [6000, 6000, 0]),
  ('regression refundable-after-offset 2', (1, 0, 17494, 'mfj', 5000, 30000), [2000, 2000, 0]),
  ('partial repair guard 1', (0, 1, 150314, 'single', 0, 30000), [500, 0, 0]),
  ('partial repair guard 2', (0, 1, 200001, 'mfj', 0, 30000), [500, 0, 0]),
  ('control: earned limit', (1, 0, 30000, 'mfj', 0, 10000), [2000, 0, 1125]),
  ('control: fully phased', (1, 0, 450000, 'mfj', 5000, 450000), [0, 0, 0]),
  ('control: joint partial phase-out', (3, 2, 410500, 'mfj', 1000, 410500), [6450, 1000, 5100]),
  ('control: other dependents only', (0, 3, 50000, 'single', 0, 50000), [1500, 0, 0])],
 [('regression refundable-after-offset 1', (1, 0, 201000, 'mfj', 5000, 10000), [2000, 2000, 0]),
  ('regression refundable-after-offset 2', (3, 2, 200001, 'single', 10000, 3000), [6950, 6950, 0]),
  ('partial repair guard 1', (2, 0, 357237, 'mfj', 500, 89964), [4000, 500, 3400]),
  ('partial repair guard 2', (2, 0, 200001, 'single', 0, 93156), [3950, 0, 3400]),
  ('control: other dependents only', (0, 3, 50000, 'single', 0, 50000), [1500, 0, 0]),
  ('control: low earner', (2, 0, 2000, 'single', 0, 2000), [4000, 0, 0]),
  ('control: refund limited by child cap', (2, 0, 150000, 'single', 1000, 30000), [4000, 1000, 3000]),
  ('control: fraction thereof', (2, 1, 201001, 'single', 10000, 200000), [4400, 4400, 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 refundable-after-offset 1[4000, 1000, 3000][4000, 1000, 3000]Passed
regression refundable-after-offset 2[2000, 1500, 500][2000, 1500, 500]Passed
partial repair guard 1[6450, 1000, 5450][6450, 1000, 5100]Failed
partial repair guard 2[1500, 0, 1500][1500, 0, 0]Failed
control: fraction thereof[4400, 4400, 0][4400, 4400, 0]Passed
control: earned limit[2000, 0, 1125][2000, 0, 1125]Passed
control: fully phased[0, 0, 0][0, 0, 0]Passed
control: low earner[4000, 0, 0][4000, 0, 0]Passed

SHA-256 / 3ab70ae59f830c5bb581a3882ea70bb08f03a1d63335c06f0df0c53d8a59aec2

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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

Case digest / 9586bd329ee25e165d5316f82b718fcacb8fe449dc5c45c89d0843e6700d3b15