FAILURE MAP
← Case archive

FA-84481 / Betting odds conversion / Open access

Parlay payout rounded up or to nearest cent · case 01

Fractional-cent payouts are rounded up, overpaying the customer.

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

ROOT CAUSE

The payout is rounded to the nearest cent.

VERIFIED REPAIR

Always round the payout down to the cent.

Unsuccessful approach: Rounding up is even more generous.

Case contract

Accumulator settlement. legs rows are [decimal price, result] with results win, lose, push, void, half-win (half the stake wins at the price, half is refunded: factor (1 + d) / 2) and half-lose (half refunded: factor 1/2). push and void legs have factor 1, win factor d, lose makes the whole bet lose. Return [combined factor rounded half up to four decimals as a string, payout in cents rounded down].

Why this case matters

Settlement engines must collapse pushed, voided and Asian half results inside multiples.

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(legs, stake_cents):
    factor = Fraction(1)
    for price, result in legs:
        d = Fraction(price)
        if result == 'lose':
            factor = Fraction(0)
            break
        if result == 'win':
            factor *= d
        elif result == 'half-win':
            factor *= (1 + d) / 2
        elif result == 'half-lose':
            factor *= Fraction(1, 2)
    q = math.floor(factor * 10000 + Fraction(1, 2))
    return ['%d.%04d' % (q // 10000, q % 10000), round(stake_cents * factor)]
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 two winners', ([['2.00', 'win'], ['1.50', 'win']], 1000), ['3.0000', 3000]),
  ('boundary pushed leg', ([['2.00', 'win'], ['1.90', 'push']], 1000), ['2.0000', 2000]),
  ('boundary half-win leg', ([['2.00', 'half-win'], ['2.00', 'win']], 1000), ['3.0000', 3000]),
  ('boundary half-lose leg', ([['2.00', 'half-lose'], ['3.00', 'win']], 1000), ['1.5000', 1500]),
  ('control losing leg', ([['2.00', 'win'], ['1.50', 'lose']], 1000), ['0.0000', 0]),
  ('control payout rounds down', ([['1.33', 'win']], 333), ['1.3300', 442]),
  ('regression: payout rounding',
   ([['1.54', 'half-win'],
     ['2.44', 'win'],
     ['1.51', 'half-win'],
     ['3.53', 'push'],
     ['3.61', 'win']],
    100),
   ['14.0393', 1403]),
  ('variant scenario 1',
   ([['3.83', 'half-win'], ['1.67', 'lose'], ['2.67', 'push']], 1999),
   ['0.0000', 0]),
  ('variant scenario 2',
   ([['2.18', 'void'], ['2.39', 'lose'], ['1.73', 'win'], ['2.99', 'push'], ['2.32', 'half-win']],
    333),
   ['0.0000', 0])],
 [('control two winners', ([['2.00', 'win'], ['1.50', 'win']], 1000), ['3.0000', 3000]),
  ('boundary pushed leg', ([['2.00', 'win'], ['1.90', 'push']], 1000), ['2.0000', 2000]),
  ('boundary half-win leg', ([['2.00', 'half-win'], ['2.00', 'win']], 1000), ['3.0000', 3000]),
  ('boundary half-lose leg', ([['2.00', 'half-lose'], ['3.00', 'win']], 1000), ['1.5000', 1500]),
  ('control losing leg', ([['2.00', 'win'], ['1.50', 'lose']], 1000), ['0.0000', 0]),
  ('control payout rounds down', ([['1.33', 'win']], 333), ['1.3300', 442]),
  ('regression: payout rounding', ([['3.50', 'half-win'], ['1.78', 'win']], 100), ['4.0050', 400]),
  ('regression: payout rounding',
   ([['3.52', 'win'],
     ['3.90', 'half-win'],
     ['2.23', 'void'],
     ['3.23', 'half-lose'],
     ['2.62', 'win']],
    1999),
   ['11.2974', 22583]),
  ('variant scenario 1',
   ([['2.37', 'half-win'], ['1.31', 'half-win'], ['1.84', 'lose']], 1000),
   ['0.0000', 0]),
  ('variant scenario 2', ([['3.39', 'void'], ['1.92', 'win']], 100), ['1.9200', 192])],
 [('control two winners', ([['2.00', 'win'], ['1.50', 'win']], 1000), ['3.0000', 3000]),
  ('boundary pushed leg', ([['2.00', 'win'], ['1.90', 'push']], 1000), ['2.0000', 2000]),
  ('boundary half-win leg', ([['2.00', 'half-win'], ['2.00', 'win']], 1000), ['3.0000', 3000]),
  ('boundary half-lose leg', ([['2.00', 'half-lose'], ['3.00', 'win']], 1000), ['1.5000', 1500]),
  ('control losing leg', ([['2.00', 'win'], ['1.50', 'lose']], 1000), ['0.0000', 0]),
  ('control payout rounds down', ([['1.33', 'win']], 333), ['1.3300', 442]),
  ('regression: payout rounding', ([['3.61', 'half-win'], ['1.35', 'win']], 333), ['3.1118', 1036]),
  ('regression: payout rounding',
   ([['3.54', 'win'], ['2.46', 'push'], ['1.36', 'void'], ['2.75', 'win'], ['1.79', 'win']], 1999),
   ['17.4257', 34833]),
  ('variant scenario 1',
   ([['2.60', 'void'], ['2.23', 'win'], ['1.68', 'lose'], ['1.96', 'half-win'], ['1.91', 'win']],
    1000),
   ['0.0000', 0]),
  ('variant scenario 2',
   ([['1.22', 'push'], ['2.49', 'void'], ['3.59', 'push'], ['3.59', 'lose']], 250),
   ['0.0000', 0])],
 [('control two winners', ([['2.00', 'win'], ['1.50', 'win']], 1000), ['3.0000', 3000]),
  ('boundary pushed leg', ([['2.00', 'win'], ['1.90', 'push']], 1000), ['2.0000', 2000]),
  ('boundary half-win leg', ([['2.00', 'half-win'], ['2.00', 'win']], 1000), ['3.0000', 3000]),
  ('boundary half-lose leg', ([['2.00', 'half-lose'], ['3.00', 'win']], 1000), ['1.5000', 1500]),
  ('control losing leg', ([['2.00', 'win'], ['1.50', 'lose']], 1000), ['0.0000', 0]),
  ('control payout rounds down', ([['1.33', 'win']], 333), ['1.3300', 442]),
  ('regression: payout rounding',
   ([['2.42', 'win'], ['3.10', 'win'], ['1.90', 'win']], 1000),
   ['14.2538', 14253]),
  ('variant scenario 1',
   ([['3.57', 'half-win'], ['2.67', 'win'], ['1.31', 'win'], ['2.06', 'push'], ['2.36', 'win']],
    1000),
   ['18.8617', 18861]),
  ('variant scenario 2', ([['1.21', 'win'], ['3.54', 'win']], 100), ['4.2834', 428])],
 [('control two winners', ([['2.00', 'win'], ['1.50', 'win']], 1000), ['3.0000', 3000]),
  ('boundary pushed leg', ([['2.00', 'win'], ['1.90', 'push']], 1000), ['2.0000', 2000]),
  ('boundary half-win leg', ([['2.00', 'half-win'], ['2.00', 'win']], 1000), ['3.0000', 3000]),
  ('boundary half-lose leg', ([['2.00', 'half-lose'], ['3.00', 'win']], 1000), ['1.5000', 1500]),
  ('control losing leg', ([['2.00', 'win'], ['1.50', 'lose']], 1000), ['0.0000', 0]),
  ('control payout rounds down', ([['1.33', 'win']], 333), ['1.3300', 442]),
  ('regression: payout rounding',
   ([['3.86', 'half-lose'], ['3.17', 'push'], ['2.09', 'void']], 1999),
   ['0.5000', 999]),
  ('variant scenario 1',
   ([['2.72', 'void'],
     ['3.77', 'half-win'],
     ['2.12', 'win'],
     ['1.39', 'lose'],
     ['2.98', 'half-win']],
    1999),
   ['0.0000', 0]),
  ('variant scenario 2',
   ([['3.07', 'half-win'], ['2.59', 'lose'], ['1.62', 'lose']], 250),
   ['0.0000', 0])]]
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 two winners['3.0000', 3000]['3.0000', 3000]Passed
boundary pushed leg['2.0000', 2000]['2.0000', 2000]Passed
boundary half-win leg['3.0000', 3000]['3.0000', 3000]Passed
boundary half-lose leg['1.5000', 1500]['1.5000', 1500]Passed
control losing leg['0.0000', 0]['0.0000', 0]Passed
control payout rounds down['1.3300', 443]['1.3300', 442]Failed
regression: payout rounding['14.0393', 1404]['14.0393', 1403]Failed
variant scenario 1['0.0000', 0]['0.0000', 0]Passed
variant scenario 2['0.0000', 0]['0.0000', 0]Passed

SHA-256 / eb17860732014d1c52275db49db1084818de62e1b80a0f4b4f7cf20329501775

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(legs, stake_cents):
    factor = Fraction(1)
    for price, result in legs:
        d = Fraction(price)
        if result == 'lose':
            factor = Fraction(0)
            break
        if result == 'win':
            factor *= d
        elif result == 'half-win':
            factor *= (1 + d) / 2
        elif result == 'half-lose':
            factor *= Fraction(1, 2)
    q = math.floor(factor * 10000 + Fraction(1, 2))
    return ['%d.%04d' % (q // 10000, q % 10000), math.ceil(stake_cents * factor)]
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 two winners', ([['2.00', 'win'], ['1.50', 'win']], 1000), ['3.0000', 3000]),
  ('boundary pushed leg', ([['2.00', 'win'], ['1.90', 'push']], 1000), ['2.0000', 2000]),
  ('boundary half-win leg', ([['2.00', 'half-win'], ['2.00', 'win']], 1000), ['3.0000', 3000]),
  ('boundary half-lose leg', ([['2.00', 'half-lose'], ['3.00', 'win']], 1000), ['1.5000', 1500]),
  ('control losing leg', ([['2.00', 'win'], ['1.50', 'lose']], 1000), ['0.0000', 0]),
  ('control payout rounds down', ([['1.33', 'win']], 333), ['1.3300', 442]),
  ('regression: payout rounding',
   ([['1.54', 'half-win'],
     ['2.44', 'win'],
     ['1.51', 'half-win'],
     ['3.53', 'push'],
     ['3.61', 'win']],
    100),
   ['14.0393', 1403]),
  ('variant scenario 1',
   ([['3.83', 'half-win'], ['1.67', 'lose'], ['2.67', 'push']], 1999),
   ['0.0000', 0]),
  ('variant scenario 2',
   ([['2.18', 'void'], ['2.39', 'lose'], ['1.73', 'win'], ['2.99', 'push'], ['2.32', 'half-win']],
    333),
   ['0.0000', 0])],
 [('control two winners', ([['2.00', 'win'], ['1.50', 'win']], 1000), ['3.0000', 3000]),
  ('boundary pushed leg', ([['2.00', 'win'], ['1.90', 'push']], 1000), ['2.0000', 2000]),
  ('boundary half-win leg', ([['2.00', 'half-win'], ['2.00', 'win']], 1000), ['3.0000', 3000]),
  ('boundary half-lose leg', ([['2.00', 'half-lose'], ['3.00', 'win']], 1000), ['1.5000', 1500]),
  ('control losing leg', ([['2.00', 'win'], ['1.50', 'lose']], 1000), ['0.0000', 0]),
  ('control payout rounds down', ([['1.33', 'win']], 333), ['1.3300', 442]),
  ('regression: payout rounding', ([['3.50', 'half-win'], ['1.78', 'win']], 100), ['4.0050', 400]),
  ('regression: payout rounding',
   ([['3.52', 'win'],
     ['3.90', 'half-win'],
     ['2.23', 'void'],
     ['3.23', 'half-lose'],
     ['2.62', 'win']],
    1999),
   ['11.2974', 22583]),
  ('variant scenario 1',
   ([['2.37', 'half-win'], ['1.31', 'half-win'], ['1.84', 'lose']], 1000),
   ['0.0000', 0]),
  ('variant scenario 2', ([['3.39', 'void'], ['1.92', 'win']], 100), ['1.9200', 192])],
 [('control two winners', ([['2.00', 'win'], ['1.50', 'win']], 1000), ['3.0000', 3000]),
  ('boundary pushed leg', ([['2.00', 'win'], ['1.90', 'push']], 1000), ['2.0000', 2000]),
  ('boundary half-win leg', ([['2.00', 'half-win'], ['2.00', 'win']], 1000), ['3.0000', 3000]),
  ('boundary half-lose leg', ([['2.00', 'half-lose'], ['3.00', 'win']], 1000), ['1.5000', 1500]),
  ('control losing leg', ([['2.00', 'win'], ['1.50', 'lose']], 1000), ['0.0000', 0]),
  ('control payout rounds down', ([['1.33', 'win']], 333), ['1.3300', 442]),
  ('regression: payout rounding', ([['3.61', 'half-win'], ['1.35', 'win']], 333), ['3.1118', 1036]),
  ('regression: payout rounding',
   ([['3.54', 'win'], ['2.46', 'push'], ['1.36', 'void'], ['2.75', 'win'], ['1.79', 'win']], 1999),
   ['17.4257', 34833]),
  ('variant scenario 1',
   ([['2.60', 'void'], ['2.23', 'win'], ['1.68', 'lose'], ['1.96', 'half-win'], ['1.91', 'win']],
    1000),
   ['0.0000', 0]),
  ('variant scenario 2',
   ([['1.22', 'push'], ['2.49', 'void'], ['3.59', 'push'], ['3.59', 'lose']], 250),
   ['0.0000', 0])],
 [('control two winners', ([['2.00', 'win'], ['1.50', 'win']], 1000), ['3.0000', 3000]),
  ('boundary pushed leg', ([['2.00', 'win'], ['1.90', 'push']], 1000), ['2.0000', 2000]),
  ('boundary half-win leg', ([['2.00', 'half-win'], ['2.00', 'win']], 1000), ['3.0000', 3000]),
  ('boundary half-lose leg', ([['2.00', 'half-lose'], ['3.00', 'win']], 1000), ['1.5000', 1500]),
  ('control losing leg', ([['2.00', 'win'], ['1.50', 'lose']], 1000), ['0.0000', 0]),
  ('control payout rounds down', ([['1.33', 'win']], 333), ['1.3300', 442]),
  ('regression: payout rounding',
   ([['2.42', 'win'], ['3.10', 'win'], ['1.90', 'win']], 1000),
   ['14.2538', 14253]),
  ('variant scenario 1',
   ([['3.57', 'half-win'], ['2.67', 'win'], ['1.31', 'win'], ['2.06', 'push'], ['2.36', 'win']],
    1000),
   ['18.8617', 18861]),
  ('variant scenario 2', ([['1.21', 'win'], ['3.54', 'win']], 100), ['4.2834', 428])],
 [('control two winners', ([['2.00', 'win'], ['1.50', 'win']], 1000), ['3.0000', 3000]),
  ('boundary pushed leg', ([['2.00', 'win'], ['1.90', 'push']], 1000), ['2.0000', 2000]),
  ('boundary half-win leg', ([['2.00', 'half-win'], ['2.00', 'win']], 1000), ['3.0000', 3000]),
  ('boundary half-lose leg', ([['2.00', 'half-lose'], ['3.00', 'win']], 1000), ['1.5000', 1500]),
  ('control losing leg', ([['2.00', 'win'], ['1.50', 'lose']], 1000), ['0.0000', 0]),
  ('control payout rounds down', ([['1.33', 'win']], 333), ['1.3300', 442]),
  ('regression: payout rounding',
   ([['3.86', 'half-lose'], ['3.17', 'push'], ['2.09', 'void']], 1999),
   ['0.5000', 999]),
  ('variant scenario 1',
   ([['2.72', 'void'],
     ['3.77', 'half-win'],
     ['2.12', 'win'],
     ['1.39', 'lose'],
     ['2.98', 'half-win']],
    1999),
   ['0.0000', 0]),
  ('variant scenario 2',
   ([['3.07', 'half-win'], ['2.59', 'lose'], ['1.62', 'lose']], 250),
   ['0.0000', 0])]]
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 two winners['3.0000', 3000]['3.0000', 3000]Passed
boundary pushed leg['2.0000', 2000]['2.0000', 2000]Passed
boundary half-win leg['3.0000', 3000]['3.0000', 3000]Passed
boundary half-lose leg['1.5000', 1500]['1.5000', 1500]Passed
control losing leg['0.0000', 0]['0.0000', 0]Passed
control payout rounds down['1.3300', 443]['1.3300', 442]Failed
regression: payout rounding['14.0393', 1404]['14.0393', 1403]Failed
variant scenario 1['0.0000', 0]['0.0000', 0]Passed
variant scenario 2['0.0000', 0]['0.0000', 0]Passed

SHA-256 / 7791864669dc2a0c9bab8d77a3a02e358801607a85328903e30ab0e8d266ac4b

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
import math
N = 1
observations = []
def solve(legs, stake_cents):
    factor = Fraction(1)
    for price, result in legs:
        d = Fraction(price)
        if result == 'lose':
            factor = Fraction(0)
            break
        if result == 'win':
            factor *= d
        elif result == 'half-win':
            factor *= (1 + d) / 2
        elif result == 'half-lose':
            factor *= Fraction(1, 2)
    q = math.floor(factor * 10000 + Fraction(1, 2))
    return ['%d.%04d' % (q // 10000, q % 10000), math.floor(stake_cents * factor)]
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 two winners', ([['2.00', 'win'], ['1.50', 'win']], 1000), ['3.0000', 3000]),
  ('boundary pushed leg', ([['2.00', 'win'], ['1.90', 'push']], 1000), ['2.0000', 2000]),
  ('boundary half-win leg', ([['2.00', 'half-win'], ['2.00', 'win']], 1000), ['3.0000', 3000]),
  ('boundary half-lose leg', ([['2.00', 'half-lose'], ['3.00', 'win']], 1000), ['1.5000', 1500]),
  ('control losing leg', ([['2.00', 'win'], ['1.50', 'lose']], 1000), ['0.0000', 0]),
  ('control payout rounds down', ([['1.33', 'win']], 333), ['1.3300', 442]),
  ('regression: payout rounding',
   ([['1.54', 'half-win'],
     ['2.44', 'win'],
     ['1.51', 'half-win'],
     ['3.53', 'push'],
     ['3.61', 'win']],
    100),
   ['14.0393', 1403]),
  ('variant scenario 1',
   ([['3.83', 'half-win'], ['1.67', 'lose'], ['2.67', 'push']], 1999),
   ['0.0000', 0]),
  ('variant scenario 2',
   ([['2.18', 'void'], ['2.39', 'lose'], ['1.73', 'win'], ['2.99', 'push'], ['2.32', 'half-win']],
    333),
   ['0.0000', 0])],
 [('control two winners', ([['2.00', 'win'], ['1.50', 'win']], 1000), ['3.0000', 3000]),
  ('boundary pushed leg', ([['2.00', 'win'], ['1.90', 'push']], 1000), ['2.0000', 2000]),
  ('boundary half-win leg', ([['2.00', 'half-win'], ['2.00', 'win']], 1000), ['3.0000', 3000]),
  ('boundary half-lose leg', ([['2.00', 'half-lose'], ['3.00', 'win']], 1000), ['1.5000', 1500]),
  ('control losing leg', ([['2.00', 'win'], ['1.50', 'lose']], 1000), ['0.0000', 0]),
  ('control payout rounds down', ([['1.33', 'win']], 333), ['1.3300', 442]),
  ('regression: payout rounding', ([['3.50', 'half-win'], ['1.78', 'win']], 100), ['4.0050', 400]),
  ('regression: payout rounding',
   ([['3.52', 'win'],
     ['3.90', 'half-win'],
     ['2.23', 'void'],
     ['3.23', 'half-lose'],
     ['2.62', 'win']],
    1999),
   ['11.2974', 22583]),
  ('variant scenario 1',
   ([['2.37', 'half-win'], ['1.31', 'half-win'], ['1.84', 'lose']], 1000),
   ['0.0000', 0]),
  ('variant scenario 2', ([['3.39', 'void'], ['1.92', 'win']], 100), ['1.9200', 192])],
 [('control two winners', ([['2.00', 'win'], ['1.50', 'win']], 1000), ['3.0000', 3000]),
  ('boundary pushed leg', ([['2.00', 'win'], ['1.90', 'push']], 1000), ['2.0000', 2000]),
  ('boundary half-win leg', ([['2.00', 'half-win'], ['2.00', 'win']], 1000), ['3.0000', 3000]),
  ('boundary half-lose leg', ([['2.00', 'half-lose'], ['3.00', 'win']], 1000), ['1.5000', 1500]),
  ('control losing leg', ([['2.00', 'win'], ['1.50', 'lose']], 1000), ['0.0000', 0]),
  ('control payout rounds down', ([['1.33', 'win']], 333), ['1.3300', 442]),
  ('regression: payout rounding', ([['3.61', 'half-win'], ['1.35', 'win']], 333), ['3.1118', 1036]),
  ('regression: payout rounding',
   ([['3.54', 'win'], ['2.46', 'push'], ['1.36', 'void'], ['2.75', 'win'], ['1.79', 'win']], 1999),
   ['17.4257', 34833]),
  ('variant scenario 1',
   ([['2.60', 'void'], ['2.23', 'win'], ['1.68', 'lose'], ['1.96', 'half-win'], ['1.91', 'win']],
    1000),
   ['0.0000', 0]),
  ('variant scenario 2',
   ([['1.22', 'push'], ['2.49', 'void'], ['3.59', 'push'], ['3.59', 'lose']], 250),
   ['0.0000', 0])],
 [('control two winners', ([['2.00', 'win'], ['1.50', 'win']], 1000), ['3.0000', 3000]),
  ('boundary pushed leg', ([['2.00', 'win'], ['1.90', 'push']], 1000), ['2.0000', 2000]),
  ('boundary half-win leg', ([['2.00', 'half-win'], ['2.00', 'win']], 1000), ['3.0000', 3000]),
  ('boundary half-lose leg', ([['2.00', 'half-lose'], ['3.00', 'win']], 1000), ['1.5000', 1500]),
  ('control losing leg', ([['2.00', 'win'], ['1.50', 'lose']], 1000), ['0.0000', 0]),
  ('control payout rounds down', ([['1.33', 'win']], 333), ['1.3300', 442]),
  ('regression: payout rounding',
   ([['2.42', 'win'], ['3.10', 'win'], ['1.90', 'win']], 1000),
   ['14.2538', 14253]),
  ('variant scenario 1',
   ([['3.57', 'half-win'], ['2.67', 'win'], ['1.31', 'win'], ['2.06', 'push'], ['2.36', 'win']],
    1000),
   ['18.8617', 18861]),
  ('variant scenario 2', ([['1.21', 'win'], ['3.54', 'win']], 100), ['4.2834', 428])],
 [('control two winners', ([['2.00', 'win'], ['1.50', 'win']], 1000), ['3.0000', 3000]),
  ('boundary pushed leg', ([['2.00', 'win'], ['1.90', 'push']], 1000), ['2.0000', 2000]),
  ('boundary half-win leg', ([['2.00', 'half-win'], ['2.00', 'win']], 1000), ['3.0000', 3000]),
  ('boundary half-lose leg', ([['2.00', 'half-lose'], ['3.00', 'win']], 1000), ['1.5000', 1500]),
  ('control losing leg', ([['2.00', 'win'], ['1.50', 'lose']], 1000), ['0.0000', 0]),
  ('control payout rounds down', ([['1.33', 'win']], 333), ['1.3300', 442]),
  ('regression: payout rounding',
   ([['3.86', 'half-lose'], ['3.17', 'push'], ['2.09', 'void']], 1999),
   ['0.5000', 999]),
  ('variant scenario 1',
   ([['2.72', 'void'],
     ['3.77', 'half-win'],
     ['2.12', 'win'],
     ['1.39', 'lose'],
     ['2.98', 'half-win']],
    1999),
   ['0.0000', 0]),
  ('variant scenario 2',
   ([['3.07', 'half-win'], ['2.59', 'lose'], ['1.62', 'lose']], 250),
   ['0.0000', 0])]]
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 two winners['3.0000', 3000]['3.0000', 3000]Passed
boundary pushed leg['2.0000', 2000]['2.0000', 2000]Passed
boundary half-win leg['3.0000', 3000]['3.0000', 3000]Passed
boundary half-lose leg['1.5000', 1500]['1.5000', 1500]Passed
control losing leg['0.0000', 0]['0.0000', 0]Passed
control payout rounds down['1.3300', 442]['1.3300', 442]Passed
regression: payout rounding['14.0393', 1403]['14.0393', 1403]Passed
variant scenario 1['0.0000', 0]['0.0000', 0]Passed
variant scenario 2['0.0000', 0]['0.0000', 0]Passed

SHA-256 / fe53aa015042004fcfba0c62ee40d71a386117cd16b6b729c274b48f9cc335f4

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

Case digest / 2c664e53c4c61f9b14569987e5a6cb8a2a5c4bc4b271e72dd32058639c85e192