FAILURE MAP
← Case archive

FA-11671 / Game simulation rules / Open access

Multiple aces force an avoidable blackjack bust · case 01

Multiple aces force an avoidable blackjack bust.

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

ROOT CAUSE

Every ace is valued at eleven.

VERIFIED REPAIR

Start aces at eleven and lower by ten repeatedly while over twenty-one.

Unsuccessful approach: Lowering at most one ace still busts multi-ace hands.

Case contract

Cards are integers 2..10 or A. Return the maximal blackjack total at most 21 if achievable, otherwise minimum possible total. Empty hand scores zero.

Why this case matters

A deterministic game-rule model isolates this rule interaction for regression testing.

1 / The failure

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

N = 1
observations = []
def solve(cards):
    return sum(11 if c=='A' else c for c in cards)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('multiple soft aces',solve(['A','A','A',9]),12)
check('single downgrade',solve(['A',10,N+1]),12+N)
check('natural',solve(['A',10]),21)
check('soft pair',solve(['A','A']),12)
check('empty',solve([]),0)
check('hard bust',solve([10,10,5]),25)
check('all aces',solve(['A']*(N+2)),12+N)
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
multiple soft aces4212Failed
single downgrade2313Failed
natural2121Passed
soft pair2212Failed
empty00Passed
hard bust2525Passed
all aces3313Failed

SHA-256 / 09b509e57ebfdc44422ae546c3a2a1dfc89012a2ae99c763c84209330560358b

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(cards):
    total=sum(11 if c=='A' else c for c in cards)
    return total-10 if total>21 and 'A' in cards else total
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('multiple soft aces',solve(['A','A','A',9]),12)
check('single downgrade',solve(['A',10,N+1]),12+N)
check('natural',solve(['A',10]),21)
check('soft pair',solve(['A','A']),12)
check('empty',solve([]),0)
check('hard bust',solve([10,10,5]),25)
check('all aces',solve(['A']*(N+2)),12+N)
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
multiple soft aces3212Failed
single downgrade1313Passed
natural2121Passed
soft pair1212Passed
empty00Passed
hard bust2525Passed
all aces2313Failed

SHA-256 / 16fb3fd7d5a82d151049c16a81295f22a810ee2a75c70a9ff9b0272edf6307cf

3 / The verified repair

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

N = 1
observations = []
def solve(cards):
    total=sum(11 if c=='A' else c for c in cards)
    aces=cards.count('A')
    while total>21 and aces:
     total-=10; aces-=1
    return total
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('multiple soft aces',solve(['A','A','A',9]),12)
check('single downgrade',solve(['A',10,N+1]),12+N)
check('natural',solve(['A',10]),21)
check('soft pair',solve(['A','A']),12)
check('empty',solve([]),0)
check('hard bust',solve([10,10,5]),25)
check('all aces',solve(['A']*(N+2)),12+N)
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
multiple soft aces1212Passed
single downgrade1313Passed
natural2121Passed
soft pair1212Passed
empty00Passed
hard bust2525Passed
all aces1313Passed

SHA-256 / c901c58eec6ef161ac91bf6b0a130f86dd1f4d114f6bab3d1cc3fbd7d7263f35

Verification & scope

Controlled rules-only simulation; not a complete game engine. 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:38:49.915404+00:00.

Case digest / 77ac7684f0ce0f75ec3c9db881c8d13b536617f7d342d096c0a68b7076f6ba80