FAILURE MAP
← Case archive

FA-82046 / Poker hand evaluation / Open access

Leftover units go to the last winners in order · case 01

Odd units go to the winners farthest from the button, and an even split pays everyone an extra unit.

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

ROOT CAUSE

The remainder is taken with a negative slice; with no remainder [-0:] selects every winner.

VERIFIED REPAIR

Take the first rem winners in clockwise order from the button.

Unsuccessful approach: Ordering winners by absolute seat index ignores where the button is.

Case contract

Input: {"pot", "winners", "seats" (clockwise), "button", "unit" (smallest chip in play; pot is a multiple of it)}. Split the pot equally in whole units; each leftover unit goes to one winner, starting with the first winner clockwise from the button (the button itself is last). Return {winner: amount} sorted by name.

Why this case matters

Odd-chip placement is where split pots disagree between dealers and software.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    pot=x['pot']; unit=x['unit']; winners=x['winners']; seats=x['seats']
    k=len(winners)
    units=pot//unit
    share=units//k
    rem=units-share*k
    out={w:share*unit for w in winners}
    start=(seats.index(x['button'])+1)%len(seats)
    order=seats[start:]+seats[:start]
    for w in [s for s in order if s in winners][-rem:]:
        out[w]+=unit
    return dict(sorted(out.items()))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('three-way odd units',
   {'button': 'c',
    'pot': 110,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 5,
    'winners': ['b', 'd', 'e']},
   {'b': 35, 'd': 40, 'e': 35}),
  ('two-way one unit',
   {'button': 'b', 'pot': 25, 'seats': ['a', 'b', 'c', 'd'], 'unit': 5, 'winners': ['a', 'c']},
   {'a': 10, 'c': 15}),
  ('button is a winner',
   {'button': 'd', 'pot': 7, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'd']},
   {'a': 4, 'd': 3}),
  ('even split',
   {'button': 'c', 'pot': 100, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['a', 'b']},
   {'a': 50, 'b': 50}),
  ('single winner',
   {'button': 'a', 'pot': 35, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['c']}, {'c': 35}),
  ('wrap past last seat',
   {'button': 'd',
    'pot': 11,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 1,
    'winners': ['a', 'e', 'b']},
   {'a': 4, 'b': 3, 'e': 4}),
  ('four-way three odd',
   {'button': 'b',
    'pot': 19,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 1,
    'winners': ['a', 'b', 'c', 'd']},
   {'a': 5, 'b': 4, 'c': 5, 'd': 5}),
  ('large unit',
   {'button': 'a',
    'pot': 300,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 100,
    'winners': ['f', 'a']},
   {'a': 100, 'f': 200})],
 [('two-way one unit',
   {'button': 'b', 'pot': 25, 'seats': ['a', 'b', 'c', 'd'], 'unit': 5, 'winners': ['a', 'c']},
   {'a': 10, 'c': 15}),
  ('button is a winner',
   {'button': 'd', 'pot': 7, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'd']},
   {'a': 4, 'd': 3}),
  ('even split',
   {'button': 'c', 'pot': 100, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['a', 'b']},
   {'a': 50, 'b': 50}),
  ('single winner',
   {'button': 'a', 'pot': 35, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['c']}, {'c': 35}),
  ('wrap past last seat',
   {'button': 'd',
    'pot': 11,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 1,
    'winners': ['a', 'e', 'b']},
   {'a': 4, 'b': 3, 'e': 4}),
  ('four-way three odd',
   {'button': 'b',
    'pot': 19,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 1,
    'winners': ['a', 'b', 'c', 'd']},
   {'a': 5, 'b': 4, 'c': 5, 'd': 5}),
  ('large unit',
   {'button': 'a',
    'pot': 300,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 100,
    'winners': ['f', 'a']},
   {'a': 100, 'f': 200}),
  ('button left winner',
   {'button': 'a', 'pot': 5, 'seats': ['a', 'b', 'c'], 'unit': 1, 'winners': ['b', 'c']},
   {'b': 3, 'c': 2})],
 [('three-way odd units',
   {'button': 'c',
    'pot': 110,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 5,
    'winners': ['b', 'd', 'e']},
   {'b': 35, 'd': 40, 'e': 35}),
  ('button is a winner',
   {'button': 'd', 'pot': 7, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'd']},
   {'a': 4, 'd': 3}),
  ('even split',
   {'button': 'c', 'pot': 100, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['a', 'b']},
   {'a': 50, 'b': 50}),
  ('wrap past last seat',
   {'button': 'd',
    'pot': 11,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 1,
    'winners': ['a', 'e', 'b']},
   {'a': 4, 'b': 3, 'e': 4}),
  ('four-way three odd',
   {'button': 'b',
    'pot': 19,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 1,
    'winners': ['a', 'b', 'c', 'd']},
   {'a': 5, 'b': 4, 'c': 5, 'd': 5}),
  ('large unit',
   {'button': 'a',
    'pot': 300,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 100,
    'winners': ['f', 'a']},
   {'a': 100, 'f': 200}),
  ('button left winner',
   {'button': 'a', 'pot': 5, 'seats': ['a', 'b', 'c'], 'unit': 1, 'winners': ['b', 'c']},
   {'b': 3, 'c': 2}),
  ('winner right of button',
   {'button': 'b', 'pot': 5, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'c']},
   {'a': 2, 'c': 3})],
 [('three-way odd units',
   {'button': 'c',
    'pot': 110,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 5,
    'winners': ['b', 'd', 'e']},
   {'b': 35, 'd': 40, 'e': 35}),
  ('two-way one unit',
   {'button': 'b', 'pot': 25, 'seats': ['a', 'b', 'c', 'd'], 'unit': 5, 'winners': ['a', 'c']},
   {'a': 10, 'c': 15}),
  ('button is a winner',
   {'button': 'd', 'pot': 7, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'd']},
   {'a': 4, 'd': 3}),
  ('even split',
   {'button': 'c', 'pot': 100, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['a', 'b']},
   {'a': 50, 'b': 50}),
  ('single winner',
   {'button': 'a', 'pot': 35, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['c']}, {'c': 35}),
  ('four-way three odd',
   {'button': 'b',
    'pot': 19,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 1,
    'winners': ['a', 'b', 'c', 'd']},
   {'a': 5, 'b': 4, 'c': 5, 'd': 5}),
  ('large unit',
   {'button': 'a',
    'pot': 300,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 100,
    'winners': ['f', 'a']},
   {'a': 100, 'f': 200}),
  ('winner right of button',
   {'button': 'b', 'pot': 5, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'c']},
   {'a': 2, 'c': 3})],
 [('button is a winner',
   {'button': 'd', 'pot': 7, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'd']},
   {'a': 4, 'd': 3}),
  ('even split',
   {'button': 'c', 'pot': 100, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['a', 'b']},
   {'a': 50, 'b': 50}),
  ('single winner',
   {'button': 'a', 'pot': 35, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['c']}, {'c': 35}),
  ('wrap past last seat',
   {'button': 'd',
    'pot': 11,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 1,
    'winners': ['a', 'e', 'b']},
   {'a': 4, 'b': 3, 'e': 4}),
  ('four-way three odd',
   {'button': 'b',
    'pot': 19,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 1,
    'winners': ['a', 'b', 'c', 'd']},
   {'a': 5, 'b': 4, 'c': 5, 'd': 5}),
  ('large unit',
   {'button': 'a',
    'pot': 300,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 100,
    'winners': ['f', 'a']},
   {'a': 100, 'f': 200}),
  ('button left winner',
   {'button': 'a', 'pot': 5, 'seats': ['a', 'b', 'c'], 'unit': 1, 'winners': ['b', 'c']},
   {'b': 3, 'c': 2}),
  ('winner right of button',
   {'button': 'b', 'pot': 5, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'c']},
   {'a': 2, 'c': 3})]]
for label, args, expected in fixtures[N-1]:
    try:
        actual = solve(args)
    except Exception as exc:
        actual = 'error:' + type(exc).__name__
    check(label, actual, 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
three-way odd units{'b': 40, 'd': 35, 'e': 35}{'b': 35, 'd': 40, 'e': 35}Failed
two-way one unit{'a': 15, 'c': 10}{'a': 10, 'c': 15}Failed
button is a winner{'a': 3, 'd': 4}{'a': 4, 'd': 3}Failed
even split{'a': 55, 'b': 55}{'a': 50, 'b': 50}Failed
single winner{'c': 40}{'c': 35}Failed
wrap past last seat{'a': 4, 'b': 4, 'e': 3}{'a': 4, 'b': 3, 'e': 4}Failed
four-way three odd{'a': 5, 'b': 5, 'c': 4, 'd': 5}{'a': 5, 'b': 4, 'c': 5, 'd': 5}Failed
large unit{'a': 200, 'f': 100}{'a': 100, 'f': 200}Failed

SHA-256 / a78ac7e5289bd95097fa3104775d70e365afb809677f81235243da3a991d4d62

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    pot=x['pot']; unit=x['unit']; winners=x['winners']; seats=x['seats']
    k=len(winners)
    units=pot//unit
    share=units//k
    rem=units-share*k
    out={w:share*unit for w in winners}
    start=(seats.index(x['button'])+1)%len(seats)
    order=seats[start:]+seats[:start]
    for w in [s for s in sorted(winners, key=seats.index) if s in winners][:rem]:
        out[w]+=unit
    return dict(sorted(out.items()))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('three-way odd units',
   {'button': 'c',
    'pot': 110,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 5,
    'winners': ['b', 'd', 'e']},
   {'b': 35, 'd': 40, 'e': 35}),
  ('two-way one unit',
   {'button': 'b', 'pot': 25, 'seats': ['a', 'b', 'c', 'd'], 'unit': 5, 'winners': ['a', 'c']},
   {'a': 10, 'c': 15}),
  ('button is a winner',
   {'button': 'd', 'pot': 7, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'd']},
   {'a': 4, 'd': 3}),
  ('even split',
   {'button': 'c', 'pot': 100, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['a', 'b']},
   {'a': 50, 'b': 50}),
  ('single winner',
   {'button': 'a', 'pot': 35, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['c']}, {'c': 35}),
  ('wrap past last seat',
   {'button': 'd',
    'pot': 11,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 1,
    'winners': ['a', 'e', 'b']},
   {'a': 4, 'b': 3, 'e': 4}),
  ('four-way three odd',
   {'button': 'b',
    'pot': 19,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 1,
    'winners': ['a', 'b', 'c', 'd']},
   {'a': 5, 'b': 4, 'c': 5, 'd': 5}),
  ('large unit',
   {'button': 'a',
    'pot': 300,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 100,
    'winners': ['f', 'a']},
   {'a': 100, 'f': 200})],
 [('two-way one unit',
   {'button': 'b', 'pot': 25, 'seats': ['a', 'b', 'c', 'd'], 'unit': 5, 'winners': ['a', 'c']},
   {'a': 10, 'c': 15}),
  ('button is a winner',
   {'button': 'd', 'pot': 7, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'd']},
   {'a': 4, 'd': 3}),
  ('even split',
   {'button': 'c', 'pot': 100, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['a', 'b']},
   {'a': 50, 'b': 50}),
  ('single winner',
   {'button': 'a', 'pot': 35, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['c']}, {'c': 35}),
  ('wrap past last seat',
   {'button': 'd',
    'pot': 11,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 1,
    'winners': ['a', 'e', 'b']},
   {'a': 4, 'b': 3, 'e': 4}),
  ('four-way three odd',
   {'button': 'b',
    'pot': 19,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 1,
    'winners': ['a', 'b', 'c', 'd']},
   {'a': 5, 'b': 4, 'c': 5, 'd': 5}),
  ('large unit',
   {'button': 'a',
    'pot': 300,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 100,
    'winners': ['f', 'a']},
   {'a': 100, 'f': 200}),
  ('button left winner',
   {'button': 'a', 'pot': 5, 'seats': ['a', 'b', 'c'], 'unit': 1, 'winners': ['b', 'c']},
   {'b': 3, 'c': 2})],
 [('three-way odd units',
   {'button': 'c',
    'pot': 110,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 5,
    'winners': ['b', 'd', 'e']},
   {'b': 35, 'd': 40, 'e': 35}),
  ('button is a winner',
   {'button': 'd', 'pot': 7, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'd']},
   {'a': 4, 'd': 3}),
  ('even split',
   {'button': 'c', 'pot': 100, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['a', 'b']},
   {'a': 50, 'b': 50}),
  ('wrap past last seat',
   {'button': 'd',
    'pot': 11,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 1,
    'winners': ['a', 'e', 'b']},
   {'a': 4, 'b': 3, 'e': 4}),
  ('four-way three odd',
   {'button': 'b',
    'pot': 19,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 1,
    'winners': ['a', 'b', 'c', 'd']},
   {'a': 5, 'b': 4, 'c': 5, 'd': 5}),
  ('large unit',
   {'button': 'a',
    'pot': 300,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 100,
    'winners': ['f', 'a']},
   {'a': 100, 'f': 200}),
  ('button left winner',
   {'button': 'a', 'pot': 5, 'seats': ['a', 'b', 'c'], 'unit': 1, 'winners': ['b', 'c']},
   {'b': 3, 'c': 2}),
  ('winner right of button',
   {'button': 'b', 'pot': 5, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'c']},
   {'a': 2, 'c': 3})],
 [('three-way odd units',
   {'button': 'c',
    'pot': 110,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 5,
    'winners': ['b', 'd', 'e']},
   {'b': 35, 'd': 40, 'e': 35}),
  ('two-way one unit',
   {'button': 'b', 'pot': 25, 'seats': ['a', 'b', 'c', 'd'], 'unit': 5, 'winners': ['a', 'c']},
   {'a': 10, 'c': 15}),
  ('button is a winner',
   {'button': 'd', 'pot': 7, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'd']},
   {'a': 4, 'd': 3}),
  ('even split',
   {'button': 'c', 'pot': 100, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['a', 'b']},
   {'a': 50, 'b': 50}),
  ('single winner',
   {'button': 'a', 'pot': 35, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['c']}, {'c': 35}),
  ('four-way three odd',
   {'button': 'b',
    'pot': 19,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 1,
    'winners': ['a', 'b', 'c', 'd']},
   {'a': 5, 'b': 4, 'c': 5, 'd': 5}),
  ('large unit',
   {'button': 'a',
    'pot': 300,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 100,
    'winners': ['f', 'a']},
   {'a': 100, 'f': 200}),
  ('winner right of button',
   {'button': 'b', 'pot': 5, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'c']},
   {'a': 2, 'c': 3})],
 [('button is a winner',
   {'button': 'd', 'pot': 7, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'd']},
   {'a': 4, 'd': 3}),
  ('even split',
   {'button': 'c', 'pot': 100, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['a', 'b']},
   {'a': 50, 'b': 50}),
  ('single winner',
   {'button': 'a', 'pot': 35, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['c']}, {'c': 35}),
  ('wrap past last seat',
   {'button': 'd',
    'pot': 11,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 1,
    'winners': ['a', 'e', 'b']},
   {'a': 4, 'b': 3, 'e': 4}),
  ('four-way three odd',
   {'button': 'b',
    'pot': 19,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 1,
    'winners': ['a', 'b', 'c', 'd']},
   {'a': 5, 'b': 4, 'c': 5, 'd': 5}),
  ('large unit',
   {'button': 'a',
    'pot': 300,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 100,
    'winners': ['f', 'a']},
   {'a': 100, 'f': 200}),
  ('button left winner',
   {'button': 'a', 'pot': 5, 'seats': ['a', 'b', 'c'], 'unit': 1, 'winners': ['b', 'c']},
   {'b': 3, 'c': 2}),
  ('winner right of button',
   {'button': 'b', 'pot': 5, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'c']},
   {'a': 2, 'c': 3})]]
for label, args, expected in fixtures[N-1]:
    try:
        actual = solve(args)
    except Exception as exc:
        actual = 'error:' + type(exc).__name__
    check(label, actual, 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
three-way odd units{'b': 40, 'd': 35, 'e': 35}{'b': 35, 'd': 40, 'e': 35}Failed
two-way one unit{'a': 15, 'c': 10}{'a': 10, 'c': 15}Failed
button is a winner{'a': 4, 'd': 3}{'a': 4, 'd': 3}Passed
even split{'a': 50, 'b': 50}{'a': 50, 'b': 50}Passed
single winner{'c': 35}{'c': 35}Passed
wrap past last seat{'a': 4, 'b': 4, 'e': 3}{'a': 4, 'b': 3, 'e': 4}Failed
four-way three odd{'a': 5, 'b': 5, 'c': 5, 'd': 4}{'a': 5, 'b': 4, 'c': 5, 'd': 5}Failed
large unit{'a': 200, 'f': 100}{'a': 100, 'f': 200}Failed

SHA-256 / 7562c61334b012e4118459a983f92fdf54e4db7db789b3fa4fe5a21ae9e7b3f3

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    pot=x['pot']; unit=x['unit']; winners=x['winners']; seats=x['seats']
    k=len(winners)
    units=pot//unit
    share=units//k
    rem=units-share*k
    out={w:share*unit for w in winners}
    start=(seats.index(x['button'])+1)%len(seats)
    order=seats[start:]+seats[:start]
    for w in [s for s in order if s in winners][:rem]:
        out[w]+=unit
    return dict(sorted(out.items()))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('three-way odd units',
   {'button': 'c',
    'pot': 110,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 5,
    'winners': ['b', 'd', 'e']},
   {'b': 35, 'd': 40, 'e': 35}),
  ('two-way one unit',
   {'button': 'b', 'pot': 25, 'seats': ['a', 'b', 'c', 'd'], 'unit': 5, 'winners': ['a', 'c']},
   {'a': 10, 'c': 15}),
  ('button is a winner',
   {'button': 'd', 'pot': 7, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'd']},
   {'a': 4, 'd': 3}),
  ('even split',
   {'button': 'c', 'pot': 100, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['a', 'b']},
   {'a': 50, 'b': 50}),
  ('single winner',
   {'button': 'a', 'pot': 35, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['c']}, {'c': 35}),
  ('wrap past last seat',
   {'button': 'd',
    'pot': 11,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 1,
    'winners': ['a', 'e', 'b']},
   {'a': 4, 'b': 3, 'e': 4}),
  ('four-way three odd',
   {'button': 'b',
    'pot': 19,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 1,
    'winners': ['a', 'b', 'c', 'd']},
   {'a': 5, 'b': 4, 'c': 5, 'd': 5}),
  ('large unit',
   {'button': 'a',
    'pot': 300,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 100,
    'winners': ['f', 'a']},
   {'a': 100, 'f': 200})],
 [('two-way one unit',
   {'button': 'b', 'pot': 25, 'seats': ['a', 'b', 'c', 'd'], 'unit': 5, 'winners': ['a', 'c']},
   {'a': 10, 'c': 15}),
  ('button is a winner',
   {'button': 'd', 'pot': 7, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'd']},
   {'a': 4, 'd': 3}),
  ('even split',
   {'button': 'c', 'pot': 100, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['a', 'b']},
   {'a': 50, 'b': 50}),
  ('single winner',
   {'button': 'a', 'pot': 35, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['c']}, {'c': 35}),
  ('wrap past last seat',
   {'button': 'd',
    'pot': 11,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 1,
    'winners': ['a', 'e', 'b']},
   {'a': 4, 'b': 3, 'e': 4}),
  ('four-way three odd',
   {'button': 'b',
    'pot': 19,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 1,
    'winners': ['a', 'b', 'c', 'd']},
   {'a': 5, 'b': 4, 'c': 5, 'd': 5}),
  ('large unit',
   {'button': 'a',
    'pot': 300,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 100,
    'winners': ['f', 'a']},
   {'a': 100, 'f': 200}),
  ('button left winner',
   {'button': 'a', 'pot': 5, 'seats': ['a', 'b', 'c'], 'unit': 1, 'winners': ['b', 'c']},
   {'b': 3, 'c': 2})],
 [('three-way odd units',
   {'button': 'c',
    'pot': 110,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 5,
    'winners': ['b', 'd', 'e']},
   {'b': 35, 'd': 40, 'e': 35}),
  ('button is a winner',
   {'button': 'd', 'pot': 7, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'd']},
   {'a': 4, 'd': 3}),
  ('even split',
   {'button': 'c', 'pot': 100, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['a', 'b']},
   {'a': 50, 'b': 50}),
  ('wrap past last seat',
   {'button': 'd',
    'pot': 11,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 1,
    'winners': ['a', 'e', 'b']},
   {'a': 4, 'b': 3, 'e': 4}),
  ('four-way three odd',
   {'button': 'b',
    'pot': 19,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 1,
    'winners': ['a', 'b', 'c', 'd']},
   {'a': 5, 'b': 4, 'c': 5, 'd': 5}),
  ('large unit',
   {'button': 'a',
    'pot': 300,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 100,
    'winners': ['f', 'a']},
   {'a': 100, 'f': 200}),
  ('button left winner',
   {'button': 'a', 'pot': 5, 'seats': ['a', 'b', 'c'], 'unit': 1, 'winners': ['b', 'c']},
   {'b': 3, 'c': 2}),
  ('winner right of button',
   {'button': 'b', 'pot': 5, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'c']},
   {'a': 2, 'c': 3})],
 [('three-way odd units',
   {'button': 'c',
    'pot': 110,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 5,
    'winners': ['b', 'd', 'e']},
   {'b': 35, 'd': 40, 'e': 35}),
  ('two-way one unit',
   {'button': 'b', 'pot': 25, 'seats': ['a', 'b', 'c', 'd'], 'unit': 5, 'winners': ['a', 'c']},
   {'a': 10, 'c': 15}),
  ('button is a winner',
   {'button': 'd', 'pot': 7, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'd']},
   {'a': 4, 'd': 3}),
  ('even split',
   {'button': 'c', 'pot': 100, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['a', 'b']},
   {'a': 50, 'b': 50}),
  ('single winner',
   {'button': 'a', 'pot': 35, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['c']}, {'c': 35}),
  ('four-way three odd',
   {'button': 'b',
    'pot': 19,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 1,
    'winners': ['a', 'b', 'c', 'd']},
   {'a': 5, 'b': 4, 'c': 5, 'd': 5}),
  ('large unit',
   {'button': 'a',
    'pot': 300,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 100,
    'winners': ['f', 'a']},
   {'a': 100, 'f': 200}),
  ('winner right of button',
   {'button': 'b', 'pot': 5, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'c']},
   {'a': 2, 'c': 3})],
 [('button is a winner',
   {'button': 'd', 'pot': 7, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'd']},
   {'a': 4, 'd': 3}),
  ('even split',
   {'button': 'c', 'pot': 100, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['a', 'b']},
   {'a': 50, 'b': 50}),
  ('single winner',
   {'button': 'a', 'pot': 35, 'seats': ['a', 'b', 'c'], 'unit': 5, 'winners': ['c']}, {'c': 35}),
  ('wrap past last seat',
   {'button': 'd',
    'pot': 11,
    'seats': ['a', 'b', 'c', 'd', 'e'],
    'unit': 1,
    'winners': ['a', 'e', 'b']},
   {'a': 4, 'b': 3, 'e': 4}),
  ('four-way three odd',
   {'button': 'b',
    'pot': 19,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 1,
    'winners': ['a', 'b', 'c', 'd']},
   {'a': 5, 'b': 4, 'c': 5, 'd': 5}),
  ('large unit',
   {'button': 'a',
    'pot': 300,
    'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
    'unit': 100,
    'winners': ['f', 'a']},
   {'a': 100, 'f': 200}),
  ('button left winner',
   {'button': 'a', 'pot': 5, 'seats': ['a', 'b', 'c'], 'unit': 1, 'winners': ['b', 'c']},
   {'b': 3, 'c': 2}),
  ('winner right of button',
   {'button': 'b', 'pot': 5, 'seats': ['a', 'b', 'c', 'd'], 'unit': 1, 'winners': ['a', 'c']},
   {'a': 2, 'c': 3})]]
for label, args, expected in fixtures[N-1]:
    try:
        actual = solve(args)
    except Exception as exc:
        actual = 'error:' + type(exc).__name__
    check(label, actual, 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
three-way odd units{'b': 35, 'd': 40, 'e': 35}{'b': 35, 'd': 40, 'e': 35}Passed
two-way one unit{'a': 10, 'c': 15}{'a': 10, 'c': 15}Passed
button is a winner{'a': 4, 'd': 3}{'a': 4, 'd': 3}Passed
even split{'a': 50, 'b': 50}{'a': 50, 'b': 50}Passed
single winner{'c': 35}{'c': 35}Passed
wrap past last seat{'a': 4, 'b': 3, 'e': 4}{'a': 4, 'b': 3, 'e': 4}Passed
four-way three odd{'a': 5, 'b': 4, 'c': 5, 'd': 5}{'a': 5, 'b': 4, 'c': 5, 'd': 5}Passed
large unit{'a': 100, 'f': 200}{'a': 100, 'f': 200}Passed

SHA-256 / d517447efdc55c62aa678b917089cd09cce10195c2ab845b3511d0b77c2a1e0a

Verification & scope

A deterministic toy model with an explicitly stated contract; no claim of conformance to any casino or tournament rulebook. 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:08.536912+00:00.

Case digest / ec7cf27e293299a5b2af107bac0cc8a13c41d382e7f2437cbc523d5d7133bea9