FA-82001 / Poker hand evaluation / Open access
Five-card Omaha deal rejected as invalid · case 01
Every plo5 hand is reported invalid, and a plo hand with five hole cards is not.
ROOT CAUSE
The hole-card count is hard-coded to four regardless of the variant.
VERIFIED REPAIR
Look up the required hole count from the variant.
Unsuccessful approach: A lower bound of four accepts a fifth hole card in four-card Omaha.
Case contract
Input: {"variant": "plo" (4 hole cards) or "plo5" (5 hole cards), "hole": [...], "board": 3 to 5 cards}. The hand must use exactly two hole cards and exactly three board cards. Return the best category name, or "invalid" for a wrong hole count, a board outside 3-5 cards, or a duplicated card.
Why this case matters
Poker engines settle real money pots from these comparisons; a single misranked hand pays the wrong seat.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import collections
import itertools
N = 1
observations = []
def solve(x):
R='23456789TJQKA'
def key5(h):
vals=sorted((R.index(c[0])+2 for c in h), reverse=True)
cnt=collections.Counter(vals)
order=sorted(cnt, key=lambda v:(cnt[v],v), reverse=True)
shape=sorted(cnt.values(), reverse=True)
flush=len({c[1] for c in h})==1
straight=len(cnt)==5 and (vals[0]-vals[4]==4 or vals==[14,5,4,3,2])
top=5 if vals==[14,5,4,3,2] else vals[0]
if straight and flush: return (8,[top])
if shape==[4,1]: return (7,order)
if shape==[3,2]: return (6,order)
if flush: return (5,vals)
if straight: return (4,[top])
if shape==[3,1,1]: return (3,order)
if shape==[2,2,1]: return (2,order)
if shape==[2,1,1,1]: return (1,order)
return (0,vals)
NAMES=['high card','one pair','two pair','three of a kind','straight','flush','full house','four of a kind','straight flush']
hole=x['hole']; board=x['board']
if len(hole)!=4: return 'invalid'
if not 3<=len(board)<=5: return 'invalid'
allc=hole+board
if len(set(allc))!=len(allc): return 'invalid'
cands=[hc+bc for hc in itertools.combinations(hole,2) for bc in itertools.combinations(board,3)]
return NAMES[max(key5(c) for c in cands)[0]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('board flush one suited hole card',
{'board': ['2h', '5h', '7h', '9h', 'Th'], 'hole': ['Ah', 'Kd', 'Qc', 'Js'], 'variant': 'plo'},
'high card'),
('board straight',
{'board': ['9h', 'Td', 'Jc', 'Qs', 'Kh'], 'hole': ['2c', '2d', '3c', '3s'], 'variant': 'plo'},
'one pair'),
('four aces in hand',
{'board': ['2h', '7d', '9c', 'Js', '4h'], 'hole': ['Ah', 'Ad', 'Ac', 'As'], 'variant': 'plo'},
'one pair'),
('real flush',
{'board': ['2h', '5h', '7h', '9d', 'Tc'], 'hole': ['Ah', 'Kh', 'Qc', 'Js'], 'variant': 'plo'},
'flush'),
('flop only', {'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo'},
'three of a kind'),
('plo5 five holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks', '2d'], 'variant': 'plo5'},
'three of a kind'),
('plo with five holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks', '2d'], 'variant': 'plo'},
'invalid'),
('plo5 with four holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo5'}, 'invalid')],
[('real flush',
{'board': ['2h', '5h', '7h', '9d', 'Tc'], 'hole': ['Ah', 'Kh', 'Qc', 'Js'], 'variant': 'plo'},
'flush'),
('flop only', {'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo'},
'three of a kind'),
('turn board',
{'board': ['Tc', 'Jd', '2c', '5h'], 'hole': ['8h', '9d', 'Kc', 'Ks'], 'variant': 'plo'},
'one pair'),
('two card board', {'board': ['Ac', '7d'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo'},
'invalid'),
('plo5 five holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks', '2d'], 'variant': 'plo5'},
'three of a kind'),
('plo with five holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks', '2d'], 'variant': 'plo'},
'invalid'),
('plo5 with four holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo5'}, 'invalid'),
('duplicate across hole and board',
{'board': ['Ah', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo'}, 'invalid')],
[('two card board', {'board': ['Ac', '7d'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo'},
'invalid'),
('plo5 five holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks', '2d'], 'variant': 'plo5'},
'three of a kind'),
('plo with five holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks', '2d'], 'variant': 'plo'},
'invalid'),
('plo5 with four holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo5'}, 'invalid'),
('duplicate across hole and board',
{'board': ['Ah', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo'}, 'invalid'),
('duplicate inside hole',
{'board': ['Qh', '7d', '2c'], 'hole': ['Ah', 'Ah', 'Kc', 'Ks'], 'variant': 'plo'}, 'invalid'),
('duplicate on board',
{'board': ['Qh', 'Qh', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo'}, 'invalid'),
('six card board',
{'board': ['Qh', 'Jh', '2c', '3c', '4c', '5c'],
'hole': ['Ah', 'Ad', 'Kc', 'Ks'],
'variant': 'plo'},
'invalid')],
[('board flush one suited hole card',
{'board': ['2h', '5h', '7h', '9h', 'Th'], 'hole': ['Ah', 'Kd', 'Qc', 'Js'], 'variant': 'plo'},
'high card'),
('board straight',
{'board': ['9h', 'Td', 'Jc', 'Qs', 'Kh'], 'hole': ['2c', '2d', '3c', '3s'], 'variant': 'plo'},
'one pair'),
('plo5 five holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks', '2d'], 'variant': 'plo5'},
'three of a kind'),
('plo with five holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks', '2d'], 'variant': 'plo'},
'invalid'),
('plo5 with four holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo5'}, 'invalid'),
('duplicate on board',
{'board': ['Qh', 'Qh', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo'}, 'invalid'),
('six card board',
{'board': ['Qh', 'Jh', '2c', '3c', '4c', '5c'],
'hole': ['Ah', 'Ad', 'Kc', 'Ks'],
'variant': 'plo'},
'invalid'),
('full house two pairs in hand',
{'board': ['Kc', '7d', '2c', '3h', '9s'], 'hole': ['Kh', 'Kd', '7c', '7s'], 'variant': 'plo'},
'three of a kind')],
[('board flush one suited hole card',
{'board': ['2h', '5h', '7h', '9h', 'Th'], 'hole': ['Ah', 'Kd', 'Qc', 'Js'], 'variant': 'plo'},
'high card'),
('board straight',
{'board': ['9h', 'Td', 'Jc', 'Qs', 'Kh'], 'hole': ['2c', '2d', '3c', '3s'], 'variant': 'plo'},
'one pair'),
('four aces in hand',
{'board': ['2h', '7d', '9c', 'Js', '4h'], 'hole': ['Ah', 'Ad', 'Ac', 'As'], 'variant': 'plo'},
'one pair'),
('real flush',
{'board': ['2h', '5h', '7h', '9d', 'Tc'], 'hole': ['Ah', 'Kh', 'Qc', 'Js'], 'variant': 'plo'},
'flush'),
('flop only', {'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo'},
'three of a kind'),
('plo5 five holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks', '2d'], 'variant': 'plo5'},
'three of a kind'),
('plo with five holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks', '2d'], 'variant': 'plo'},
'invalid'),
('plo5 with four holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo5'}, 'invalid')]]
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 |
|---|---|---|---|
| board flush one suited hole card | high card | high card | Passed |
| board straight | one pair | one pair | Passed |
| four aces in hand | one pair | one pair | Passed |
| real flush | flush | flush | Passed |
| flop only | three of a kind | three of a kind | Passed |
| plo5 five holes | invalid | three of a kind | Failed |
| plo with five holes | invalid | invalid | Passed |
| plo5 with four holes | three of a kind | invalid | Failed |
SHA-256 / a63f91dd33638dbb9da8112a4e172254d52f07da3ab506e62aeb87f917c11379
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import collections
import itertools
N = 1
observations = []
def solve(x):
R='23456789TJQKA'
def key5(h):
vals=sorted((R.index(c[0])+2 for c in h), reverse=True)
cnt=collections.Counter(vals)
order=sorted(cnt, key=lambda v:(cnt[v],v), reverse=True)
shape=sorted(cnt.values(), reverse=True)
flush=len({c[1] for c in h})==1
straight=len(cnt)==5 and (vals[0]-vals[4]==4 or vals==[14,5,4,3,2])
top=5 if vals==[14,5,4,3,2] else vals[0]
if straight and flush: return (8,[top])
if shape==[4,1]: return (7,order)
if shape==[3,2]: return (6,order)
if flush: return (5,vals)
if straight: return (4,[top])
if shape==[3,1,1]: return (3,order)
if shape==[2,2,1]: return (2,order)
if shape==[2,1,1,1]: return (1,order)
return (0,vals)
NAMES=['high card','one pair','two pair','three of a kind','straight','flush','full house','four of a kind','straight flush']
hole=x['hole']; board=x['board']
if len(hole)<4: return 'invalid'
if not 3<=len(board)<=5: return 'invalid'
allc=hole+board
if len(set(allc))!=len(allc): return 'invalid'
cands=[hc+bc for hc in itertools.combinations(hole,2) for bc in itertools.combinations(board,3)]
return NAMES[max(key5(c) for c in cands)[0]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('board flush one suited hole card',
{'board': ['2h', '5h', '7h', '9h', 'Th'], 'hole': ['Ah', 'Kd', 'Qc', 'Js'], 'variant': 'plo'},
'high card'),
('board straight',
{'board': ['9h', 'Td', 'Jc', 'Qs', 'Kh'], 'hole': ['2c', '2d', '3c', '3s'], 'variant': 'plo'},
'one pair'),
('four aces in hand',
{'board': ['2h', '7d', '9c', 'Js', '4h'], 'hole': ['Ah', 'Ad', 'Ac', 'As'], 'variant': 'plo'},
'one pair'),
('real flush',
{'board': ['2h', '5h', '7h', '9d', 'Tc'], 'hole': ['Ah', 'Kh', 'Qc', 'Js'], 'variant': 'plo'},
'flush'),
('flop only', {'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo'},
'three of a kind'),
('plo5 five holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks', '2d'], 'variant': 'plo5'},
'three of a kind'),
('plo with five holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks', '2d'], 'variant': 'plo'},
'invalid'),
('plo5 with four holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo5'}, 'invalid')],
[('real flush',
{'board': ['2h', '5h', '7h', '9d', 'Tc'], 'hole': ['Ah', 'Kh', 'Qc', 'Js'], 'variant': 'plo'},
'flush'),
('flop only', {'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo'},
'three of a kind'),
('turn board',
{'board': ['Tc', 'Jd', '2c', '5h'], 'hole': ['8h', '9d', 'Kc', 'Ks'], 'variant': 'plo'},
'one pair'),
('two card board', {'board': ['Ac', '7d'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo'},
'invalid'),
('plo5 five holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks', '2d'], 'variant': 'plo5'},
'three of a kind'),
('plo with five holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks', '2d'], 'variant': 'plo'},
'invalid'),
('plo5 with four holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo5'}, 'invalid'),
('duplicate across hole and board',
{'board': ['Ah', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo'}, 'invalid')],
[('two card board', {'board': ['Ac', '7d'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo'},
'invalid'),
('plo5 five holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks', '2d'], 'variant': 'plo5'},
'three of a kind'),
('plo with five holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks', '2d'], 'variant': 'plo'},
'invalid'),
('plo5 with four holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo5'}, 'invalid'),
('duplicate across hole and board',
{'board': ['Ah', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo'}, 'invalid'),
('duplicate inside hole',
{'board': ['Qh', '7d', '2c'], 'hole': ['Ah', 'Ah', 'Kc', 'Ks'], 'variant': 'plo'}, 'invalid'),
('duplicate on board',
{'board': ['Qh', 'Qh', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo'}, 'invalid'),
('six card board',
{'board': ['Qh', 'Jh', '2c', '3c', '4c', '5c'],
'hole': ['Ah', 'Ad', 'Kc', 'Ks'],
'variant': 'plo'},
'invalid')],
[('board flush one suited hole card',
{'board': ['2h', '5h', '7h', '9h', 'Th'], 'hole': ['Ah', 'Kd', 'Qc', 'Js'], 'variant': 'plo'},
'high card'),
('board straight',
{'board': ['9h', 'Td', 'Jc', 'Qs', 'Kh'], 'hole': ['2c', '2d', '3c', '3s'], 'variant': 'plo'},
'one pair'),
('plo5 five holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks', '2d'], 'variant': 'plo5'},
'three of a kind'),
('plo with five holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks', '2d'], 'variant': 'plo'},
'invalid'),
('plo5 with four holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo5'}, 'invalid'),
('duplicate on board',
{'board': ['Qh', 'Qh', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo'}, 'invalid'),
('six card board',
{'board': ['Qh', 'Jh', '2c', '3c', '4c', '5c'],
'hole': ['Ah', 'Ad', 'Kc', 'Ks'],
'variant': 'plo'},
'invalid'),
('full house two pairs in hand',
{'board': ['Kc', '7d', '2c', '3h', '9s'], 'hole': ['Kh', 'Kd', '7c', '7s'], 'variant': 'plo'},
'three of a kind')],
[('board flush one suited hole card',
{'board': ['2h', '5h', '7h', '9h', 'Th'], 'hole': ['Ah', 'Kd', 'Qc', 'Js'], 'variant': 'plo'},
'high card'),
('board straight',
{'board': ['9h', 'Td', 'Jc', 'Qs', 'Kh'], 'hole': ['2c', '2d', '3c', '3s'], 'variant': 'plo'},
'one pair'),
('four aces in hand',
{'board': ['2h', '7d', '9c', 'Js', '4h'], 'hole': ['Ah', 'Ad', 'Ac', 'As'], 'variant': 'plo'},
'one pair'),
('real flush',
{'board': ['2h', '5h', '7h', '9d', 'Tc'], 'hole': ['Ah', 'Kh', 'Qc', 'Js'], 'variant': 'plo'},
'flush'),
('flop only', {'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo'},
'three of a kind'),
('plo5 five holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks', '2d'], 'variant': 'plo5'},
'three of a kind'),
('plo with five holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks', '2d'], 'variant': 'plo'},
'invalid'),
('plo5 with four holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo5'}, 'invalid')]]
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 |
|---|---|---|---|
| board flush one suited hole card | high card | high card | Passed |
| board straight | one pair | one pair | Passed |
| four aces in hand | one pair | one pair | Passed |
| real flush | flush | flush | Passed |
| flop only | three of a kind | three of a kind | Passed |
| plo5 five holes | three of a kind | three of a kind | Passed |
| plo with five holes | three of a kind | invalid | Failed |
| plo5 with four holes | three of a kind | invalid | Failed |
SHA-256 / 4684021e501f700b4a7ca79997576c3eb5b3adce72d2f467b8214c59d4e2d6d5
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import collections
import itertools
N = 1
observations = []
def solve(x):
R='23456789TJQKA'
def key5(h):
vals=sorted((R.index(c[0])+2 for c in h), reverse=True)
cnt=collections.Counter(vals)
order=sorted(cnt, key=lambda v:(cnt[v],v), reverse=True)
shape=sorted(cnt.values(), reverse=True)
flush=len({c[1] for c in h})==1
straight=len(cnt)==5 and (vals[0]-vals[4]==4 or vals==[14,5,4,3,2])
top=5 if vals==[14,5,4,3,2] else vals[0]
if straight and flush: return (8,[top])
if shape==[4,1]: return (7,order)
if shape==[3,2]: return (6,order)
if flush: return (5,vals)
if straight: return (4,[top])
if shape==[3,1,1]: return (3,order)
if shape==[2,2,1]: return (2,order)
if shape==[2,1,1,1]: return (1,order)
return (0,vals)
NAMES=['high card','one pair','two pair','three of a kind','straight','flush','full house','four of a kind','straight flush']
hole=x['hole']; board=x['board']
if len(hole)!={'plo':4,'plo5':5}[x['variant']]: return 'invalid'
if not 3<=len(board)<=5: return 'invalid'
allc=hole+board
if len(set(allc))!=len(allc): return 'invalid'
cands=[hc+bc for hc in itertools.combinations(hole,2) for bc in itertools.combinations(board,3)]
return NAMES[max(key5(c) for c in cands)[0]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('board flush one suited hole card',
{'board': ['2h', '5h', '7h', '9h', 'Th'], 'hole': ['Ah', 'Kd', 'Qc', 'Js'], 'variant': 'plo'},
'high card'),
('board straight',
{'board': ['9h', 'Td', 'Jc', 'Qs', 'Kh'], 'hole': ['2c', '2d', '3c', '3s'], 'variant': 'plo'},
'one pair'),
('four aces in hand',
{'board': ['2h', '7d', '9c', 'Js', '4h'], 'hole': ['Ah', 'Ad', 'Ac', 'As'], 'variant': 'plo'},
'one pair'),
('real flush',
{'board': ['2h', '5h', '7h', '9d', 'Tc'], 'hole': ['Ah', 'Kh', 'Qc', 'Js'], 'variant': 'plo'},
'flush'),
('flop only', {'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo'},
'three of a kind'),
('plo5 five holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks', '2d'], 'variant': 'plo5'},
'three of a kind'),
('plo with five holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks', '2d'], 'variant': 'plo'},
'invalid'),
('plo5 with four holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo5'}, 'invalid')],
[('real flush',
{'board': ['2h', '5h', '7h', '9d', 'Tc'], 'hole': ['Ah', 'Kh', 'Qc', 'Js'], 'variant': 'plo'},
'flush'),
('flop only', {'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo'},
'three of a kind'),
('turn board',
{'board': ['Tc', 'Jd', '2c', '5h'], 'hole': ['8h', '9d', 'Kc', 'Ks'], 'variant': 'plo'},
'one pair'),
('two card board', {'board': ['Ac', '7d'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo'},
'invalid'),
('plo5 five holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks', '2d'], 'variant': 'plo5'},
'three of a kind'),
('plo with five holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks', '2d'], 'variant': 'plo'},
'invalid'),
('plo5 with four holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo5'}, 'invalid'),
('duplicate across hole and board',
{'board': ['Ah', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo'}, 'invalid')],
[('two card board', {'board': ['Ac', '7d'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo'},
'invalid'),
('plo5 five holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks', '2d'], 'variant': 'plo5'},
'three of a kind'),
('plo with five holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks', '2d'], 'variant': 'plo'},
'invalid'),
('plo5 with four holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo5'}, 'invalid'),
('duplicate across hole and board',
{'board': ['Ah', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo'}, 'invalid'),
('duplicate inside hole',
{'board': ['Qh', '7d', '2c'], 'hole': ['Ah', 'Ah', 'Kc', 'Ks'], 'variant': 'plo'}, 'invalid'),
('duplicate on board',
{'board': ['Qh', 'Qh', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo'}, 'invalid'),
('six card board',
{'board': ['Qh', 'Jh', '2c', '3c', '4c', '5c'],
'hole': ['Ah', 'Ad', 'Kc', 'Ks'],
'variant': 'plo'},
'invalid')],
[('board flush one suited hole card',
{'board': ['2h', '5h', '7h', '9h', 'Th'], 'hole': ['Ah', 'Kd', 'Qc', 'Js'], 'variant': 'plo'},
'high card'),
('board straight',
{'board': ['9h', 'Td', 'Jc', 'Qs', 'Kh'], 'hole': ['2c', '2d', '3c', '3s'], 'variant': 'plo'},
'one pair'),
('plo5 five holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks', '2d'], 'variant': 'plo5'},
'three of a kind'),
('plo with five holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks', '2d'], 'variant': 'plo'},
'invalid'),
('plo5 with four holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo5'}, 'invalid'),
('duplicate on board',
{'board': ['Qh', 'Qh', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo'}, 'invalid'),
('six card board',
{'board': ['Qh', 'Jh', '2c', '3c', '4c', '5c'],
'hole': ['Ah', 'Ad', 'Kc', 'Ks'],
'variant': 'plo'},
'invalid'),
('full house two pairs in hand',
{'board': ['Kc', '7d', '2c', '3h', '9s'], 'hole': ['Kh', 'Kd', '7c', '7s'], 'variant': 'plo'},
'three of a kind')],
[('board flush one suited hole card',
{'board': ['2h', '5h', '7h', '9h', 'Th'], 'hole': ['Ah', 'Kd', 'Qc', 'Js'], 'variant': 'plo'},
'high card'),
('board straight',
{'board': ['9h', 'Td', 'Jc', 'Qs', 'Kh'], 'hole': ['2c', '2d', '3c', '3s'], 'variant': 'plo'},
'one pair'),
('four aces in hand',
{'board': ['2h', '7d', '9c', 'Js', '4h'], 'hole': ['Ah', 'Ad', 'Ac', 'As'], 'variant': 'plo'},
'one pair'),
('real flush',
{'board': ['2h', '5h', '7h', '9d', 'Tc'], 'hole': ['Ah', 'Kh', 'Qc', 'Js'], 'variant': 'plo'},
'flush'),
('flop only', {'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo'},
'three of a kind'),
('plo5 five holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks', '2d'], 'variant': 'plo5'},
'three of a kind'),
('plo with five holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks', '2d'], 'variant': 'plo'},
'invalid'),
('plo5 with four holes',
{'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo5'}, 'invalid')]]
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 |
|---|---|---|---|
| board flush one suited hole card | high card | high card | Passed |
| board straight | one pair | one pair | Passed |
| four aces in hand | one pair | one pair | Passed |
| real flush | flush | flush | Passed |
| flop only | three of a kind | three of a kind | Passed |
| plo5 five holes | three of a kind | three of a kind | Passed |
| plo with five holes | invalid | invalid | Passed |
| plo5 with four holes | invalid | invalid | Passed |
SHA-256 / 406896202e6a140b077c67063efa29ef1000147bbc15f86f601d7743d5fbee03
Verification & scope
A deterministic toy model with an explicitly stated contract; card strings are rank+suit (for example "As", "Td"); 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.198997+00:00.
Case digest / c26729ce2aef767ca9f37f24f9adf6f1b38890abcf60163dd6aaf62ad79b21a1