FAILURE MAP
← Case archive

FA-82216 / Poker hand evaluation / Open access

Short-deck ranks valued from the full-deck offset · case 01

The ace scores as 10, so the A-6-7-8-9 pattern never matches.

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

ROOT CAUSE

Card values reuse the full-deck offset of 2 on a rank table that starts at 6.

VERIFIED REPAIR

Offset the short rank table by 6 so the six is 6 and the ace 14.

Unsuccessful approach: An offset of 5 still misvalues every rank and misses the low straight.

Case contract

Input: [hand_a, hand_b], five cards each from a 36-card deck (ranks 6-A). Short-deck ranking: straight flush > quads > flush > full house > straight > trips > two pair > pair > high card. A-6-7-8-9 is the lowest straight (nine high). A card below 6 in either hand makes the result "invalid". Return 1, -1, 0 or "invalid".

Why this case matters

Short-deck tables reuse full-deck evaluators and must patch exactly these rules.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import collections
N = 1
observations = []
def solve(x):
    R='6789TJQKA'
    for c in x[0]+x[1]:
        if c[0] not in R: return 'invalid'
    def key(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
        low=vals==[14,9,8,7,6]
        straight=len(cnt)==5 and (vals[0]-vals[4]==4 or low)
        if straight: order=[9 if low else vals[0]]
        if straight and flush: return (8,order)
        if shape==[4,1]: return (7,order)
        if flush: return (6,vals)
        if shape==[3,2]: return (5,order)
        if straight: return (4,order)
        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)
    a,b=key(x[0]),key(x[1])
    return (a>b)-(a<b)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('flush beats full house', [['6h', '9h', 'Jh', 'Qh', 'Ah'], ['Kh', 'Kd', 'Kc', '7s', '7h']], 1),
  ('full house loses to flush', [['Ks', 'Kd', 'Kc', '7s', '7c'], ['6d', '8d', 'Td', 'Jd', 'Qd']],
   -1),
  ('short wheel is a straight', [['Ah', '6d', '7c', '8s', '9h'], ['Qh', 'Qd', 'Qc', '7s', '6h']],
   1),
  ('short wheel vs six-ten', [['Ah', '6d', '7c', '8s', '9h'], ['6h', '7d', '8c', '9s', 'Th']], -1),
  ('jack-nine gap not a straight', [['Jh', '6d', '7c', '8s', '9h'], ['Ah', 'Ad', '7s', '8h', 'Tc']],
   -1),
  ('low card in hand b', [['Ah', 'Kd', 'Qc', 'Js', '9h'], ['5h', '6d', '7c', '8s', '9s']],
   'invalid'),
  ('low card in hand a', [['2h', 'Kd', 'Qc', 'Js', '9h'], ['Th', '6d', '7c', '8s', '9s']],
   'invalid'),
  ('broadway vs short wheel', [['Th', 'Jd', 'Qc', 'Ks', 'Ah'], ['Ad', '6c', '7d', '8h', '9c']], 1)],
 [('short wheel is a straight', [['Ah', '6d', '7c', '8s', '9h'], ['Qh', 'Qd', 'Qc', '7s', '6h']],
   1),
  ('jack-nine gap not a straight', [['Jh', '6d', '7c', '8s', '9h'], ['Ah', 'Ad', '7s', '8h', 'Tc']],
   -1),
  ('low card in hand b', [['Ah', 'Kd', 'Qc', 'Js', '9h'], ['5h', '6d', '7c', '8s', '9s']],
   'invalid'),
  ('low card in hand a', [['2h', 'Kd', 'Qc', 'Js', '9h'], ['Th', '6d', '7c', '8s', '9s']],
   'invalid'),
  ('broadway vs short wheel', [['Th', 'Jd', 'Qc', 'Ks', 'Ah'], ['Ad', '6c', '7d', '8h', '9c']], 1),
  ('pair vs pair kicker', [['Kh', 'Kd', 'Qc', '7s', '6h'], ['Ks', 'Kc', 'Jc', 'Ts', '9h']], 1),
  ('tie straights', [['6h', '7d', '8c', '9s', 'Th'], ['6c', '7h', '8d', '9h', 'Tc']], 0),
  ('quads beat flush', [['9h', '9d', '9c', '9s', '6h'], ['6d', '8d', 'Td', 'Jd', 'Ad']], 1)],
 [('flush beats full house', [['6h', '9h', 'Jh', 'Qh', 'Ah'], ['Kh', 'Kd', 'Kc', '7s', '7h']], 1),
  ('full house loses to flush', [['Ks', 'Kd', 'Kc', '7s', '7c'], ['6d', '8d', 'Td', 'Jd', 'Qd']],
   -1),
  ('short wheel is a straight', [['Ah', '6d', '7c', '8s', '9h'], ['Qh', 'Qd', 'Qc', '7s', '6h']],
   1),
  ('broadway vs short wheel', [['Th', 'Jd', 'Qc', 'Ks', 'Ah'], ['Ad', '6c', '7d', '8h', '9c']], 1),
  ('pair vs pair kicker', [['Kh', 'Kd', 'Qc', '7s', '6h'], ['Ks', 'Kc', 'Jc', 'Ts', '9h']], 1),
  ('tie straights', [['6h', '7d', '8c', '9s', 'Th'], ['6c', '7h', '8d', '9h', 'Tc']], 0),
  ('quads beat flush', [['9h', '9d', '9c', '9s', '6h'], ['6d', '8d', 'Td', 'Jd', 'Ad']], 1),
  ('trips vs two pair', [['7h', '7d', '7c', 'As', 'Kh'], ['Ah', 'Ad', 'Kc', 'Ks', 'Qh']], 1)],
 [('flush beats full house', [['6h', '9h', 'Jh', 'Qh', 'Ah'], ['Kh', 'Kd', 'Kc', '7s', '7h']], 1),
  ('full house loses to flush', [['Ks', 'Kd', 'Kc', '7s', '7c'], ['6d', '8d', 'Td', 'Jd', 'Qd']],
   -1),
  ('short wheel is a straight', [['Ah', '6d', '7c', '8s', '9h'], ['Qh', 'Qd', 'Qc', '7s', '6h']],
   1),
  ('short wheel vs six-ten', [['Ah', '6d', '7c', '8s', '9h'], ['6h', '7d', '8c', '9s', 'Th']], -1),
  ('jack-nine gap not a straight', [['Jh', '6d', '7c', '8s', '9h'], ['Ah', 'Ad', '7s', '8h', 'Tc']],
   -1),
  ('low card in hand b', [['Ah', 'Kd', 'Qc', 'Js', '9h'], ['5h', '6d', '7c', '8s', '9s']],
   'invalid'),
  ('quads beat flush', [['9h', '9d', '9c', '9s', '6h'], ['6d', '8d', 'Td', 'Jd', 'Ad']], 1),
  ('trips vs two pair', [['7h', '7d', '7c', 'As', 'Kh'], ['Ah', 'Ad', 'Kc', 'Ks', 'Qh']], 1)],
 [('flush beats full house', [['6h', '9h', 'Jh', 'Qh', 'Ah'], ['Kh', 'Kd', 'Kc', '7s', '7h']], 1),
  ('full house loses to flush', [['Ks', 'Kd', 'Kc', '7s', '7c'], ['6d', '8d', 'Td', 'Jd', 'Qd']],
   -1),
  ('short wheel is a straight', [['Ah', '6d', '7c', '8s', '9h'], ['Qh', 'Qd', 'Qc', '7s', '6h']],
   1),
  ('short wheel vs six-ten', [['Ah', '6d', '7c', '8s', '9h'], ['6h', '7d', '8c', '9s', 'Th']], -1),
  ('jack-nine gap not a straight', [['Jh', '6d', '7c', '8s', '9h'], ['Ah', 'Ad', '7s', '8h', 'Tc']],
   -1),
  ('low card in hand b', [['Ah', 'Kd', 'Qc', 'Js', '9h'], ['5h', '6d', '7c', '8s', '9s']],
   'invalid'),
  ('low card in hand a', [['2h', 'Kd', 'Qc', 'Js', '9h'], ['Th', '6d', '7c', '8s', '9s']],
   'invalid'),
  ('broadway vs short wheel', [['Th', 'Jd', 'Qc', 'Ks', 'Ah'], ['Ad', '6c', '7d', '8h', '9c']], 1)]]
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
flush beats full house11Passed
full house loses to flush-1-1Passed
short wheel is a straight-11Failed
short wheel vs six-ten-1-1Passed
jack-nine gap not a straight-1-1Passed
low card in hand binvalidinvalidPassed
low card in hand ainvalidinvalidPassed
broadway vs short wheel11Passed

SHA-256 / e114763fcdb177f442bf1190a18744e5a1c1b82aa2608b2e55d68b1754935622

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import collections
N = 1
observations = []
def solve(x):
    R='6789TJQKA'
    for c in x[0]+x[1]:
        if c[0] not in R: return 'invalid'
    def key(h):
        vals=sorted((R.index(c[0])+5 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
        low=vals==[14,9,8,7,6]
        straight=len(cnt)==5 and (vals[0]-vals[4]==4 or low)
        if straight: order=[9 if low else vals[0]]
        if straight and flush: return (8,order)
        if shape==[4,1]: return (7,order)
        if flush: return (6,vals)
        if shape==[3,2]: return (5,order)
        if straight: return (4,order)
        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)
    a,b=key(x[0]),key(x[1])
    return (a>b)-(a<b)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('flush beats full house', [['6h', '9h', 'Jh', 'Qh', 'Ah'], ['Kh', 'Kd', 'Kc', '7s', '7h']], 1),
  ('full house loses to flush', [['Ks', 'Kd', 'Kc', '7s', '7c'], ['6d', '8d', 'Td', 'Jd', 'Qd']],
   -1),
  ('short wheel is a straight', [['Ah', '6d', '7c', '8s', '9h'], ['Qh', 'Qd', 'Qc', '7s', '6h']],
   1),
  ('short wheel vs six-ten', [['Ah', '6d', '7c', '8s', '9h'], ['6h', '7d', '8c', '9s', 'Th']], -1),
  ('jack-nine gap not a straight', [['Jh', '6d', '7c', '8s', '9h'], ['Ah', 'Ad', '7s', '8h', 'Tc']],
   -1),
  ('low card in hand b', [['Ah', 'Kd', 'Qc', 'Js', '9h'], ['5h', '6d', '7c', '8s', '9s']],
   'invalid'),
  ('low card in hand a', [['2h', 'Kd', 'Qc', 'Js', '9h'], ['Th', '6d', '7c', '8s', '9s']],
   'invalid'),
  ('broadway vs short wheel', [['Th', 'Jd', 'Qc', 'Ks', 'Ah'], ['Ad', '6c', '7d', '8h', '9c']], 1)],
 [('short wheel is a straight', [['Ah', '6d', '7c', '8s', '9h'], ['Qh', 'Qd', 'Qc', '7s', '6h']],
   1),
  ('jack-nine gap not a straight', [['Jh', '6d', '7c', '8s', '9h'], ['Ah', 'Ad', '7s', '8h', 'Tc']],
   -1),
  ('low card in hand b', [['Ah', 'Kd', 'Qc', 'Js', '9h'], ['5h', '6d', '7c', '8s', '9s']],
   'invalid'),
  ('low card in hand a', [['2h', 'Kd', 'Qc', 'Js', '9h'], ['Th', '6d', '7c', '8s', '9s']],
   'invalid'),
  ('broadway vs short wheel', [['Th', 'Jd', 'Qc', 'Ks', 'Ah'], ['Ad', '6c', '7d', '8h', '9c']], 1),
  ('pair vs pair kicker', [['Kh', 'Kd', 'Qc', '7s', '6h'], ['Ks', 'Kc', 'Jc', 'Ts', '9h']], 1),
  ('tie straights', [['6h', '7d', '8c', '9s', 'Th'], ['6c', '7h', '8d', '9h', 'Tc']], 0),
  ('quads beat flush', [['9h', '9d', '9c', '9s', '6h'], ['6d', '8d', 'Td', 'Jd', 'Ad']], 1)],
 [('flush beats full house', [['6h', '9h', 'Jh', 'Qh', 'Ah'], ['Kh', 'Kd', 'Kc', '7s', '7h']], 1),
  ('full house loses to flush', [['Ks', 'Kd', 'Kc', '7s', '7c'], ['6d', '8d', 'Td', 'Jd', 'Qd']],
   -1),
  ('short wheel is a straight', [['Ah', '6d', '7c', '8s', '9h'], ['Qh', 'Qd', 'Qc', '7s', '6h']],
   1),
  ('broadway vs short wheel', [['Th', 'Jd', 'Qc', 'Ks', 'Ah'], ['Ad', '6c', '7d', '8h', '9c']], 1),
  ('pair vs pair kicker', [['Kh', 'Kd', 'Qc', '7s', '6h'], ['Ks', 'Kc', 'Jc', 'Ts', '9h']], 1),
  ('tie straights', [['6h', '7d', '8c', '9s', 'Th'], ['6c', '7h', '8d', '9h', 'Tc']], 0),
  ('quads beat flush', [['9h', '9d', '9c', '9s', '6h'], ['6d', '8d', 'Td', 'Jd', 'Ad']], 1),
  ('trips vs two pair', [['7h', '7d', '7c', 'As', 'Kh'], ['Ah', 'Ad', 'Kc', 'Ks', 'Qh']], 1)],
 [('flush beats full house', [['6h', '9h', 'Jh', 'Qh', 'Ah'], ['Kh', 'Kd', 'Kc', '7s', '7h']], 1),
  ('full house loses to flush', [['Ks', 'Kd', 'Kc', '7s', '7c'], ['6d', '8d', 'Td', 'Jd', 'Qd']],
   -1),
  ('short wheel is a straight', [['Ah', '6d', '7c', '8s', '9h'], ['Qh', 'Qd', 'Qc', '7s', '6h']],
   1),
  ('short wheel vs six-ten', [['Ah', '6d', '7c', '8s', '9h'], ['6h', '7d', '8c', '9s', 'Th']], -1),
  ('jack-nine gap not a straight', [['Jh', '6d', '7c', '8s', '9h'], ['Ah', 'Ad', '7s', '8h', 'Tc']],
   -1),
  ('low card in hand b', [['Ah', 'Kd', 'Qc', 'Js', '9h'], ['5h', '6d', '7c', '8s', '9s']],
   'invalid'),
  ('quads beat flush', [['9h', '9d', '9c', '9s', '6h'], ['6d', '8d', 'Td', 'Jd', 'Ad']], 1),
  ('trips vs two pair', [['7h', '7d', '7c', 'As', 'Kh'], ['Ah', 'Ad', 'Kc', 'Ks', 'Qh']], 1)],
 [('flush beats full house', [['6h', '9h', 'Jh', 'Qh', 'Ah'], ['Kh', 'Kd', 'Kc', '7s', '7h']], 1),
  ('full house loses to flush', [['Ks', 'Kd', 'Kc', '7s', '7c'], ['6d', '8d', 'Td', 'Jd', 'Qd']],
   -1),
  ('short wheel is a straight', [['Ah', '6d', '7c', '8s', '9h'], ['Qh', 'Qd', 'Qc', '7s', '6h']],
   1),
  ('short wheel vs six-ten', [['Ah', '6d', '7c', '8s', '9h'], ['6h', '7d', '8c', '9s', 'Th']], -1),
  ('jack-nine gap not a straight', [['Jh', '6d', '7c', '8s', '9h'], ['Ah', 'Ad', '7s', '8h', 'Tc']],
   -1),
  ('low card in hand b', [['Ah', 'Kd', 'Qc', 'Js', '9h'], ['5h', '6d', '7c', '8s', '9s']],
   'invalid'),
  ('low card in hand a', [['2h', 'Kd', 'Qc', 'Js', '9h'], ['Th', '6d', '7c', '8s', '9s']],
   'invalid'),
  ('broadway vs short wheel', [['Th', 'Jd', 'Qc', 'Ks', 'Ah'], ['Ad', '6c', '7d', '8h', '9c']], 1)]]
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
flush beats full house11Passed
full house loses to flush-1-1Passed
short wheel is a straight-11Failed
short wheel vs six-ten-1-1Passed
jack-nine gap not a straight-1-1Passed
low card in hand binvalidinvalidPassed
low card in hand ainvalidinvalidPassed
broadway vs short wheel11Passed

SHA-256 / fb47f2c2e954b0d3fa56d3003d068b0cfd176b5819cd007963acf51dc92dcfc0

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import collections
N = 1
observations = []
def solve(x):
    R='6789TJQKA'
    for c in x[0]+x[1]:
        if c[0] not in R: return 'invalid'
    def key(h):
        vals=sorted((R.index(c[0])+6 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
        low=vals==[14,9,8,7,6]
        straight=len(cnt)==5 and (vals[0]-vals[4]==4 or low)
        if straight: order=[9 if low else vals[0]]
        if straight and flush: return (8,order)
        if shape==[4,1]: return (7,order)
        if flush: return (6,vals)
        if shape==[3,2]: return (5,order)
        if straight: return (4,order)
        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)
    a,b=key(x[0]),key(x[1])
    return (a>b)-(a<b)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('flush beats full house', [['6h', '9h', 'Jh', 'Qh', 'Ah'], ['Kh', 'Kd', 'Kc', '7s', '7h']], 1),
  ('full house loses to flush', [['Ks', 'Kd', 'Kc', '7s', '7c'], ['6d', '8d', 'Td', 'Jd', 'Qd']],
   -1),
  ('short wheel is a straight', [['Ah', '6d', '7c', '8s', '9h'], ['Qh', 'Qd', 'Qc', '7s', '6h']],
   1),
  ('short wheel vs six-ten', [['Ah', '6d', '7c', '8s', '9h'], ['6h', '7d', '8c', '9s', 'Th']], -1),
  ('jack-nine gap not a straight', [['Jh', '6d', '7c', '8s', '9h'], ['Ah', 'Ad', '7s', '8h', 'Tc']],
   -1),
  ('low card in hand b', [['Ah', 'Kd', 'Qc', 'Js', '9h'], ['5h', '6d', '7c', '8s', '9s']],
   'invalid'),
  ('low card in hand a', [['2h', 'Kd', 'Qc', 'Js', '9h'], ['Th', '6d', '7c', '8s', '9s']],
   'invalid'),
  ('broadway vs short wheel', [['Th', 'Jd', 'Qc', 'Ks', 'Ah'], ['Ad', '6c', '7d', '8h', '9c']], 1)],
 [('short wheel is a straight', [['Ah', '6d', '7c', '8s', '9h'], ['Qh', 'Qd', 'Qc', '7s', '6h']],
   1),
  ('jack-nine gap not a straight', [['Jh', '6d', '7c', '8s', '9h'], ['Ah', 'Ad', '7s', '8h', 'Tc']],
   -1),
  ('low card in hand b', [['Ah', 'Kd', 'Qc', 'Js', '9h'], ['5h', '6d', '7c', '8s', '9s']],
   'invalid'),
  ('low card in hand a', [['2h', 'Kd', 'Qc', 'Js', '9h'], ['Th', '6d', '7c', '8s', '9s']],
   'invalid'),
  ('broadway vs short wheel', [['Th', 'Jd', 'Qc', 'Ks', 'Ah'], ['Ad', '6c', '7d', '8h', '9c']], 1),
  ('pair vs pair kicker', [['Kh', 'Kd', 'Qc', '7s', '6h'], ['Ks', 'Kc', 'Jc', 'Ts', '9h']], 1),
  ('tie straights', [['6h', '7d', '8c', '9s', 'Th'], ['6c', '7h', '8d', '9h', 'Tc']], 0),
  ('quads beat flush', [['9h', '9d', '9c', '9s', '6h'], ['6d', '8d', 'Td', 'Jd', 'Ad']], 1)],
 [('flush beats full house', [['6h', '9h', 'Jh', 'Qh', 'Ah'], ['Kh', 'Kd', 'Kc', '7s', '7h']], 1),
  ('full house loses to flush', [['Ks', 'Kd', 'Kc', '7s', '7c'], ['6d', '8d', 'Td', 'Jd', 'Qd']],
   -1),
  ('short wheel is a straight', [['Ah', '6d', '7c', '8s', '9h'], ['Qh', 'Qd', 'Qc', '7s', '6h']],
   1),
  ('broadway vs short wheel', [['Th', 'Jd', 'Qc', 'Ks', 'Ah'], ['Ad', '6c', '7d', '8h', '9c']], 1),
  ('pair vs pair kicker', [['Kh', 'Kd', 'Qc', '7s', '6h'], ['Ks', 'Kc', 'Jc', 'Ts', '9h']], 1),
  ('tie straights', [['6h', '7d', '8c', '9s', 'Th'], ['6c', '7h', '8d', '9h', 'Tc']], 0),
  ('quads beat flush', [['9h', '9d', '9c', '9s', '6h'], ['6d', '8d', 'Td', 'Jd', 'Ad']], 1),
  ('trips vs two pair', [['7h', '7d', '7c', 'As', 'Kh'], ['Ah', 'Ad', 'Kc', 'Ks', 'Qh']], 1)],
 [('flush beats full house', [['6h', '9h', 'Jh', 'Qh', 'Ah'], ['Kh', 'Kd', 'Kc', '7s', '7h']], 1),
  ('full house loses to flush', [['Ks', 'Kd', 'Kc', '7s', '7c'], ['6d', '8d', 'Td', 'Jd', 'Qd']],
   -1),
  ('short wheel is a straight', [['Ah', '6d', '7c', '8s', '9h'], ['Qh', 'Qd', 'Qc', '7s', '6h']],
   1),
  ('short wheel vs six-ten', [['Ah', '6d', '7c', '8s', '9h'], ['6h', '7d', '8c', '9s', 'Th']], -1),
  ('jack-nine gap not a straight', [['Jh', '6d', '7c', '8s', '9h'], ['Ah', 'Ad', '7s', '8h', 'Tc']],
   -1),
  ('low card in hand b', [['Ah', 'Kd', 'Qc', 'Js', '9h'], ['5h', '6d', '7c', '8s', '9s']],
   'invalid'),
  ('quads beat flush', [['9h', '9d', '9c', '9s', '6h'], ['6d', '8d', 'Td', 'Jd', 'Ad']], 1),
  ('trips vs two pair', [['7h', '7d', '7c', 'As', 'Kh'], ['Ah', 'Ad', 'Kc', 'Ks', 'Qh']], 1)],
 [('flush beats full house', [['6h', '9h', 'Jh', 'Qh', 'Ah'], ['Kh', 'Kd', 'Kc', '7s', '7h']], 1),
  ('full house loses to flush', [['Ks', 'Kd', 'Kc', '7s', '7c'], ['6d', '8d', 'Td', 'Jd', 'Qd']],
   -1),
  ('short wheel is a straight', [['Ah', '6d', '7c', '8s', '9h'], ['Qh', 'Qd', 'Qc', '7s', '6h']],
   1),
  ('short wheel vs six-ten', [['Ah', '6d', '7c', '8s', '9h'], ['6h', '7d', '8c', '9s', 'Th']], -1),
  ('jack-nine gap not a straight', [['Jh', '6d', '7c', '8s', '9h'], ['Ah', 'Ad', '7s', '8h', 'Tc']],
   -1),
  ('low card in hand b', [['Ah', 'Kd', 'Qc', 'Js', '9h'], ['5h', '6d', '7c', '8s', '9s']],
   'invalid'),
  ('low card in hand a', [['2h', 'Kd', 'Qc', 'Js', '9h'], ['Th', '6d', '7c', '8s', '9s']],
   'invalid'),
  ('broadway vs short wheel', [['Th', 'Jd', 'Qc', 'Ks', 'Ah'], ['Ad', '6c', '7d', '8h', '9c']], 1)]]
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
flush beats full house11Passed
full house loses to flush-1-1Passed
short wheel is a straight11Passed
short wheel vs six-ten-1-1Passed
jack-nine gap not a straight-1-1Passed
low card in hand binvalidinvalidPassed
low card in hand ainvalidinvalidPassed
broadway vs short wheel11Passed

SHA-256 / 5fcda26353dd8c6606bfd00345f0e4925def9c318c39e9078f13a435de47bcbb

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

Case digest / 9483b5cb53f843a99a3a093440de8a437fa1cd6308e56154b706d4c445441dd6