FAILURE MAP
← Case archive

FA-62446 / Tax bracket computation / Open access

The allowance is reduced pound for pound above the taper threshold · case 01

The allowance vanishes at 112570 instead of 125140.

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

ROOT CAUSE

The reduction is the full excess over 100000 rather than half of it.

VERIFIED REPAIR

Reduce by floor(excess / 2).

Unsuccessful approach: Rounding the half-reduction up instead of down removes one pound too many on odd excesses.

Case contract

solve(income, pension): stipulated allowance taper in whole pounds. Adjusted net income ani = income - pension. The personal allowance 12570 is reduced by 1 for every 2 whole pounds of ani above 100000 (floor of half the excess), never below 0. Taxable = max(0, ani - allowance). Taxable income is taxed 20% up to 37700, 40% from 37700 to 125140, 45% above 125140. Return tax in integer pence.

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

N = 1
observations = []
def solve(income, pension):
    ani = income - pension
    allow = 12570
    if ani > 100000: allow = max(0, allow - (ani - 100000))
    taxable = max(0, ani - allow)
    basic = min(taxable, 37700)
    higher = max(0, min(taxable, 125140) - 37700)
    additional = max(0, taxable - 125140)
    return basic * 20 + higher * 40 + additional * 45
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression taper-ratio 1', (110001, 0), 3343240), ('regression taper-ratio 2', (110000, 0), 3343200),
  ('partial repair guard 2', (100003, 0), 2743360), ('control: basic and higher', (50000, 0), 748600),
  ('control: pension restores allowance', (130000, 5000), 4243200), ('control: fully tapered', (200000, 0), 7620300),
  ('control: allowance exhausted exactly', (125140, 0), 4251600)],
 [('regression taper-ratio 1', (130000, 5000), 4243200), ('regression taper-ratio 2', (100003, 0), 2743360),
  ('partial repair guard 1', (112519, 0), 3494320), ('partial repair guard 2', (113902, 1), 3577240),
  ('control: fully tapered', (200000, 0), 7620300), ('control: allowance exhausted exactly', (125140, 0), 4251600),
  ('control: just beyond exhaustion', (125143, 0), 4251735), ('control: below allowance', (9000, 0), 0)],
 [('regression taper-ratio 1', (112519, 0), 3494320), ('regression taper-ratio 2', (125142, 20000), 3051720),
  ('partial repair guard 1', (125141, 5000), 3951640), ('partial repair guard 2', (100001, 0), 2743240),
  ('control: below allowance', (9000, 0), 0), ('control: large pension', (160000, 60000), 2743200),
  ('control: mid taper', (140000, 0), 4920300), ('control: basic and higher', (50000, 0), 748600)],
 [('regression taper-ratio 1', (100003, 1), 2743320), ('regression taper-ratio 2', (102064, 0), 2867040),
  ('partial repair guard 1', (122175, 0), 4073680), ('partial repair guard 2', (120569, 0), 3977320),
  ('control: basic and higher', (50000, 0), 748600), ('control: odd excess in taper', (110001, 0), 3343240),
  ('control: pension restores allowance', (130000, 5000), 4243200), ('control: fully tapered', (200000, 0), 7620300)],
 [('regression taper-ratio 1', (113902, 1), 3577240), ('regression taper-ratio 2', (105360, 0), 3064800),
  ('partial repair guard 1', (114809, 5000), 3331720), ('partial repair guard 2', (106705, 5000), 2845480),
  ('control: fully tapered', (200000, 0), 7620300), ('control: allowance exhausted exactly', (125140, 0), 4251600),
  ('control: just beyond exhaustion', (125143, 0), 4251735), ('control: below allowance', (9000, 0), 0)]]
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 taper-ratio 135432803343240Failed
regression taper-ratio 235432003343200Failed
partial repair guard 227434402743360Failed
control: basic and higher748600748600Passed
control: pension restores allowance42460004243200Failed
control: fully tapered76203007620300Passed
control: allowance exhausted exactly42516004251600Passed

SHA-256 / a2e731cb6d79733608241017904ebc830c767aa5306d052de2ec5d9ea3f8a99a

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(income, pension):
    ani = income - pension
    allow = 12570
    if ani > 100000: allow = max(0, allow - -(-(ani - 100000) // 2))
    taxable = max(0, ani - allow)
    basic = min(taxable, 37700)
    higher = max(0, min(taxable, 125140) - 37700)
    additional = max(0, taxable - 125140)
    return basic * 20 + higher * 40 + additional * 45
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression taper-ratio 1', (110001, 0), 3343240), ('regression taper-ratio 2', (110000, 0), 3343200),
  ('partial repair guard 2', (100003, 0), 2743360), ('control: basic and higher', (50000, 0), 748600),
  ('control: pension restores allowance', (130000, 5000), 4243200), ('control: fully tapered', (200000, 0), 7620300),
  ('control: allowance exhausted exactly', (125140, 0), 4251600)],
 [('regression taper-ratio 1', (130000, 5000), 4243200), ('regression taper-ratio 2', (100003, 0), 2743360),
  ('partial repair guard 1', (112519, 0), 3494320), ('partial repair guard 2', (113902, 1), 3577240),
  ('control: fully tapered', (200000, 0), 7620300), ('control: allowance exhausted exactly', (125140, 0), 4251600),
  ('control: just beyond exhaustion', (125143, 0), 4251735), ('control: below allowance', (9000, 0), 0)],
 [('regression taper-ratio 1', (112519, 0), 3494320), ('regression taper-ratio 2', (125142, 20000), 3051720),
  ('partial repair guard 1', (125141, 5000), 3951640), ('partial repair guard 2', (100001, 0), 2743240),
  ('control: below allowance', (9000, 0), 0), ('control: large pension', (160000, 60000), 2743200),
  ('control: mid taper', (140000, 0), 4920300), ('control: basic and higher', (50000, 0), 748600)],
 [('regression taper-ratio 1', (100003, 1), 2743320), ('regression taper-ratio 2', (102064, 0), 2867040),
  ('partial repair guard 1', (122175, 0), 4073680), ('partial repair guard 2', (120569, 0), 3977320),
  ('control: basic and higher', (50000, 0), 748600), ('control: odd excess in taper', (110001, 0), 3343240),
  ('control: pension restores allowance', (130000, 5000), 4243200), ('control: fully tapered', (200000, 0), 7620300)],
 [('regression taper-ratio 1', (113902, 1), 3577240), ('regression taper-ratio 2', (105360, 0), 3064800),
  ('partial repair guard 1', (114809, 5000), 3331720), ('partial repair guard 2', (106705, 5000), 2845480),
  ('control: fully tapered', (200000, 0), 7620300), ('control: allowance exhausted exactly', (125140, 0), 4251600),
  ('control: just beyond exhaustion', (125143, 0), 4251735), ('control: below allowance', (9000, 0), 0)]]
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 taper-ratio 133432803343240Failed
regression taper-ratio 233432003343200Passed
partial repair guard 227434002743360Failed
control: basic and higher748600748600Passed
control: pension restores allowance42432004243200Passed
control: fully tapered76203007620300Passed
control: allowance exhausted exactly42516004251600Passed

SHA-256 / 1486a1cdbe4c53aa697015fd7aceae5efc7f0dac13564c81cdc2c59e03ecd51e

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(income, pension):
    ani = income - pension
    allow = 12570
    if ani > 100000: allow = max(0, allow - (ani - 100000) // 2)
    taxable = max(0, ani - allow)
    basic = min(taxable, 37700)
    higher = max(0, min(taxable, 125140) - 37700)
    additional = max(0, taxable - 125140)
    return basic * 20 + higher * 40 + additional * 45
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression taper-ratio 1', (110001, 0), 3343240), ('regression taper-ratio 2', (110000, 0), 3343200),
  ('partial repair guard 2', (100003, 0), 2743360), ('control: basic and higher', (50000, 0), 748600),
  ('control: pension restores allowance', (130000, 5000), 4243200), ('control: fully tapered', (200000, 0), 7620300),
  ('control: allowance exhausted exactly', (125140, 0), 4251600)],
 [('regression taper-ratio 1', (130000, 5000), 4243200), ('regression taper-ratio 2', (100003, 0), 2743360),
  ('partial repair guard 1', (112519, 0), 3494320), ('partial repair guard 2', (113902, 1), 3577240),
  ('control: fully tapered', (200000, 0), 7620300), ('control: allowance exhausted exactly', (125140, 0), 4251600),
  ('control: just beyond exhaustion', (125143, 0), 4251735), ('control: below allowance', (9000, 0), 0)],
 [('regression taper-ratio 1', (112519, 0), 3494320), ('regression taper-ratio 2', (125142, 20000), 3051720),
  ('partial repair guard 1', (125141, 5000), 3951640), ('partial repair guard 2', (100001, 0), 2743240),
  ('control: below allowance', (9000, 0), 0), ('control: large pension', (160000, 60000), 2743200),
  ('control: mid taper', (140000, 0), 4920300), ('control: basic and higher', (50000, 0), 748600)],
 [('regression taper-ratio 1', (100003, 1), 2743320), ('regression taper-ratio 2', (102064, 0), 2867040),
  ('partial repair guard 1', (122175, 0), 4073680), ('partial repair guard 2', (120569, 0), 3977320),
  ('control: basic and higher', (50000, 0), 748600), ('control: odd excess in taper', (110001, 0), 3343240),
  ('control: pension restores allowance', (130000, 5000), 4243200), ('control: fully tapered', (200000, 0), 7620300)],
 [('regression taper-ratio 1', (113902, 1), 3577240), ('regression taper-ratio 2', (105360, 0), 3064800),
  ('partial repair guard 1', (114809, 5000), 3331720), ('partial repair guard 2', (106705, 5000), 2845480),
  ('control: fully tapered', (200000, 0), 7620300), ('control: allowance exhausted exactly', (125140, 0), 4251600),
  ('control: just beyond exhaustion', (125143, 0), 4251735), ('control: below allowance', (9000, 0), 0)]]
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 taper-ratio 133432403343240Passed
regression taper-ratio 233432003343200Passed
partial repair guard 227433602743360Passed
control: basic and higher748600748600Passed
control: pension restores allowance42432004243200Passed
control: fully tapered76203007620300Passed
control: allowance exhausted exactly42516004251600Passed

SHA-256 / 30f6d92057b84c2417ff1f64c11ce8f48b26121b6c599d97b348018997d31fd6

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

Case digest / 58e94f501b0ca0a65139935971f3ca6eb5f2c7c2f3ef561dafe47c599726d671