FA-82056 / Poker hand evaluation / Open access
Clockwise order stops at the last seat index · case 01
Winners seated before the button in the seat list never receive odd units.
ROOT CAUSE
The rotated order drops the seats that precede the start index instead of wrapping around.
VERIFIED REPAIR
Concatenate the tail from the start index with the head before it.
Unsuccessful approach: Concatenating head then tail is just the unrotated seat list.
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:]
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}),
('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}),
('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}),
('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})],
[('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})],
[('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})],
[('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}),
('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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| 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': 3, 'b': 3, 'e': 4} | {'a': 4, 'b': 3, 'e': 4} | Failed |
| four-way three odd | {'a': 4, 'b': 4, 'c': 5, 'd': 5} | {'a': 5, 'b': 4, 'c': 5, 'd': 5} | Failed |
| button left winner | {'b': 3, 'c': 2} | {'b': 3, 'c': 2} | Passed |
SHA-256 / 03dbc293f5c0e2f18cb6c641509d91fe405ee9b1f741ea0654dbfc6f967bf616
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 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}),
('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}),
('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}),
('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})],
[('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})],
[('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})],
[('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}),
('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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| 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 |
| button left winner | {'b': 3, 'c': 2} | {'b': 3, 'c': 2} | Passed |
SHA-256 / 9e68d6591f9894ce8d527cbf7fa41d14d1d772ec9dbf97f6a1d10eb317804a4d
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}),
('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}),
('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}),
('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})],
[('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})],
[('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})],
[('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}),
('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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| 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 |
| button left winner | {'b': 3, 'c': 2} | {'b': 3, 'c': 2} | Passed |
SHA-256 / 5a8c588fa1f40cafda43c364a1676e124ac307db3288e8e81e5d13b2389f2aa1
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.708465+00:00.
Case digest / 56373e667d3479d6438be0b1fe093fe6300398049e9a5272bdce70d726a42749