FA-62526 / Tax bracket computation / Open access
Incomes under five dollars are charged a table amount · case 01
A filer with 3 dollars of taxable income owes 1 dollar.
ROOT CAUSE
The minimum-income rule is missing, so [0,25) is taxed at its midpoint.
VERIFIED REPAIR
Return zero tax for incomes below 5.
Unsuccessful approach: Exempting only zero income still charges incomes from 1 to 4.
Case contract
solve(income, brackets): stipulated tax-table lookup. income < 0 returns 0 and incomes below 5 have zero tax. For income < 100000 the tax is the progressive tax on the midpoint of the income's band, rounded half-up to whole dollars: bands are 25 wide below 3000 ([0,25), [25,50), ...) and 50 wide from 3000 ([3000,3050), ...). Incomes of 100000 or more use the exact progressive tax rounded half-up to cents. Return 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(income, brackets):
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))
if income < 0: return 0
if income >= 100000: return cents(prog(income, brackets))
w = 25 if income < 3000 else 50
lo = income // w * w
mid = lo + Fraction(w, 2)
return int(prog(mid, brackets) + Fraction(1, 2)) * 100
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression minimum-taxable 1', (4, [[10000, '10'], [40000, '12'], [None, '22']]), 0),
('regression minimum-taxable 2', (1, [[10000, '10'], [40000, '12'], [None, '22']]), 0),
('control: last narrow band', (2999, [[10000, '10'], [40000, '12'], [None, '22']]), 29900),
('control: first wide band', (3000, [[10000, '10'], [40000, '12'], [None, '22']]), 30300),
('control: ordinary', (12345, [[10000, '10'], [40000, '12'], [None, '22']]), 127900),
('control: table cutoff', (100000, [[10000, '10'], [40000, '12'], [None, '22']]), 1780000)],
[('regression minimum-taxable 1', (4, [[10000, '10'], [40000, '12'], [None, '22']]), 0),
('regression minimum-taxable 2', (1, [[10000, '10'], [40000, '12'], [None, '22']]), 0),
('control: table cutoff', (100000, [[10000, '10'], [40000, '12'], [None, '22']]), 1780000),
('control: small', (24, [[10000, '10'], [40000, '12'], [None, '22']]), 100),
('control: just under cutoff', (99999, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),
1739400),
('control: above cutoff', (100001, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),
1740024)],
[('regression minimum-taxable 1', (4, [[10000, '10'], [40000, '12'], [None, '22']]), 0),
('regression minimum-taxable 2', (1, [[10000, '10'], [40000, '12'], [None, '22']]), 0),
('control: just under cutoff', (99999, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),
1739400),
('control: above cutoff', (100001, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),
1740024),
('control: band edge', (40050, [[10000, '10'], [40000, '12'], [None, '22']]), 461700),
('control: last narrow band', (2999, [[10000, '10'], [40000, '12'], [None, '22']]), 29900)],
[('regression minimum-taxable 1', (4, [[10000, '10'], [40000, '12'], [None, '22']]), 0),
('regression minimum-taxable 2', (1, [[10000, '10'], [40000, '12'], [None, '22']]), 0),
('control: last narrow band', (2999, [[10000, '10'], [40000, '12'], [None, '22']]), 29900),
('control: first wide band', (3000, [[10000, '10'], [40000, '12'], [None, '22']]), 30300),
('control: ordinary', (12345, [[10000, '10'], [40000, '12'], [None, '22']]), 127900),
('control: table cutoff', (100000, [[10000, '10'], [40000, '12'], [None, '22']]), 1780000)],
[('regression minimum-taxable 1', (4, [[10000, '10'], [40000, '12'], [None, '22']]), 0),
('regression minimum-taxable 2', (1, [[10000, '10'], [40000, '12'], [None, '22']]), 0),
('control: table cutoff', (100000, [[10000, '10'], [40000, '12'], [None, '22']]), 1780000),
('control: small', (24, [[10000, '10'], [40000, '12'], [None, '22']]), 100),
('control: just under cutoff', (99999, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),
1739400),
('control: above cutoff', (100001, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),
1740024)]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression minimum-taxable 1 | 100 | 0 | Failed |
| regression minimum-taxable 2 | 100 | 0 | Failed |
| control: last narrow band | 29900 | 29900 | Passed |
| control: first wide band | 30300 | 30300 | Passed |
| control: ordinary | 127900 | 127900 | Passed |
| control: table cutoff | 1780000 | 1780000 | Passed |
SHA-256 / b2c0bc0fe9eaf7c86e3254e47c770c670e0a0bc0dfad3bf90ff56e8aef85609d
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(income, brackets):
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))
if income <= 0: return 0
if income >= 100000: return cents(prog(income, brackets))
w = 25 if income < 3000 else 50
lo = income // w * w
mid = lo + Fraction(w, 2)
return int(prog(mid, brackets) + Fraction(1, 2)) * 100
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression minimum-taxable 1', (4, [[10000, '10'], [40000, '12'], [None, '22']]), 0),
('regression minimum-taxable 2', (1, [[10000, '10'], [40000, '12'], [None, '22']]), 0),
('control: last narrow band', (2999, [[10000, '10'], [40000, '12'], [None, '22']]), 29900),
('control: first wide band', (3000, [[10000, '10'], [40000, '12'], [None, '22']]), 30300),
('control: ordinary', (12345, [[10000, '10'], [40000, '12'], [None, '22']]), 127900),
('control: table cutoff', (100000, [[10000, '10'], [40000, '12'], [None, '22']]), 1780000)],
[('regression minimum-taxable 1', (4, [[10000, '10'], [40000, '12'], [None, '22']]), 0),
('regression minimum-taxable 2', (1, [[10000, '10'], [40000, '12'], [None, '22']]), 0),
('control: table cutoff', (100000, [[10000, '10'], [40000, '12'], [None, '22']]), 1780000),
('control: small', (24, [[10000, '10'], [40000, '12'], [None, '22']]), 100),
('control: just under cutoff', (99999, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),
1739400),
('control: above cutoff', (100001, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),
1740024)],
[('regression minimum-taxable 1', (4, [[10000, '10'], [40000, '12'], [None, '22']]), 0),
('regression minimum-taxable 2', (1, [[10000, '10'], [40000, '12'], [None, '22']]), 0),
('control: just under cutoff', (99999, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),
1739400),
('control: above cutoff', (100001, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),
1740024),
('control: band edge', (40050, [[10000, '10'], [40000, '12'], [None, '22']]), 461700),
('control: last narrow band', (2999, [[10000, '10'], [40000, '12'], [None, '22']]), 29900)],
[('regression minimum-taxable 1', (4, [[10000, '10'], [40000, '12'], [None, '22']]), 0),
('regression minimum-taxable 2', (1, [[10000, '10'], [40000, '12'], [None, '22']]), 0),
('control: last narrow band', (2999, [[10000, '10'], [40000, '12'], [None, '22']]), 29900),
('control: first wide band', (3000, [[10000, '10'], [40000, '12'], [None, '22']]), 30300),
('control: ordinary', (12345, [[10000, '10'], [40000, '12'], [None, '22']]), 127900),
('control: table cutoff', (100000, [[10000, '10'], [40000, '12'], [None, '22']]), 1780000)],
[('regression minimum-taxable 1', (4, [[10000, '10'], [40000, '12'], [None, '22']]), 0),
('regression minimum-taxable 2', (1, [[10000, '10'], [40000, '12'], [None, '22']]), 0),
('control: table cutoff', (100000, [[10000, '10'], [40000, '12'], [None, '22']]), 1780000),
('control: small', (24, [[10000, '10'], [40000, '12'], [None, '22']]), 100),
('control: just under cutoff', (99999, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),
1739400),
('control: above cutoff', (100001, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),
1740024)]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression minimum-taxable 1 | 100 | 0 | Failed |
| regression minimum-taxable 2 | 100 | 0 | Failed |
| control: last narrow band | 29900 | 29900 | Passed |
| control: first wide band | 30300 | 30300 | Passed |
| control: ordinary | 127900 | 127900 | Passed |
| control: table cutoff | 1780000 | 1780000 | Passed |
SHA-256 / 63b3cbd6239c50fe543088df9c5e451620f5f6a324fd571f28beb8245e5fb070
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(income, brackets):
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))
if income < 5: return 0
if income >= 100000: return cents(prog(income, brackets))
w = 25 if income < 3000 else 50
lo = income // w * w
mid = lo + Fraction(w, 2)
return int(prog(mid, brackets) + Fraction(1, 2)) * 100
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression minimum-taxable 1', (4, [[10000, '10'], [40000, '12'], [None, '22']]), 0),
('regression minimum-taxable 2', (1, [[10000, '10'], [40000, '12'], [None, '22']]), 0),
('control: last narrow band', (2999, [[10000, '10'], [40000, '12'], [None, '22']]), 29900),
('control: first wide band', (3000, [[10000, '10'], [40000, '12'], [None, '22']]), 30300),
('control: ordinary', (12345, [[10000, '10'], [40000, '12'], [None, '22']]), 127900),
('control: table cutoff', (100000, [[10000, '10'], [40000, '12'], [None, '22']]), 1780000)],
[('regression minimum-taxable 1', (4, [[10000, '10'], [40000, '12'], [None, '22']]), 0),
('regression minimum-taxable 2', (1, [[10000, '10'], [40000, '12'], [None, '22']]), 0),
('control: table cutoff', (100000, [[10000, '10'], [40000, '12'], [None, '22']]), 1780000),
('control: small', (24, [[10000, '10'], [40000, '12'], [None, '22']]), 100),
('control: just under cutoff', (99999, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),
1739400),
('control: above cutoff', (100001, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),
1740024)],
[('regression minimum-taxable 1', (4, [[10000, '10'], [40000, '12'], [None, '22']]), 0),
('regression minimum-taxable 2', (1, [[10000, '10'], [40000, '12'], [None, '22']]), 0),
('control: just under cutoff', (99999, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),
1739400),
('control: above cutoff', (100001, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),
1740024),
('control: band edge', (40050, [[10000, '10'], [40000, '12'], [None, '22']]), 461700),
('control: last narrow band', (2999, [[10000, '10'], [40000, '12'], [None, '22']]), 29900)],
[('regression minimum-taxable 1', (4, [[10000, '10'], [40000, '12'], [None, '22']]), 0),
('regression minimum-taxable 2', (1, [[10000, '10'], [40000, '12'], [None, '22']]), 0),
('control: last narrow band', (2999, [[10000, '10'], [40000, '12'], [None, '22']]), 29900),
('control: first wide band', (3000, [[10000, '10'], [40000, '12'], [None, '22']]), 30300),
('control: ordinary', (12345, [[10000, '10'], [40000, '12'], [None, '22']]), 127900),
('control: table cutoff', (100000, [[10000, '10'], [40000, '12'], [None, '22']]), 1780000)],
[('regression minimum-taxable 1', (4, [[10000, '10'], [40000, '12'], [None, '22']]), 0),
('regression minimum-taxable 2', (1, [[10000, '10'], [40000, '12'], [None, '22']]), 0),
('control: table cutoff', (100000, [[10000, '10'], [40000, '12'], [None, '22']]), 1780000),
('control: small', (24, [[10000, '10'], [40000, '12'], [None, '22']]), 100),
('control: just under cutoff', (99999, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),
1739400),
('control: above cutoff', (100001, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),
1740024)]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression minimum-taxable 1 | 0 | 0 | Passed |
| regression minimum-taxable 2 | 0 | 0 | Passed |
| control: last narrow band | 29900 | 29900 | Passed |
| control: first wide band | 30300 | 30300 | Passed |
| control: ordinary | 127900 | 127900 | Passed |
| control: table cutoff | 1780000 | 1780000 | Passed |
SHA-256 / 5b6efccce4ac163028798d27691026da9d451ccc847ef3ec03e8960d85c51089
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.392040+00:00.
Case digest / 1a8718b9902fbaa7fea96cac85d52f2d7290c68b237c59055641d7bd71df1e70