FA-82226 / Poker hand evaluation / Open access
A-6-7-8-9 ranked as the best straight · case 01
The short-deck wheel beats broadway and six-to-ten straights.
ROOT CAUSE
The straight tiebreak uses the ace as the top card of the low straight.
VERIFIED REPAIR
The A-6-7-8-9 straight is nine high.
Unsuccessful approach: Comparing all five values still leads with the ace.
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])+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=[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 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),
('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 vs six-ten', [['Ah', '6d', '7c', '8s', '9h'], ['6h', '7d', '8c', '9s', 'Th']], -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'),
('broadway vs short wheel', [['Th', 'Jd', 'Qc', 'Ks', 'Ah'], ['Ad', '6c', '7d', '8h', '9c']], 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| flush beats full house | 1 | 1 | Passed |
| full house loses to flush | -1 | -1 | Passed |
| short wheel is a straight | 1 | 1 | Passed |
| short wheel vs six-ten | 1 | -1 | Failed |
| jack-nine gap not a straight | -1 | -1 | Passed |
| low card in hand b | invalid | invalid | Passed |
| low card in hand a | invalid | invalid | Passed |
| broadway vs short wheel | 0 | 1 | Failed |
SHA-256 / 720cfa0c840186706e7aa1e355d8ca4424dafbd740493ead481b5e0d8e7cf091
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])+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=vals
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 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),
('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 vs six-ten', [['Ah', '6d', '7c', '8s', '9h'], ['6h', '7d', '8c', '9s', 'Th']], -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'),
('broadway vs short wheel', [['Th', 'Jd', 'Qc', 'Ks', 'Ah'], ['Ad', '6c', '7d', '8h', '9c']], 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| flush beats full house | 1 | 1 | Passed |
| full house loses to flush | -1 | -1 | Passed |
| short wheel is a straight | 1 | 1 | Passed |
| short wheel vs six-ten | 1 | -1 | Failed |
| jack-nine gap not a straight | -1 | -1 | Passed |
| low card in hand b | invalid | invalid | Passed |
| low card in hand a | invalid | invalid | Passed |
| broadway vs short wheel | 1 | 1 | Passed |
SHA-256 / aa48312f43ffcc2b63c03e291123cfa2e497634e027a1b3780e929574547e79b
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 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),
('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 vs six-ten', [['Ah', '6d', '7c', '8s', '9h'], ['6h', '7d', '8c', '9s', 'Th']], -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'),
('broadway vs short wheel', [['Th', 'Jd', 'Qc', 'Ks', 'Ah'], ['Ad', '6c', '7d', '8h', '9c']], 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| flush beats full house | 1 | 1 | Passed |
| full house loses to flush | -1 | -1 | Passed |
| short wheel is a straight | 1 | 1 | Passed |
| short wheel vs six-ten | -1 | -1 | Passed |
| jack-nine gap not a straight | -1 | -1 | Passed |
| low card in hand b | invalid | invalid | Passed |
| low card in hand a | invalid | invalid | Passed |
| broadway vs short wheel | 1 | 1 | Passed |
SHA-256 / 9aa06d131cfbd8f8fb4a90b745969fca20b24a158a35239f61e3c5082918d4a2
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.152581+00:00.
Case digest / 9a7b608a7027c1fba2dae2fe0935a6ed36c79aaaecf78ec336ce86bc07b20c38