FAILURE MAP
← Case archive

FA-62411 / Tax bracket computation / Open access

A deflationary year lowers the bracket thresholds · case 01

A factor below one reduces thresholds, raising real tax.

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

ROOT CAUSE

Each year's value overwrites the previous one without a max().

VERIFIED REPAIR

Keep the larger of the new value and the previous year's threshold.

Unsuccessful approach: Guarding only against falling below the original base still lets thresholds fall from an indexed peak.

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_FLOOR)) * 50
            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 no-deflation-guard 1', ([10000], ['1.02', '0.97']), [10200]),
  ('regression no-deflation-guard 2', ([10025], ['1']), [10025]),
  ('partial repair guard 2', ([191950, 47150, 360842], ['1.0716', '0.9901']), [205650, 50500, 386650]),
  ('control: two years', ([10000, 40000], ['1.031', '1.029']), [10600, 42400]),
  ('control: small compounding', ([10000], ['1.0049', '1.0049']), [10050]),
  ('control: no years', ([11600, 47150], []), [11600, 47150]),
  ('control: three years', ([47150, 100525, 191950], ['1.054', '1.032', '1.028']), [52700, 112400, 214600])],
 [('regression no-deflation-guard 1', ([191950, 47150, 360842], ['1.0716', '0.9901']), [205650, 50500, 386650]),
  ('regression no-deflation-guard 2', ([11600, 609350, 609350], ['1.0650', '0.9754']), [12350, 648950, 648950]),
  ('partial repair guard 2', ([11600], ['1.0358', '1.0752', '0.9901']), [12900]),
  ('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 no-deflation-guard 1', ([11600], ['1.0358', '1.0752', '0.9901']), [12900]),
  ('regression no-deflation-guard 2', ([243725], ['0.9795', '1.0047']), [243725]),
  ('partial repair guard 1', ([10000, 243725, 243725], ['1.0568', '0.9846', '0.9825']), [10550, 257550, 257550]),
  ('partial repair guard 2', ([191950], ['1.0175', '0.9701', '1.0078', '0.9784']), [195300]),
  ('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 no-deflation-guard 1', ([243725], ['0.9947', '0.9867']), [243725]),
  ('regression no-deflation-guard 2', ([10000, 243725, 243725], ['1.0568', '0.9846', '0.9825']),
   [10550, 257550, 257550]),
  ('partial repair guard 1', ([243725, 10000, 140645], ['1.0182', '1.0339', '0.9851', '0.9830']),
   [256550, 10500, 148050]),
  ('partial repair guard 2', ([47150], ['1.0333', '0.9741']), [48700]),
  ('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 no-deflation-guard 1', ([609350], ['0.9880']), [609350]),
  ('regression no-deflation-guard 2', ([609350], ['0.9788']), [609350]),
  ('partial repair guard 1', ([609350, 10000, 680541], ['0.9966', '1.0113', '0.9967', '0.9988']),
   [614100, 10050, 685850]),
  ('partial repair guard 2', ([191950, 609350, 609350], ['1.0136', '0.9903']), [194550, 617600, 617600]),
  ('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 no-deflation-guard 1[9850][10200]Failed
regression no-deflation-guard 2[10000][10025]Failed
partial repair guard 2[203650, 50000, 382850][205650, 50500, 386650]Failed
control: two years[10600, 42400][10600, 42400]Passed
control: small compounding[10050][10050]Passed
control: no years[11600, 47150][11600, 47150]Passed
control: three years[52700, 112400, 214600][52700, 112400, 214600]Passed

SHA-256 / 46c5d59b995bebe67e5f7678f4715ffd8d5bf694e0a9530491fda0b528e6f4f0

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_FLOOR)) * 50
            prev = max(t, v)
        out.append(prev)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression no-deflation-guard 1', ([10000], ['1.02', '0.97']), [10200]),
  ('regression no-deflation-guard 2', ([10025], ['1']), [10025]),
  ('partial repair guard 2', ([191950, 47150, 360842], ['1.0716', '0.9901']), [205650, 50500, 386650]),
  ('control: two years', ([10000, 40000], ['1.031', '1.029']), [10600, 42400]),
  ('control: small compounding', ([10000], ['1.0049', '1.0049']), [10050]),
  ('control: no years', ([11600, 47150], []), [11600, 47150]),
  ('control: three years', ([47150, 100525, 191950], ['1.054', '1.032', '1.028']), [52700, 112400, 214600])],
 [('regression no-deflation-guard 1', ([191950, 47150, 360842], ['1.0716', '0.9901']), [205650, 50500, 386650]),
  ('regression no-deflation-guard 2', ([11600, 609350, 609350], ['1.0650', '0.9754']), [12350, 648950, 648950]),
  ('partial repair guard 2', ([11600], ['1.0358', '1.0752', '0.9901']), [12900]),
  ('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 no-deflation-guard 1', ([11600], ['1.0358', '1.0752', '0.9901']), [12900]),
  ('regression no-deflation-guard 2', ([243725], ['0.9795', '1.0047']), [243725]),
  ('partial repair guard 1', ([10000, 243725, 243725], ['1.0568', '0.9846', '0.9825']), [10550, 257550, 257550]),
  ('partial repair guard 2', ([191950], ['1.0175', '0.9701', '1.0078', '0.9784']), [195300]),
  ('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 no-deflation-guard 1', ([243725], ['0.9947', '0.9867']), [243725]),
  ('regression no-deflation-guard 2', ([10000, 243725, 243725], ['1.0568', '0.9846', '0.9825']),
   [10550, 257550, 257550]),
  ('partial repair guard 1', ([243725, 10000, 140645], ['1.0182', '1.0339', '0.9851', '0.9830']),
   [256550, 10500, 148050]),
  ('partial repair guard 2', ([47150], ['1.0333', '0.9741']), [48700]),
  ('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 no-deflation-guard 1', ([609350], ['0.9880']), [609350]),
  ('regression no-deflation-guard 2', ([609350], ['0.9788']), [609350]),
  ('partial repair guard 1', ([609350, 10000, 680541], ['0.9966', '1.0113', '0.9967', '0.9988']),
   [614100, 10050, 685850]),
  ('partial repair guard 2', ([191950, 609350, 609350], ['1.0136', '0.9903']), [194550, 617600, 617600]),
  ('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 no-deflation-guard 1[10000][10200]Failed
regression no-deflation-guard 2[10025][10025]Passed
partial repair guard 2[203650, 50000, 382850][205650, 50500, 386650]Failed
control: two years[10600, 42400][10600, 42400]Passed
control: small compounding[10050][10050]Passed
control: no years[11600, 47150][11600, 47150]Passed
control: three years[52700, 112400, 214600][52700, 112400, 214600]Passed

SHA-256 / b757a708c7a9ad5c6926d687ea69b6cfce5ca9cfb773e01417fbccec9a98d697

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 no-deflation-guard 1', ([10000], ['1.02', '0.97']), [10200]),
  ('regression no-deflation-guard 2', ([10025], ['1']), [10025]),
  ('partial repair guard 2', ([191950, 47150, 360842], ['1.0716', '0.9901']), [205650, 50500, 386650]),
  ('control: two years', ([10000, 40000], ['1.031', '1.029']), [10600, 42400]),
  ('control: small compounding', ([10000], ['1.0049', '1.0049']), [10050]),
  ('control: no years', ([11600, 47150], []), [11600, 47150]),
  ('control: three years', ([47150, 100525, 191950], ['1.054', '1.032', '1.028']), [52700, 112400, 214600])],
 [('regression no-deflation-guard 1', ([191950, 47150, 360842], ['1.0716', '0.9901']), [205650, 50500, 386650]),
  ('regression no-deflation-guard 2', ([11600, 609350, 609350], ['1.0650', '0.9754']), [12350, 648950, 648950]),
  ('partial repair guard 2', ([11600], ['1.0358', '1.0752', '0.9901']), [12900]),
  ('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 no-deflation-guard 1', ([11600], ['1.0358', '1.0752', '0.9901']), [12900]),
  ('regression no-deflation-guard 2', ([243725], ['0.9795', '1.0047']), [243725]),
  ('partial repair guard 1', ([10000, 243725, 243725], ['1.0568', '0.9846', '0.9825']), [10550, 257550, 257550]),
  ('partial repair guard 2', ([191950], ['1.0175', '0.9701', '1.0078', '0.9784']), [195300]),
  ('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 no-deflation-guard 1', ([243725], ['0.9947', '0.9867']), [243725]),
  ('regression no-deflation-guard 2', ([10000, 243725, 243725], ['1.0568', '0.9846', '0.9825']),
   [10550, 257550, 257550]),
  ('partial repair guard 1', ([243725, 10000, 140645], ['1.0182', '1.0339', '0.9851', '0.9830']),
   [256550, 10500, 148050]),
  ('partial repair guard 2', ([47150], ['1.0333', '0.9741']), [48700]),
  ('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 no-deflation-guard 1', ([609350], ['0.9880']), [609350]),
  ('regression no-deflation-guard 2', ([609350], ['0.9788']), [609350]),
  ('partial repair guard 1', ([609350, 10000, 680541], ['0.9966', '1.0113', '0.9967', '0.9988']),
   [614100, 10050, 685850]),
  ('partial repair guard 2', ([191950, 609350, 609350], ['1.0136', '0.9903']), [194550, 617600, 617600]),
  ('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 no-deflation-guard 1[10200][10200]Passed
regression no-deflation-guard 2[10025][10025]Passed
partial repair guard 2[205650, 50500, 386650][205650, 50500, 386650]Passed
control: two years[10600, 42400][10600, 42400]Passed
control: small compounding[10050][10050]Passed
control: no years[11600, 47150][11600, 47150]Passed
control: three years[52700, 112400, 214600][52700, 112400, 214600]Passed

SHA-256 / c0660920492b84900fa82038f200ff05e7c6d6a9982abc14c107ef78b1bba901

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

Case digest / e8b7815c60c2dd852e091ac27f28d5881bc58e215b342cad6b9afa19fe2afe9d