FA-82011 / Poker hand evaluation / Open access
Card shared by hole and board goes undetected · case 01
An ace of hearts dealt both in hand and on the board produces a hand instead of "invalid".
ROOT CAUSE
Duplicate detection only inspects the hole cards.
VERIFIED REPAIR
Check for duplicates across the combined hole and board cards.
Unsuccessful approach: Checking only the board still misses hole-board and hole-hole duplicates.
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)!={'plo':4,'plo5':5}[x['variant']]: return 'invalid'
if not 3<=len(board)<=5: return 'invalid'
allc=hole+board
if len(set(hole))!=len(hole): 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'),
('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')],
[('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'),
('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')],
[('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 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'),
('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'),
('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')]]
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 |
| duplicate across hole and board | three of a kind | invalid | Failed |
| duplicate inside hole | invalid | invalid | Passed |
| duplicate on board | two pair | invalid | Failed |
SHA-256 / cbdf073f7e22d987a55cf8b676930d6046939014c097bb09b0aaa716615621fe
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)!={'plo':4,'plo5':5}[x['variant']]: return 'invalid'
if not 3<=len(board)<=5: return 'invalid'
allc=hole+board
if len(set(board))!=len(board): 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'),
('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')],
[('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'),
('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')],
[('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 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'),
('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'),
('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')]]
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 |
| duplicate across hole and board | three of a kind | invalid | Failed |
| duplicate inside hole | one pair | invalid | Failed |
| duplicate on board | invalid | invalid | Passed |
SHA-256 / 335b90966da5f7f0fb4922e39948bf5f19d21370b1bf1c21cfd5c7c801b909af
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'),
('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')],
[('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'),
('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')],
[('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 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'),
('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'),
('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')]]
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 |
| duplicate across hole and board | invalid | invalid | Passed |
| duplicate inside hole | invalid | invalid | Passed |
| duplicate on board | invalid | invalid | Passed |
SHA-256 / 79ffe7056db241f1f2d1c9a60b1e09cfbccd5aeae417b842cc95cb591674d9f9
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.231193+00:00.
Case digest / 5b0fd81ec095bdd8fc6fc481a1978d05fba18aacb20c067cbbed80b420aab5dc