FAILURE MAP
← Case archive

FA-83496 / Card game rule engines / Open access

The suit printed on the eight overrides the declared suit · case 01

After an eight declared hearts, the eight own suit is still playable.

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

ROOT CAUSE

The declared-suit branch is missing.

THE FAILURE

The declared-suit branch is missing.

Unsuccessful approach: Allowing the declared suit or the printed suit still accepts the suit the player abandoned.

Case contract

Input [card, top_card, declared_suit_or_None]. Eights are always playable. When the top card is an 8 with a declared suit, only that suit (or an 8) may follow. Otherwise match suit or rank. Return a bool.

Why this case matters

Card-game engines, scoring apps and online tables apply this rule automatically on every hand.

1 / The failure

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

N = 1
observations = []
def solve(x):
    card, top, declared = x
    if card[0] == '8':
        return True
    return card[1] == top[1] or card[0] == top[0]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[['3D', '8D', 'S'], False], [['7H', '8C', 'C'], False], [['8C', '8S', 'S'], True], [['JD', '8S', None], False], [['8S', '8H', 'S'], True], [['TS', '3H', None], False], [['8S', '8D', 'H'], True], [['JS', '8S', 'D'], False]], [[['8C', 'JD', None], True], [['6H', 'TC', None], False], [['KC', '6H', None], False], [['2D', '3C', None], False], [['8C', '4D', None], True], [['7C', 'QC', None], True], [['2S', '8C', 'S'], True], [['9S', '8S', 'H'], False]], [[['3D', '8D', 'S'], False], [['JS', '8C', 'C'], False], [['3C', '8H', None], False], [['6C', '8S', 'C'], True], [['AH', 'TC', None], False], [['KH', '8H', 'H'], True], [['3D', 'AS', None], False], [['9S', '8S', 'H'], False]], [[['TC', '8C', 'D'], False], [['2H', '2C', None], True], [['6S', '4D', None], False], [['2S', '8C', 'S'], True], [['AC', '8D', 'S'], False], [['8C', '8C', 'H'], True], [['4D', '8D', 'S'], False], [['4D', '8D', 'S'], False]], [[['AC', '4D', None], False], [['JD', '8C', 'H'], False], [['8C', 'AC', None], True], [['8H', '8D', 'C'], True], [['8H', 'TC', None], True], [['TC', '9D', None], False], [['7S', '8S', 'D'], False], [['9S', '8D', 'S'], True]]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check("playable case %d" % i, solve(args), 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
playable case 0TrueFalseFailed
playable case 1FalseFalsePassed
playable case 2TrueTruePassed
playable case 3FalseFalsePassed
playable case 4TrueTruePassed
playable case 5FalseFalsePassed
playable case 6TrueTruePassed
playable case 7TrueFalseFailed

SHA-256 / b8ad5b893d96bce7e54716235ceb5a7963a8e1033fb74e954826cad9bfb35761

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(x):
    card, top, declared = x
    if card[0] == '8':
        return True
    if top[0] == '8' and declared:
        return card[1] == declared or card[1] == top[1]
    return card[1] == top[1] or card[0] == top[0]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[['3D', '8D', 'S'], False], [['7H', '8C', 'C'], False], [['8C', '8S', 'S'], True], [['JD', '8S', None], False], [['8S', '8H', 'S'], True], [['TS', '3H', None], False], [['8S', '8D', 'H'], True], [['JS', '8S', 'D'], False]], [[['8C', 'JD', None], True], [['6H', 'TC', None], False], [['KC', '6H', None], False], [['2D', '3C', None], False], [['8C', '4D', None], True], [['7C', 'QC', None], True], [['2S', '8C', 'S'], True], [['9S', '8S', 'H'], False]], [[['3D', '8D', 'S'], False], [['JS', '8C', 'C'], False], [['3C', '8H', None], False], [['6C', '8S', 'C'], True], [['AH', 'TC', None], False], [['KH', '8H', 'H'], True], [['3D', 'AS', None], False], [['9S', '8S', 'H'], False]], [[['TC', '8C', 'D'], False], [['2H', '2C', None], True], [['6S', '4D', None], False], [['2S', '8C', 'S'], True], [['AC', '8D', 'S'], False], [['8C', '8C', 'H'], True], [['4D', '8D', 'S'], False], [['4D', '8D', 'S'], False]], [[['AC', '4D', None], False], [['JD', '8C', 'H'], False], [['8C', 'AC', None], True], [['8H', '8D', 'C'], True], [['8H', 'TC', None], True], [['TC', '9D', None], False], [['7S', '8S', 'D'], False], [['9S', '8D', 'S'], True]]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check("playable case %d" % i, solve(args), 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
playable case 0TrueFalseFailed
playable case 1FalseFalsePassed
playable case 2TrueTruePassed
playable case 3FalseFalsePassed
playable case 4TrueTruePassed
playable case 5FalseFalsePassed
playable case 6TrueTruePassed
playable case 7TrueFalseFailed

SHA-256 / 7a0011a82c466d09835ff4101147d92cbb506b94cbeac6a4e89cd4acd65ebc12

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 bounded toy rule contract stated explicitly in the contract field; cards are two-character codes (rank, suit). Not a complete implementation of any published rulebook or casino table rules. 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:22.055788+00:00.

Case digest / c9b299708f7f8dcbc11b983ce510340883b75aa0185941f82b99b2f16b8ea966