FAILURE MAP
← Case archive

FA-62456 / Tax bracket computation / Open access

The taper is measured on gross income instead of adjusted net income · case 01

Pension contributions no longer restore the personal allowance.

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

ROOT CAUSE

The reduction uses income - 100000 instead of ani - 100000.

VERIFIED REPAIR

Measure the taper on adjusted net income.

Unsuccessful approach: Tapering on ani but taxing income before the pension deduction overstates taxable income.

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 income > 100000: allow = max(0, allow - (income - 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-measure 1', (130000, 5000), 4243200), ('regression taper-measure 2', (160000, 60000), 2743200),
  ('control: basic and higher', (50000, 0), 748600), ('control: odd excess in taper', (110001, 0), 3343240),
  ('control: fully tapered', (200000, 0), 7620300), ('control: allowance exhausted exactly', (125140, 0), 4251600)],
 [('regression taper-measure 1', (125142, 20000), 3051720), ('regression taper-measure 2', (100003, 5000), 2543320),
  ('partial repair guard 1', (100001, 5000), 2543240), ('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-measure 1', (103415, 5000), 2679800), ('regression taper-measure 2', (125142, 31576), 2485840),
  ('partial repair guard 1', (100003, 5000), 2543320), ('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-measure 1', (113902, 1), 3577240), ('regression taper-measure 2', (125141, 5000), 3951640),
  ('partial repair guard 1', (125142, 1), 4251645), ('partial repair guard 2', (125141, 1), 4251600),
  ('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-measure 1', (100003, 7786), 2431880), ('regression taper-measure 2', (105804, 5000), 2791440),
  ('partial repair guard 1', (125142, 31576), 2485840), ('partial repair guard 2', (100003, 1), 2743320),
  ('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-measure 142460004243200Failed
regression taper-measure 232460002743200Failed
control: basic and higher748600748600Passed
control: odd excess in taper33432403343240Passed
control: fully tapered76203007620300Passed
control: allowance exhausted exactly42516004251600Passed

SHA-256 / a0ca0e60779121ea82932ed630dd26b95639718ae9f072b98ec1fcde10dcf7c6

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, income - 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-measure 1', (130000, 5000), 4243200), ('regression taper-measure 2', (160000, 60000), 2743200),
  ('control: basic and higher', (50000, 0), 748600), ('control: odd excess in taper', (110001, 0), 3343240),
  ('control: fully tapered', (200000, 0), 7620300), ('control: allowance exhausted exactly', (125140, 0), 4251600)],
 [('regression taper-measure 1', (125142, 20000), 3051720), ('regression taper-measure 2', (100003, 5000), 2543320),
  ('partial repair guard 1', (100001, 5000), 2543240), ('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-measure 1', (103415, 5000), 2679800), ('regression taper-measure 2', (125142, 31576), 2485840),
  ('partial repair guard 1', (100003, 5000), 2543320), ('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-measure 1', (113902, 1), 3577240), ('regression taper-measure 2', (125141, 5000), 3951640),
  ('partial repair guard 1', (125142, 1), 4251645), ('partial repair guard 2', (125141, 1), 4251600),
  ('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-measure 1', (100003, 7786), 2431880), ('regression taper-measure 2', (105804, 5000), 2791440),
  ('partial repair guard 1', (125142, 31576), 2485840), ('partial repair guard 2', (100003, 1), 2743320),
  ('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-measure 144671504243200Failed
regression taper-measure 252546502743200Failed
control: basic and higher748600748600Passed
control: odd excess in taper33432403343240Passed
control: fully tapered76203007620300Passed
control: allowance exhausted exactly42516004251600Passed

SHA-256 / a2c9ffbc3b2a15a3d183666815a78ed3e6b802c0b218c40ff39aad48cf8c6ca3

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-measure 1', (130000, 5000), 4243200), ('regression taper-measure 2', (160000, 60000), 2743200),
  ('control: basic and higher', (50000, 0), 748600), ('control: odd excess in taper', (110001, 0), 3343240),
  ('control: fully tapered', (200000, 0), 7620300), ('control: allowance exhausted exactly', (125140, 0), 4251600)],
 [('regression taper-measure 1', (125142, 20000), 3051720), ('regression taper-measure 2', (100003, 5000), 2543320),
  ('partial repair guard 1', (100001, 5000), 2543240), ('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-measure 1', (103415, 5000), 2679800), ('regression taper-measure 2', (125142, 31576), 2485840),
  ('partial repair guard 1', (100003, 5000), 2543320), ('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-measure 1', (113902, 1), 3577240), ('regression taper-measure 2', (125141, 5000), 3951640),
  ('partial repair guard 1', (125142, 1), 4251645), ('partial repair guard 2', (125141, 1), 4251600),
  ('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-measure 1', (100003, 7786), 2431880), ('regression taper-measure 2', (105804, 5000), 2791440),
  ('partial repair guard 1', (125142, 31576), 2485840), ('partial repair guard 2', (100003, 1), 2743320),
  ('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-measure 142432004243200Passed
regression taper-measure 227432002743200Passed
control: basic and higher748600748600Passed
control: odd excess in taper33432403343240Passed
control: fully tapered76203007620300Passed
control: allowance exhausted exactly42516004251600Passed

SHA-256 / ceb28b0aa1965f176d42afbdb3edcb470522323572920766209cb9e42ffdca88

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

Case digest / e1f79ff76803ed420cef0f6df57fcf03aa7a0519d40724a124e3bd429ebb6a2b