FA-62811 / Tax bracket computation / Open access
The surcharge is rounded to the nearest cent instead of down · case 01
Some surcharges are one cent higher than stipulated.
ROOT CAUSE
The exact surcharge is rounded half-up.
VERIFIED REPAIR
Round the surcharge down to whole cents.
Unsuccessful approach: Rounding up to the next cent over-charges every fractional surcharge.
Case contract
solve(income_tax, joint): stipulated surcharge on income tax, in integer cents. The exemption limit is 1813000 (doubled for joint assessment). At or below it the surcharge is 0; above it the surcharge is the lesser of 5.5% of the income tax and 11.9% of the excess over the limit (a gliding zone), rounded down to 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_tax, joint):
thr = 1813000 * (2 if joint else 1)
if income_tax <= thr: return 0
soli = min(income_tax * Fraction(55, 1000), (income_tax - thr) * Fraction(119, 1000))
return int(soli + Fraction(1, 2))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression round-down-cents 1', (1983210, False), 20254),
('regression round-down-cents 2', (3256603, False), 171788), ('partial repair guard 1', (1813009, False), 1),
('partial repair guard 2', (3626001, False), 199430), ('control: at limit', (1813000, False), 0),
('control: gliding zone', (1900000, False), 10353), ('control: full rate', (5000000, False), 275000),
('control: joint glide', (3700000, True), 8806)],
[('regression round-down-cents 1', (1891730, False), 9368), ('regression round-down-cents 2', (2031073, False), 25950),
('partial repair guard 1', (1983210, False), 20254), ('partial repair guard 2', (1813001, False), 0),
('control: joint glide', (3700000, True), 8806), ('control: joint below', (3000000, True), 0),
('control: glide edge', (3300000, False), 176953), ('control: at limit', (1813000, False), 0)],
[('regression round-down-cents 1', (2429991, False), 73421),
('regression round-down-cents 2', (2042226, False), 27277), ('partial repair guard 1', (3626001, True), 0),
('partial repair guard 2', (4499538, True), 103951), ('control: at limit', (1813000, False), 0),
('control: gliding zone', (1900000, False), 10353), ('control: full rate', (5000000, False), 275000),
('control: joint glide', (3700000, True), 8806)],
[('regression round-down-cents 1', (2561678, False), 89092),
('regression round-down-cents 2', (4398816, False), 241934), ('partial repair guard 1', (3835420, False), 210948),
('partial repair guard 2', (3256603, False), 171788), ('control: joint glide', (3700000, True), 8806),
('control: joint below', (3000000, True), 0), ('control: glide edge', (3300000, False), 176953),
('control: at limit', (1813000, False), 0)],
[('regression round-down-cents 1', (3091013, False), 152083),
('regression round-down-cents 2', (5134546, True), 179516), ('partial repair guard 1', (3974588, False), 218602),
('partial repair guard 2', (2115665, False), 36017), ('control: at limit', (1813000, False), 0),
('control: gliding zone', (1900000, False), 10353), ('control: full rate', (5000000, False), 275000),
('control: joint glide', (3700000, True), 8806)]]
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 round-down-cents 1 | 20255 | 20254 | Failed |
| regression round-down-cents 2 | 171789 | 171788 | Failed |
| partial repair guard 1 | 1 | 1 | Passed |
| partial repair guard 2 | 199430 | 199430 | Passed |
| control: at limit | 0 | 0 | Passed |
| control: gliding zone | 10353 | 10353 | Passed |
| control: full rate | 275000 | 275000 | Passed |
| control: joint glide | 8806 | 8806 | Passed |
SHA-256 / 849581421ed6f4fa772b8a5b8821e327927ab08dbf75d80c68db2436c38e4873
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_tax, joint):
thr = 1813000 * (2 if joint else 1)
if income_tax <= thr: return 0
soli = min(income_tax * Fraction(55, 1000), (income_tax - thr) * Fraction(119, 1000))
return -int(-soli // 1)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression round-down-cents 1', (1983210, False), 20254),
('regression round-down-cents 2', (3256603, False), 171788), ('partial repair guard 1', (1813009, False), 1),
('partial repair guard 2', (3626001, False), 199430), ('control: at limit', (1813000, False), 0),
('control: gliding zone', (1900000, False), 10353), ('control: full rate', (5000000, False), 275000),
('control: joint glide', (3700000, True), 8806)],
[('regression round-down-cents 1', (1891730, False), 9368), ('regression round-down-cents 2', (2031073, False), 25950),
('partial repair guard 1', (1983210, False), 20254), ('partial repair guard 2', (1813001, False), 0),
('control: joint glide', (3700000, True), 8806), ('control: joint below', (3000000, True), 0),
('control: glide edge', (3300000, False), 176953), ('control: at limit', (1813000, False), 0)],
[('regression round-down-cents 1', (2429991, False), 73421),
('regression round-down-cents 2', (2042226, False), 27277), ('partial repair guard 1', (3626001, True), 0),
('partial repair guard 2', (4499538, True), 103951), ('control: at limit', (1813000, False), 0),
('control: gliding zone', (1900000, False), 10353), ('control: full rate', (5000000, False), 275000),
('control: joint glide', (3700000, True), 8806)],
[('regression round-down-cents 1', (2561678, False), 89092),
('regression round-down-cents 2', (4398816, False), 241934), ('partial repair guard 1', (3835420, False), 210948),
('partial repair guard 2', (3256603, False), 171788), ('control: joint glide', (3700000, True), 8806),
('control: joint below', (3000000, True), 0), ('control: glide edge', (3300000, False), 176953),
('control: at limit', (1813000, False), 0)],
[('regression round-down-cents 1', (3091013, False), 152083),
('regression round-down-cents 2', (5134546, True), 179516), ('partial repair guard 1', (3974588, False), 218602),
('partial repair guard 2', (2115665, False), 36017), ('control: at limit', (1813000, False), 0),
('control: gliding zone', (1900000, False), 10353), ('control: full rate', (5000000, False), 275000),
('control: joint glide', (3700000, True), 8806)]]
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 round-down-cents 1 | 20255 | 20254 | Failed |
| regression round-down-cents 2 | 171789 | 171788 | Failed |
| partial repair guard 1 | 2 | 1 | Failed |
| partial repair guard 2 | 199431 | 199430 | Failed |
| control: at limit | 0 | 0 | Passed |
| control: gliding zone | 10353 | 10353 | Passed |
| control: full rate | 275000 | 275000 | Passed |
| control: joint glide | 8806 | 8806 | Passed |
SHA-256 / 8d4997995005609abf2bebedf5c877507d728f46c30704ccb923efa10b70bf90
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_tax, joint):
thr = 1813000 * (2 if joint else 1)
if income_tax <= thr: return 0
soli = min(income_tax * Fraction(55, 1000), (income_tax - thr) * Fraction(119, 1000))
return int(soli)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression round-down-cents 1', (1983210, False), 20254),
('regression round-down-cents 2', (3256603, False), 171788), ('partial repair guard 1', (1813009, False), 1),
('partial repair guard 2', (3626001, False), 199430), ('control: at limit', (1813000, False), 0),
('control: gliding zone', (1900000, False), 10353), ('control: full rate', (5000000, False), 275000),
('control: joint glide', (3700000, True), 8806)],
[('regression round-down-cents 1', (1891730, False), 9368), ('regression round-down-cents 2', (2031073, False), 25950),
('partial repair guard 1', (1983210, False), 20254), ('partial repair guard 2', (1813001, False), 0),
('control: joint glide', (3700000, True), 8806), ('control: joint below', (3000000, True), 0),
('control: glide edge', (3300000, False), 176953), ('control: at limit', (1813000, False), 0)],
[('regression round-down-cents 1', (2429991, False), 73421),
('regression round-down-cents 2', (2042226, False), 27277), ('partial repair guard 1', (3626001, True), 0),
('partial repair guard 2', (4499538, True), 103951), ('control: at limit', (1813000, False), 0),
('control: gliding zone', (1900000, False), 10353), ('control: full rate', (5000000, False), 275000),
('control: joint glide', (3700000, True), 8806)],
[('regression round-down-cents 1', (2561678, False), 89092),
('regression round-down-cents 2', (4398816, False), 241934), ('partial repair guard 1', (3835420, False), 210948),
('partial repair guard 2', (3256603, False), 171788), ('control: joint glide', (3700000, True), 8806),
('control: joint below', (3000000, True), 0), ('control: glide edge', (3300000, False), 176953),
('control: at limit', (1813000, False), 0)],
[('regression round-down-cents 1', (3091013, False), 152083),
('regression round-down-cents 2', (5134546, True), 179516), ('partial repair guard 1', (3974588, False), 218602),
('partial repair guard 2', (2115665, False), 36017), ('control: at limit', (1813000, False), 0),
('control: gliding zone', (1900000, False), 10353), ('control: full rate', (5000000, False), 275000),
('control: joint glide', (3700000, True), 8806)]]
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 round-down-cents 1 | 20254 | 20254 | Passed |
| regression round-down-cents 2 | 171788 | 171788 | Passed |
| partial repair guard 1 | 1 | 1 | Passed |
| partial repair guard 2 | 199430 | 199430 | Passed |
| control: at limit | 0 | 0 | Passed |
| control: gliding zone | 10353 | 10353 | Passed |
| control: full rate | 275000 | 275000 | Passed |
| control: joint glide | 8806 | 8806 | Passed |
SHA-256 / 5ec1e5c8c0f0320e09507fd04a07ccded288c10adb566e0d09dfdac17cb849b6
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.111949+00:00.
Case digest / bb362b668c7fd4c9f07e4073b5353c93050834ae027430cc55f0f130c04fdef0