FAILURE MAP
← Case archive

FA-84451 / Betting odds conversion / Open access

Malay evens shown as -1.00 · case 01

A 2.00 decimal price is shown as -1.00 in Malay format.

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

ROOT CAUSE

The positive Malay branch uses d < 2.

VERIFIED REPAIR

Use the positive branch for d <= 2.

Unsuccessful approach: Widening the positive band to 2.01 shows 2.01 as a positive Malay price.

Case contract

Convert a decimal price (> 1, else "invalid") to an Asian odds style. hk: d - 1. malay: d - 1 when d <= 2, else -1 / (d - 1). indo: d - 1 when d >= 2, else -1 / (d - 1). Other styles return "invalid style". Values are rounded half away from zero to two decimals and formatted with a leading "-" for negatives.

Why this case matters

Asian-facing sportsbooks show Hong Kong, Malay and Indonesian prices with sign conventions.

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(decimal, style):
    def fmt(x):
        sign = '-' if x < 0 else ''
        c = math.floor(abs(x) * 100 + Fraction(1, 2))
        return sign + '%d.%02d' % (c // 100, c % 100)
    d = Fraction(decimal)
    if d <= 1:
        return 'invalid'
    if style == 'hk':
        v = d - 1
    elif style == 'malay':
        v = d - 1 if d < 2 else -1 / (d - 1)
    elif style == 'indo':
        v = d - 1 if d >= 2 else -1 / (d - 1)
    else:
        return 'invalid style'
    return fmt(v)
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 hong kong', ('1.85', 'hk'), '0.85'),
  ('control malay positive', ('1.80', 'malay'), '0.80'),
  ('control malay negative', ('2.25', 'malay'), '-0.80'),
  ('boundary malay evens', ('2.00', 'malay'), '1.00'),
  ('control indo negative', ('1.80', 'indo'), '-1.25'),
  ('boundary indo half rounds away', ('9.00', 'malay'), '-0.13'),
  ('regression: malay evens branch', ('2.00', 'malay'), '1.00'),
  ('regression: malay evens branch', ('2.01', 'malay'), '-0.99'),
  ('variant scenario 1', ('3.58', 'indo'), '2.58'),
  ('variant scenario 2', ('1.80', 'malay'), '0.80')],
 [('control hong kong', ('1.85', 'hk'), '0.85'),
  ('control malay positive', ('1.80', 'malay'), '0.80'),
  ('control malay negative', ('2.25', 'malay'), '-0.80'),
  ('boundary malay evens', ('2.00', 'malay'), '1.00'),
  ('control indo negative', ('1.80', 'indo'), '-1.25'),
  ('boundary indo half rounds away', ('9.00', 'malay'), '-0.13'),
  ('regression: malay evens branch', ('2.00', 'malay'), '1.00'),
  ('regression: malay evens branch', ('2.005', 'malay'), '-1.00'),
  ('variant scenario 1', ('1.25', 'malay'), '0.25'),
  ('variant scenario 2', ('9.00', 'indo'), '8.00')],
 [('control hong kong', ('1.85', 'hk'), '0.85'),
  ('control malay positive', ('1.80', 'malay'), '0.80'),
  ('control malay negative', ('2.25', 'malay'), '-0.80'),
  ('boundary malay evens', ('2.00', 'malay'), '1.00'),
  ('control indo negative', ('1.80', 'indo'), '-1.25'),
  ('boundary indo half rounds away', ('9.00', 'malay'), '-0.13'),
  ('regression: malay evens branch', ('2.00', 'malay'), '1.00'),
  ('regression: malay evens branch', ('2.005', 'malay'), '-1.00'),
  ('variant scenario 1', ('1.00', 'us'), 'invalid'),
  ('variant scenario 2', ('2.25', 'malay'), '-0.80')],
 [('control hong kong', ('1.85', 'hk'), '0.85'),
  ('control malay positive', ('1.80', 'malay'), '0.80'),
  ('control malay negative', ('2.25', 'malay'), '-0.80'),
  ('boundary malay evens', ('2.00', 'malay'), '1.00'),
  ('control indo negative', ('1.80', 'indo'), '-1.25'),
  ('boundary indo half rounds away', ('9.00', 'malay'), '-0.13'),
  ('regression: malay evens branch', ('2.00', 'malay'), '1.00'),
  ('regression: malay evens branch', ('2.01', 'malay'), '-0.99'),
  ('variant scenario 1', ('2.00', 'indo'), '1.00'),
  ('variant scenario 2', ('1.00', 'us'), 'invalid')],
 [('control hong kong', ('1.85', 'hk'), '0.85'),
  ('control malay positive', ('1.80', 'malay'), '0.80'),
  ('control malay negative', ('2.25', 'malay'), '-0.80'),
  ('boundary malay evens', ('2.00', 'malay'), '1.00'),
  ('control indo negative', ('1.80', 'indo'), '-1.25'),
  ('boundary indo half rounds away', ('9.00', 'malay'), '-0.13'),
  ('regression: malay evens branch', ('2.00', 'malay'), '1.00'),
  ('regression: malay evens branch', ('2.005', 'malay'), '-1.00'),
  ('variant scenario 1', ('2.77', 'us'), 'invalid style'),
  ('variant scenario 2', ('2.04', 'us'), 'invalid style')]]
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 hong kong0.850.85Passed
control malay positive0.800.80Passed
control malay negative-0.80-0.80Passed
boundary malay evens-1.001.00Failed
control indo negative-1.25-1.25Passed
boundary indo half rounds away-0.13-0.13Passed
regression: malay evens branch-1.001.00Failed
regression: malay evens branch-0.99-0.99Passed
variant scenario 12.582.58Passed
variant scenario 20.800.80Passed

SHA-256 / 4d45a50450076d205704ef0b9a5012d19d8f608c4e89cd3497c47d4f4ec37053

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(decimal, style):
    def fmt(x):
        sign = '-' if x < 0 else ''
        c = math.floor(abs(x) * 100 + Fraction(1, 2))
        return sign + '%d.%02d' % (c // 100, c % 100)
    d = Fraction(decimal)
    if d <= 1:
        return 'invalid'
    if style == 'hk':
        v = d - 1
    elif style == 'malay':
        v = d - 1 if d <= Fraction(201, 100) else -1 / (d - 1)
    elif style == 'indo':
        v = d - 1 if d >= 2 else -1 / (d - 1)
    else:
        return 'invalid style'
    return fmt(v)
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 hong kong', ('1.85', 'hk'), '0.85'),
  ('control malay positive', ('1.80', 'malay'), '0.80'),
  ('control malay negative', ('2.25', 'malay'), '-0.80'),
  ('boundary malay evens', ('2.00', 'malay'), '1.00'),
  ('control indo negative', ('1.80', 'indo'), '-1.25'),
  ('boundary indo half rounds away', ('9.00', 'malay'), '-0.13'),
  ('regression: malay evens branch', ('2.00', 'malay'), '1.00'),
  ('regression: malay evens branch', ('2.01', 'malay'), '-0.99'),
  ('variant scenario 1', ('3.58', 'indo'), '2.58'),
  ('variant scenario 2', ('1.80', 'malay'), '0.80')],
 [('control hong kong', ('1.85', 'hk'), '0.85'),
  ('control malay positive', ('1.80', 'malay'), '0.80'),
  ('control malay negative', ('2.25', 'malay'), '-0.80'),
  ('boundary malay evens', ('2.00', 'malay'), '1.00'),
  ('control indo negative', ('1.80', 'indo'), '-1.25'),
  ('boundary indo half rounds away', ('9.00', 'malay'), '-0.13'),
  ('regression: malay evens branch', ('2.00', 'malay'), '1.00'),
  ('regression: malay evens branch', ('2.005', 'malay'), '-1.00'),
  ('variant scenario 1', ('1.25', 'malay'), '0.25'),
  ('variant scenario 2', ('9.00', 'indo'), '8.00')],
 [('control hong kong', ('1.85', 'hk'), '0.85'),
  ('control malay positive', ('1.80', 'malay'), '0.80'),
  ('control malay negative', ('2.25', 'malay'), '-0.80'),
  ('boundary malay evens', ('2.00', 'malay'), '1.00'),
  ('control indo negative', ('1.80', 'indo'), '-1.25'),
  ('boundary indo half rounds away', ('9.00', 'malay'), '-0.13'),
  ('regression: malay evens branch', ('2.00', 'malay'), '1.00'),
  ('regression: malay evens branch', ('2.005', 'malay'), '-1.00'),
  ('variant scenario 1', ('1.00', 'us'), 'invalid'),
  ('variant scenario 2', ('2.25', 'malay'), '-0.80')],
 [('control hong kong', ('1.85', 'hk'), '0.85'),
  ('control malay positive', ('1.80', 'malay'), '0.80'),
  ('control malay negative', ('2.25', 'malay'), '-0.80'),
  ('boundary malay evens', ('2.00', 'malay'), '1.00'),
  ('control indo negative', ('1.80', 'indo'), '-1.25'),
  ('boundary indo half rounds away', ('9.00', 'malay'), '-0.13'),
  ('regression: malay evens branch', ('2.00', 'malay'), '1.00'),
  ('regression: malay evens branch', ('2.01', 'malay'), '-0.99'),
  ('variant scenario 1', ('2.00', 'indo'), '1.00'),
  ('variant scenario 2', ('1.00', 'us'), 'invalid')],
 [('control hong kong', ('1.85', 'hk'), '0.85'),
  ('control malay positive', ('1.80', 'malay'), '0.80'),
  ('control malay negative', ('2.25', 'malay'), '-0.80'),
  ('boundary malay evens', ('2.00', 'malay'), '1.00'),
  ('control indo negative', ('1.80', 'indo'), '-1.25'),
  ('boundary indo half rounds away', ('9.00', 'malay'), '-0.13'),
  ('regression: malay evens branch', ('2.00', 'malay'), '1.00'),
  ('regression: malay evens branch', ('2.005', 'malay'), '-1.00'),
  ('variant scenario 1', ('2.77', 'us'), 'invalid style'),
  ('variant scenario 2', ('2.04', 'us'), 'invalid style')]]
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 hong kong0.850.85Passed
control malay positive0.800.80Passed
control malay negative-0.80-0.80Passed
boundary malay evens1.001.00Passed
control indo negative-1.25-1.25Passed
boundary indo half rounds away-0.13-0.13Passed
regression: malay evens branch1.001.00Passed
regression: malay evens branch1.01-0.99Failed
variant scenario 12.582.58Passed
variant scenario 20.800.80Passed

SHA-256 / 48794cd63765a516e887b2cbb3b2bfc65816d01d7c63f61474e833264cb0505b

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(decimal, style):
    def fmt(x):
        sign = '-' if x < 0 else ''
        c = math.floor(abs(x) * 100 + Fraction(1, 2))
        return sign + '%d.%02d' % (c // 100, c % 100)
    d = Fraction(decimal)
    if d <= 1:
        return 'invalid'
    if style == 'hk':
        v = d - 1
    elif style == 'malay':
        v = d - 1 if d <= 2 else -1 / (d - 1)
    elif style == 'indo':
        v = d - 1 if d >= 2 else -1 / (d - 1)
    else:
        return 'invalid style'
    return fmt(v)
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 hong kong', ('1.85', 'hk'), '0.85'),
  ('control malay positive', ('1.80', 'malay'), '0.80'),
  ('control malay negative', ('2.25', 'malay'), '-0.80'),
  ('boundary malay evens', ('2.00', 'malay'), '1.00'),
  ('control indo negative', ('1.80', 'indo'), '-1.25'),
  ('boundary indo half rounds away', ('9.00', 'malay'), '-0.13'),
  ('regression: malay evens branch', ('2.00', 'malay'), '1.00'),
  ('regression: malay evens branch', ('2.01', 'malay'), '-0.99'),
  ('variant scenario 1', ('3.58', 'indo'), '2.58'),
  ('variant scenario 2', ('1.80', 'malay'), '0.80')],
 [('control hong kong', ('1.85', 'hk'), '0.85'),
  ('control malay positive', ('1.80', 'malay'), '0.80'),
  ('control malay negative', ('2.25', 'malay'), '-0.80'),
  ('boundary malay evens', ('2.00', 'malay'), '1.00'),
  ('control indo negative', ('1.80', 'indo'), '-1.25'),
  ('boundary indo half rounds away', ('9.00', 'malay'), '-0.13'),
  ('regression: malay evens branch', ('2.00', 'malay'), '1.00'),
  ('regression: malay evens branch', ('2.005', 'malay'), '-1.00'),
  ('variant scenario 1', ('1.25', 'malay'), '0.25'),
  ('variant scenario 2', ('9.00', 'indo'), '8.00')],
 [('control hong kong', ('1.85', 'hk'), '0.85'),
  ('control malay positive', ('1.80', 'malay'), '0.80'),
  ('control malay negative', ('2.25', 'malay'), '-0.80'),
  ('boundary malay evens', ('2.00', 'malay'), '1.00'),
  ('control indo negative', ('1.80', 'indo'), '-1.25'),
  ('boundary indo half rounds away', ('9.00', 'malay'), '-0.13'),
  ('regression: malay evens branch', ('2.00', 'malay'), '1.00'),
  ('regression: malay evens branch', ('2.005', 'malay'), '-1.00'),
  ('variant scenario 1', ('1.00', 'us'), 'invalid'),
  ('variant scenario 2', ('2.25', 'malay'), '-0.80')],
 [('control hong kong', ('1.85', 'hk'), '0.85'),
  ('control malay positive', ('1.80', 'malay'), '0.80'),
  ('control malay negative', ('2.25', 'malay'), '-0.80'),
  ('boundary malay evens', ('2.00', 'malay'), '1.00'),
  ('control indo negative', ('1.80', 'indo'), '-1.25'),
  ('boundary indo half rounds away', ('9.00', 'malay'), '-0.13'),
  ('regression: malay evens branch', ('2.00', 'malay'), '1.00'),
  ('regression: malay evens branch', ('2.01', 'malay'), '-0.99'),
  ('variant scenario 1', ('2.00', 'indo'), '1.00'),
  ('variant scenario 2', ('1.00', 'us'), 'invalid')],
 [('control hong kong', ('1.85', 'hk'), '0.85'),
  ('control malay positive', ('1.80', 'malay'), '0.80'),
  ('control malay negative', ('2.25', 'malay'), '-0.80'),
  ('boundary malay evens', ('2.00', 'malay'), '1.00'),
  ('control indo negative', ('1.80', 'indo'), '-1.25'),
  ('boundary indo half rounds away', ('9.00', 'malay'), '-0.13'),
  ('regression: malay evens branch', ('2.00', 'malay'), '1.00'),
  ('regression: malay evens branch', ('2.005', 'malay'), '-1.00'),
  ('variant scenario 1', ('2.77', 'us'), 'invalid style'),
  ('variant scenario 2', ('2.04', 'us'), 'invalid style')]]
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 hong kong0.850.85Passed
control malay positive0.800.80Passed
control malay negative-0.80-0.80Passed
boundary malay evens1.001.00Passed
control indo negative-1.25-1.25Passed
boundary indo half rounds away-0.13-0.13Passed
regression: malay evens branch1.001.00Passed
regression: malay evens branch-0.99-0.99Passed
variant scenario 12.582.58Passed
variant scenario 20.800.80Passed

SHA-256 / 2340ddb9d9e4053d82f599ca1277b6caf440e19aa30485494bd4c7902d110bec

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

Case digest / 3d00c01ad4ff9fa13f886af2152b6bd8fd128761245c43bb4734438acbf92988