FAILURE MAP
← Case archive

FA-83786 / Card game rule engines / Open access

Nobody may bid every trick · case 01

A bid equal to the hand size is missing.

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

ROOT CAUSE

The range stops one short.

THE FAILURE

The range stops one short.

Unsuccessful approach: Starting at 1 forbids the zero bid.

Case contract

Input [bids_so_far, players, hand_size]. Bids range 0..hand_size. The last bidder (dealer) may not bid the amount that makes the total of bids equal hand_size. Return the allowed bids ascending.

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):
    bids, players, size = x
    allowed = list(range(size))
    if len(bids) == players - 1:
        forbidden = size - sum(bids)
        allowed = [b for b in allowed if b != forbidden]
    return allowed
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[[], 3, 4], [0, 1, 2, 3, 4]], [[[1, 1, 1, 0], 5, 1], [0, 1]], [[[2], 3, 7], [0, 1, 2, 3, 4, 5, 6, 7]], [[[3], 4, 5], [0, 1, 2, 3, 4, 5]], [[[0, 3], 3, 6], [0, 1, 2, 4, 5, 6]], [[[8, 6], 4, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], [[[2, 3], 4, 3], [0, 1, 2, 3]], [[[1, 1], 5, 1], [0, 1]]], [[[[], 3, 5], [0, 1, 2, 3, 4, 5]], [[[0, 3], 3, 6], [0, 1, 2, 4, 5, 6]], [[[0], 3, 7], [0, 1, 2, 3, 4, 5, 6, 7]], [[[], 3, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], [[[], 4, 1], [0, 1]], [[[0], 4, 4], [0, 1, 2, 3, 4]], [[[2, 5], 5, 7], [0, 1, 2, 3, 4, 5, 6, 7]], [[[0, 0, 4], 4, 4], [1, 2, 3, 4]]], [[[[1, 1, 1, 0], 5, 1], [0, 1]], [[[0], 3, 7], [0, 1, 2, 3, 4, 5, 6, 7]], [[[], 3, 7], [0, 1, 2, 3, 4, 5, 6, 7]], [[[0], 3, 10], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]], [[[8, 2], 3, 8], [0, 1, 2, 3, 4, 5, 6, 7, 8]], [[[3, 5, 0], 5, 5], [0, 1, 2, 3, 4, 5]], [[[], 5, 6], [0, 1, 2, 3, 4, 5, 6]], [[[], 5, 5], [0, 1, 2, 3, 4, 5]]], [[[[2], 3, 7], [0, 1, 2, 3, 4, 5, 6, 7]], [[[0, 0], 3, 4], [0, 1, 2, 3]], [[[2], 4, 2], [0, 1, 2]], [[[4, 2, 0], 5, 10], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]], [[[0], 3, 4], [0, 1, 2, 3, 4]], [[[7], 3, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], [[[], 3, 3], [0, 1, 2, 3]], [[[2, 0, 1], 4, 2], [0, 1, 2]]], [[[[8, 6], 4, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], [[[], 5, 6], [0, 1, 2, 3, 4, 5, 6]], [[[0, 3], 3, 7], [0, 1, 2, 3, 5, 6, 7]], [[[6, 0], 3, 8], [0, 1, 3, 4, 5, 6, 7, 8]], [[[4, 3, 3], 5, 7], [0, 1, 2, 3, 4, 5, 6, 7]], [[[], 3, 5], [0, 1, 2, 3, 4, 5]], [[[2], 5, 10], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]], [[[], 5, 6], [0, 1, 2, 3, 4, 5, 6]]]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check("allowed bids 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
allowed bids case 0[0, 1, 2, 3][0, 1, 2, 3, 4]Failed
allowed bids case 1[0][0, 1]Failed
allowed bids case 2[0, 1, 2, 3, 4, 5, 6][0, 1, 2, 3, 4, 5, 6, 7]Failed
allowed bids case 3[0, 1, 2, 3, 4][0, 1, 2, 3, 4, 5]Failed
allowed bids case 4[0, 1, 2, 4, 5][0, 1, 2, 4, 5, 6]Failed
allowed bids case 5[0, 1, 2, 3, 4, 5, 6, 7, 8][0, 1, 2, 3, 4, 5, 6, 7, 8, 9]Failed
allowed bids case 6[0, 1, 2][0, 1, 2, 3]Failed
allowed bids case 7[0][0, 1]Failed

SHA-256 / 2919e2b27561a7fd156d77aa95164857df3a997ebbc5332fca1b91793267750b

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(x):
    bids, players, size = x
    allowed = list(range(1, size + 1))
    if len(bids) == players - 1:
        forbidden = size - sum(bids)
        allowed = [b for b in allowed if b != forbidden]
    return allowed
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[[], 3, 4], [0, 1, 2, 3, 4]], [[[1, 1, 1, 0], 5, 1], [0, 1]], [[[2], 3, 7], [0, 1, 2, 3, 4, 5, 6, 7]], [[[3], 4, 5], [0, 1, 2, 3, 4, 5]], [[[0, 3], 3, 6], [0, 1, 2, 4, 5, 6]], [[[8, 6], 4, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], [[[2, 3], 4, 3], [0, 1, 2, 3]], [[[1, 1], 5, 1], [0, 1]]], [[[[], 3, 5], [0, 1, 2, 3, 4, 5]], [[[0, 3], 3, 6], [0, 1, 2, 4, 5, 6]], [[[0], 3, 7], [0, 1, 2, 3, 4, 5, 6, 7]], [[[], 3, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], [[[], 4, 1], [0, 1]], [[[0], 4, 4], [0, 1, 2, 3, 4]], [[[2, 5], 5, 7], [0, 1, 2, 3, 4, 5, 6, 7]], [[[0, 0, 4], 4, 4], [1, 2, 3, 4]]], [[[[1, 1, 1, 0], 5, 1], [0, 1]], [[[0], 3, 7], [0, 1, 2, 3, 4, 5, 6, 7]], [[[], 3, 7], [0, 1, 2, 3, 4, 5, 6, 7]], [[[0], 3, 10], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]], [[[8, 2], 3, 8], [0, 1, 2, 3, 4, 5, 6, 7, 8]], [[[3, 5, 0], 5, 5], [0, 1, 2, 3, 4, 5]], [[[], 5, 6], [0, 1, 2, 3, 4, 5, 6]], [[[], 5, 5], [0, 1, 2, 3, 4, 5]]], [[[[2], 3, 7], [0, 1, 2, 3, 4, 5, 6, 7]], [[[0, 0], 3, 4], [0, 1, 2, 3]], [[[2], 4, 2], [0, 1, 2]], [[[4, 2, 0], 5, 10], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]], [[[0], 3, 4], [0, 1, 2, 3, 4]], [[[7], 3, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], [[[], 3, 3], [0, 1, 2, 3]], [[[2, 0, 1], 4, 2], [0, 1, 2]]], [[[[8, 6], 4, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], [[[], 5, 6], [0, 1, 2, 3, 4, 5, 6]], [[[0, 3], 3, 7], [0, 1, 2, 3, 5, 6, 7]], [[[6, 0], 3, 8], [0, 1, 3, 4, 5, 6, 7, 8]], [[[4, 3, 3], 5, 7], [0, 1, 2, 3, 4, 5, 6, 7]], [[[], 3, 5], [0, 1, 2, 3, 4, 5]], [[[2], 5, 10], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]], [[[], 5, 6], [0, 1, 2, 3, 4, 5, 6]]]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check("allowed bids 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
allowed bids case 0[1, 2, 3, 4][0, 1, 2, 3, 4]Failed
allowed bids case 1[1][0, 1]Failed
allowed bids case 2[1, 2, 3, 4, 5, 6, 7][0, 1, 2, 3, 4, 5, 6, 7]Failed
allowed bids case 3[1, 2, 3, 4, 5][0, 1, 2, 3, 4, 5]Failed
allowed bids case 4[1, 2, 4, 5, 6][0, 1, 2, 4, 5, 6]Failed
allowed bids case 5[1, 2, 3, 4, 5, 6, 7, 8, 9][0, 1, 2, 3, 4, 5, 6, 7, 8, 9]Failed
allowed bids case 6[1, 2, 3][0, 1, 2, 3]Failed
allowed bids case 7[1][0, 1]Failed

SHA-256 / 846e7d252d0da66485309a67dbd527a3ff86522b41893b737d68d667e3f4d1d0

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

Case digest / 3e6264abd01b2ee06c34a6e760e0ef3af38f94285200de94b217753d09f4cc59