FAILURE MAP
← Case archive

FA-82106 / Poker hand evaluation / Open access

Pocket pairs carry an offsuit marker · case 01

Pocket queens are written "QQo" and do not match range keys.

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

ROOT CAUSE

The pair branch appends a suitedness marker although pairs are always written without one.

THE FAILURE

The pair branch appends a suitedness marker although pairs are always written without one.

Unsuccessful approach: Testing whole card strings for the pair branch never matches, so pairs fall through and get a marker.

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+'o'
    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'),
  ('exact duplicate', ['7c', '7c'], 'invalid'),
  ('pair of tens mixed tokens', ['10h', 'Td'], 'TT')],
 [('nine ten mixed', ['9c', '10d'], 'T9o'), ('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'), ('pair of tens mixed tokens', ['10h', 'Td'], 'TT')],
 [('pair of queens', ['Qh', 'Qs'], 'QQ'), ('queen ten', ['Tc', 'Qc'], 'QTs'),
  ('lower case ranks', ['kd', 'js'], 'KJo'), ('suit case differs', ['Jh', 'TH'], 'JTs'),
  ('empty rank', ['h', 'Kd'], 'invalid'), ('two-letter rank', ['KQh', '2d'], 'invalid'),
  ('ten first suited', ['10h', 'Jh'], 'JTs'), ('pair of tens mixed tokens', ['10h', 'Td'], 'TT')],
 [('ace king suited', ['Ah', 'Kh'], 'AKs'), ('king ace offsuit order', ['Kd', 'Ah'], 'AKo'),
  ('pair of queens', ['Qh', 'Qs'], 'QQ'), ('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'), ('nine ten mixed', ['9c', '10d'], 'T9o'),
  ('pair of queens', ['Qh', 'Qs'], 'QQ'), ('duplicate card case', ['Ah', 'aH'], 'invalid'),
  ('deuce seven', ['2d', '7s'], '72o'), ('pair of tens mixed tokens', ['10h', 'Td'], 'TT')]]
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 queensQQoQQFailed
duplicate card caseinvalidinvalidPassed
exact duplicateinvalidinvalidPassed
pair of tens mixed tokensTToTTFailed

SHA-256 / a43a672bb7a9f349b56b7202048bf672826cf03720079333671fc184812afd22

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 x[0]==x[1]: 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'),
  ('exact duplicate', ['7c', '7c'], 'invalid'),
  ('pair of tens mixed tokens', ['10h', 'Td'], 'TT')],
 [('nine ten mixed', ['9c', '10d'], 'T9o'), ('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'), ('pair of tens mixed tokens', ['10h', 'Td'], 'TT')],
 [('pair of queens', ['Qh', 'Qs'], 'QQ'), ('queen ten', ['Tc', 'Qc'], 'QTs'),
  ('lower case ranks', ['kd', 'js'], 'KJo'), ('suit case differs', ['Jh', 'TH'], 'JTs'),
  ('empty rank', ['h', 'Kd'], 'invalid'), ('two-letter rank', ['KQh', '2d'], 'invalid'),
  ('ten first suited', ['10h', 'Jh'], 'JTs'), ('pair of tens mixed tokens', ['10h', 'Td'], 'TT')],
 [('ace king suited', ['Ah', 'Kh'], 'AKs'), ('king ace offsuit order', ['Kd', 'Ah'], 'AKo'),
  ('pair of queens', ['Qh', 'Qs'], 'QQ'), ('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'), ('nine ten mixed', ['9c', '10d'], 'T9o'),
  ('pair of queens', ['Qh', 'Qs'], 'QQ'), ('duplicate card case', ['Ah', 'aH'], 'invalid'),
  ('deuce seven', ['2d', '7s'], '72o'), ('pair of tens mixed tokens', ['10h', 'Td'], 'TT')]]
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 queensQQoQQFailed
duplicate card caseinvalidinvalidPassed
exact duplicateinvalidinvalidPassed
pair of tens mixed tokensTToTTFailed

SHA-256 / c40d6ea631f7011b61f7e0518077faa39f4fab4e71e149c3ee6eb6fe60a84599

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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

Case digest / c3e3c39090191bdde71ba0e1484cc70b3249e3b525e9c76e2b3c1ee350c4e9e0