FAILURE MAP
← Case archive

FA-81901 / Poker hand evaluation / Open access

A paired hand spanning four ranks becomes a straight · case 01

5-5-6-7-9 is scored as a straight and beats ace high.

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

ROOT CAUSE

The straight test accepts four distinct ranks, so a pair inside a four-rank span passes the max-min test.

VERIFIED REPAIR

A straight requires five distinct ranks before the span test.

Unsuccessful approach: Checking the card count instead of the distinct rank count is always true for five cards.

Case contract

Input: [hand_a, hand_b], each five distinct cards "Rs" (ranks 23456789TJQKA, suits cdhs). Return 1 if hand_a wins, -1 if hand_b wins, 0 for a split. Categories rank in the standard order; within a category compare rank groups by (group size, rank) descending; a wheel straight is five-high; suits never break ties.

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
N = 1
observations = []
def solve(x):
    R='23456789TJQKA'
    def key(h):
        vals=[R.index(c[0])+2 for c in h]
        cnt=collections.Counter(vals)
        groups=sorted(cnt.items(), key=lambda kv:(kv[1],kv[0]), reverse=True)
        ranks=[v for v,n in groups]
        shape=[n for v,n in groups]
        flush=len({c[1] for c in h})==1
        straight=len(cnt)>=4 and (max(vals)-min(vals)==4 or sorted(vals)==[2,3,4,5,14])
        if straight:
            ranks=[5] if sorted(vals)==[2,3,4,5,14] else [max(vals)]
        if straight and flush: cat=8
        elif shape==[4,1]: cat=7
        elif shape==[3,2]: cat=6
        elif flush: cat=5
        elif straight: cat=4
        elif shape==[3,1,1]: cat=3
        elif shape==[2,2,1]: cat=2
        elif shape==[2,1,1,1]: cat=1
        else: cat=0
        return (cat, ranks)
    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 = [[('wheel vs six-high straight', [['Ah', '2d', '3c', '4s', '5h'], ['2h', '3d', '4c', '5s', '6h']],
   -1),
  ('six-high vs wheel', [['2c', '3h', '4d', '5c', '6s'], ['As', '2c', '3d', '4h', '5d']], 1),
  ('pair of twos vs ace high kickers',
   [['2h', '2d', 'Kc', 'Qs', 'Jh'], ['3h', '3d', '4c', '5s', '7h']], -1),
  ('full house trips first', [['3h', '3d', '3c', 'As', 'Ah'], ['Kh', 'Kd', '2c', '2s', '2h']], 1),
  ('identical ranks different suits',
   [['Ah', 'Kd', '9c', '7s', '4h'], ['As', 'Kc', '9d', '7h', '4d']], 0),
  ('split straights', [['9h', 'Td', 'Jc', 'Qs', 'Kh'], ['9s', 'Tc', 'Jd', 'Qh', 'Kd']], 0),
  ('flush beats straight', [['2h', '7h', '9h', 'Jh', 'Kh'], ['9s', 'Tc', 'Jd', 'Qh', 'Kd']], 1),
  ('paired span vs two pair', [['5h', '5d', '6c', '7s', '9h'], ['3h', '3d', '2c', '2s', 'Kh']],
   -1)],
 [('full house trips first', [['3h', '3d', '3c', 'As', 'Ah'], ['Kh', 'Kd', '2c', '2s', '2h']], 1),
  ('identical ranks different suits',
   [['Ah', 'Kd', '9c', '7s', '4h'], ['As', 'Kc', '9d', '7h', '4d']], 0),
  ('split straights', [['9h', 'Td', 'Jc', 'Qs', 'Kh'], ['9s', 'Tc', 'Jd', 'Qh', 'Kd']], 0),
  ('flush beats straight', [['2h', '7h', '9h', 'Jh', 'Kh'], ['9s', 'Tc', 'Jd', 'Qh', 'Kd']], 1),
  ('straight loses to flush', [['9s', 'Tc', 'Jd', 'Qh', 'Kd'], ['2c', '5c', '8c', 'Tc', 'Qc']], -1),
  ('paired five-card span', [['5h', '5d', '6c', '7s', '9h'], ['Ah', 'Kd', 'Qc', '8s', '4h']], 1),
  ('paired span vs two pair', [['5h', '5d', '6c', '7s', '9h'], ['3h', '3d', '2c', '2s', 'Kh']], -1),
  ('two pair vs paired span', [['Jh', 'Jd', '2c', '2s', 'Kh'], ['8h', '8d', '6c', '7s', '9h']], 1)],
 [('flush beats straight', [['2h', '7h', '9h', 'Jh', 'Kh'], ['9s', 'Tc', 'Jd', 'Qh', 'Kd']], 1),
  ('straight loses to flush', [['9s', 'Tc', 'Jd', 'Qh', 'Kd'], ['2c', '5c', '8c', 'Tc', 'Qc']], -1),
  ('paired five-card span', [['5h', '5d', '6c', '7s', '9h'], ['Ah', 'Kd', 'Qc', '8s', '4h']], 1),
  ('paired span vs two pair', [['5h', '5d', '6c', '7s', '9h'], ['3h', '3d', '2c', '2s', 'Kh']], -1),
  ('two pair vs paired span', [['Jh', 'Jd', '2c', '2s', 'Kh'], ['8h', '8d', '6c', '7s', '9h']], 1),
  ('two pair high pair first', [['Kh', 'Kd', '3c', '3s', '9h'], ['Qh', 'Qd', 'Jc', 'Js', '2h']], 1),
  ('kicker decides pair', [['Qh', 'Qd', 'Ac', '4s', '2h'], ['Qs', 'Qc', 'Kc', '9s', '8h']], 1),
  ('trips vs two pair', [['7h', '7d', '7c', '2s', '3h'], ['Ah', 'Ad', 'Kc', 'Ks', '2h']], 1)],
 [('paired span vs two pair', [['5h', '5d', '6c', '7s', '9h'], ['3h', '3d', '2c', '2s', 'Kh']], -1),
  ('two pair vs paired span', [['Jh', 'Jd', '2c', '2s', 'Kh'], ['8h', '8d', '6c', '7s', '9h']], 1),
  ('two pair high pair first', [['Kh', 'Kd', '3c', '3s', '9h'], ['Qh', 'Qd', 'Jc', 'Js', '2h']], 1),
  ('kicker decides pair', [['Qh', 'Qd', 'Ac', '4s', '2h'], ['Qs', 'Qc', 'Kc', '9s', '8h']], 1),
  ('trips vs two pair', [['7h', '7d', '7c', '2s', '3h'], ['Ah', 'Ad', 'Kc', 'Ks', '2h']], 1),
  ('quads vs full house', [['4h', '4d', '4c', '4s', '2h'], ['Ah', 'Ad', 'Ac', 'Ks', 'Kh']], 1),
  ('high card ace vs king', [['Ah', '9d', '7c', '4s', '2h'], ['Kh', 'Qd', 'Jc', '9s', '7h']], 1),
  ('broadway vs wheel', [['Th', 'Jd', 'Qc', 'Ks', 'Ah'], ['As', '2c', '3d', '4h', '5d']], 1)],
 [('wheel vs six-high straight', [['Ah', '2d', '3c', '4s', '5h'], ['2h', '3d', '4c', '5s', '6h']],
   -1),
  ('six-high vs wheel', [['2c', '3h', '4d', '5c', '6s'], ['As', '2c', '3d', '4h', '5d']], 1),
  ('pair of twos vs ace high kickers',
   [['2h', '2d', 'Kc', 'Qs', 'Jh'], ['3h', '3d', '4c', '5s', '7h']], -1),
  ('paired span vs two pair', [['5h', '5d', '6c', '7s', '9h'], ['3h', '3d', '2c', '2s', 'Kh']], -1),
  ('trips vs two pair', [['7h', '7d', '7c', '2s', '3h'], ['Ah', 'Ad', 'Kc', 'Ks', '2h']], 1),
  ('quads vs full house', [['4h', '4d', '4c', '4s', '2h'], ['Ah', 'Ad', 'Ac', 'Ks', 'Kh']], 1),
  ('high card ace vs king', [['Ah', '9d', '7c', '4s', '2h'], ['Kh', 'Qd', 'Jc', '9s', '7h']], 1),
  ('broadway vs wheel', [['Th', 'Jd', 'Qc', 'Ks', 'Ah'], ['As', '2c', '3d', '4h', '5d']], 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
wheel vs six-high straight-1-1Passed
six-high vs wheel11Passed
pair of twos vs ace high kickers-1-1Passed
full house trips first11Passed
identical ranks different suits00Passed
split straights00Passed
flush beats straight11Passed
paired span vs two pair1-1Failed

SHA-256 / 57d4b3eae324c8eeea9f1e5d133cd7cf0b88eb2b9c6182dc04b572193ea82622

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='23456789TJQKA'
    def key(h):
        vals=[R.index(c[0])+2 for c in h]
        cnt=collections.Counter(vals)
        groups=sorted(cnt.items(), key=lambda kv:(kv[1],kv[0]), reverse=True)
        ranks=[v for v,n in groups]
        shape=[n for v,n in groups]
        flush=len({c[1] for c in h})==1
        straight=len(vals)==5 and (max(vals)-min(vals)==4 or sorted(vals)==[2,3,4,5,14])
        if straight:
            ranks=[5] if sorted(vals)==[2,3,4,5,14] else [max(vals)]
        if straight and flush: cat=8
        elif shape==[4,1]: cat=7
        elif shape==[3,2]: cat=6
        elif flush: cat=5
        elif straight: cat=4
        elif shape==[3,1,1]: cat=3
        elif shape==[2,2,1]: cat=2
        elif shape==[2,1,1,1]: cat=1
        else: cat=0
        return (cat, ranks)
    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 = [[('wheel vs six-high straight', [['Ah', '2d', '3c', '4s', '5h'], ['2h', '3d', '4c', '5s', '6h']],
   -1),
  ('six-high vs wheel', [['2c', '3h', '4d', '5c', '6s'], ['As', '2c', '3d', '4h', '5d']], 1),
  ('pair of twos vs ace high kickers',
   [['2h', '2d', 'Kc', 'Qs', 'Jh'], ['3h', '3d', '4c', '5s', '7h']], -1),
  ('full house trips first', [['3h', '3d', '3c', 'As', 'Ah'], ['Kh', 'Kd', '2c', '2s', '2h']], 1),
  ('identical ranks different suits',
   [['Ah', 'Kd', '9c', '7s', '4h'], ['As', 'Kc', '9d', '7h', '4d']], 0),
  ('split straights', [['9h', 'Td', 'Jc', 'Qs', 'Kh'], ['9s', 'Tc', 'Jd', 'Qh', 'Kd']], 0),
  ('flush beats straight', [['2h', '7h', '9h', 'Jh', 'Kh'], ['9s', 'Tc', 'Jd', 'Qh', 'Kd']], 1),
  ('paired span vs two pair', [['5h', '5d', '6c', '7s', '9h'], ['3h', '3d', '2c', '2s', 'Kh']],
   -1)],
 [('full house trips first', [['3h', '3d', '3c', 'As', 'Ah'], ['Kh', 'Kd', '2c', '2s', '2h']], 1),
  ('identical ranks different suits',
   [['Ah', 'Kd', '9c', '7s', '4h'], ['As', 'Kc', '9d', '7h', '4d']], 0),
  ('split straights', [['9h', 'Td', 'Jc', 'Qs', 'Kh'], ['9s', 'Tc', 'Jd', 'Qh', 'Kd']], 0),
  ('flush beats straight', [['2h', '7h', '9h', 'Jh', 'Kh'], ['9s', 'Tc', 'Jd', 'Qh', 'Kd']], 1),
  ('straight loses to flush', [['9s', 'Tc', 'Jd', 'Qh', 'Kd'], ['2c', '5c', '8c', 'Tc', 'Qc']], -1),
  ('paired five-card span', [['5h', '5d', '6c', '7s', '9h'], ['Ah', 'Kd', 'Qc', '8s', '4h']], 1),
  ('paired span vs two pair', [['5h', '5d', '6c', '7s', '9h'], ['3h', '3d', '2c', '2s', 'Kh']], -1),
  ('two pair vs paired span', [['Jh', 'Jd', '2c', '2s', 'Kh'], ['8h', '8d', '6c', '7s', '9h']], 1)],
 [('flush beats straight', [['2h', '7h', '9h', 'Jh', 'Kh'], ['9s', 'Tc', 'Jd', 'Qh', 'Kd']], 1),
  ('straight loses to flush', [['9s', 'Tc', 'Jd', 'Qh', 'Kd'], ['2c', '5c', '8c', 'Tc', 'Qc']], -1),
  ('paired five-card span', [['5h', '5d', '6c', '7s', '9h'], ['Ah', 'Kd', 'Qc', '8s', '4h']], 1),
  ('paired span vs two pair', [['5h', '5d', '6c', '7s', '9h'], ['3h', '3d', '2c', '2s', 'Kh']], -1),
  ('two pair vs paired span', [['Jh', 'Jd', '2c', '2s', 'Kh'], ['8h', '8d', '6c', '7s', '9h']], 1),
  ('two pair high pair first', [['Kh', 'Kd', '3c', '3s', '9h'], ['Qh', 'Qd', 'Jc', 'Js', '2h']], 1),
  ('kicker decides pair', [['Qh', 'Qd', 'Ac', '4s', '2h'], ['Qs', 'Qc', 'Kc', '9s', '8h']], 1),
  ('trips vs two pair', [['7h', '7d', '7c', '2s', '3h'], ['Ah', 'Ad', 'Kc', 'Ks', '2h']], 1)],
 [('paired span vs two pair', [['5h', '5d', '6c', '7s', '9h'], ['3h', '3d', '2c', '2s', 'Kh']], -1),
  ('two pair vs paired span', [['Jh', 'Jd', '2c', '2s', 'Kh'], ['8h', '8d', '6c', '7s', '9h']], 1),
  ('two pair high pair first', [['Kh', 'Kd', '3c', '3s', '9h'], ['Qh', 'Qd', 'Jc', 'Js', '2h']], 1),
  ('kicker decides pair', [['Qh', 'Qd', 'Ac', '4s', '2h'], ['Qs', 'Qc', 'Kc', '9s', '8h']], 1),
  ('trips vs two pair', [['7h', '7d', '7c', '2s', '3h'], ['Ah', 'Ad', 'Kc', 'Ks', '2h']], 1),
  ('quads vs full house', [['4h', '4d', '4c', '4s', '2h'], ['Ah', 'Ad', 'Ac', 'Ks', 'Kh']], 1),
  ('high card ace vs king', [['Ah', '9d', '7c', '4s', '2h'], ['Kh', 'Qd', 'Jc', '9s', '7h']], 1),
  ('broadway vs wheel', [['Th', 'Jd', 'Qc', 'Ks', 'Ah'], ['As', '2c', '3d', '4h', '5d']], 1)],
 [('wheel vs six-high straight', [['Ah', '2d', '3c', '4s', '5h'], ['2h', '3d', '4c', '5s', '6h']],
   -1),
  ('six-high vs wheel', [['2c', '3h', '4d', '5c', '6s'], ['As', '2c', '3d', '4h', '5d']], 1),
  ('pair of twos vs ace high kickers',
   [['2h', '2d', 'Kc', 'Qs', 'Jh'], ['3h', '3d', '4c', '5s', '7h']], -1),
  ('paired span vs two pair', [['5h', '5d', '6c', '7s', '9h'], ['3h', '3d', '2c', '2s', 'Kh']], -1),
  ('trips vs two pair', [['7h', '7d', '7c', '2s', '3h'], ['Ah', 'Ad', 'Kc', 'Ks', '2h']], 1),
  ('quads vs full house', [['4h', '4d', '4c', '4s', '2h'], ['Ah', 'Ad', 'Ac', 'Ks', 'Kh']], 1),
  ('high card ace vs king', [['Ah', '9d', '7c', '4s', '2h'], ['Kh', 'Qd', 'Jc', '9s', '7h']], 1),
  ('broadway vs wheel', [['Th', 'Jd', 'Qc', 'Ks', 'Ah'], ['As', '2c', '3d', '4h', '5d']], 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
wheel vs six-high straight-1-1Passed
six-high vs wheel11Passed
pair of twos vs ace high kickers-1-1Passed
full house trips first11Passed
identical ranks different suits00Passed
split straights00Passed
flush beats straight11Passed
paired span vs two pair1-1Failed

SHA-256 / e304196821b8e3b043590c54f0d50ce170fd4bbe4fd7b86e8e6c7d8c34ff6ff8

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='23456789TJQKA'
    def key(h):
        vals=[R.index(c[0])+2 for c in h]
        cnt=collections.Counter(vals)
        groups=sorted(cnt.items(), key=lambda kv:(kv[1],kv[0]), reverse=True)
        ranks=[v for v,n in groups]
        shape=[n for v,n in groups]
        flush=len({c[1] for c in h})==1
        straight=len(cnt)==5 and (max(vals)-min(vals)==4 or sorted(vals)==[2,3,4,5,14])
        if straight:
            ranks=[5] if sorted(vals)==[2,3,4,5,14] else [max(vals)]
        if straight and flush: cat=8
        elif shape==[4,1]: cat=7
        elif shape==[3,2]: cat=6
        elif flush: cat=5
        elif straight: cat=4
        elif shape==[3,1,1]: cat=3
        elif shape==[2,2,1]: cat=2
        elif shape==[2,1,1,1]: cat=1
        else: cat=0
        return (cat, ranks)
    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 = [[('wheel vs six-high straight', [['Ah', '2d', '3c', '4s', '5h'], ['2h', '3d', '4c', '5s', '6h']],
   -1),
  ('six-high vs wheel', [['2c', '3h', '4d', '5c', '6s'], ['As', '2c', '3d', '4h', '5d']], 1),
  ('pair of twos vs ace high kickers',
   [['2h', '2d', 'Kc', 'Qs', 'Jh'], ['3h', '3d', '4c', '5s', '7h']], -1),
  ('full house trips first', [['3h', '3d', '3c', 'As', 'Ah'], ['Kh', 'Kd', '2c', '2s', '2h']], 1),
  ('identical ranks different suits',
   [['Ah', 'Kd', '9c', '7s', '4h'], ['As', 'Kc', '9d', '7h', '4d']], 0),
  ('split straights', [['9h', 'Td', 'Jc', 'Qs', 'Kh'], ['9s', 'Tc', 'Jd', 'Qh', 'Kd']], 0),
  ('flush beats straight', [['2h', '7h', '9h', 'Jh', 'Kh'], ['9s', 'Tc', 'Jd', 'Qh', 'Kd']], 1),
  ('paired span vs two pair', [['5h', '5d', '6c', '7s', '9h'], ['3h', '3d', '2c', '2s', 'Kh']],
   -1)],
 [('full house trips first', [['3h', '3d', '3c', 'As', 'Ah'], ['Kh', 'Kd', '2c', '2s', '2h']], 1),
  ('identical ranks different suits',
   [['Ah', 'Kd', '9c', '7s', '4h'], ['As', 'Kc', '9d', '7h', '4d']], 0),
  ('split straights', [['9h', 'Td', 'Jc', 'Qs', 'Kh'], ['9s', 'Tc', 'Jd', 'Qh', 'Kd']], 0),
  ('flush beats straight', [['2h', '7h', '9h', 'Jh', 'Kh'], ['9s', 'Tc', 'Jd', 'Qh', 'Kd']], 1),
  ('straight loses to flush', [['9s', 'Tc', 'Jd', 'Qh', 'Kd'], ['2c', '5c', '8c', 'Tc', 'Qc']], -1),
  ('paired five-card span', [['5h', '5d', '6c', '7s', '9h'], ['Ah', 'Kd', 'Qc', '8s', '4h']], 1),
  ('paired span vs two pair', [['5h', '5d', '6c', '7s', '9h'], ['3h', '3d', '2c', '2s', 'Kh']], -1),
  ('two pair vs paired span', [['Jh', 'Jd', '2c', '2s', 'Kh'], ['8h', '8d', '6c', '7s', '9h']], 1)],
 [('flush beats straight', [['2h', '7h', '9h', 'Jh', 'Kh'], ['9s', 'Tc', 'Jd', 'Qh', 'Kd']], 1),
  ('straight loses to flush', [['9s', 'Tc', 'Jd', 'Qh', 'Kd'], ['2c', '5c', '8c', 'Tc', 'Qc']], -1),
  ('paired five-card span', [['5h', '5d', '6c', '7s', '9h'], ['Ah', 'Kd', 'Qc', '8s', '4h']], 1),
  ('paired span vs two pair', [['5h', '5d', '6c', '7s', '9h'], ['3h', '3d', '2c', '2s', 'Kh']], -1),
  ('two pair vs paired span', [['Jh', 'Jd', '2c', '2s', 'Kh'], ['8h', '8d', '6c', '7s', '9h']], 1),
  ('two pair high pair first', [['Kh', 'Kd', '3c', '3s', '9h'], ['Qh', 'Qd', 'Jc', 'Js', '2h']], 1),
  ('kicker decides pair', [['Qh', 'Qd', 'Ac', '4s', '2h'], ['Qs', 'Qc', 'Kc', '9s', '8h']], 1),
  ('trips vs two pair', [['7h', '7d', '7c', '2s', '3h'], ['Ah', 'Ad', 'Kc', 'Ks', '2h']], 1)],
 [('paired span vs two pair', [['5h', '5d', '6c', '7s', '9h'], ['3h', '3d', '2c', '2s', 'Kh']], -1),
  ('two pair vs paired span', [['Jh', 'Jd', '2c', '2s', 'Kh'], ['8h', '8d', '6c', '7s', '9h']], 1),
  ('two pair high pair first', [['Kh', 'Kd', '3c', '3s', '9h'], ['Qh', 'Qd', 'Jc', 'Js', '2h']], 1),
  ('kicker decides pair', [['Qh', 'Qd', 'Ac', '4s', '2h'], ['Qs', 'Qc', 'Kc', '9s', '8h']], 1),
  ('trips vs two pair', [['7h', '7d', '7c', '2s', '3h'], ['Ah', 'Ad', 'Kc', 'Ks', '2h']], 1),
  ('quads vs full house', [['4h', '4d', '4c', '4s', '2h'], ['Ah', 'Ad', 'Ac', 'Ks', 'Kh']], 1),
  ('high card ace vs king', [['Ah', '9d', '7c', '4s', '2h'], ['Kh', 'Qd', 'Jc', '9s', '7h']], 1),
  ('broadway vs wheel', [['Th', 'Jd', 'Qc', 'Ks', 'Ah'], ['As', '2c', '3d', '4h', '5d']], 1)],
 [('wheel vs six-high straight', [['Ah', '2d', '3c', '4s', '5h'], ['2h', '3d', '4c', '5s', '6h']],
   -1),
  ('six-high vs wheel', [['2c', '3h', '4d', '5c', '6s'], ['As', '2c', '3d', '4h', '5d']], 1),
  ('pair of twos vs ace high kickers',
   [['2h', '2d', 'Kc', 'Qs', 'Jh'], ['3h', '3d', '4c', '5s', '7h']], -1),
  ('paired span vs two pair', [['5h', '5d', '6c', '7s', '9h'], ['3h', '3d', '2c', '2s', 'Kh']], -1),
  ('trips vs two pair', [['7h', '7d', '7c', '2s', '3h'], ['Ah', 'Ad', 'Kc', 'Ks', '2h']], 1),
  ('quads vs full house', [['4h', '4d', '4c', '4s', '2h'], ['Ah', 'Ad', 'Ac', 'Ks', 'Kh']], 1),
  ('high card ace vs king', [['Ah', '9d', '7c', '4s', '2h'], ['Kh', 'Qd', 'Jc', '9s', '7h']], 1),
  ('broadway vs wheel', [['Th', 'Jd', 'Qc', 'Ks', 'Ah'], ['As', '2c', '3d', '4h', '5d']], 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
wheel vs six-high straight-1-1Passed
six-high vs wheel11Passed
pair of twos vs ace high kickers-1-1Passed
full house trips first11Passed
identical ranks different suits00Passed
split straights00Passed
flush beats straight11Passed
paired span vs two pair-1-1Passed

SHA-256 / c9c91d62e5924342a7de716e1f7f442480799c29cb0934213686bf0431dce201

Verification & scope

A deterministic toy model with an explicitly stated contract; card strings are rank+suit (for example "As", "Td", "10h"); 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:07.156436+00:00.

Case digest / 8994568bae334a2c0b58d0caefb0150515a77aa9e1219ce61978a784dec09024