{"abstract":"Quarter-line winners are paid double, or single lines are paid half.","category":"Betting odds conversion","checks":10,"contract":"Asian handicap bet on the home side. line is a multiple of 0.25 (else \"invalid line\"). Whole and half lines are a single bet; quarter lines split the stake equally between line - 0.25 and line + 0.25. Each part: margin = home_goals - away_goals + part_line; positive wins stake_part * price, zero refunds stake_part, negative loses. Return [total return in cents rounded down, label] where the label is win, half-win, push, half-lose or lose from the summed part outcomes.","contract_signature":"line, home_goals, away_goals, stake_cents, price","evaluation_group":"w2-odds-conversion-asian-handicap-settlement","failed_approach":"Always halving the stake underpays whole and half lines.","family":"w2-odds-conversion-asian-handicap-settlement-split-stake-share","id":"FA-84511","implementations":{"attempt":{"sha256":"9371d609c47c5dba3647c370981bf774ff7377d5b6d049112f220412b2b65f8b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nimport math\nN = 1\nobservations = []\ndef solve(line, home_goals, away_goals, stake_cents, price):\n    L = Fraction(line)\n    if (L * 4).denominator != 1:\n        return 'invalid line'\n    if (L * 2).denominator == 1:\n        parts = [L]\n    else:\n        parts = [L - Fraction(1, 4), L + Fraction(1, 4)]\n    d = Fraction(price)\n    share = Fraction(stake_cents, 2)\n    ret = Fraction(0)\n    res = []\n    for p in parts:\n        m = home_goals - away_goals + p\n        if m > 0:\n            ret += share * d\n            res.append(1)\n        elif m == 0:\n            ret += share\n            res.append(0)\n        else:\n            res.append(-1)\n    score = sum(res) * 2 // len(parts)\n    label = {2: 'win', 1: 'half-win', 0: 'push', -1: 'half-lose', -2: 'lose'}[score]\n    return [math.floor(ret), label]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ndef run(args):\n    try:\n        return solve(*args)\n    except Exception as exc:\n        return 'raised ' + type(exc).__name__\ncases = [[('control half line win', ('-0.5', 1, 0, 1000, '1.90'), [1900, 'win']),\n  ('boundary whole line push', ('-1', 2, 1, 1000, '1.90'), [1000, 'push']),\n  ('boundary quarter half-lose', ('-0.25', 1, 1, 1000, '1.90'), [500, 'half-lose']),\n  ('boundary quarter half-win', ('-0.75', 1, 0, 1000, '2.00'), [1500, 'half-win']),\n  ('control lose', ('+0.5', 0, 2, 1000, '1.90'), [0, 'lose']),\n  ('boundary off-grid line', ('-0.3', 1, 0, 1000, '1.90'), 'invalid line'),\n  ('regression: split stake share', ('-0.25', 3, 2, 250, '2.00'), [500, 'win']),\n  ('regression: split stake share', ('0', 3, 3, 1000, '2.05'), [1000, 'push']),\n  ('variant scenario 1', ('-1.75', 4, 0, 1000, '2.00'), [2000, 'win']),\n  ('variant scenario 2', ('-0.75', 2, 4, 500, '2.00'), [0, 'lose'])],\n [('control half line win', ('-0.5', 1, 0, 1000, '1.90'), [1900, 'win']),\n  ('boundary whole line push', ('-1', 2, 1, 1000, '1.90'), [1000, 'push']),\n  ('boundary quarter half-lose', ('-0.25', 1, 1, 1000, '1.90'), [500, 'half-lose']),\n  ('boundary quarter half-win', ('-0.75', 1, 0, 1000, '2.00'), [1500, 'half-win']),\n  ('control lose', ('+0.5', 0, 2, 1000, '1.90'), [0, 'lose']),\n  ('boundary off-grid line', ('-0.3', 1, 0, 1000, '1.90'), 'invalid line'),\n  ('regression: split stake share', ('-0.5', 4, 0, 999, '1.90'), [1898, 'win']),\n  ('regression: split stake share', ('+0.25', 3, 3, 1000, '2.00'), [1500, 'half-win']),\n  ('variant scenario 1', ('-0.3', 3, 3, 250, '1.90'), 'invalid line'),\n  ('variant scenario 2', ('+0.75', 1, 3, 1000, '1.90'), [0, 'lose'])],\n [('control half line win', ('-0.5', 1, 0, 1000, '1.90'), [1900, 'win']),\n  ('boundary whole line push', ('-1', 2, 1, 1000, '1.90'), [1000, 'push']),\n  ('boundary quarter half-lose', ('-0.25', 1, 1, 1000, '1.90'), [500, 'half-lose']),\n  ('boundary quarter half-win', ('-0.75', 1, 0, 1000, '2.00'), [1500, 'half-win']),\n  ('control lose', ('+0.5', 0, 2, 1000, '1.90'), [0, 'lose']),\n  ('boundary off-grid line', ('-0.3', 1, 0, 1000, '1.90'), 'invalid line'),\n  ('regression: split stake share', ('+0.75', 4, 0, 250, '2.00'), [500, 'win']),\n  ('regression: split stake share', ('+0.5', 2, 0, 999, '2.00'), [1998, 'win']),\n  ('variant scenario 1', ('-1', 0, 2, 999, '2.00'), [0, 'lose']),\n  ('variant scenario 2', ('+0.25', 1, 0, 250, '1.85'), [462, 'win'])],\n [('control half line win', ('-0.5', 1, 0, 1000, '1.90'), [1900, 'win']),\n  ('boundary whole line push', ('-1', 2, 1, 1000, '1.90'), [1000, 'push']),\n  ('boundary quarter half-lose', ('-0.25', 1, 1, 1000, '1.90'), [500, 'half-lose']),\n  ('boundary quarter half-win', ('-0.75', 1, 0, 1000, '2.00'), [1500, 'half-win']),\n  ('control lose', ('+0.5', 0, 2, 1000, '1.90'), [0, 'lose']),\n  ('boundary off-grid line', ('-0.3', 1, 0, 1000, '1.90'), 'invalid line'),\n  ('regression: split stake share', ('+0.5', 4, 1, 250, '1.90'), [475, 'win']),\n  ('regression: split stake share', ('+0.25', 3, 2, 1000, '1.85'), [1850, 'win']),\n  ('variant scenario 1', ('+2', 1, 4, 500, '1.90'), [0, 'lose']),\n  ('variant scenario 2', ('+0.75', 0, 4, 1000, '2.05'), [0, 'lose'])],\n [('control half line win', ('-0.5', 1, 0, 1000, '1.90'), [1900, 'win']),\n  ('boundary whole line push', ('-1', 2, 1, 1000, '1.90'), [1000, 'push']),\n  ('boundary quarter half-lose', ('-0.25', 1, 1, 1000, '1.90'), [500, 'half-lose']),\n  ('boundary quarter half-win', ('-0.75', 1, 0, 1000, '2.00'), [1500, 'half-win']),\n  ('control lose', ('+0.5', 0, 2, 1000, '1.90'), [0, 'lose']),\n  ('boundary off-grid line', ('-0.3', 1, 0, 1000, '1.90'), 'invalid line'),\n  ('regression: split stake share', ('+1.25', 1, 0, 500, '1.85'), [925, 'win']),\n  ('regression: split stake share', ('0', 2, 0, 250, '1.90'), [475, 'win']),\n  ('variant scenario 1', ('-1.75', 2, 0, 999, '2.00'), [1498, 'half-win']),\n  ('variant scenario 2', ('-0.3', 2, 4, 1000, '2.00'), 'invalid line')]]\nfor label, args, expected in cases[N - 1]:\n    check(label, run(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"78b8d85b12b8f3620eef570380aeb9a746dfe0286ada251eb6310c7faa4b9204","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nimport math\nN = 1\nobservations = []\ndef solve(line, home_goals, away_goals, stake_cents, price):\n    L = Fraction(line)\n    if (L * 4).denominator != 1:\n        return 'invalid line'\n    if (L * 2).denominator == 1:\n        parts = [L]\n    else:\n        parts = [L - Fraction(1, 4), L + Fraction(1, 4)]\n    d = Fraction(price)\n    share = Fraction(stake_cents)\n    ret = Fraction(0)\n    res = []\n    for p in parts:\n        m = home_goals - away_goals + p\n        if m > 0:\n            ret += share * d\n            res.append(1)\n        elif m == 0:\n            ret += share\n            res.append(0)\n        else:\n            res.append(-1)\n    score = sum(res) * 2 // len(parts)\n    label = {2: 'win', 1: 'half-win', 0: 'push', -1: 'half-lose', -2: 'lose'}[score]\n    return [math.floor(ret), label]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ndef run(args):\n    try:\n        return solve(*args)\n    except Exception as exc:\n        return 'raised ' + type(exc).__name__\ncases = [[('control half line win', ('-0.5', 1, 0, 1000, '1.90'), [1900, 'win']),\n  ('boundary whole line push', ('-1', 2, 1, 1000, '1.90'), [1000, 'push']),\n  ('boundary quarter half-lose', ('-0.25', 1, 1, 1000, '1.90'), [500, 'half-lose']),\n  ('boundary quarter half-win', ('-0.75', 1, 0, 1000, '2.00'), [1500, 'half-win']),\n  ('control lose', ('+0.5', 0, 2, 1000, '1.90'), [0, 'lose']),\n  ('boundary off-grid line', ('-0.3', 1, 0, 1000, '1.90'), 'invalid line'),\n  ('regression: split stake share', ('-0.25', 3, 2, 250, '2.00'), [500, 'win']),\n  ('regression: split stake share', ('0', 3, 3, 1000, '2.05'), [1000, 'push']),\n  ('variant scenario 1', ('-1.75', 4, 0, 1000, '2.00'), [2000, 'win']),\n  ('variant scenario 2', ('-0.75', 2, 4, 500, '2.00'), [0, 'lose'])],\n [('control half line win', ('-0.5', 1, 0, 1000, '1.90'), [1900, 'win']),\n  ('boundary whole line push', ('-1', 2, 1, 1000, '1.90'), [1000, 'push']),\n  ('boundary quarter half-lose', ('-0.25', 1, 1, 1000, '1.90'), [500, 'half-lose']),\n  ('boundary quarter half-win', ('-0.75', 1, 0, 1000, '2.00'), [1500, 'half-win']),\n  ('control lose', ('+0.5', 0, 2, 1000, '1.90'), [0, 'lose']),\n  ('boundary off-grid line', ('-0.3', 1, 0, 1000, '1.90'), 'invalid line'),\n  ('regression: split stake share', ('-0.5', 4, 0, 999, '1.90'), [1898, 'win']),\n  ('regression: split stake share', ('+0.25', 3, 3, 1000, '2.00'), [1500, 'half-win']),\n  ('variant scenario 1', ('-0.3', 3, 3, 250, '1.90'), 'invalid line'),\n  ('variant scenario 2', ('+0.75', 1, 3, 1000, '1.90'), [0, 'lose'])],\n [('control half line win', ('-0.5', 1, 0, 1000, '1.90'), [1900, 'win']),\n  ('boundary whole line push', ('-1', 2, 1, 1000, '1.90'), [1000, 'push']),\n  ('boundary quarter half-lose', ('-0.25', 1, 1, 1000, '1.90'), [500, 'half-lose']),\n  ('boundary quarter half-win', ('-0.75', 1, 0, 1000, '2.00'), [1500, 'half-win']),\n  ('control lose', ('+0.5', 0, 2, 1000, '1.90'), [0, 'lose']),\n  ('boundary off-grid line', ('-0.3', 1, 0, 1000, '1.90'), 'invalid line'),\n  ('regression: split stake share', ('+0.75', 4, 0, 250, '2.00'), [500, 'win']),\n  ('regression: split stake share', ('+0.5', 2, 0, 999, '2.00'), [1998, 'win']),\n  ('variant scenario 1', ('-1', 0, 2, 999, '2.00'), [0, 'lose']),\n  ('variant scenario 2', ('+0.25', 1, 0, 250, '1.85'), [462, 'win'])],\n [('control half line win', ('-0.5', 1, 0, 1000, '1.90'), [1900, 'win']),\n  ('boundary whole line push', ('-1', 2, 1, 1000, '1.90'), [1000, 'push']),\n  ('boundary quarter half-lose', ('-0.25', 1, 1, 1000, '1.90'), [500, 'half-lose']),\n  ('boundary quarter half-win', ('-0.75', 1, 0, 1000, '2.00'), [1500, 'half-win']),\n  ('control lose', ('+0.5', 0, 2, 1000, '1.90'), [0, 'lose']),\n  ('boundary off-grid line', ('-0.3', 1, 0, 1000, '1.90'), 'invalid line'),\n  ('regression: split stake share', ('+0.5', 4, 1, 250, '1.90'), [475, 'win']),\n  ('regression: split stake share', ('+0.25', 3, 2, 1000, '1.85'), [1850, 'win']),\n  ('variant scenario 1', ('+2', 1, 4, 500, '1.90'), [0, 'lose']),\n  ('variant scenario 2', ('+0.75', 0, 4, 1000, '2.05'), [0, 'lose'])],\n [('control half line win', ('-0.5', 1, 0, 1000, '1.90'), [1900, 'win']),\n  ('boundary whole line push', ('-1', 2, 1, 1000, '1.90'), [1000, 'push']),\n  ('boundary quarter half-lose', ('-0.25', 1, 1, 1000, '1.90'), [500, 'half-lose']),\n  ('boundary quarter half-win', ('-0.75', 1, 0, 1000, '2.00'), [1500, 'half-win']),\n  ('control lose', ('+0.5', 0, 2, 1000, '1.90'), [0, 'lose']),\n  ('boundary off-grid line', ('-0.3', 1, 0, 1000, '1.90'), 'invalid line'),\n  ('regression: split stake share', ('+1.25', 1, 0, 500, '1.85'), [925, 'win']),\n  ('regression: split stake share', ('0', 2, 0, 250, '1.90'), [475, 'win']),\n  ('variant scenario 1', ('-1.75', 2, 0, 999, '2.00'), [1498, 'half-win']),\n  ('variant scenario 2', ('-0.3', 2, 4, 1000, '2.00'), 'invalid line')]]\nfor label, args, expected in cases[N - 1]:\n    check(label, run(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-odds-conversion-asian-handicap-settlement-split-stake-share","generated_at":"2026-09-29T14:50:31.658464+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Asian handicap settlement with split quarter lines is a common source of payout disputes.","root_cause":"The per-part stake is the full stake for every part.","sha256":"31a48aa7b72ea2dfa3dfa095a6abc31655d0fc68c79e1d9f82ad341a80679303","title":"Each half of a split bet staked with the full amount · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":42.147,"exit_code":1,"observations":[{"actual":[950,"win"],"check":"control half line win","expected":[1900,"win"],"passed":false},{"actual":[500,"push"],"check":"boundary whole line push","expected":[1000,"push"],"passed":false},{"actual":[500,"half-lose"],"check":"boundary quarter half-lose","expected":[500,"half-lose"],"passed":true},{"actual":[1500,"half-win"],"check":"boundary quarter half-win","expected":[1500,"half-win"],"passed":true},{"actual":[0,"lose"],"check":"control lose","expected":[0,"lose"],"passed":true},{"actual":"invalid line","check":"boundary off-grid line","expected":"invalid line","passed":true},{"actual":[500,"win"],"check":"regression: split stake share","expected":[500,"win"],"passed":true},{"actual":[500,"push"],"check":"regression: split stake share","expected":[1000,"push"],"passed":false},{"actual":[2000,"win"],"check":"variant scenario 1","expected":[2000,"win"],"passed":true},{"actual":[0,"lose"],"check":"variant scenario 2","expected":[0,"lose"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control half line win\", \"actual\": [950, \"win\"], \"expected\": [1900, \"win\"], \"passed\": false}, {\"check\": \"boundary whole line push\", \"actual\": [500, \"push\"], \"expected\": [1000, \"push\"], \"passed\": false}, {\"check\": \"boundary quarter half-lose\", \"actual\": [500, \"half-lose\"], \"expected\": [500, \"half-lose\"], \"passed\": true}, {\"check\": \"boundary quarter half-win\", \"actual\": [1500, \"half-win\"], \"expected\": [1500, \"half-win\"], \"passed\": true}, {\"check\": \"control lose\", \"actual\": [0, \"lose\"], \"expected\": [0, \"lose\"], \"passed\": true}, {\"check\": \"boundary off-grid line\", \"actual\": \"invalid line\", \"expected\": \"invalid line\", \"passed\": true}, {\"check\": \"regression: split stake share\", \"actual\": [500, \"win\"], \"expected\": [500, \"win\"], \"passed\": true}, {\"check\": \"regression: split stake share\", \"actual\": [500, \"push\"], \"expected\": [1000, \"push\"], \"passed\": false}, {\"check\": \"variant scenario 1\", \"actual\": [2000, \"win\"], \"expected\": [2000, \"win\"], \"passed\": true}, {\"check\": \"variant scenario 2\", \"actual\": [0, \"lose\"], \"expected\": [0, \"lose\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.097,"exit_code":1,"observations":[{"actual":[1900,"win"],"check":"control half line win","expected":[1900,"win"],"passed":true},{"actual":[1000,"push"],"check":"boundary whole line push","expected":[1000,"push"],"passed":true},{"actual":[1000,"half-lose"],"check":"boundary quarter half-lose","expected":[500,"half-lose"],"passed":false},{"actual":[3000,"half-win"],"check":"boundary quarter half-win","expected":[1500,"half-win"],"passed":false},{"actual":[0,"lose"],"check":"control lose","expected":[0,"lose"],"passed":true},{"actual":"invalid line","check":"boundary off-grid line","expected":"invalid line","passed":true},{"actual":[1000,"win"],"check":"regression: split stake share","expected":[500,"win"],"passed":false},{"actual":[1000,"push"],"check":"regression: split stake share","expected":[1000,"push"],"passed":true},{"actual":[4000,"win"],"check":"variant scenario 1","expected":[2000,"win"],"passed":false},{"actual":[0,"lose"],"check":"variant scenario 2","expected":[0,"lose"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control half line win\", \"actual\": [1900, \"win\"], \"expected\": [1900, \"win\"], \"passed\": true}, {\"check\": \"boundary whole line push\", \"actual\": [1000, \"push\"], \"expected\": [1000, \"push\"], \"passed\": true}, {\"check\": \"boundary quarter half-lose\", \"actual\": [1000, \"half-lose\"], \"expected\": [500, \"half-lose\"], \"passed\": false}, {\"check\": \"boundary quarter half-win\", \"actual\": [3000, \"half-win\"], \"expected\": [1500, \"half-win\"], \"passed\": false}, {\"check\": \"control lose\", \"actual\": [0, \"lose\"], \"expected\": [0, \"lose\"], \"passed\": true}, {\"check\": \"boundary off-grid line\", \"actual\": \"invalid line\", \"expected\": \"invalid line\", \"passed\": true}, {\"check\": \"regression: split stake share\", \"actual\": [1000, \"win\"], \"expected\": [500, \"win\"], \"passed\": false}, {\"check\": \"regression: split stake share\", \"actual\": [1000, \"push\"], \"expected\": [1000, \"push\"], \"passed\": true}, {\"check\": \"variant scenario 1\", \"actual\": [4000, \"win\"], \"expected\": [2000, \"win\"], \"passed\": false}, {\"check\": \"variant scenario 2\", \"actual\": [0, \"lose\"], \"expected\": [0, \"lose\"], \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}