FA-83811 / Card game rule engines / Open access
Schwarz without an explicit schneider flag skips the schneider level · case 01
A schwarz game is valued one level short.
ROOT CAUSE
Schneider is counted only from its own flag.
THE FAILURE
Schneider is counted only from its own flag.
Unsuccessful approach: Requiring both flags drops schneider when only schneider was reached.
Case contract
Input [game(D/H/S/C/G), trumps_held, hand, schneider, schwarz]. Base D9 H10 S11 C12 G24. Matadors count the unbroken run from CJ down the trump sequence (CJ SJ HJ DJ then A T K Q 9 8 7 of the suit; grand only jacks), either held ("with") or missing ("without"). Multiplier = matadors + 1 (game) + hand + schneider (implied by schwarz) + schwarz. Return base * multiplier.
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):
game, held, hand, schneider, schwarz = x
base = {'D': 9, 'H': 10, 'S': 11, 'C': 12, 'G': 24}[game]
seq = ['CJ', 'SJ', 'HJ', 'DJ']
if game != 'G':
seq += [r + game for r in 'ATKQ987']
has = set(held)
first = seq[0] in has
mat = 0
for card in seq:
if (card in has) == first:
mat += 1
else:
break
mult = mat + 1
if hand:
mult += 1
if schneider:
mult += 1
if schwarz:
mult += 1
return base * mult
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[['D', ['CJ', 'HJ', 'QD', '9D', '8D'], True, False, False], 27], [['C', ['CJ', 'SJ', 'HJ', 'DJ', 'AC', 'TC', 'KC'], False, True, False], 108], [['C', ['CJ', 'SJ', 'HJ'], True, False, False], 60], [['G', ['CJ', 'SJ', 'DJ'], True, False, False], 96], [['C', ['CJ', 'SJ', 'HJ', 'DJ', 'AC', 'TC', 'KC', 'QC', '9C', '8C'], True, True, False], 156], [['H', ['AH', 'TH', 'KH', 'QH', '9H', '8H', '7H'], False, True, False], 60], [['G', ['CJ', 'HJ'], False, True, False], 72], [['C', ['9C', '8C', '7C'], False, False, True], 132]], [[['S', ['CJ', 'DJ', 'AS', '9S', '8S', '7S'], False, False, False], 22], [['H', ['CJ', 'SJ', 'HJ', 'DJ', 'AH', 'TH', 'KH'], False, False, False], 80], [['D', ['7D'], False, False, False], 99], [['D', ['CJ', 'AD', 'TD', 'QD'], False, False, False], 18], [['G', ['CJ', 'HJ'], False, True, False], 72], [['D', ['CJ', 'SJ', 'HJ', 'DJ', 'AD', 'TD', 'KD', 'QD'], False, False, False], 81], [['C', ['9C', '8C', '7C'], False, False, True], 132], [['H', ['SJ', 'DJ', 'QH', '7H'], False, False, True], 40]], [[['D', ['CJ', 'HJ', 'KD', '9D', '8D'], False, True, False], 27], [['H', ['CJ'], False, False, False], 20], [['H', ['CJ', 'SJ', 'HJ', 'DJ', 'AH', 'TH', 'KH', 'QH'], True, True, False], 110], [['H', ['SJ', 'TH', 'KH', '9H', '7H'], False, True, False], 30], [['C', ['SJ', 'DJ', 'KC', 'QC', '8C', '7C'], False, False, False], 24], [['C', ['HJ', 'DJ'], False, False, False], 36], [['C', ['9C', '8C', '7C'], False, False, True], 132], [['S', ['CJ'], False, True, False], 33]], [[['H', ['DJ', 'TH', 'KH', 'QH', '7H'], False, False, False], 40], [['C', ['KC', 'QC', '9C', '8C', '7C'], False, False, False], 84], [['C', ['9C', '8C', '7C'], False, False, True], 132], [['C', ['CJ', 'SJ', 'HJ', 'DJ'], False, False, False], 60], [['S', ['CJ', 'SJ', 'AS', 'TS', '7S'], False, True, True], 55], [['D', ['7D'], False, True, False], 108], [['H', ['CJ', 'SJ', 'HJ', 'DJ', 'AH', 'TH', 'KH', 'QH'], False, True, False], 100], [['H', ['SJ', 'DJ', 'QH', '7H'], False, False, True], 40]], [[['C', ['9C', '8C', '7C'], False, False, True], 132], [['H', ['KH', 'QH', '9H', '8H', '7H'], False, False, False], 70], [['H', ['HJ', 'DJ', 'KH', '9H', '8H'], False, True, False], 40], [['C', ['CJ', 'DJ', 'AC', 'TC', '9C'], False, True, True], 48], [['H', ['SJ', 'AH', 'KH', '8H', '7H'], False, False, False], 20], [['D', ['CJ', 'SJ', 'HJ', 'DJ', 'AD', 'TD', 'KD', 'QD', '9D'], False, True, True], 108], [['D', ['CJ', 'SJ', 'AD', 'TD', 'QD', '8D', '7D'], False, False, False], 27], [['G', ['HJ', 'DJ'], False, True, False], 96]]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("game value 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| game value case 0 | 27 | 27 | Passed |
| game value case 1 | 108 | 108 | Passed |
| game value case 2 | 60 | 60 | Passed |
| game value case 3 | 96 | 96 | Passed |
| game value case 4 | 156 | 156 | Passed |
| game value case 5 | 60 | 60 | Passed |
| game value case 6 | 72 | 72 | Passed |
| game value case 7 | 120 | 132 | Failed |
SHA-256 / be9f075440491ea3387678039d99718924ddbc6682f861199ac1179f89fdc810
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
game, held, hand, schneider, schwarz = x
base = {'D': 9, 'H': 10, 'S': 11, 'C': 12, 'G': 24}[game]
seq = ['CJ', 'SJ', 'HJ', 'DJ']
if game != 'G':
seq += [r + game for r in 'ATKQ987']
has = set(held)
first = seq[0] in has
mat = 0
for card in seq:
if (card in has) == first:
mat += 1
else:
break
mult = mat + 1
if hand:
mult += 1
if schneider and schwarz:
mult += 1
if schwarz:
mult += 1
return base * mult
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[['D', ['CJ', 'HJ', 'QD', '9D', '8D'], True, False, False], 27], [['C', ['CJ', 'SJ', 'HJ', 'DJ', 'AC', 'TC', 'KC'], False, True, False], 108], [['C', ['CJ', 'SJ', 'HJ'], True, False, False], 60], [['G', ['CJ', 'SJ', 'DJ'], True, False, False], 96], [['C', ['CJ', 'SJ', 'HJ', 'DJ', 'AC', 'TC', 'KC', 'QC', '9C', '8C'], True, True, False], 156], [['H', ['AH', 'TH', 'KH', 'QH', '9H', '8H', '7H'], False, True, False], 60], [['G', ['CJ', 'HJ'], False, True, False], 72], [['C', ['9C', '8C', '7C'], False, False, True], 132]], [[['S', ['CJ', 'DJ', 'AS', '9S', '8S', '7S'], False, False, False], 22], [['H', ['CJ', 'SJ', 'HJ', 'DJ', 'AH', 'TH', 'KH'], False, False, False], 80], [['D', ['7D'], False, False, False], 99], [['D', ['CJ', 'AD', 'TD', 'QD'], False, False, False], 18], [['G', ['CJ', 'HJ'], False, True, False], 72], [['D', ['CJ', 'SJ', 'HJ', 'DJ', 'AD', 'TD', 'KD', 'QD'], False, False, False], 81], [['C', ['9C', '8C', '7C'], False, False, True], 132], [['H', ['SJ', 'DJ', 'QH', '7H'], False, False, True], 40]], [[['D', ['CJ', 'HJ', 'KD', '9D', '8D'], False, True, False], 27], [['H', ['CJ'], False, False, False], 20], [['H', ['CJ', 'SJ', 'HJ', 'DJ', 'AH', 'TH', 'KH', 'QH'], True, True, False], 110], [['H', ['SJ', 'TH', 'KH', '9H', '7H'], False, True, False], 30], [['C', ['SJ', 'DJ', 'KC', 'QC', '8C', '7C'], False, False, False], 24], [['C', ['HJ', 'DJ'], False, False, False], 36], [['C', ['9C', '8C', '7C'], False, False, True], 132], [['S', ['CJ'], False, True, False], 33]], [[['H', ['DJ', 'TH', 'KH', 'QH', '7H'], False, False, False], 40], [['C', ['KC', 'QC', '9C', '8C', '7C'], False, False, False], 84], [['C', ['9C', '8C', '7C'], False, False, True], 132], [['C', ['CJ', 'SJ', 'HJ', 'DJ'], False, False, False], 60], [['S', ['CJ', 'SJ', 'AS', 'TS', '7S'], False, True, True], 55], [['D', ['7D'], False, True, False], 108], [['H', ['CJ', 'SJ', 'HJ', 'DJ', 'AH', 'TH', 'KH', 'QH'], False, True, False], 100], [['H', ['SJ', 'DJ', 'QH', '7H'], False, False, True], 40]], [[['C', ['9C', '8C', '7C'], False, False, True], 132], [['H', ['KH', 'QH', '9H', '8H', '7H'], False, False, False], 70], [['H', ['HJ', 'DJ', 'KH', '9H', '8H'], False, True, False], 40], [['C', ['CJ', 'DJ', 'AC', 'TC', '9C'], False, True, True], 48], [['H', ['SJ', 'AH', 'KH', '8H', '7H'], False, False, False], 20], [['D', ['CJ', 'SJ', 'HJ', 'DJ', 'AD', 'TD', 'KD', 'QD', '9D'], False, True, True], 108], [['D', ['CJ', 'SJ', 'AD', 'TD', 'QD', '8D', '7D'], False, False, False], 27], [['G', ['HJ', 'DJ'], False, True, False], 96]]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("game value 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| game value case 0 | 27 | 27 | Passed |
| game value case 1 | 96 | 108 | Failed |
| game value case 2 | 60 | 60 | Passed |
| game value case 3 | 96 | 96 | Passed |
| game value case 4 | 144 | 156 | Failed |
| game value case 5 | 50 | 60 | Failed |
| game value case 6 | 48 | 72 | Failed |
| game value case 7 | 120 | 132 | Failed |
SHA-256 / 6888a2b0a1e3c7b9e9a1b543a05e456e4653bbfba9b84d711ae4cac9ce39bafc
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:25.165942+00:00.
Case digest / 558e7c283dc7647c1d67f27d3edcad30979b1517bc0b0561a5e1e0025cf499ee