FAILURE MAP
← Case archive

FA-62401 / Tax bracket computation / Open access

Each year indexes the previously rounded threshold · case 01

After a few years thresholds lag the published cumulative indexation.

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

ROOT CAUSE

The factor is applied to last year's rounded threshold instead of the unrounded base.

VERIFIED REPAIR

Multiply the original base by the cumulative factor, then round.

Unsuccessful approach: Rounding the cumulative factor to four decimals each year still compounds a rounding drift.

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:
            v = int((prev * Decimal(f) / 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 index-from-rounded 1', ([10000], ['1.0049', '1.0049']), [10050]),
  ('regression index-from-rounded 2', ([47150, 100525, 191950], ['1.054', '1.032', '1.028']), [52700, 112400, 214600]),
  ('partial repair guard 1', ([47150, 47150, 609350], ['0.9826', '1.0776']), [49900, 49900, 645200]),
  ('partial repair guard 2', ([243725], ['1.0800', '1.0031', '1.0633', '0.9916', '1.0198']), [283900]),
  ('control: two years', ([10000, 40000], ['1.031', '1.029']), [10600, 42400]),
  ('control: deflation year', ([10000], ['1.02', '0.97']), [10200]),
  ('control: unrounded base', ([10025], ['1']), [10025]), ('control: no years', ([11600, 47150], []), [11600, 47150])],
 [('regression index-from-rounded 1', ([10000, 40000], ['1.031', '1.029']), [10600, 42400]),
  ('regression index-from-rounded 2', ([47150, 47150, 609350], ['0.9826', '1.0776']), [49900, 49900, 645200]),
  ('partial repair guard 1', ([268354, 243725], ['1.0072', '1.0060']), [271900, 246950]),
  ('partial repair guard 2', ([609350, 191950, 243725], ['1.0507', '0.9882', '1.0150', '1.0296']),
   [661150, 208250, 264450]),
  ('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: small compounding', ([10000], ['1.0049', '1.0049']), [10050])],
 [('regression index-from-rounded 1', ([243725, 11600], ['0.9717', '1.0752']), [254600, 12100]),
  ('regression index-from-rounded 2', ([102361], ['0.9751', '1.0398']), [103750]),
  ('partial repair guard 1', ([602498, 11600], ['1.0084', '1.0091']), [613050, 11800]),
  ('partial repair guard 2', ([609350, 10000, 680541], ['0.9966', '1.0113', '0.9967', '0.9988']),
   [614100, 10050, 685850]),
  ('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 index-from-rounded 1', ([11600], ['1.0439', '0.9870', '1.0302']), [12300]),
  ('regression index-from-rounded 2', ([11600], ['0.9966', '1.0602', '1.0714', '1.0361', '1.0508']), [14250]),
  ('partial repair guard 1', ([609350, 16633, 609350], ['1.0660', '1.0009', '1.0062', '1.0674', '0.9939']),
   [698250, 19050, 698250]),
  ('partial repair guard 2', ([697474, 47150], ['0.9883', '1.0237']), [705650, 47700]),
  ('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 index-from-rounded 1', ([10000, 47150, 191950], ['1.0605', '1.0510', '0.9809', '1.0498']),
   [11450, 54100, 220300]),
  ('regression index-from-rounded 2', ([11600, 243725], ['1.0641', '1.0478', '0.9707', '1.0624', '1.0640']),
   [14150, 298150]),
  ('partial repair guard 1', ([47150, 100525, 11600], ['1.0430', '1.0034', '0.9845', '0.9761']),
   [49300, 105200, 12100]),
  ('partial repair guard 2', ([11600, 609350], ['1.0003', '1.0039', '1.0541', '1.0389', '1.0444']), [13300, 699850]),
  ('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 index-from-rounded 1[10000][10050]Failed
regression index-from-rounded 2[52600, 112350, 214550][52700, 112400, 214600]Failed
partial repair guard 1[50800, 50800, 656600][49900, 49900, 645200]Failed
partial repair guard 2[286250][283900]Failed
control: two years[10550, 42350][10600, 42400]Failed
control: deflation year[10200][10200]Passed
control: unrounded base[10025][10025]Passed
control: no years[11600, 47150][11600, 47150]Passed

SHA-256 / c4cd2f5d52a84f04af66f967416655f5b8f4991749f045035fe76c0037d2e685

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 = (cum * Decimal(f)).quantize(Decimal('0.0001'), rounding=ROUND_HALF_EVEN)
            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 index-from-rounded 1', ([10000], ['1.0049', '1.0049']), [10050]),
  ('regression index-from-rounded 2', ([47150, 100525, 191950], ['1.054', '1.032', '1.028']), [52700, 112400, 214600]),
  ('partial repair guard 1', ([47150, 47150, 609350], ['0.9826', '1.0776']), [49900, 49900, 645200]),
  ('partial repair guard 2', ([243725], ['1.0800', '1.0031', '1.0633', '0.9916', '1.0198']), [283900]),
  ('control: two years', ([10000, 40000], ['1.031', '1.029']), [10600, 42400]),
  ('control: deflation year', ([10000], ['1.02', '0.97']), [10200]),
  ('control: unrounded base', ([10025], ['1']), [10025]), ('control: no years', ([11600, 47150], []), [11600, 47150])],
 [('regression index-from-rounded 1', ([10000, 40000], ['1.031', '1.029']), [10600, 42400]),
  ('regression index-from-rounded 2', ([47150, 47150, 609350], ['0.9826', '1.0776']), [49900, 49900, 645200]),
  ('partial repair guard 1', ([268354, 243725], ['1.0072', '1.0060']), [271900, 246950]),
  ('partial repair guard 2', ([609350, 191950, 243725], ['1.0507', '0.9882', '1.0150', '1.0296']),
   [661150, 208250, 264450]),
  ('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: small compounding', ([10000], ['1.0049', '1.0049']), [10050])],
 [('regression index-from-rounded 1', ([243725, 11600], ['0.9717', '1.0752']), [254600, 12100]),
  ('regression index-from-rounded 2', ([102361], ['0.9751', '1.0398']), [103750]),
  ('partial repair guard 1', ([602498, 11600], ['1.0084', '1.0091']), [613050, 11800]),
  ('partial repair guard 2', ([609350, 10000, 680541], ['0.9966', '1.0113', '0.9967', '0.9988']),
   [614100, 10050, 685850]),
  ('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 index-from-rounded 1', ([11600], ['1.0439', '0.9870', '1.0302']), [12300]),
  ('regression index-from-rounded 2', ([11600], ['0.9966', '1.0602', '1.0714', '1.0361', '1.0508']), [14250]),
  ('partial repair guard 1', ([609350, 16633, 609350], ['1.0660', '1.0009', '1.0062', '1.0674', '0.9939']),
   [698250, 19050, 698250]),
  ('partial repair guard 2', ([697474, 47150], ['0.9883', '1.0237']), [705650, 47700]),
  ('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 index-from-rounded 1', ([10000, 47150, 191950], ['1.0605', '1.0510', '0.9809', '1.0498']),
   [11450, 54100, 220300]),
  ('regression index-from-rounded 2', ([11600, 243725], ['1.0641', '1.0478', '0.9707', '1.0624', '1.0640']),
   [14150, 298150]),
  ('partial repair guard 1', ([47150, 100525, 11600], ['1.0430', '1.0034', '0.9845', '0.9761']),
   [49300, 105200, 12100]),
  ('partial repair guard 2', ([11600, 609350], ['1.0003', '1.0039', '1.0541', '1.0389', '1.0444']), [13300, 699850]),
  ('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 index-from-rounded 1[10050][10050]Passed
regression index-from-rounded 2[52700, 112400, 214600][52700, 112400, 214600]Passed
partial repair guard 1[49900, 49900, 645150][49900, 49900, 645200]Failed
partial repair guard 2[283850][283900]Failed
control: two years[10600, 42400][10600, 42400]Passed
control: deflation year[10200][10200]Passed
control: unrounded base[10025][10025]Passed
control: no years[11600, 47150][11600, 47150]Passed

SHA-256 / e8086670d3f7c9f011a2dd480e49724af57cbd85e1edbaf0a04b3eebf09adb75

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 index-from-rounded 1', ([10000], ['1.0049', '1.0049']), [10050]),
  ('regression index-from-rounded 2', ([47150, 100525, 191950], ['1.054', '1.032', '1.028']), [52700, 112400, 214600]),
  ('partial repair guard 1', ([47150, 47150, 609350], ['0.9826', '1.0776']), [49900, 49900, 645200]),
  ('partial repair guard 2', ([243725], ['1.0800', '1.0031', '1.0633', '0.9916', '1.0198']), [283900]),
  ('control: two years', ([10000, 40000], ['1.031', '1.029']), [10600, 42400]),
  ('control: deflation year', ([10000], ['1.02', '0.97']), [10200]),
  ('control: unrounded base', ([10025], ['1']), [10025]), ('control: no years', ([11600, 47150], []), [11600, 47150])],
 [('regression index-from-rounded 1', ([10000, 40000], ['1.031', '1.029']), [10600, 42400]),
  ('regression index-from-rounded 2', ([47150, 47150, 609350], ['0.9826', '1.0776']), [49900, 49900, 645200]),
  ('partial repair guard 1', ([268354, 243725], ['1.0072', '1.0060']), [271900, 246950]),
  ('partial repair guard 2', ([609350, 191950, 243725], ['1.0507', '0.9882', '1.0150', '1.0296']),
   [661150, 208250, 264450]),
  ('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: small compounding', ([10000], ['1.0049', '1.0049']), [10050])],
 [('regression index-from-rounded 1', ([243725, 11600], ['0.9717', '1.0752']), [254600, 12100]),
  ('regression index-from-rounded 2', ([102361], ['0.9751', '1.0398']), [103750]),
  ('partial repair guard 1', ([602498, 11600], ['1.0084', '1.0091']), [613050, 11800]),
  ('partial repair guard 2', ([609350, 10000, 680541], ['0.9966', '1.0113', '0.9967', '0.9988']),
   [614100, 10050, 685850]),
  ('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 index-from-rounded 1', ([11600], ['1.0439', '0.9870', '1.0302']), [12300]),
  ('regression index-from-rounded 2', ([11600], ['0.9966', '1.0602', '1.0714', '1.0361', '1.0508']), [14250]),
  ('partial repair guard 1', ([609350, 16633, 609350], ['1.0660', '1.0009', '1.0062', '1.0674', '0.9939']),
   [698250, 19050, 698250]),
  ('partial repair guard 2', ([697474, 47150], ['0.9883', '1.0237']), [705650, 47700]),
  ('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 index-from-rounded 1', ([10000, 47150, 191950], ['1.0605', '1.0510', '0.9809', '1.0498']),
   [11450, 54100, 220300]),
  ('regression index-from-rounded 2', ([11600, 243725], ['1.0641', '1.0478', '0.9707', '1.0624', '1.0640']),
   [14150, 298150]),
  ('partial repair guard 1', ([47150, 100525, 11600], ['1.0430', '1.0034', '0.9845', '0.9761']),
   [49300, 105200, 12100]),
  ('partial repair guard 2', ([11600, 609350], ['1.0003', '1.0039', '1.0541', '1.0389', '1.0444']), [13300, 699850]),
  ('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 index-from-rounded 1[10050][10050]Passed
regression index-from-rounded 2[52700, 112400, 214600][52700, 112400, 214600]Passed
partial repair guard 1[49900, 49900, 645200][49900, 49900, 645200]Passed
partial repair guard 2[283900][283900]Passed
control: two years[10600, 42400][10600, 42400]Passed
control: deflation year[10200][10200]Passed
control: unrounded base[10025][10025]Passed
control: no years[11600, 47150][11600, 47150]Passed

SHA-256 / 3c46eadd2db993faaffda5f626dcf9badf87b6b67330fbf34edb3747bab36d59

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

Case digest / 63d343075af6dc13a217ec9c605c88947d2ee4db9ef5a05e3fcc107789124c0a