FAILURE MAP
← Case archive

FA-46836 / Bounded deques / Open access

Resumed deque producer stays registered as blocked · case 01

Resumed deque producer stays registered as blocked.

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

ROOT CAUSE

Resumed deque producer stays registered as blocked.

VERIFIED REPAIR

Restore the documented waiter removal invariant in producer-waiters.

Unsuccessful approach: The partial repair still applies the incorrect transition to an admitted boundary or multi-element case.

Case contract

After cancellation by waiter identity, fill free bounded-deque slots from FIFO blocked producers. Return updated queue, remaining waiters, resumed IDs, cancelled IDs and remaining free slots.

Why this case matters

Controlled bounded deque implementation model with explicit storage and lifecycle observations.

1 / The failure

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

N = 1
observations = []
def solve(x):
    a,cap,waiters,cancel=x
    active=[w for w in waiters if w[0]!=cancel]
    cancelled=[w[0] for w in waiters if w[0]==cancel]
    room=cap-len(a)
    selected=active[:room]
    remaining=active
    result=a+[w[1] for w in selected]
    resumed=[w[0] for w in selected]
    return [result,remaining,resumed,cancelled,room-len(selected)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[N],3,[[1,N+1],[2,N+2],[3,N+3]],2]), {1: [[1, 2, 4], [], [1, 3], [2], 0], 2: [[2, 3, 5], [], [1, 3], [2], 0], 3: [[3, 4, 6], [], [1, 3], [2], 0], 4: [[4, 5, 7], [], [1, 3], [2], 0], 5: [[5, 6, 8], [], [1, 3], [2], 0]}[N])
check('1', solve([[N,N+1],2,[[1,N+2]],9]), {1: [[1, 2], [[1, 3]], [], [], 0], 2: [[2, 3], [[1, 4]], [], [], 0], 3: [[3, 4], [[1, 5]], [], [], 0], 4: [[4, 5], [[1, 6]], [], [], 0], 5: [[5, 6], [[1, 7]], [], [], 0]}[N])
check('2', solve([[],2,[[1,N],[2,N+1],[3,N+2]],9]), {1: [[1, 2], [[3, 3]], [1, 2], [], 0], 2: [[2, 3], [[3, 4]], [1, 2], [], 0], 3: [[3, 4], [[3, 5]], [1, 2], [], 0], 4: [[4, 5], [[3, 6]], [1, 2], [], 0], 5: [[5, 6], [[3, 7]], [1, 2], [], 0]}[N])
check('3', solve([[N],4,[],8]), {1: [[1], [], [], [], 3], 2: [[2], [], [], [], 3], 3: [[3], [], [], [], 3], 4: [[4], [], [], [], 3], 5: [[5], [], [], [], 3]}[N])
check('4', solve([[],3,[[1,N],[2,N]],1]), {1: [[1], [], [2], [1], 2], 2: [[2], [], [2], [1], 2], 3: [[3], [], [2], [1], 2], 4: [[4], [], [2], [1], 2], 5: [[5], [], [2], [1], 2]}[N])
check('5', solve([[N],2,[[1,N+1],[2,N+2],[3,N+3]],1]), {1: [[1, 3], [[3, 4]], [2], [1], 0], 2: [[2, 4], [[3, 5]], [2], [1], 0], 3: [[3, 5], [[3, 6]], [2], [1], 0], 4: [[4, 6], [[3, 7]], [2], [1], 0], 5: [[5, 7], [[3, 8]], [2], [1], 0]}[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
0[[1, 2, 4], [[1, 2], [3, 4]], [1, 3], [2], 0][[1, 2, 4], [], [1, 3], [2], 0]Failed
1[[1, 2], [[1, 3]], [], [], 0][[1, 2], [[1, 3]], [], [], 0]Passed
2[[1, 2], [[1, 1], [2, 2], [3, 3]], [1, 2], [], 0][[1, 2], [[3, 3]], [1, 2], [], 0]Failed
3[[1], [], [], [], 3][[1], [], [], [], 3]Passed
4[[1], [[2, 1]], [2], [1], 2][[1], [], [2], [1], 2]Failed
5[[1, 3], [[2, 3], [3, 4]], [2], [1], 0][[1, 3], [[3, 4]], [2], [1], 0]Failed

SHA-256 / 4018b87ad68e972c84ca08be310b0d2a126d389b83be2f29b24ef4eaaf9def43

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(x):
    a,cap,waiters,cancel=x
    active=[w for w in waiters if w[0]!=cancel]
    cancelled=[w[0] for w in waiters if w[0]==cancel]
    room=cap-len(a)
    selected=active[:room]
    remaining=[] if len(active)<=room else active
    result=a+[w[1] for w in selected]
    resumed=[w[0] for w in selected]
    return [result,remaining,resumed,cancelled,room-len(selected)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[N],3,[[1,N+1],[2,N+2],[3,N+3]],2]), {1: [[1, 2, 4], [], [1, 3], [2], 0], 2: [[2, 3, 5], [], [1, 3], [2], 0], 3: [[3, 4, 6], [], [1, 3], [2], 0], 4: [[4, 5, 7], [], [1, 3], [2], 0], 5: [[5, 6, 8], [], [1, 3], [2], 0]}[N])
check('1', solve([[N,N+1],2,[[1,N+2]],9]), {1: [[1, 2], [[1, 3]], [], [], 0], 2: [[2, 3], [[1, 4]], [], [], 0], 3: [[3, 4], [[1, 5]], [], [], 0], 4: [[4, 5], [[1, 6]], [], [], 0], 5: [[5, 6], [[1, 7]], [], [], 0]}[N])
check('2', solve([[],2,[[1,N],[2,N+1],[3,N+2]],9]), {1: [[1, 2], [[3, 3]], [1, 2], [], 0], 2: [[2, 3], [[3, 4]], [1, 2], [], 0], 3: [[3, 4], [[3, 5]], [1, 2], [], 0], 4: [[4, 5], [[3, 6]], [1, 2], [], 0], 5: [[5, 6], [[3, 7]], [1, 2], [], 0]}[N])
check('3', solve([[N],4,[],8]), {1: [[1], [], [], [], 3], 2: [[2], [], [], [], 3], 3: [[3], [], [], [], 3], 4: [[4], [], [], [], 3], 5: [[5], [], [], [], 3]}[N])
check('4', solve([[],3,[[1,N],[2,N]],1]), {1: [[1], [], [2], [1], 2], 2: [[2], [], [2], [1], 2], 3: [[3], [], [2], [1], 2], 4: [[4], [], [2], [1], 2], 5: [[5], [], [2], [1], 2]}[N])
check('5', solve([[N],2,[[1,N+1],[2,N+2],[3,N+3]],1]), {1: [[1, 3], [[3, 4]], [2], [1], 0], 2: [[2, 4], [[3, 5]], [2], [1], 0], 3: [[3, 5], [[3, 6]], [2], [1], 0], 4: [[4, 6], [[3, 7]], [2], [1], 0], 5: [[5, 7], [[3, 8]], [2], [1], 0]}[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
0[[1, 2, 4], [], [1, 3], [2], 0][[1, 2, 4], [], [1, 3], [2], 0]Passed
1[[1, 2], [[1, 3]], [], [], 0][[1, 2], [[1, 3]], [], [], 0]Passed
2[[1, 2], [[1, 1], [2, 2], [3, 3]], [1, 2], [], 0][[1, 2], [[3, 3]], [1, 2], [], 0]Failed
3[[1], [], [], [], 3][[1], [], [], [], 3]Passed
4[[1], [], [2], [1], 2][[1], [], [2], [1], 2]Passed
5[[1, 3], [[2, 3], [3, 4]], [2], [1], 0][[1, 3], [[3, 4]], [2], [1], 0]Failed

SHA-256 / ebc976cb0edfde274f776436c690436238ab73028c8ab60aa15b5609f87dd342

3 / The verified repair

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

N = 1
observations = []
def solve(x):
    a,cap,waiters,cancel=x
    active=[w for w in waiters if w[0]!=cancel]
    cancelled=[w[0] for w in waiters if w[0]==cancel]
    room=cap-len(a)
    selected=active[:room]
    remaining=active[room:]
    result=a+[w[1] for w in selected]
    resumed=[w[0] for w in selected]
    return [result,remaining,resumed,cancelled,room-len(selected)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[N],3,[[1,N+1],[2,N+2],[3,N+3]],2]), {1: [[1, 2, 4], [], [1, 3], [2], 0], 2: [[2, 3, 5], [], [1, 3], [2], 0], 3: [[3, 4, 6], [], [1, 3], [2], 0], 4: [[4, 5, 7], [], [1, 3], [2], 0], 5: [[5, 6, 8], [], [1, 3], [2], 0]}[N])
check('1', solve([[N,N+1],2,[[1,N+2]],9]), {1: [[1, 2], [[1, 3]], [], [], 0], 2: [[2, 3], [[1, 4]], [], [], 0], 3: [[3, 4], [[1, 5]], [], [], 0], 4: [[4, 5], [[1, 6]], [], [], 0], 5: [[5, 6], [[1, 7]], [], [], 0]}[N])
check('2', solve([[],2,[[1,N],[2,N+1],[3,N+2]],9]), {1: [[1, 2], [[3, 3]], [1, 2], [], 0], 2: [[2, 3], [[3, 4]], [1, 2], [], 0], 3: [[3, 4], [[3, 5]], [1, 2], [], 0], 4: [[4, 5], [[3, 6]], [1, 2], [], 0], 5: [[5, 6], [[3, 7]], [1, 2], [], 0]}[N])
check('3', solve([[N],4,[],8]), {1: [[1], [], [], [], 3], 2: [[2], [], [], [], 3], 3: [[3], [], [], [], 3], 4: [[4], [], [], [], 3], 5: [[5], [], [], [], 3]}[N])
check('4', solve([[],3,[[1,N],[2,N]],1]), {1: [[1], [], [2], [1], 2], 2: [[2], [], [2], [1], 2], 3: [[3], [], [2], [1], 2], 4: [[4], [], [2], [1], 2], 5: [[5], [], [2], [1], 2]}[N])
check('5', solve([[N],2,[[1,N+1],[2,N+2],[3,N+3]],1]), {1: [[1, 3], [[3, 4]], [2], [1], 0], 2: [[2, 4], [[3, 5]], [2], [1], 0], 3: [[3, 5], [[3, 6]], [2], [1], 0], 4: [[4, 6], [[3, 7]], [2], [1], 0], 5: [[5, 7], [[3, 8]], [2], [1], 0]}[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
0[[1, 2, 4], [], [1, 3], [2], 0][[1, 2, 4], [], [1, 3], [2], 0]Passed
1[[1, 2], [[1, 3]], [], [], 0][[1, 2], [[1, 3]], [], [], 0]Passed
2[[1, 2], [[3, 3]], [1, 2], [], 0][[1, 2], [[3, 3]], [1, 2], [], 0]Passed
3[[1], [], [], [], 3][[1], [], [], [], 3]Passed
4[[1], [], [2], [1], 2][[1], [], [2], [1], 2]Passed
5[[1, 3], [[3, 4]], [2], [1], 0][[1, 3], [[3, 4]], [2], [1], 0]Passed

SHA-256 / 541bb5005675062bbde1975109dd95832353d2621e984dbf350b18742fb6d466

Verification & scope

Offline finite deterministic model; no claim of production implementation or concurrent memory-model conformance. 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:44:35.868408+00:00.

Case digest / 067885df4948d526b749e6c79bf3b8ee6b83c50d8dc049c969f6ec3812a71bf4