FAILURE MAP
← Case archive

FA-62406 / Tax bracket computation / Open access

Indexed thresholds are rounded to the nearest 50 instead of down · case 01

Some thresholds are 50 higher than the published figure.

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

ROOT CAUSE

Indexed values are rounded half-up to a multiple of 50.

VERIFIED REPAIR

Round indexed values down to a multiple of 50.

Unsuccessful approach: Rounding up is the opposite of the stipulated downward rounding.

Case contract

solve(base, factors): base is a list of statutory thresholds; factors are yearly inflation factors (decimal strings). For every year, a threshold is the base times the cumulative product of factors so far, rounded DOWN to a multiple of 50 (indexing always starts again from the unrounded base, never from a previously rounded value). A threshold may never fall below its previous year's value. Return the final-year thresholds.

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 decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN, ROUND_FLOOR, ROUND_CEILING, ROUND_DOWN
N = 1
observations = []
def solve(base, factors):
    out = []
    for t in base:
        cum, prev = Decimal(1), t
        for f in factors:
            cum *= Decimal(f)
            v = int((t * cum / 50).to_integral_value(rounding=ROUND_HALF_UP)) * 50
            prev = max(prev, v)
        out.append(prev)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression rounding-direction 1', ([10000, 40000], ['1.031', '1.029']), [10600, 42400]),
  ('regression rounding-direction 2', ([10000], ['1.0049', '1.0049']), [10050]),
  ('control: deflation year', ([10000], ['1.02', '0.97']), [10200]),
  ('control: unrounded base', ([10025], ['1']), [10025]), ('control: no years', ([11600, 47150], []), [11600, 47150]),
  ('control: three years', ([47150, 100525, 191950], ['1.054', '1.032', '1.028']), [52700, 112400, 214600])],
 [('regression rounding-direction 1', ([10025], ['1']), [10025]),
  ('regression rounding-direction 2', ([47150, 100525, 191950], ['1.054', '1.032', '1.028']), [52700, 112400, 214600]),
  ('control: no years', ([11600, 47150], []), [11600, 47150]),
  ('control: two years', ([10000, 40000], ['1.031', '1.029']), [10600, 42400]),
  ('control: small compounding', ([10000], ['1.0049', '1.0049']), [10050]),
  ('control: deflation year', ([10000], ['1.02', '0.97']), [10200])],
 [('regression rounding-direction 1', ([243725, 11600], ['0.9717', '1.0752']), [254600, 12100]),
  ('regression rounding-direction 2', ([102361], ['0.9751', '1.0398']), [103750]),
  ('partial repair guard 1', ([47150, 47150, 609350], ['0.9826', '1.0776']), [49900, 49900, 645200]),
  ('control: two years', ([10000, 40000], ['1.031', '1.029']), [10600, 42400]),
  ('control: small compounding', ([10000], ['1.0049', '1.0049']), [10050]),
  ('control: deflation year', ([10000], ['1.02', '0.97']), [10200]),
  ('control: unrounded base', ([10025], ['1']), [10025])],
 [('regression rounding-direction 1', ([10000, 100525, 11600], ['1.0397']), [10350, 104500, 12050]),
  ('regression rounding-direction 2', ([11600], ['0.9966', '1.0602', '1.0714', '1.0361', '1.0508']), [14250]),
  ('partial repair guard 1', ([102361], ['0.9751', '1.0398']), [103750]),
  ('control: unrounded base', ([10025], ['1']), [10025]), ('control: no years', ([11600, 47150], []), [11600, 47150]),
  ('control: three years', ([47150, 100525, 191950], ['1.054', '1.032', '1.028']), [52700, 112400, 214600]),
  ('control: two years', ([10000, 40000], ['1.031', '1.029']), [10600, 42400])],
 [('regression rounding-direction 1', ([354067, 11600, 609350], ['1.0605']), [375450, 12300, 646200]),
  ('regression rounding-direction 2', ([191950, 100525], ['1.0054']), [192950, 101050]),
  ('partial repair guard 1', ([11600], ['1.0439', '0.9870', '1.0302']), [12300]),
  ('partial repair guard 2', ([11600], ['0.9966', '1.0602', '1.0714', '1.0361', '1.0508']), [14250]),
  ('control: two years', ([10000, 40000], ['1.031', '1.029']), [10600, 42400]),
  ('control: small compounding', ([10000], ['1.0049', '1.0049']), [10050]),
  ('control: deflation year', ([10000], ['1.02', '0.97']), [10200]),
  ('control: unrounded base', ([10025], ['1']), [10025])]]
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 rounding-direction 1[10600, 42450][10600, 42400]Failed
regression rounding-direction 2[10100][10050]Failed
control: deflation year[10200][10200]Passed
control: unrounded base[10050][10025]Failed
control: no years[11600, 47150][11600, 47150]Passed
control: three years[52700, 112400, 214650][52700, 112400, 214600]Failed

SHA-256 / 6c9d8a8f0a060e83672d4b62849d16924487c9593444f3346eefc9b6e0e6ac40

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN, ROUND_FLOOR, ROUND_CEILING, ROUND_DOWN
N = 1
observations = []
def solve(base, factors):
    out = []
    for t in base:
        cum, prev = Decimal(1), t
        for f in factors:
            cum *= Decimal(f)
            v = int((t * cum / 50).to_integral_value(rounding=ROUND_CEILING)) * 50
            prev = max(prev, v)
        out.append(prev)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression rounding-direction 1', ([10000, 40000], ['1.031', '1.029']), [10600, 42400]),
  ('regression rounding-direction 2', ([10000], ['1.0049', '1.0049']), [10050]),
  ('control: deflation year', ([10000], ['1.02', '0.97']), [10200]),
  ('control: unrounded base', ([10025], ['1']), [10025]), ('control: no years', ([11600, 47150], []), [11600, 47150]),
  ('control: three years', ([47150, 100525, 191950], ['1.054', '1.032', '1.028']), [52700, 112400, 214600])],
 [('regression rounding-direction 1', ([10025], ['1']), [10025]),
  ('regression rounding-direction 2', ([47150, 100525, 191950], ['1.054', '1.032', '1.028']), [52700, 112400, 214600]),
  ('control: no years', ([11600, 47150], []), [11600, 47150]),
  ('control: two years', ([10000, 40000], ['1.031', '1.029']), [10600, 42400]),
  ('control: small compounding', ([10000], ['1.0049', '1.0049']), [10050]),
  ('control: deflation year', ([10000], ['1.02', '0.97']), [10200])],
 [('regression rounding-direction 1', ([243725, 11600], ['0.9717', '1.0752']), [254600, 12100]),
  ('regression rounding-direction 2', ([102361], ['0.9751', '1.0398']), [103750]),
  ('partial repair guard 1', ([47150, 47150, 609350], ['0.9826', '1.0776']), [49900, 49900, 645200]),
  ('control: two years', ([10000, 40000], ['1.031', '1.029']), [10600, 42400]),
  ('control: small compounding', ([10000], ['1.0049', '1.0049']), [10050]),
  ('control: deflation year', ([10000], ['1.02', '0.97']), [10200]),
  ('control: unrounded base', ([10025], ['1']), [10025])],
 [('regression rounding-direction 1', ([10000, 100525, 11600], ['1.0397']), [10350, 104500, 12050]),
  ('regression rounding-direction 2', ([11600], ['0.9966', '1.0602', '1.0714', '1.0361', '1.0508']), [14250]),
  ('partial repair guard 1', ([102361], ['0.9751', '1.0398']), [103750]),
  ('control: unrounded base', ([10025], ['1']), [10025]), ('control: no years', ([11600, 47150], []), [11600, 47150]),
  ('control: three years', ([47150, 100525, 191950], ['1.054', '1.032', '1.028']), [52700, 112400, 214600]),
  ('control: two years', ([10000, 40000], ['1.031', '1.029']), [10600, 42400])],
 [('regression rounding-direction 1', ([354067, 11600, 609350], ['1.0605']), [375450, 12300, 646200]),
  ('regression rounding-direction 2', ([191950, 100525], ['1.0054']), [192950, 101050]),
  ('partial repair guard 1', ([11600], ['1.0439', '0.9870', '1.0302']), [12300]),
  ('partial repair guard 2', ([11600], ['0.9966', '1.0602', '1.0714', '1.0361', '1.0508']), [14250]),
  ('control: two years', ([10000, 40000], ['1.031', '1.029']), [10600, 42400]),
  ('control: small compounding', ([10000], ['1.0049', '1.0049']), [10050]),
  ('control: deflation year', ([10000], ['1.02', '0.97']), [10200]),
  ('control: unrounded base', ([10025], ['1']), [10025])]]
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 rounding-direction 1[10650, 42450][10600, 42400]Failed
regression rounding-direction 2[10100][10050]Failed
control: deflation year[10200][10200]Passed
control: unrounded base[10050][10025]Failed
control: no years[11600, 47150][11600, 47150]Passed
control: three years[52750, 112450, 214650][52700, 112400, 214600]Failed

SHA-256 / fec15bf7406ab58005242c0b204a5ed804cbcd613b980a77acf91bdc69077edd

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN, ROUND_FLOOR, ROUND_CEILING, ROUND_DOWN
N = 1
observations = []
def solve(base, factors):
    out = []
    for t in base:
        cum, prev = Decimal(1), t
        for f in factors:
            cum *= Decimal(f)
            v = int((t * cum / 50).to_integral_value(rounding=ROUND_FLOOR)) * 50
            prev = max(prev, v)
        out.append(prev)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression rounding-direction 1', ([10000, 40000], ['1.031', '1.029']), [10600, 42400]),
  ('regression rounding-direction 2', ([10000], ['1.0049', '1.0049']), [10050]),
  ('control: deflation year', ([10000], ['1.02', '0.97']), [10200]),
  ('control: unrounded base', ([10025], ['1']), [10025]), ('control: no years', ([11600, 47150], []), [11600, 47150]),
  ('control: three years', ([47150, 100525, 191950], ['1.054', '1.032', '1.028']), [52700, 112400, 214600])],
 [('regression rounding-direction 1', ([10025], ['1']), [10025]),
  ('regression rounding-direction 2', ([47150, 100525, 191950], ['1.054', '1.032', '1.028']), [52700, 112400, 214600]),
  ('control: no years', ([11600, 47150], []), [11600, 47150]),
  ('control: two years', ([10000, 40000], ['1.031', '1.029']), [10600, 42400]),
  ('control: small compounding', ([10000], ['1.0049', '1.0049']), [10050]),
  ('control: deflation year', ([10000], ['1.02', '0.97']), [10200])],
 [('regression rounding-direction 1', ([243725, 11600], ['0.9717', '1.0752']), [254600, 12100]),
  ('regression rounding-direction 2', ([102361], ['0.9751', '1.0398']), [103750]),
  ('partial repair guard 1', ([47150, 47150, 609350], ['0.9826', '1.0776']), [49900, 49900, 645200]),
  ('control: two years', ([10000, 40000], ['1.031', '1.029']), [10600, 42400]),
  ('control: small compounding', ([10000], ['1.0049', '1.0049']), [10050]),
  ('control: deflation year', ([10000], ['1.02', '0.97']), [10200]),
  ('control: unrounded base', ([10025], ['1']), [10025])],
 [('regression rounding-direction 1', ([10000, 100525, 11600], ['1.0397']), [10350, 104500, 12050]),
  ('regression rounding-direction 2', ([11600], ['0.9966', '1.0602', '1.0714', '1.0361', '1.0508']), [14250]),
  ('partial repair guard 1', ([102361], ['0.9751', '1.0398']), [103750]),
  ('control: unrounded base', ([10025], ['1']), [10025]), ('control: no years', ([11600, 47150], []), [11600, 47150]),
  ('control: three years', ([47150, 100525, 191950], ['1.054', '1.032', '1.028']), [52700, 112400, 214600]),
  ('control: two years', ([10000, 40000], ['1.031', '1.029']), [10600, 42400])],
 [('regression rounding-direction 1', ([354067, 11600, 609350], ['1.0605']), [375450, 12300, 646200]),
  ('regression rounding-direction 2', ([191950, 100525], ['1.0054']), [192950, 101050]),
  ('partial repair guard 1', ([11600], ['1.0439', '0.9870', '1.0302']), [12300]),
  ('partial repair guard 2', ([11600], ['0.9966', '1.0602', '1.0714', '1.0361', '1.0508']), [14250]),
  ('control: two years', ([10000, 40000], ['1.031', '1.029']), [10600, 42400]),
  ('control: small compounding', ([10000], ['1.0049', '1.0049']), [10050]),
  ('control: deflation year', ([10000], ['1.02', '0.97']), [10200]),
  ('control: unrounded base', ([10025], ['1']), [10025])]]
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 rounding-direction 1[10600, 42400][10600, 42400]Passed
regression rounding-direction 2[10050][10050]Passed
control: deflation year[10200][10200]Passed
control: unrounded base[10025][10025]Passed
control: no years[11600, 47150][11600, 47150]Passed
control: three years[52700, 112400, 214600][52700, 112400, 214600]Passed

SHA-256 / 899660f4bcd2b5697620c7adb6e17a8c3747af7fa91377a2770438236d79664c

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

Case digest / 7e4ff6c7cf2c63ee56f12d1ab10360bdd974b8ec757a689dd29d20b3ab0eb483