FA-83771 / Card game rule engines / Open access
Double pinochle scores as two single pinochles · case 01
Both jacks of diamonds and queens of spades score 80.
ROOT CAUSE
The double pinochle bonus is missing.
THE FAILURE
The double pinochle bonus is missing.
Unsuccessful approach: Treating two JD with one QS as double pinochle overpays.
Case contract
Input [hand, trump]. Arounds (one of the rank in each suit): A 100, K 80, Q 60, J 40; double around x10. Run in trump (A T K Q J) 150 each; marriages (K+Q same suit) 20, royal marriage in trump 40, but a K+Q used in a run is not also a royal marriage. Pinochle (JD+QS) 40, double pinochle 300. Return the meld total.
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
from collections import Counter
N = 1
observations = []
def solve(x):
hand, trump = x
cnt = Counter(hand)
pts = 0
for r, v in (('A', 100), ('K', 80), ('Q', 60), ('J', 40)):
k = min(cnt[r + s] for s in 'SHDC')
if k >= 2:
pts += v * 10
elif k == 1:
pts += v
runs = min(cnt[r + trump] for r in 'ATKQJ')
pts += 150 * runs
for s in 'SHDC':
m = min(cnt['K' + s], cnt['Q' + s])
if s == trump:
m -= runs
pts += 40 * m
else:
pts += 20 * m
p = min(cnt['JD'], cnt['QS'])
pts += 40 * p
return pts
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[['9H', 'AC', 'AD', 'AD', 'JD', 'JD', 'KH', 'QC', 'QD', 'QS', 'QS', 'TS'], 'D'], 300], [[['9C', '9D', '9S', 'AC', 'AH', 'JH', 'JS', 'KH', 'KH', 'KS', 'QH', 'TD'], 'C'], 20], [[['9D', 'JC', 'JD', 'JD', 'JH', 'KD', 'KS', 'QH', 'QS', 'QS', 'TC', 'TD'], 'H'], 320], [[['AC', 'AC', 'AD', 'AD', 'AH', 'AH', 'AS', 'AS', 'JD', 'JD', 'QS', 'QS'], 'D'], 1300], [[['9S', 'AH', 'AS', 'JC', 'JS', 'KD', 'KS', 'KS', 'QD', 'QS', 'TC', 'TS'], 'S'], 170], [[['AH', 'AH', 'AS', 'AS', 'JH', 'KC', 'KH', 'QH', 'QS', 'TH', 'TH', 'TS'], 'C'], 20], [[['9S', '9S', 'AC', 'JD', 'JD', 'KD', 'KS', 'QD', 'QS', 'QS', 'QS', 'TD'], 'D'], 360], [[['AD', 'JD', 'JD', 'JD', 'JH', 'KC', 'KS', 'QD', 'QH', 'QS', 'QS', 'TC'], 'S'], 340]], [[[['AC', 'AC', 'AD', 'AD', 'AH', 'AH', 'AS', 'AS', 'JD', 'JD', 'QS', 'QS'], 'D'], 1300], [[['9C', 'AC', 'AC', 'AD', 'AH', 'AH', 'JD', 'JH', 'QC', 'QD', 'QH', 'TS'], 'C'], 0], [[['9C', '9D', '9S', 'AD', 'JH', 'JS', 'KC', 'QD', 'QH', 'TC', 'TD', 'TH'], 'D'], 0], [[['AC', 'AC', 'AD', 'AD', 'AH', 'AH', 'AS', 'AS', 'AS', 'QC', 'TC', 'TD'], 'H'], 1000], [[['9C', '9H', 'AC', 'AS', 'JC', 'KD', 'KH', 'QC', 'QH', 'TD', 'TH', 'TH'], 'S'], 20], [[['9D', '9S', 'AS', 'JC', 'JH', 'JS', 'KD', 'KH', 'KS', 'QC', 'QD', 'QS'], 'D'], 60], [[['9C', 'AS', 'AS', 'JD', 'JH', 'JS', 'KC', 'KS', 'QC', 'QS', 'TD', 'TS'], 'S'], 210], [[['9H', '9S', 'AC', 'JD', 'JD', 'JD', 'JD', 'KD', 'QH', 'QS', 'QS', 'TD'], 'S'], 300]], [[[['9C', 'AS', 'JC', 'JH', 'KD', 'KD', 'KH', 'KS', 'QS', 'QS', 'TD', 'TH'], 'S'], 40], [[['AH', 'AH', 'JC', 'JH', 'JH', 'KH', 'KH', 'QH', 'QH', 'QS', 'TH', 'TH'], 'C'], 40], [[['AC', 'AC', 'AD', 'AD', 'AH', 'AH', 'AS', 'AS', 'JD', 'JD', 'QS', 'QS'], 'H'], 1300], [[['9C', '9D', 'AC', 'AD', 'AD', 'JD', 'JH', 'KD', 'KD', 'QD', 'QH', 'TD'], 'C'], 20], [[['9D', '9S', 'AD', 'JD', 'JD', 'KS', 'QD', 'QD', 'QH', 'QS', 'QS', 'TH'], 'S'], 340], [[['AC', 'AC', 'AC', 'AD', 'AD', 'AH', 'AH', 'AS', 'AS', 'KC', 'QC', 'TC'], 'D'], 1020], [[['AD', 'AH', 'AS', 'JD', 'JH', 'JS', 'KC', 'KD', 'QC', 'QD', 'QD', 'TD'], 'D'], 170], [[['AC', 'AD', 'AD', 'JD', 'JD', 'KD', 'KD', 'KS', 'QD', 'QH', 'QS', 'TD'], 'H'], 80]], [[[['9C', '9D', 'AC', 'AH', 'AH', 'KC', 'KD', 'KS', 'QC', 'QD', 'QS', 'TH'], 'H'], 60], [[['9C', '9C', 'AC', 'JD', 'KD', 'KD', 'KH', 'KS', 'QC', 'QH', 'TC', 'TD'], 'H'], 40], [[['9H', 'AC', 'AD', 'AS', 'JH', 'JS', 'KC', 'KD', 'QD', 'QH', 'TC', 'TD'], 'D'], 40], [[['AC', 'AC', 'AD', 'AD', 'AH', 'AH', 'AS', 'AS', 'JC', 'KS', 'QH', 'TS'], 'H'], 1000], [[['9C', '9D', '9D', '9H', 'AC', 'AH', 'JC', 'KC', 'KS', 'TC', 'TD', 'TH'], 'S'], 0], [[['AH', 'AH', 'JH', 'JH', 'JS', 'KH', 'KH', 'QH', 'QH', 'TD', 'TH', 'TH'], 'D'], 40], [[['AC', 'AC', 'AD', 'AD', 'AH', 'AH', 'AS', 'AS', 'JD', 'JD', 'QS', 'QS'], 'S'], 1300], [[['AD', 'JD', 'JD', 'JD', 'JH', 'KC', 'KS', 'QD', 'QH', 'QS', 'QS', 'TC'], 'S'], 340]], [[[['9D', '9S', 'AH', 'JH', 'KC', 'KD', 'KS', 'QD', 'QD', 'TC', 'TC', 'TS'], 'D'], 40], [[['9D', 'AC', 'AH', 'JC', 'JH', 'JS', 'KC', 'KH', 'QC', 'TC', 'TH', 'TS'], 'S'], 20], [[['AC', 'AC', 'AD', 'AD', 'AH', 'AH', 'AS', 'AS', 'JD', 'JD', 'QS', 'QS'], 'S'], 1300], [[['AH', 'AH', 'JH', 'JH', 'KD', 'KD', 'KH', 'KH', 'QH', 'QH', 'TH', 'TH'], 'C'], 40], [[['9C', '9D', '9S', '9S', 'AD', 'AD', 'AH', 'AS', 'JC', 'JD', 'KH', 'QS'], 'C'], 40], [[['9C', '9H', 'AD', 'JC', 'JD', 'JS', 'JS', 'KC', 'KD', 'KH', 'TD', 'TH'], 'D'], 0], [[['AC', 'AC', 'AD', 'AD', 'AH', 'AH', 'AS', 'AS', 'JD', 'JD', 'QS', 'QS'], 'H'], 1300], [[['9H', '9S', 'AC', 'JD', 'JD', 'JD', 'JD', 'KD', 'QH', 'QS', 'QS', 'TD'], 'S'], 300]]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("meld points 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 |
|---|---|---|---|
| meld points case 0 | 80 | 300 | Failed |
| meld points case 1 | 20 | 20 | Passed |
| meld points case 2 | 100 | 320 | Failed |
| meld points case 3 | 1080 | 1300 | Failed |
| meld points case 4 | 170 | 170 | Passed |
| meld points case 5 | 20 | 20 | Passed |
| meld points case 6 | 140 | 360 | Failed |
| meld points case 7 | 120 | 340 | Failed |
SHA-256 / 90cd2b10fc4daf73cca64b056c27d3ead1edada6e6cefbb9837def1f97c585b5
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
from collections import Counter
N = 1
observations = []
def solve(x):
hand, trump = x
cnt = Counter(hand)
pts = 0
for r, v in (('A', 100), ('K', 80), ('Q', 60), ('J', 40)):
k = min(cnt[r + s] for s in 'SHDC')
if k >= 2:
pts += v * 10
elif k == 1:
pts += v
runs = min(cnt[r + trump] for r in 'ATKQJ')
pts += 150 * runs
for s in 'SHDC':
m = min(cnt['K' + s], cnt['Q' + s])
if s == trump:
m -= runs
pts += 40 * m
else:
pts += 20 * m
p = min(cnt['JD'], cnt['QS'])
pts += 300 if p >= 1 and cnt['JD'] == 2 else 40 * p
return pts
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[['9H', 'AC', 'AD', 'AD', 'JD', 'JD', 'KH', 'QC', 'QD', 'QS', 'QS', 'TS'], 'D'], 300], [[['9C', '9D', '9S', 'AC', 'AH', 'JH', 'JS', 'KH', 'KH', 'KS', 'QH', 'TD'], 'C'], 20], [[['9D', 'JC', 'JD', 'JD', 'JH', 'KD', 'KS', 'QH', 'QS', 'QS', 'TC', 'TD'], 'H'], 320], [[['AC', 'AC', 'AD', 'AD', 'AH', 'AH', 'AS', 'AS', 'JD', 'JD', 'QS', 'QS'], 'D'], 1300], [[['9S', 'AH', 'AS', 'JC', 'JS', 'KD', 'KS', 'KS', 'QD', 'QS', 'TC', 'TS'], 'S'], 170], [[['AH', 'AH', 'AS', 'AS', 'JH', 'KC', 'KH', 'QH', 'QS', 'TH', 'TH', 'TS'], 'C'], 20], [[['9S', '9S', 'AC', 'JD', 'JD', 'KD', 'KS', 'QD', 'QS', 'QS', 'QS', 'TD'], 'D'], 360], [[['AD', 'JD', 'JD', 'JD', 'JH', 'KC', 'KS', 'QD', 'QH', 'QS', 'QS', 'TC'], 'S'], 340]], [[[['AC', 'AC', 'AD', 'AD', 'AH', 'AH', 'AS', 'AS', 'JD', 'JD', 'QS', 'QS'], 'D'], 1300], [[['9C', 'AC', 'AC', 'AD', 'AH', 'AH', 'JD', 'JH', 'QC', 'QD', 'QH', 'TS'], 'C'], 0], [[['9C', '9D', '9S', 'AD', 'JH', 'JS', 'KC', 'QD', 'QH', 'TC', 'TD', 'TH'], 'D'], 0], [[['AC', 'AC', 'AD', 'AD', 'AH', 'AH', 'AS', 'AS', 'AS', 'QC', 'TC', 'TD'], 'H'], 1000], [[['9C', '9H', 'AC', 'AS', 'JC', 'KD', 'KH', 'QC', 'QH', 'TD', 'TH', 'TH'], 'S'], 20], [[['9D', '9S', 'AS', 'JC', 'JH', 'JS', 'KD', 'KH', 'KS', 'QC', 'QD', 'QS'], 'D'], 60], [[['9C', 'AS', 'AS', 'JD', 'JH', 'JS', 'KC', 'KS', 'QC', 'QS', 'TD', 'TS'], 'S'], 210], [[['9H', '9S', 'AC', 'JD', 'JD', 'JD', 'JD', 'KD', 'QH', 'QS', 'QS', 'TD'], 'S'], 300]], [[[['9C', 'AS', 'JC', 'JH', 'KD', 'KD', 'KH', 'KS', 'QS', 'QS', 'TD', 'TH'], 'S'], 40], [[['AH', 'AH', 'JC', 'JH', 'JH', 'KH', 'KH', 'QH', 'QH', 'QS', 'TH', 'TH'], 'C'], 40], [[['AC', 'AC', 'AD', 'AD', 'AH', 'AH', 'AS', 'AS', 'JD', 'JD', 'QS', 'QS'], 'H'], 1300], [[['9C', '9D', 'AC', 'AD', 'AD', 'JD', 'JH', 'KD', 'KD', 'QD', 'QH', 'TD'], 'C'], 20], [[['9D', '9S', 'AD', 'JD', 'JD', 'KS', 'QD', 'QD', 'QH', 'QS', 'QS', 'TH'], 'S'], 340], [[['AC', 'AC', 'AC', 'AD', 'AD', 'AH', 'AH', 'AS', 'AS', 'KC', 'QC', 'TC'], 'D'], 1020], [[['AD', 'AH', 'AS', 'JD', 'JH', 'JS', 'KC', 'KD', 'QC', 'QD', 'QD', 'TD'], 'D'], 170], [[['AC', 'AD', 'AD', 'JD', 'JD', 'KD', 'KD', 'KS', 'QD', 'QH', 'QS', 'TD'], 'H'], 80]], [[[['9C', '9D', 'AC', 'AH', 'AH', 'KC', 'KD', 'KS', 'QC', 'QD', 'QS', 'TH'], 'H'], 60], [[['9C', '9C', 'AC', 'JD', 'KD', 'KD', 'KH', 'KS', 'QC', 'QH', 'TC', 'TD'], 'H'], 40], [[['9H', 'AC', 'AD', 'AS', 'JH', 'JS', 'KC', 'KD', 'QD', 'QH', 'TC', 'TD'], 'D'], 40], [[['AC', 'AC', 'AD', 'AD', 'AH', 'AH', 'AS', 'AS', 'JC', 'KS', 'QH', 'TS'], 'H'], 1000], [[['9C', '9D', '9D', '9H', 'AC', 'AH', 'JC', 'KC', 'KS', 'TC', 'TD', 'TH'], 'S'], 0], [[['AH', 'AH', 'JH', 'JH', 'JS', 'KH', 'KH', 'QH', 'QH', 'TD', 'TH', 'TH'], 'D'], 40], [[['AC', 'AC', 'AD', 'AD', 'AH', 'AH', 'AS', 'AS', 'JD', 'JD', 'QS', 'QS'], 'S'], 1300], [[['AD', 'JD', 'JD', 'JD', 'JH', 'KC', 'KS', 'QD', 'QH', 'QS', 'QS', 'TC'], 'S'], 340]], [[[['9D', '9S', 'AH', 'JH', 'KC', 'KD', 'KS', 'QD', 'QD', 'TC', 'TC', 'TS'], 'D'], 40], [[['9D', 'AC', 'AH', 'JC', 'JH', 'JS', 'KC', 'KH', 'QC', 'TC', 'TH', 'TS'], 'S'], 20], [[['AC', 'AC', 'AD', 'AD', 'AH', 'AH', 'AS', 'AS', 'JD', 'JD', 'QS', 'QS'], 'S'], 1300], [[['AH', 'AH', 'JH', 'JH', 'KD', 'KD', 'KH', 'KH', 'QH', 'QH', 'TH', 'TH'], 'C'], 40], [[['9C', '9D', '9S', '9S', 'AD', 'AD', 'AH', 'AS', 'JC', 'JD', 'KH', 'QS'], 'C'], 40], [[['9C', '9H', 'AD', 'JC', 'JD', 'JS', 'JS', 'KC', 'KD', 'KH', 'TD', 'TH'], 'D'], 0], [[['AC', 'AC', 'AD', 'AD', 'AH', 'AH', 'AS', 'AS', 'JD', 'JD', 'QS', 'QS'], 'H'], 1300], [[['9H', '9S', 'AC', 'JD', 'JD', 'JD', 'JD', 'KD', 'QH', 'QS', 'QS', 'TD'], 'S'], 300]]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("meld points 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 |
|---|---|---|---|
| meld points case 0 | 300 | 300 | Passed |
| meld points case 1 | 20 | 20 | Passed |
| meld points case 2 | 320 | 320 | Passed |
| meld points case 3 | 1300 | 1300 | Passed |
| meld points case 4 | 170 | 170 | Passed |
| meld points case 5 | 20 | 20 | Passed |
| meld points case 6 | 360 | 360 | Passed |
| meld points case 7 | 120 | 340 | Failed |
SHA-256 / 0f53b89ad10d5458eab4bd528865d2127f2a2d15a3fb3da83cf9d801af9a9b6c
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:24.624120+00:00.
Case digest / d41f7306537c4b5ac70e3d407d6a589ae146c92ca2da6cd840de56a72d25b94d