FAILURE MAP
← Case archive

FA-62666 / Tax bracket computation / Open access

Lifetime gifts are left out of the tentative tax base · case 01

An estate after large gifts is taxed in lower brackets than the cumulative transfers warrant.

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

ROOT CAUSE

The tentative tax is computed on the estate alone.

THE FAILURE

The tentative tax is computed on the estate alone.

Unsuccessful approach: Adding separately computed taxes on the estate and on the gifts restarts the schedule for each.

Case contract

solve(estate, gifts, dsue): stipulated unified transfer tax in whole dollars. T is the progressive schedule 18% to 10000 rising to 40% above 1000000. The exclusion is 13610000 + dsue; the unified credit is T(exclusion). Tentative tax = T(estate + gifts). Gift credit = max(0, T(gifts) - unified credit). Tax = max(0, tentative - gift credit - unified credit), returned in integer cents.

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(estate, gifts, dsue):
    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))
    
    sched = [[10000, '18'], [20000, '20'], [40000, '22'], [60000, '24'], [80000, '26'], [100000, '28'], [150000, '30'], [250000, '32'], [500000, '34'], [750000, '37'], [1000000, '39'], [None, '40']]
    T = lambda x: prog(x, sched)
    credit = T(13610000 + dsue)
    tent = T(estate)
    gift_credit = max(0, T(gifts) - credit)
    return cents(max(0, tent - gift_credit - credit))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression gifts-in-base 1', (10000000, 5000000, 0), 55600000),
  ('regression gifts-in-base 2', (5000000, 15000000, 0), 200000000),
  ('control: large estate', (20000000, 0, 0), 255600000), ('control: under exclusion', (10000000, 0, 0), 0),
  ('control: ported exclusion', (20000000, 0, 5000000), 55600000), ('control: modest', (1500000, 200000, 0), 0)],
 [('regression gifts-in-base 1', (13610000, 15000000, 0), 544400000),
  ('regression gifts-in-base 2', (8632782, 5000000, 0), 911280),
  ('control: ported exclusion', (20000000, 0, 5000000), 55600000),
  ('control: gifts above exclusion', (5000000, 15000000, 0), 200000000), ('control: modest', (1500000, 200000, 0), 0),
  ('control: large estate', (20000000, 0, 0), 255600000)],
 [('regression gifts-in-base 1', (788866, 18885032, 2000000), 31554640),
  ('regression gifts-in-base 2', (21431981, 500000, 0), 332879240),
  ('control: large estate', (20000000, 0, 0), 255600000), ('control: under exclusion', (10000000, 0, 0), 0),
  ('control: with prior gifts', (10000000, 5000000, 0), 55600000),
  ('control: ported exclusion', (20000000, 0, 5000000), 55600000)],
 [('regression gifts-in-base 1', (13610000, 500000, 0), 20000000),
  ('regression gifts-in-base 2', (13610000, 5000000, 2000000), 120000000),
  ('control: ported exclusion', (20000000, 0, 5000000), 55600000),
  ('control: gifts above exclusion', (5000000, 15000000, 0), 200000000), ('control: modest', (1500000, 200000, 0), 0),
  ('control: large estate', (20000000, 0, 0), 255600000)],
 [('regression gifts-in-base 1', (13610000, 5703648, 0), 228145920),
  ('regression gifts-in-base 2', (27783445, 500000, 5000000), 386937800),
  ('control: large estate', (20000000, 0, 0), 255600000), ('control: under exclusion', (10000000, 0, 0), 0),
  ('control: with prior gifts', (10000000, 5000000, 0), 55600000),
  ('control: ported exclusion', (20000000, 0, 5000000), 55600000)]]
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 gifts-in-base 1055600000Failed
regression gifts-in-base 20200000000Failed
control: large estate255600000255600000Passed
control: under exclusion00Passed
control: ported exclusion5560000055600000Passed
control: modest00Passed

SHA-256 / 1512a3bc4674d2998c8ce41296f1b033940871f53ffd0f21c4b3e6c8d7f10fd6

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(estate, gifts, dsue):
    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))
    
    sched = [[10000, '18'], [20000, '20'], [40000, '22'], [60000, '24'], [80000, '26'], [100000, '28'], [150000, '30'], [250000, '32'], [500000, '34'], [750000, '37'], [1000000, '39'], [None, '40']]
    T = lambda x: prog(x, sched)
    credit = T(13610000 + dsue)
    tent = T(estate) + T(gifts)
    gift_credit = max(0, T(gifts) - credit)
    return cents(max(0, tent - gift_credit - credit))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression gifts-in-base 1', (10000000, 5000000, 0), 55600000),
  ('regression gifts-in-base 2', (5000000, 15000000, 0), 200000000),
  ('control: large estate', (20000000, 0, 0), 255600000), ('control: under exclusion', (10000000, 0, 0), 0),
  ('control: ported exclusion', (20000000, 0, 5000000), 55600000), ('control: modest', (1500000, 200000, 0), 0)],
 [('regression gifts-in-base 1', (13610000, 15000000, 0), 544400000),
  ('regression gifts-in-base 2', (8632782, 5000000, 0), 911280),
  ('control: ported exclusion', (20000000, 0, 5000000), 55600000),
  ('control: gifts above exclusion', (5000000, 15000000, 0), 200000000), ('control: modest', (1500000, 200000, 0), 0),
  ('control: large estate', (20000000, 0, 0), 255600000)],
 [('regression gifts-in-base 1', (788866, 18885032, 2000000), 31554640),
  ('regression gifts-in-base 2', (21431981, 500000, 0), 332879240),
  ('control: large estate', (20000000, 0, 0), 255600000), ('control: under exclusion', (10000000, 0, 0), 0),
  ('control: with prior gifts', (10000000, 5000000, 0), 55600000),
  ('control: ported exclusion', (20000000, 0, 5000000), 55600000)],
 [('regression gifts-in-base 1', (13610000, 500000, 0), 20000000),
  ('regression gifts-in-base 2', (13610000, 5000000, 2000000), 120000000),
  ('control: ported exclusion', (20000000, 0, 5000000), 55600000),
  ('control: gifts above exclusion', (5000000, 15000000, 0), 200000000), ('control: modest', (1500000, 200000, 0), 0),
  ('control: large estate', (20000000, 0, 0), 255600000)],
 [('regression gifts-in-base 1', (13610000, 5703648, 0), 228145920),
  ('regression gifts-in-base 2', (27783445, 500000, 5000000), 386937800),
  ('control: large estate', (20000000, 0, 0), 255600000), ('control: under exclusion', (10000000, 0, 0), 0),
  ('control: with prior gifts', (10000000, 5000000, 0), 55600000),
  ('control: ported exclusion', (20000000, 0, 5000000), 55600000)]]
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 gifts-in-base 15018000055600000Failed
regression gifts-in-base 2194580000200000000Failed
control: large estate255600000255600000Passed
control: under exclusion00Passed
control: ported exclusion5560000055600000Passed
control: modest00Passed

SHA-256 / 413affa1f8fdab98bada95eaa20ded121213b7abe47205b3825e41237c385aad

HELD IN THE MEMBER ARCHIVE

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

This mechanism has 6 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:06.677610+00:00.

Case digest / 5d89abdc0173dc9c582579afc6133da1abbfa83f92d4e2a2fd9ff0f9070646f3