FAILURE MAP
← Case archive

FA-84821 / Betting odds conversion / Open access

Only the excess over the threshold is taxed · case 01

Large winners pay far less tax than the stated cliff rule requires.

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

ROOT CAUSE

The tax is computed on net - threshold.

THE FAILURE

The tax is computed on net - threshold.

Unsuccessful approach: Taxing a fixed amount equal to the threshold ignores the winnings above it.

Case contract

Withholding on a settled winning bet. Net winnings = return - stake. If net winnings strictly exceed the threshold, the whole net winnings (not only the excess) are taxed at rate_pct, rounded half up to a cent; otherwise no tax. Return [tax, payout after tax].

Why this case matters

Operators in taxed jurisdictions withhold on net winnings above a reporting threshold.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
import math
N = 1
observations = []
def solve(stake_cents, return_cents, threshold_cents, rate_pct):
    net = return_cents - stake_cents
    tax = 0
    if net > threshold_cents:
        tax = math.floor((net - threshold_cents) * Fraction(rate_pct) / 100 + Fraction(1, 2))
    return [tax, return_cents - tax]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
def run(args):
    try:
        return solve(*args)
    except Exception as exc:
        return 'raised ' + type(exc).__name__
cases = [[('control below threshold', (1000, 50000, 60000, '15'), [0, 50000]),
  ('boundary exactly threshold', (1000, 61000, 60000, '15'), [0, 61000]),
  ('boundary one cent above', (1000, 61001, 60000, '15'), [9000, 52001]),
  ('control losing bet', (1000, 0, 60000, '15'), [0, 0]),
  ('control large win', (5000, 105000, 60000, '20'), [20000, 85000]),
  ('regression: cliff versus marginal', (100, 131946, 60000, '20'), [26369, 105577]),
  ('variant scenario 1', (20000, 80000, 60000, '12.5'), [0, 80000]),
  ('variant scenario 2', (100, 0, 60000, '12.5'), [0, 0])],
 [('control below threshold', (1000, 50000, 60000, '15'), [0, 50000]),
  ('boundary exactly threshold', (1000, 61000, 60000, '15'), [0, 61000]),
  ('boundary one cent above', (1000, 61001, 60000, '15'), [9000, 52001]),
  ('control losing bet', (1000, 0, 60000, '15'), [0, 0]),
  ('control large win', (5000, 105000, 60000, '20'), [20000, 85000]),
  ('regression: cliff versus marginal', (100, 60101, 60000, '12.5'), [7500, 52601]),
  ('regression: cliff versus marginal', (20000, 80050, 60000, '20'), [12010, 68040]),
  ('variant scenario 1', (100, 60100, 60000, '12.5'), [0, 60100]),
  ('variant scenario 2', (100, 60100, 60000, '15'), [0, 60100])],
 [('control below threshold', (1000, 50000, 60000, '15'), [0, 50000]),
  ('boundary exactly threshold', (1000, 61000, 60000, '15'), [0, 61000]),
  ('boundary one cent above', (1000, 61001, 60000, '15'), [9000, 52001]),
  ('control losing bet', (1000, 0, 60000, '15'), [0, 0]),
  ('control large win', (5000, 105000, 60000, '20'), [20000, 85000]),
  ('regression: cliff versus marginal', (100, 60150, 60000, '15'), [9008, 51142]),
  ('variant scenario 1', (100, 60101, 60000, '15'), [9000, 51101]),
  ('variant scenario 2', (100, 118085, 60000, '12.5'), [14748, 103337])],
 [('control below threshold', (1000, 50000, 60000, '15'), [0, 50000]),
  ('boundary exactly threshold', (1000, 61000, 60000, '15'), [0, 61000]),
  ('boundary one cent above', (1000, 61001, 60000, '15'), [9000, 52001]),
  ('control losing bet', (1000, 0, 60000, '15'), [0, 0]),
  ('control large win', (5000, 105000, 60000, '20'), [20000, 85000]),
  ('regression: cliff versus marginal', (20000, 90312, 60000, '15'), [10547, 79765]),
  ('variant scenario 1', (5000, 5000, 60000, '12.5'), [0, 5000]),
  ('variant scenario 2', (20000, 0, 60000, '12.5'), [0, 0])],
 [('control below threshold', (1000, 50000, 60000, '15'), [0, 50000]),
  ('boundary exactly threshold', (1000, 61000, 60000, '15'), [0, 61000]),
  ('boundary one cent above', (1000, 61001, 60000, '15'), [9000, 52001]),
  ('control losing bet', (1000, 0, 60000, '15'), [0, 0]),
  ('control large win', (5000, 105000, 60000, '20'), [20000, 85000]),
  ('regression: cliff versus marginal', (100, 60101, 60000, '15'), [9000, 51101]),
  ('regression: cliff versus marginal', (100, 68161, 60000, '12.5'), [8508, 59653]),
  ('variant scenario 1', (20000, 79999, 60000, '12.5'), [0, 79999]),
  ('variant scenario 2', (1000, 61001, 60000, '20'), [12000, 49001])]]
for label, args, expected in cases[N - 1]:
    check(label, run(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
control below threshold[0, 50000][0, 50000]Passed
boundary exactly threshold[0, 61000][0, 61000]Passed
boundary one cent above[0, 61001][9000, 52001]Failed
control losing bet[0, 0][0, 0]Passed
control large win[8000, 97000][20000, 85000]Failed
regression: cliff versus marginal[14369, 117577][26369, 105577]Failed
variant scenario 1[0, 80000][0, 80000]Passed
variant scenario 2[0, 0][0, 0]Passed

SHA-256 / 2450ad00cfe44d49fd4337cb02984d923c2bd51dfb075a6934f962eeea980104

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
import math
N = 1
observations = []
def solve(stake_cents, return_cents, threshold_cents, rate_pct):
    net = return_cents - stake_cents
    tax = 0
    if net > threshold_cents:
        tax = math.floor(threshold_cents * Fraction(rate_pct) / 100 + Fraction(1, 2))
    return [tax, return_cents - tax]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
def run(args):
    try:
        return solve(*args)
    except Exception as exc:
        return 'raised ' + type(exc).__name__
cases = [[('control below threshold', (1000, 50000, 60000, '15'), [0, 50000]),
  ('boundary exactly threshold', (1000, 61000, 60000, '15'), [0, 61000]),
  ('boundary one cent above', (1000, 61001, 60000, '15'), [9000, 52001]),
  ('control losing bet', (1000, 0, 60000, '15'), [0, 0]),
  ('control large win', (5000, 105000, 60000, '20'), [20000, 85000]),
  ('regression: cliff versus marginal', (100, 131946, 60000, '20'), [26369, 105577]),
  ('variant scenario 1', (20000, 80000, 60000, '12.5'), [0, 80000]),
  ('variant scenario 2', (100, 0, 60000, '12.5'), [0, 0])],
 [('control below threshold', (1000, 50000, 60000, '15'), [0, 50000]),
  ('boundary exactly threshold', (1000, 61000, 60000, '15'), [0, 61000]),
  ('boundary one cent above', (1000, 61001, 60000, '15'), [9000, 52001]),
  ('control losing bet', (1000, 0, 60000, '15'), [0, 0]),
  ('control large win', (5000, 105000, 60000, '20'), [20000, 85000]),
  ('regression: cliff versus marginal', (100, 60101, 60000, '12.5'), [7500, 52601]),
  ('regression: cliff versus marginal', (20000, 80050, 60000, '20'), [12010, 68040]),
  ('variant scenario 1', (100, 60100, 60000, '12.5'), [0, 60100]),
  ('variant scenario 2', (100, 60100, 60000, '15'), [0, 60100])],
 [('control below threshold', (1000, 50000, 60000, '15'), [0, 50000]),
  ('boundary exactly threshold', (1000, 61000, 60000, '15'), [0, 61000]),
  ('boundary one cent above', (1000, 61001, 60000, '15'), [9000, 52001]),
  ('control losing bet', (1000, 0, 60000, '15'), [0, 0]),
  ('control large win', (5000, 105000, 60000, '20'), [20000, 85000]),
  ('regression: cliff versus marginal', (100, 60150, 60000, '15'), [9008, 51142]),
  ('variant scenario 1', (100, 60101, 60000, '15'), [9000, 51101]),
  ('variant scenario 2', (100, 118085, 60000, '12.5'), [14748, 103337])],
 [('control below threshold', (1000, 50000, 60000, '15'), [0, 50000]),
  ('boundary exactly threshold', (1000, 61000, 60000, '15'), [0, 61000]),
  ('boundary one cent above', (1000, 61001, 60000, '15'), [9000, 52001]),
  ('control losing bet', (1000, 0, 60000, '15'), [0, 0]),
  ('control large win', (5000, 105000, 60000, '20'), [20000, 85000]),
  ('regression: cliff versus marginal', (20000, 90312, 60000, '15'), [10547, 79765]),
  ('variant scenario 1', (5000, 5000, 60000, '12.5'), [0, 5000]),
  ('variant scenario 2', (20000, 0, 60000, '12.5'), [0, 0])],
 [('control below threshold', (1000, 50000, 60000, '15'), [0, 50000]),
  ('boundary exactly threshold', (1000, 61000, 60000, '15'), [0, 61000]),
  ('boundary one cent above', (1000, 61001, 60000, '15'), [9000, 52001]),
  ('control losing bet', (1000, 0, 60000, '15'), [0, 0]),
  ('control large win', (5000, 105000, 60000, '20'), [20000, 85000]),
  ('regression: cliff versus marginal', (100, 60101, 60000, '15'), [9000, 51101]),
  ('regression: cliff versus marginal', (100, 68161, 60000, '12.5'), [8508, 59653]),
  ('variant scenario 1', (20000, 79999, 60000, '12.5'), [0, 79999]),
  ('variant scenario 2', (1000, 61001, 60000, '20'), [12000, 49001])]]
for label, args, expected in cases[N - 1]:
    check(label, run(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
control below threshold[0, 50000][0, 50000]Passed
boundary exactly threshold[0, 61000][0, 61000]Passed
boundary one cent above[9000, 52001][9000, 52001]Passed
control losing bet[0, 0][0, 0]Passed
control large win[12000, 93000][20000, 85000]Failed
regression: cliff versus marginal[12000, 119946][26369, 105577]Failed
variant scenario 1[0, 80000][0, 80000]Passed
variant scenario 2[0, 0][0, 0]Passed

SHA-256 / c30c9c786229c04350a4d085b336ca88869a5dfc27d42921285c9093fbbdaf08

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

Stipulated, bounded toy contract stated in the contract field; not a claim of conformance with any operator, exchange or regulator rule set. 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:50:34.640100+00:00.

Case digest / 27edaf45016a870bd8d691fc0208276e8cdc47506718382f3337105355f3be87