FAILURE MAP
← Case archive

FA-82111 / Poker hand evaluation / Open access

Ten token misreads suitedness · case 01

"10h" with "Jh" is written "JTo".

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

ROOT CAUSE

The suit is read from index 1, which is the "0" of a "10" token.

VERIFIED REPAIR

Read the suit from the last character of each card.

Unsuccessful approach: Fixing only the second card still reads the first card's suit from index 1.

Case contract

Input: two hole cards as strings (rank may be "10"; rank and suit case-insensitive). Return canonical hold'em notation: pairs "QQ", otherwise higher rank first with "s" for suited or "o" for offsuit (e.g. "AKs", "T9o"). Return "invalid" for duplicate cards or unknown ranks.

Why this case matters

Range tools, solvers and hand histories key statistics on this notation.

1 / The failure

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

N = 1
observations = []
def solve(x):
    R='23456789TJQKA'
    if len(x)!=2 or x[0].upper()==x[1].upper(): return 'invalid'
    def rank(c):
        t=c[:-1].upper()
        return 'T' if t=='10' else t
    a,b=rank(x[0]),rank(x[1])
    if a not in list(R) or b not in list(R): return 'invalid'
    if a==b: return a+b
    hi,lo=sorted([a,b], key=R.index, reverse=True)
    return hi+lo+('s' if x[0][1]==x[1][1] else 'o')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('ace king suited', ['Ah', 'Kh'], 'AKs'), ('king ace offsuit order', ['Kd', 'Ah'], 'AKo'),
  ('ten nine suited with 10', ['10s', '9s'], 'T9s'), ('nine ten mixed', ['9c', '10d'], 'T9o'),
  ('pair of queens', ['Qh', 'Qs'], 'QQ'), ('duplicate card case', ['Ah', 'aH'], 'invalid'),
  ('suit case differs', ['Jh', 'TH'], 'JTs'), ('ten first suited', ['10h', 'Jh'], 'JTs')],
 [('ten nine suited with 10', ['10s', '9s'], 'T9s'), ('pair of queens', ['Qh', 'Qs'], 'QQ'),
  ('duplicate card case', ['Ah', 'aH'], 'invalid'), ('exact duplicate', ['7c', '7c'], 'invalid'),
  ('queen ten', ['Tc', 'Qc'], 'QTs'), ('lower case ranks', ['kd', 'js'], 'KJo'),
  ('suit case differs', ['Jh', 'TH'], 'JTs'), ('ten first suited', ['10h', 'Jh'], 'JTs')],
 [('ten nine suited with 10', ['10s', '9s'], 'T9s'), ('queen ten', ['Tc', 'Qc'], 'QTs'),
  ('lower case ranks', ['kd', 'js'], 'KJo'), ('empty rank', ['h', 'Kd'], 'invalid'),
  ('two-letter rank', ['KQh', '2d'], 'invalid'), ('ten first suited', ['10h', 'Jh'], 'JTs'),
  ('deuce seven', ['2d', '7s'], '72o'), ('pair of tens mixed tokens', ['10h', 'Td'], 'TT')],
 [('ace king suited', ['Ah', 'Kh'], 'AKs'), ('king ace offsuit order', ['Kd', 'Ah'], 'AKo'),
  ('ten nine suited with 10', ['10s', '9s'], 'T9s'), ('suit case differs', ['Jh', 'TH'], 'JTs'),
  ('two-letter rank', ['KQh', '2d'], 'invalid'), ('ten first suited', ['10h', 'Jh'], 'JTs'),
  ('deuce seven', ['2d', '7s'], '72o'), ('pair of tens mixed tokens', ['10h', 'Td'], 'TT')],
 [('ace king suited', ['Ah', 'Kh'], 'AKs'), ('king ace offsuit order', ['Kd', 'Ah'], 'AKo'),
  ('ten nine suited with 10', ['10s', '9s'], 'T9s'), ('nine ten mixed', ['9c', '10d'], 'T9o'),
  ('pair of queens', ['Qh', 'Qs'], 'QQ'), ('duplicate card case', ['Ah', 'aH'], 'invalid'),
  ('suit case differs', ['Jh', 'TH'], 'JTs'), ('ten first suited', ['10h', 'Jh'], 'JTs')]]
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
ace king suitedAKsAKsPassed
king ace offsuit orderAKoAKoPassed
ten nine suited with 10T9oT9sFailed
nine ten mixedT9oT9oPassed
pair of queensQQQQPassed
duplicate card caseinvalidinvalidPassed
suit case differsJToJTsFailed
ten first suitedJToJTsFailed

SHA-256 / b456b40936b33b98596875bcb50931b4d383d544b25b7cf73cd5b0c769086d03

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(x):
    R='23456789TJQKA'
    if len(x)!=2 or x[0].upper()==x[1].upper(): return 'invalid'
    def rank(c):
        t=c[:-1].upper()
        return 'T' if t=='10' else t
    a,b=rank(x[0]),rank(x[1])
    if a not in list(R) or b not in list(R): return 'invalid'
    if a==b: return a+b
    hi,lo=sorted([a,b], key=R.index, reverse=True)
    return hi+lo+('s' if x[0][1].lower()==x[1][-1].lower() else 'o')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('ace king suited', ['Ah', 'Kh'], 'AKs'), ('king ace offsuit order', ['Kd', 'Ah'], 'AKo'),
  ('ten nine suited with 10', ['10s', '9s'], 'T9s'), ('nine ten mixed', ['9c', '10d'], 'T9o'),
  ('pair of queens', ['Qh', 'Qs'], 'QQ'), ('duplicate card case', ['Ah', 'aH'], 'invalid'),
  ('suit case differs', ['Jh', 'TH'], 'JTs'), ('ten first suited', ['10h', 'Jh'], 'JTs')],
 [('ten nine suited with 10', ['10s', '9s'], 'T9s'), ('pair of queens', ['Qh', 'Qs'], 'QQ'),
  ('duplicate card case', ['Ah', 'aH'], 'invalid'), ('exact duplicate', ['7c', '7c'], 'invalid'),
  ('queen ten', ['Tc', 'Qc'], 'QTs'), ('lower case ranks', ['kd', 'js'], 'KJo'),
  ('suit case differs', ['Jh', 'TH'], 'JTs'), ('ten first suited', ['10h', 'Jh'], 'JTs')],
 [('ten nine suited with 10', ['10s', '9s'], 'T9s'), ('queen ten', ['Tc', 'Qc'], 'QTs'),
  ('lower case ranks', ['kd', 'js'], 'KJo'), ('empty rank', ['h', 'Kd'], 'invalid'),
  ('two-letter rank', ['KQh', '2d'], 'invalid'), ('ten first suited', ['10h', 'Jh'], 'JTs'),
  ('deuce seven', ['2d', '7s'], '72o'), ('pair of tens mixed tokens', ['10h', 'Td'], 'TT')],
 [('ace king suited', ['Ah', 'Kh'], 'AKs'), ('king ace offsuit order', ['Kd', 'Ah'], 'AKo'),
  ('ten nine suited with 10', ['10s', '9s'], 'T9s'), ('suit case differs', ['Jh', 'TH'], 'JTs'),
  ('two-letter rank', ['KQh', '2d'], 'invalid'), ('ten first suited', ['10h', 'Jh'], 'JTs'),
  ('deuce seven', ['2d', '7s'], '72o'), ('pair of tens mixed tokens', ['10h', 'Td'], 'TT')],
 [('ace king suited', ['Ah', 'Kh'], 'AKs'), ('king ace offsuit order', ['Kd', 'Ah'], 'AKo'),
  ('ten nine suited with 10', ['10s', '9s'], 'T9s'), ('nine ten mixed', ['9c', '10d'], 'T9o'),
  ('pair of queens', ['Qh', 'Qs'], 'QQ'), ('duplicate card case', ['Ah', 'aH'], 'invalid'),
  ('suit case differs', ['Jh', 'TH'], 'JTs'), ('ten first suited', ['10h', 'Jh'], 'JTs')]]
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
ace king suitedAKsAKsPassed
king ace offsuit orderAKoAKoPassed
ten nine suited with 10T9oT9sFailed
nine ten mixedT9oT9oPassed
pair of queensQQQQPassed
duplicate card caseinvalidinvalidPassed
suit case differsJTsJTsPassed
ten first suitedJToJTsFailed

SHA-256 / 0e13b95a2a52c2d60c736c7206660e08b0aa33c7846b7392ea81503ba4e21fcc

3 / The verified repair

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

N = 1
observations = []
def solve(x):
    R='23456789TJQKA'
    if len(x)!=2 or x[0].upper()==x[1].upper(): return 'invalid'
    def rank(c):
        t=c[:-1].upper()
        return 'T' if t=='10' else t
    a,b=rank(x[0]),rank(x[1])
    if a not in list(R) or b not in list(R): return 'invalid'
    if a==b: return a+b
    hi,lo=sorted([a,b], key=R.index, reverse=True)
    return hi+lo+('s' if x[0][-1].lower()==x[1][-1].lower() else 'o')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('ace king suited', ['Ah', 'Kh'], 'AKs'), ('king ace offsuit order', ['Kd', 'Ah'], 'AKo'),
  ('ten nine suited with 10', ['10s', '9s'], 'T9s'), ('nine ten mixed', ['9c', '10d'], 'T9o'),
  ('pair of queens', ['Qh', 'Qs'], 'QQ'), ('duplicate card case', ['Ah', 'aH'], 'invalid'),
  ('suit case differs', ['Jh', 'TH'], 'JTs'), ('ten first suited', ['10h', 'Jh'], 'JTs')],
 [('ten nine suited with 10', ['10s', '9s'], 'T9s'), ('pair of queens', ['Qh', 'Qs'], 'QQ'),
  ('duplicate card case', ['Ah', 'aH'], 'invalid'), ('exact duplicate', ['7c', '7c'], 'invalid'),
  ('queen ten', ['Tc', 'Qc'], 'QTs'), ('lower case ranks', ['kd', 'js'], 'KJo'),
  ('suit case differs', ['Jh', 'TH'], 'JTs'), ('ten first suited', ['10h', 'Jh'], 'JTs')],
 [('ten nine suited with 10', ['10s', '9s'], 'T9s'), ('queen ten', ['Tc', 'Qc'], 'QTs'),
  ('lower case ranks', ['kd', 'js'], 'KJo'), ('empty rank', ['h', 'Kd'], 'invalid'),
  ('two-letter rank', ['KQh', '2d'], 'invalid'), ('ten first suited', ['10h', 'Jh'], 'JTs'),
  ('deuce seven', ['2d', '7s'], '72o'), ('pair of tens mixed tokens', ['10h', 'Td'], 'TT')],
 [('ace king suited', ['Ah', 'Kh'], 'AKs'), ('king ace offsuit order', ['Kd', 'Ah'], 'AKo'),
  ('ten nine suited with 10', ['10s', '9s'], 'T9s'), ('suit case differs', ['Jh', 'TH'], 'JTs'),
  ('two-letter rank', ['KQh', '2d'], 'invalid'), ('ten first suited', ['10h', 'Jh'], 'JTs'),
  ('deuce seven', ['2d', '7s'], '72o'), ('pair of tens mixed tokens', ['10h', 'Td'], 'TT')],
 [('ace king suited', ['Ah', 'Kh'], 'AKs'), ('king ace offsuit order', ['Kd', 'Ah'], 'AKo'),
  ('ten nine suited with 10', ['10s', '9s'], 'T9s'), ('nine ten mixed', ['9c', '10d'], 'T9o'),
  ('pair of queens', ['Qh', 'Qs'], 'QQ'), ('duplicate card case', ['Ah', 'aH'], 'invalid'),
  ('suit case differs', ['Jh', 'TH'], 'JTs'), ('ten first suited', ['10h', 'Jh'], 'JTs')]]
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
ace king suitedAKsAKsPassed
king ace offsuit orderAKoAKoPassed
ten nine suited with 10T9sT9sPassed
nine ten mixedT9oT9oPassed
pair of queensQQQQPassed
duplicate card caseinvalidinvalidPassed
suit case differsJTsJTsPassed
ten first suitedJTsJTsPassed

SHA-256 / 283a2ef2bc2e51add01d78d9172b263f80320dc0ea52da0411319e8d600dd1c5

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

Case digest / 08f5473228ffe87d47c09681106755fb0c707d42ce29fbbdc6ed1e4c73ca2188