FA-82041 / Poker hand evaluation / Open access
Odd chip starts at the button · case 01
The button seat, when it wins, receives the odd chip ahead of the player to its left.
ROOT CAUSE
Rotation starts at the button index instead of the seat after it.
VERIFIED REPAIR
Start the clockwise order at the first seat after the button.
Unsuccessful approach: Starting one seat before the button walks from the button's right.
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'])
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})],
[('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}),
('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}),
('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}),
('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}),
('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': 3, 'd': 4} | {'a': 4, 'd': 3} | Failed |
| 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': 4, 'b': 5, 'c': 5, 'd': 5} | {'a': 5, 'b': 4, 'c': 5, 'd': 5} | Failed |
| large unit | {'a': 200, 'f': 100} | {'a': 100, 'f': 200} | Failed |
SHA-256 / faa483d324107b801a71174b9d490cc5e62c0873a1c64ba12d6dfd422f76878e
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}),
('large unit',
{'button': 'a',
'pot': 300,
'seats': ['a', 'b', 'c', 'd', 'e', 'f'],
'unit': 100,
'winners': ['f', 'a']},
{'a': 100, 'f': 200})],
[('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}),
('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}),
('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}),
('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}),
('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': 3, 'd': 4} | {'a': 4, 'd': 3} | Failed |
| 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': 5, 'c': 5, 'd': 4} | {'a': 5, 'b': 4, 'c': 5, 'd': 5} | Failed |
| large unit | {'a': 100, 'f': 200} | {'a': 100, 'f': 200} | Passed |
SHA-256 / 03c10ae13dadf0661f49295a7048863a9c6a728227d46966970ed2b69e741277
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})],
[('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}),
('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}),
('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}),
('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}),
('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 |
| large unit | {'a': 100, 'f': 200} | {'a': 100, 'f': 200} | Passed |
SHA-256 / 02c8074ce99b5e0e959866a4d9f6d7f644ec9235058f6e576860f05fbeaffa98
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.399865+00:00.
Case digest / 006acd325afa20966a1ea21e608fa369f8f6eaf4b96ad7b908340c409ec102c5