FAILURE MAP
← Case archive

FA-82006 / Poker hand evaluation / Open access

Flop and turn boards cannot be evaluated · case 01

Hands on a three- or four-card board are reported invalid.

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

ROOT CAUSE

The board check demands a complete river board.

VERIFIED REPAIR

Accept boards of three to five cards, since three board cards are all a hand needs.

Unsuccessful approach: Allowing a two-card board leaves no three-card board combination to evaluate.

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 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'),
  ('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'),
  ('plo with five holes',
   {'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks', '2d'], 'variant': 'plo'},
   'invalid')],
 [('real flush',
   {'board': ['2h', '5h', '7h', '9d', 'Tc'], 'hole': ['Ah', 'Kh', 'Qc', 'Js'], 'variant': 'plo'},
   'flush'),
  ('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'),
  ('duplicate inside hole',
   {'board': ['Qh', '7d', '2c'], 'hole': ['Ah', 'Ah', 'Kc', 'Ks'], 'variant': 'plo'}, 'invalid')],
 [('flop only', {'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo'},
   'three of a kind'),
  ('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'),
  ('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'),
  ('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'),
  ('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'),
  ('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'),
  ('six card board',
   {'board': ['Qh', 'Jh', '2c', '3c', '4c', '5c'],
    '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 fixtureActualExpectedOutcome
board flush one suited hole cardhigh cardhigh cardPassed
board straightone pairone pairPassed
four aces in handone pairone pairPassed
real flushflushflushPassed
flop onlyinvalidthree of a kindFailed
turn boardinvalidone pairFailed
two card boardinvalidinvalidPassed
plo with five holesinvalidinvalidPassed

SHA-256 / d2af951358c040bde3e3093ebb563de374d00e83166b13dbf5d3ac267a4bbaab

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 len(board)<2 or 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'),
  ('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'),
  ('plo with five holes',
   {'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks', '2d'], 'variant': 'plo'},
   'invalid')],
 [('real flush',
   {'board': ['2h', '5h', '7h', '9d', 'Tc'], 'hole': ['Ah', 'Kh', 'Qc', 'Js'], 'variant': 'plo'},
   'flush'),
  ('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'),
  ('duplicate inside hole',
   {'board': ['Qh', '7d', '2c'], 'hole': ['Ah', 'Ah', 'Kc', 'Ks'], 'variant': 'plo'}, 'invalid')],
 [('flop only', {'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo'},
   'three of a kind'),
  ('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'),
  ('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'),
  ('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'),
  ('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'),
  ('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'),
  ('six card board',
   {'board': ['Qh', 'Jh', '2c', '3c', '4c', '5c'],
    '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 fixtureActualExpectedOutcome
board flush one suited hole cardhigh cardhigh cardPassed
board straightone pairone pairPassed
four aces in handone pairone pairPassed
real flushflushflushPassed
flop onlythree of a kindthree of a kindPassed
turn boardone pairone pairPassed
two card boarderror:ValueErrorinvalidFailed
plo with five holesinvalidinvalidPassed

SHA-256 / 256a4c1072c37e7dd242068056264efdd20316a56bb4800b346bb567cf3ded44

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'),
  ('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'),
  ('plo with five holes',
   {'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks', '2d'], 'variant': 'plo'},
   'invalid')],
 [('real flush',
   {'board': ['2h', '5h', '7h', '9d', 'Tc'], 'hole': ['Ah', 'Kh', 'Qc', 'Js'], 'variant': 'plo'},
   'flush'),
  ('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'),
  ('duplicate inside hole',
   {'board': ['Qh', '7d', '2c'], 'hole': ['Ah', 'Ah', 'Kc', 'Ks'], 'variant': 'plo'}, 'invalid')],
 [('flop only', {'board': ['Ac', '7d', '2c'], 'hole': ['Ah', 'Ad', 'Kc', 'Ks'], 'variant': 'plo'},
   'three of a kind'),
  ('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'),
  ('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'),
  ('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'),
  ('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'),
  ('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'),
  ('six card board',
   {'board': ['Qh', 'Jh', '2c', '3c', '4c', '5c'],
    '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 fixtureActualExpectedOutcome
board flush one suited hole cardhigh cardhigh cardPassed
board straightone pairone pairPassed
four aces in handone pairone pairPassed
real flushflushflushPassed
flop onlythree of a kindthree of a kindPassed
turn boardone pairone pairPassed
two card boardinvalidinvalidPassed
plo with five holesinvalidinvalidPassed

SHA-256 / 01fa5b9c92dc4a1c59e6a2d7aa8166153b853c8b4bb4d29e5b572e22340d3a01

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.199803+00:00.

Case digest / 6d07bc4b36cb7ceaf1f6b95c81310303140629c108b819aa36cbcebd4668c188