FAILURE MAP
← Case archive

FA-81921 / Poker hand evaluation / Open access

Lows compared by total pips · case 01

8-4-3-2-A beats 7-6-5-4-3 because its card total is smaller.

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

ROOT CAUSE

The lows are compared by the sum of card values instead of lexicographically from the top card.

VERIFIED REPAIR

Compare the descending rank lists lexicographically; the lower list wins.

Unsuccessful approach: Comparing from the lowest card upward still ranks 7-6-5-2-A against 7-4-3-2-A incorrectly.

Case contract

Input: {"a": five cards, "b": five cards}. Ace-to-five low: aces count 1, straights and flushes are ignored, any paired rank disqualifies, the highest card must be 8 or lower to qualify. Compare qualifying lows from the highest card downward; lower wins. Return "a", "b", "tie", or "none" when neither qualifies.

Why this case matters

Hi-lo split games award half the pot from this low comparison.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    R='23456789TJQKA'
    def low(h):
        vals=sorted({1 if c[0]=='A' else R.index(c[0])+2 for c in h}, reverse=True)
        if len(vals)<5: return None
        if vals[0]>8: return None
        return vals
    la,lb=low(x['a']),low(x['b'])
    if la is None and lb is None: return 'none'
    if la is None: return 'b'
    if lb is None: return 'a'
    if la==lb: return 'tie'
    return 'a' if sum(la)<sum(lb) else 'b'
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('wheel is best low', {'a': ['Ah', '2d', '3c', '4s', '5h'], 'b': ['2h', '3d', '4c', '5s', '7h']},
   'a'),
  ('ace low vs eight low',
   {'a': ['Ah', '2d', '4c', '6s', '8h'], 'b': ['2h', '3d', '4d', '5s', '8c']}, 'b'),
  ('pair disqualifies', {'a': ['2h', '2d', '4c', '6s', '8h'], 'b': ['Kh', 'Qd', '4d', '5s', '8c']},
   'none'),
  ('eight low qualifies',
   {'a': ['8h', '6d', '4c', '3s', '2h'], 'b': ['9h', '5d', '4d', '3c', '2c']}, 'a'),
  ('nine low misses', {'a': ['9h', '5d', '4c', '3s', '2h'], 'b': ['Th', '5c', '4d', '3c', 'Ac']},
   'none'),
  ('compare from top card',
   {'a': ['7h', '6d', '5c', '2s', 'Ah'], 'b': ['7c', '4d', '3d', '2c', 'Ad']}, 'b'),
  ('sum trap', {'a': ['8h', '3d', '2c', '4s', 'Ah'], 'b': ['7c', '6d', '5d', '4c', '3c']}, 'b'),
  ('straight still counts as low',
   {'a': ['Ah', '2h', '3h', '4h', '5h'], 'b': ['6c', '4d', '3d', '2c', 'Ad']}, 'a')],
 [('nine low misses', {'a': ['9h', '5d', '4c', '3s', '2h'], 'b': ['Th', '5c', '4d', '3c', 'Ac']},
   'none'),
  ('compare from top card',
   {'a': ['7h', '6d', '5c', '2s', 'Ah'], 'b': ['7c', '4d', '3d', '2c', 'Ad']}, 'b'),
  ('sum trap', {'a': ['8h', '3d', '2c', '4s', 'Ah'], 'b': ['7c', '6d', '5d', '4c', '3c']}, 'b'),
  ('straight still counts as low',
   {'a': ['Ah', '2h', '3h', '4h', '5h'], 'b': ['6c', '4d', '3d', '2c', 'Ad']}, 'a'),
  ('six-high straight low',
   {'a': ['2h', '3d', '4c', '5s', '6h'], 'b': ['7c', '4d', '3d', '2c', 'Ad']}, 'a'),
  ('flush low', {'a': ['2c', '4c', '5c', '6c', '7c'], 'b': ['8d', '6h', '5d', '4s', '2d']}, 'a'),
  ('only b qualifies', {'a': ['Kh', 'Qd', 'Jc', 'Ts', '9h'], 'b': ['8d', '7h', '5d', '4s', '2d']},
   'b'),
  ('exact tie', {'a': ['8h', '6d', '4c', '3s', '2h'], 'b': ['8d', '6c', '4s', '3h', '2c']}, 'tie')],
 [('ace low vs eight low',
   {'a': ['Ah', '2d', '4c', '6s', '8h'], 'b': ['2h', '3d', '4d', '5s', '8c']}, 'b'),
  ('six-high straight low',
   {'a': ['2h', '3d', '4c', '5s', '6h'], 'b': ['7c', '4d', '3d', '2c', 'Ad']}, 'a'),
  ('flush low', {'a': ['2c', '4c', '5c', '6c', '7c'], 'b': ['8d', '6h', '5d', '4s', '2d']}, 'a'),
  ('only b qualifies', {'a': ['Kh', 'Qd', 'Jc', 'Ts', '9h'], 'b': ['8d', '7h', '5d', '4s', '2d']},
   'b'),
  ('exact tie', {'a': ['8h', '6d', '4c', '3s', '2h'], 'b': ['8d', '6c', '4s', '3h', '2c']}, 'tie'),
  ('trips disqualify', {'a': ['3h', '3d', '3c', '6s', '8h'], 'b': ['Kh', 'Qd', 'Jd', '9s', '8c']},
   'none'),
  ('lowest card trap', {'a': ['Kh', '5d', '4c', '3s', '2h'], 'b': ['Qh', 'Jd', 'Tc', '9s', '7c']},
   'none'),
  ('second card decides',
   {'a': ['8h', '5d', '4c', '3s', '2h'], 'b': ['8d', '6c', '3d', '2c', 'Ac']}, 'a')],
 [('wheel is best low', {'a': ['Ah', '2d', '3c', '4s', '5h'], 'b': ['2h', '3d', '4c', '5s', '7h']},
   'a'),
  ('ace low vs eight low',
   {'a': ['Ah', '2d', '4c', '6s', '8h'], 'b': ['2h', '3d', '4d', '5s', '8c']}, 'b'),
  ('pair disqualifies', {'a': ['2h', '2d', '4c', '6s', '8h'], 'b': ['Kh', 'Qd', '4d', '5s', '8c']},
   'none'),
  ('sum trap', {'a': ['8h', '3d', '2c', '4s', 'Ah'], 'b': ['7c', '6d', '5d', '4c', '3c']}, 'b'),
  ('six-high straight low',
   {'a': ['2h', '3d', '4c', '5s', '6h'], 'b': ['7c', '4d', '3d', '2c', 'Ad']}, 'a'),
  ('trips disqualify', {'a': ['3h', '3d', '3c', '6s', '8h'], 'b': ['Kh', 'Qd', 'Jd', '9s', '8c']},
   'none'),
  ('lowest card trap', {'a': ['Kh', '5d', '4c', '3s', '2h'], 'b': ['Qh', 'Jd', 'Tc', '9s', '7c']},
   'none'),
  ('second card decides',
   {'a': ['8h', '5d', '4c', '3s', '2h'], 'b': ['8d', '6c', '3d', '2c', 'Ac']}, 'a')],
 [('wheel is best low', {'a': ['Ah', '2d', '3c', '4s', '5h'], 'b': ['2h', '3d', '4c', '5s', '7h']},
   'a'),
  ('ace low vs eight low',
   {'a': ['Ah', '2d', '4c', '6s', '8h'], 'b': ['2h', '3d', '4d', '5s', '8c']}, 'b'),
  ('pair disqualifies', {'a': ['2h', '2d', '4c', '6s', '8h'], 'b': ['Kh', 'Qd', '4d', '5s', '8c']},
   'none'),
  ('eight low qualifies',
   {'a': ['8h', '6d', '4c', '3s', '2h'], 'b': ['9h', '5d', '4d', '3c', '2c']}, 'a'),
  ('nine low misses', {'a': ['9h', '5d', '4c', '3s', '2h'], 'b': ['Th', '5c', '4d', '3c', 'Ac']},
   'none'),
  ('sum trap', {'a': ['8h', '3d', '2c', '4s', 'Ah'], 'b': ['7c', '6d', '5d', '4c', '3c']}, 'b'),
  ('six-high straight low',
   {'a': ['2h', '3d', '4c', '5s', '6h'], 'b': ['7c', '4d', '3d', '2c', 'Ad']}, 'a'),
  ('second card decides',
   {'a': ['8h', '5d', '4c', '3s', '2h'], 'b': ['8d', '6c', '3d', '2c', 'Ac']}, 'a')]]
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 is best lowaaPassed
ace low vs eight lowabFailed
pair disqualifiesnonenonePassed
eight low qualifiesaaPassed
nine low missesnonenonePassed
compare from top cardbbPassed
sum trapabFailed
straight still counts as lowaaPassed

SHA-256 / e18ada2e58a6ae40a8c55fb283df5729fbc02ba9c2da269f10279a4fdc29c6b4

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    R='23456789TJQKA'
    def low(h):
        vals=sorted({1 if c[0]=='A' else R.index(c[0])+2 for c in h}, reverse=True)
        if len(vals)<5: return None
        if vals[0]>8: return None
        return vals
    la,lb=low(x['a']),low(x['b'])
    if la is None and lb is None: return 'none'
    if la is None: return 'b'
    if lb is None: return 'a'
    if la==lb: return 'tie'
    return 'a' if la[::-1]<lb[::-1] else 'b'
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('wheel is best low', {'a': ['Ah', '2d', '3c', '4s', '5h'], 'b': ['2h', '3d', '4c', '5s', '7h']},
   'a'),
  ('ace low vs eight low',
   {'a': ['Ah', '2d', '4c', '6s', '8h'], 'b': ['2h', '3d', '4d', '5s', '8c']}, 'b'),
  ('pair disqualifies', {'a': ['2h', '2d', '4c', '6s', '8h'], 'b': ['Kh', 'Qd', '4d', '5s', '8c']},
   'none'),
  ('eight low qualifies',
   {'a': ['8h', '6d', '4c', '3s', '2h'], 'b': ['9h', '5d', '4d', '3c', '2c']}, 'a'),
  ('nine low misses', {'a': ['9h', '5d', '4c', '3s', '2h'], 'b': ['Th', '5c', '4d', '3c', 'Ac']},
   'none'),
  ('compare from top card',
   {'a': ['7h', '6d', '5c', '2s', 'Ah'], 'b': ['7c', '4d', '3d', '2c', 'Ad']}, 'b'),
  ('sum trap', {'a': ['8h', '3d', '2c', '4s', 'Ah'], 'b': ['7c', '6d', '5d', '4c', '3c']}, 'b'),
  ('straight still counts as low',
   {'a': ['Ah', '2h', '3h', '4h', '5h'], 'b': ['6c', '4d', '3d', '2c', 'Ad']}, 'a')],
 [('nine low misses', {'a': ['9h', '5d', '4c', '3s', '2h'], 'b': ['Th', '5c', '4d', '3c', 'Ac']},
   'none'),
  ('compare from top card',
   {'a': ['7h', '6d', '5c', '2s', 'Ah'], 'b': ['7c', '4d', '3d', '2c', 'Ad']}, 'b'),
  ('sum trap', {'a': ['8h', '3d', '2c', '4s', 'Ah'], 'b': ['7c', '6d', '5d', '4c', '3c']}, 'b'),
  ('straight still counts as low',
   {'a': ['Ah', '2h', '3h', '4h', '5h'], 'b': ['6c', '4d', '3d', '2c', 'Ad']}, 'a'),
  ('six-high straight low',
   {'a': ['2h', '3d', '4c', '5s', '6h'], 'b': ['7c', '4d', '3d', '2c', 'Ad']}, 'a'),
  ('flush low', {'a': ['2c', '4c', '5c', '6c', '7c'], 'b': ['8d', '6h', '5d', '4s', '2d']}, 'a'),
  ('only b qualifies', {'a': ['Kh', 'Qd', 'Jc', 'Ts', '9h'], 'b': ['8d', '7h', '5d', '4s', '2d']},
   'b'),
  ('exact tie', {'a': ['8h', '6d', '4c', '3s', '2h'], 'b': ['8d', '6c', '4s', '3h', '2c']}, 'tie')],
 [('ace low vs eight low',
   {'a': ['Ah', '2d', '4c', '6s', '8h'], 'b': ['2h', '3d', '4d', '5s', '8c']}, 'b'),
  ('six-high straight low',
   {'a': ['2h', '3d', '4c', '5s', '6h'], 'b': ['7c', '4d', '3d', '2c', 'Ad']}, 'a'),
  ('flush low', {'a': ['2c', '4c', '5c', '6c', '7c'], 'b': ['8d', '6h', '5d', '4s', '2d']}, 'a'),
  ('only b qualifies', {'a': ['Kh', 'Qd', 'Jc', 'Ts', '9h'], 'b': ['8d', '7h', '5d', '4s', '2d']},
   'b'),
  ('exact tie', {'a': ['8h', '6d', '4c', '3s', '2h'], 'b': ['8d', '6c', '4s', '3h', '2c']}, 'tie'),
  ('trips disqualify', {'a': ['3h', '3d', '3c', '6s', '8h'], 'b': ['Kh', 'Qd', 'Jd', '9s', '8c']},
   'none'),
  ('lowest card trap', {'a': ['Kh', '5d', '4c', '3s', '2h'], 'b': ['Qh', 'Jd', 'Tc', '9s', '7c']},
   'none'),
  ('second card decides',
   {'a': ['8h', '5d', '4c', '3s', '2h'], 'b': ['8d', '6c', '3d', '2c', 'Ac']}, 'a')],
 [('wheel is best low', {'a': ['Ah', '2d', '3c', '4s', '5h'], 'b': ['2h', '3d', '4c', '5s', '7h']},
   'a'),
  ('ace low vs eight low',
   {'a': ['Ah', '2d', '4c', '6s', '8h'], 'b': ['2h', '3d', '4d', '5s', '8c']}, 'b'),
  ('pair disqualifies', {'a': ['2h', '2d', '4c', '6s', '8h'], 'b': ['Kh', 'Qd', '4d', '5s', '8c']},
   'none'),
  ('sum trap', {'a': ['8h', '3d', '2c', '4s', 'Ah'], 'b': ['7c', '6d', '5d', '4c', '3c']}, 'b'),
  ('six-high straight low',
   {'a': ['2h', '3d', '4c', '5s', '6h'], 'b': ['7c', '4d', '3d', '2c', 'Ad']}, 'a'),
  ('trips disqualify', {'a': ['3h', '3d', '3c', '6s', '8h'], 'b': ['Kh', 'Qd', 'Jd', '9s', '8c']},
   'none'),
  ('lowest card trap', {'a': ['Kh', '5d', '4c', '3s', '2h'], 'b': ['Qh', 'Jd', 'Tc', '9s', '7c']},
   'none'),
  ('second card decides',
   {'a': ['8h', '5d', '4c', '3s', '2h'], 'b': ['8d', '6c', '3d', '2c', 'Ac']}, 'a')],
 [('wheel is best low', {'a': ['Ah', '2d', '3c', '4s', '5h'], 'b': ['2h', '3d', '4c', '5s', '7h']},
   'a'),
  ('ace low vs eight low',
   {'a': ['Ah', '2d', '4c', '6s', '8h'], 'b': ['2h', '3d', '4d', '5s', '8c']}, 'b'),
  ('pair disqualifies', {'a': ['2h', '2d', '4c', '6s', '8h'], 'b': ['Kh', 'Qd', '4d', '5s', '8c']},
   'none'),
  ('eight low qualifies',
   {'a': ['8h', '6d', '4c', '3s', '2h'], 'b': ['9h', '5d', '4d', '3c', '2c']}, 'a'),
  ('nine low misses', {'a': ['9h', '5d', '4c', '3s', '2h'], 'b': ['Th', '5c', '4d', '3c', 'Ac']},
   'none'),
  ('sum trap', {'a': ['8h', '3d', '2c', '4s', 'Ah'], 'b': ['7c', '6d', '5d', '4c', '3c']}, 'b'),
  ('six-high straight low',
   {'a': ['2h', '3d', '4c', '5s', '6h'], 'b': ['7c', '4d', '3d', '2c', 'Ad']}, 'a'),
  ('second card decides',
   {'a': ['8h', '5d', '4c', '3s', '2h'], 'b': ['8d', '6c', '3d', '2c', 'Ac']}, 'a')]]
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 is best lowaaPassed
ace low vs eight lowabFailed
pair disqualifiesnonenonePassed
eight low qualifiesaaPassed
nine low missesnonenonePassed
compare from top cardbbPassed
sum trapabFailed
straight still counts as lowaaPassed

SHA-256 / e8bbbf4c34faec6de47b6d063b3339f2b2dda33f2b0c49eb03f75a13ea643505

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    R='23456789TJQKA'
    def low(h):
        vals=sorted({1 if c[0]=='A' else R.index(c[0])+2 for c in h}, reverse=True)
        if len(vals)<5: return None
        if vals[0]>8: return None
        return vals
    la,lb=low(x['a']),low(x['b'])
    if la is None and lb is None: return 'none'
    if la is None: return 'b'
    if lb is None: return 'a'
    if la==lb: return 'tie'
    return 'a' if la<lb else 'b'
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('wheel is best low', {'a': ['Ah', '2d', '3c', '4s', '5h'], 'b': ['2h', '3d', '4c', '5s', '7h']},
   'a'),
  ('ace low vs eight low',
   {'a': ['Ah', '2d', '4c', '6s', '8h'], 'b': ['2h', '3d', '4d', '5s', '8c']}, 'b'),
  ('pair disqualifies', {'a': ['2h', '2d', '4c', '6s', '8h'], 'b': ['Kh', 'Qd', '4d', '5s', '8c']},
   'none'),
  ('eight low qualifies',
   {'a': ['8h', '6d', '4c', '3s', '2h'], 'b': ['9h', '5d', '4d', '3c', '2c']}, 'a'),
  ('nine low misses', {'a': ['9h', '5d', '4c', '3s', '2h'], 'b': ['Th', '5c', '4d', '3c', 'Ac']},
   'none'),
  ('compare from top card',
   {'a': ['7h', '6d', '5c', '2s', 'Ah'], 'b': ['7c', '4d', '3d', '2c', 'Ad']}, 'b'),
  ('sum trap', {'a': ['8h', '3d', '2c', '4s', 'Ah'], 'b': ['7c', '6d', '5d', '4c', '3c']}, 'b'),
  ('straight still counts as low',
   {'a': ['Ah', '2h', '3h', '4h', '5h'], 'b': ['6c', '4d', '3d', '2c', 'Ad']}, 'a')],
 [('nine low misses', {'a': ['9h', '5d', '4c', '3s', '2h'], 'b': ['Th', '5c', '4d', '3c', 'Ac']},
   'none'),
  ('compare from top card',
   {'a': ['7h', '6d', '5c', '2s', 'Ah'], 'b': ['7c', '4d', '3d', '2c', 'Ad']}, 'b'),
  ('sum trap', {'a': ['8h', '3d', '2c', '4s', 'Ah'], 'b': ['7c', '6d', '5d', '4c', '3c']}, 'b'),
  ('straight still counts as low',
   {'a': ['Ah', '2h', '3h', '4h', '5h'], 'b': ['6c', '4d', '3d', '2c', 'Ad']}, 'a'),
  ('six-high straight low',
   {'a': ['2h', '3d', '4c', '5s', '6h'], 'b': ['7c', '4d', '3d', '2c', 'Ad']}, 'a'),
  ('flush low', {'a': ['2c', '4c', '5c', '6c', '7c'], 'b': ['8d', '6h', '5d', '4s', '2d']}, 'a'),
  ('only b qualifies', {'a': ['Kh', 'Qd', 'Jc', 'Ts', '9h'], 'b': ['8d', '7h', '5d', '4s', '2d']},
   'b'),
  ('exact tie', {'a': ['8h', '6d', '4c', '3s', '2h'], 'b': ['8d', '6c', '4s', '3h', '2c']}, 'tie')],
 [('ace low vs eight low',
   {'a': ['Ah', '2d', '4c', '6s', '8h'], 'b': ['2h', '3d', '4d', '5s', '8c']}, 'b'),
  ('six-high straight low',
   {'a': ['2h', '3d', '4c', '5s', '6h'], 'b': ['7c', '4d', '3d', '2c', 'Ad']}, 'a'),
  ('flush low', {'a': ['2c', '4c', '5c', '6c', '7c'], 'b': ['8d', '6h', '5d', '4s', '2d']}, 'a'),
  ('only b qualifies', {'a': ['Kh', 'Qd', 'Jc', 'Ts', '9h'], 'b': ['8d', '7h', '5d', '4s', '2d']},
   'b'),
  ('exact tie', {'a': ['8h', '6d', '4c', '3s', '2h'], 'b': ['8d', '6c', '4s', '3h', '2c']}, 'tie'),
  ('trips disqualify', {'a': ['3h', '3d', '3c', '6s', '8h'], 'b': ['Kh', 'Qd', 'Jd', '9s', '8c']},
   'none'),
  ('lowest card trap', {'a': ['Kh', '5d', '4c', '3s', '2h'], 'b': ['Qh', 'Jd', 'Tc', '9s', '7c']},
   'none'),
  ('second card decides',
   {'a': ['8h', '5d', '4c', '3s', '2h'], 'b': ['8d', '6c', '3d', '2c', 'Ac']}, 'a')],
 [('wheel is best low', {'a': ['Ah', '2d', '3c', '4s', '5h'], 'b': ['2h', '3d', '4c', '5s', '7h']},
   'a'),
  ('ace low vs eight low',
   {'a': ['Ah', '2d', '4c', '6s', '8h'], 'b': ['2h', '3d', '4d', '5s', '8c']}, 'b'),
  ('pair disqualifies', {'a': ['2h', '2d', '4c', '6s', '8h'], 'b': ['Kh', 'Qd', '4d', '5s', '8c']},
   'none'),
  ('sum trap', {'a': ['8h', '3d', '2c', '4s', 'Ah'], 'b': ['7c', '6d', '5d', '4c', '3c']}, 'b'),
  ('six-high straight low',
   {'a': ['2h', '3d', '4c', '5s', '6h'], 'b': ['7c', '4d', '3d', '2c', 'Ad']}, 'a'),
  ('trips disqualify', {'a': ['3h', '3d', '3c', '6s', '8h'], 'b': ['Kh', 'Qd', 'Jd', '9s', '8c']},
   'none'),
  ('lowest card trap', {'a': ['Kh', '5d', '4c', '3s', '2h'], 'b': ['Qh', 'Jd', 'Tc', '9s', '7c']},
   'none'),
  ('second card decides',
   {'a': ['8h', '5d', '4c', '3s', '2h'], 'b': ['8d', '6c', '3d', '2c', 'Ac']}, 'a')],
 [('wheel is best low', {'a': ['Ah', '2d', '3c', '4s', '5h'], 'b': ['2h', '3d', '4c', '5s', '7h']},
   'a'),
  ('ace low vs eight low',
   {'a': ['Ah', '2d', '4c', '6s', '8h'], 'b': ['2h', '3d', '4d', '5s', '8c']}, 'b'),
  ('pair disqualifies', {'a': ['2h', '2d', '4c', '6s', '8h'], 'b': ['Kh', 'Qd', '4d', '5s', '8c']},
   'none'),
  ('eight low qualifies',
   {'a': ['8h', '6d', '4c', '3s', '2h'], 'b': ['9h', '5d', '4d', '3c', '2c']}, 'a'),
  ('nine low misses', {'a': ['9h', '5d', '4c', '3s', '2h'], 'b': ['Th', '5c', '4d', '3c', 'Ac']},
   'none'),
  ('sum trap', {'a': ['8h', '3d', '2c', '4s', 'Ah'], 'b': ['7c', '6d', '5d', '4c', '3c']}, 'b'),
  ('six-high straight low',
   {'a': ['2h', '3d', '4c', '5s', '6h'], 'b': ['7c', '4d', '3d', '2c', 'Ad']}, 'a'),
  ('second card decides',
   {'a': ['8h', '5d', '4c', '3s', '2h'], 'b': ['8d', '6c', '3d', '2c', 'Ac']}, 'a')]]
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 is best lowaaPassed
ace low vs eight lowbbPassed
pair disqualifiesnonenonePassed
eight low qualifiesaaPassed
nine low missesnonenonePassed
compare from top cardbbPassed
sum trapbbPassed
straight still counts as lowaaPassed

SHA-256 / 597a0dbebbeff54d461dfd70ecd32898e4f4f50dbf1a4d0e48c1187e15dcb4a1

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

Case digest / 0581f0201f80defd591de1c9516a8f296fe1fbb866f5b8acfa1023ed09ea21e6