FAILURE MAP
← Case archive

FA-46846 / Bounded deques / Open access

Producer scheduler wakes every queued producer after a partial grant · case 01

Producer scheduler wakes every queued producer after a partial grant.

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

ROOT CAUSE

Producer scheduler wakes every queued producer after a partial grant.

VERIFIED REPAIR

Restore the documented wake receipt 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[room:]
    result=a+[w[1] for w in selected]
    resumed=[w[0] for w in active]
    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]], [1], [], 0][[1, 2], [[1, 3]], [], [], 0]Failed
2[[1, 2], [[3, 3]], [1, 2, 3], [], 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], [[3, 4]], [2, 3], [1], 0][[1, 3], [[3, 4]], [2], [1], 0]Failed

SHA-256 / d7dfd908a27406d10b4c0a71e4549f4652c44b0846b84b328fbc392e006a50d7

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=active[room:]
    result=a+[w[1] for w in selected]
    resumed=[w[0] for w in (selected if room==0 else active)]
    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, 3], [], 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], [[3, 4]], [2, 3], [1], 0][[1, 3], [[3, 4]], [2], [1], 0]Failed

SHA-256 / 016f6a2579f0deb68deb437c9925b4eb05416ea32ed7feb71735a9d9b250881f

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

Case digest / fc0c7085b4f495942c7920b9dee5df37e6f8738182ad4ed2b0bd2dab18499b1c