FAILURE MAP
← Case archive

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.

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

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 fixtureActualExpectedOutcome
regression round-down-cents 12025520254Failed
regression round-down-cents 2171789171788Failed
partial repair guard 111Passed
partial repair guard 2199430199430Passed
control: at limit00Passed
control: gliding zone1035310353Passed
control: full rate275000275000Passed
control: joint glide88068806Passed

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 fixtureActualExpectedOutcome
regression round-down-cents 12025520254Failed
regression round-down-cents 2171789171788Failed
partial repair guard 121Failed
partial repair guard 2199431199430Failed
control: at limit00Passed
control: gliding zone1035310353Passed
control: full rate275000275000Passed
control: joint glide88068806Passed

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 fixtureActualExpectedOutcome
regression round-down-cents 12025420254Passed
regression round-down-cents 2171788171788Passed
partial repair guard 111Passed
partial repair guard 2199430199430Passed
control: at limit00Passed
control: gliding zone1035310353Passed
control: full rate275000275000Passed
control: joint glide88068806Passed

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