FAILURE MAP
← Case archive

FA-46466 / Bounded deques / Open access

Deque block release frees borrowed storage · case 01

Deque block release frees borrowed storage.

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

ROOT CAUSE

Deque block release frees borrowed storage.

VERIFIED REPAIR

Restore the documented borrow barrier invariant in block-release.

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

Case contract

A deque block with outstanding borrowers cannot be freed. Otherwise clear its live references, append to a bounded free-block cache and dispose the oldest surplus block identities.

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):
    pool,identity,borrowed,limit,live=x
    if False:return [pool,False,live,[]]
    references=[]
    combined=pool+[identity]
    saved=combined[-limit:] if limit else []
    disposed=combined[:len(combined)-len(saved)]
    return [saved,True,references,disposed]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[1,2],3,False,2,[N,N+1]]), {1: [[2, 3], True, [], [1]], 2: [[2, 3], True, [], [1]], 3: [[2, 3], True, [], [1]], 4: [[2, 3], True, [], [1]], 5: [[2, 3], True, [], [1]]}[N])
check('1', solve([[1],2,True,3,[N]]), {1: [[1], False, [1], []], 2: [[1], False, [2], []], 3: [[1], False, [3], []], 4: [[1], False, [4], []], 5: [[1], False, [5], []]}[N])
check('2', solve([[],4,False,0,[N,N+1]]), {1: [[], True, [], [4]], 2: [[], True, [], [4]], 3: [[], True, [], [4]], 4: [[], True, [], [4]], 5: [[], True, [], [4]]}[N])
check('3', solve([[2],5,False,3,[N]]), {1: [[2, 5], True, [], []], 2: [[2, 5], True, [], []], 3: [[2, 5], True, [], []], 4: [[2, 5], True, [], []], 5: [[2, 5], True, [], []]}[N])
check('4', solve([[1,2,3],4,False,1,[N]]), {1: [[4], True, [], [1, 2, 3]], 2: [[4], True, [], [1, 2, 3]], 3: [[4], True, [], [1, 2, 3]], 4: [[4], True, [], [1, 2, 3]], 5: [[4], True, [], [1, 2, 3]]}[N])
check('5', solve([[],7,False,2,[]]), {1: [[7], True, [], []], 2: [[7], True, [], []], 3: [[7], True, [], []], 4: [[7], True, [], []], 5: [[7], True, [], []]}[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[[2, 3], True, [], [1]][[2, 3], True, [], [1]]Passed
1[[1, 2], True, [], []][[1], False, [1], []]Failed
2[[], True, [], [4]][[], True, [], [4]]Passed
3[[2, 5], True, [], []][[2, 5], True, [], []]Passed
4[[4], True, [], [1, 2, 3]][[4], True, [], [1, 2, 3]]Passed
5[[7], True, [], []][[7], True, [], []]Passed

SHA-256 / e4e5b6d465c33a4be55b4c2f74489bd5d50fc1315022c45841ad1a0f2148a06c

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(x):
    pool,identity,borrowed,limit,live=x
    if borrowed and not live:return [pool,False,live,[]]
    references=[]
    combined=pool+[identity]
    saved=combined[-limit:] if limit else []
    disposed=combined[:len(combined)-len(saved)]
    return [saved,True,references,disposed]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[1,2],3,False,2,[N,N+1]]), {1: [[2, 3], True, [], [1]], 2: [[2, 3], True, [], [1]], 3: [[2, 3], True, [], [1]], 4: [[2, 3], True, [], [1]], 5: [[2, 3], True, [], [1]]}[N])
check('1', solve([[1],2,True,3,[N]]), {1: [[1], False, [1], []], 2: [[1], False, [2], []], 3: [[1], False, [3], []], 4: [[1], False, [4], []], 5: [[1], False, [5], []]}[N])
check('2', solve([[],4,False,0,[N,N+1]]), {1: [[], True, [], [4]], 2: [[], True, [], [4]], 3: [[], True, [], [4]], 4: [[], True, [], [4]], 5: [[], True, [], [4]]}[N])
check('3', solve([[2],5,False,3,[N]]), {1: [[2, 5], True, [], []], 2: [[2, 5], True, [], []], 3: [[2, 5], True, [], []], 4: [[2, 5], True, [], []], 5: [[2, 5], True, [], []]}[N])
check('4', solve([[1,2,3],4,False,1,[N]]), {1: [[4], True, [], [1, 2, 3]], 2: [[4], True, [], [1, 2, 3]], 3: [[4], True, [], [1, 2, 3]], 4: [[4], True, [], [1, 2, 3]], 5: [[4], True, [], [1, 2, 3]]}[N])
check('5', solve([[],7,False,2,[]]), {1: [[7], True, [], []], 2: [[7], True, [], []], 3: [[7], True, [], []], 4: [[7], True, [], []], 5: [[7], True, [], []]}[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[[2, 3], True, [], [1]][[2, 3], True, [], [1]]Passed
1[[1, 2], True, [], []][[1], False, [1], []]Failed
2[[], True, [], [4]][[], True, [], [4]]Passed
3[[2, 5], True, [], []][[2, 5], True, [], []]Passed
4[[4], True, [], [1, 2, 3]][[4], True, [], [1, 2, 3]]Passed
5[[7], True, [], []][[7], True, [], []]Passed

SHA-256 / 2b900a19f19cc1cb98f0bd28672e24733766954b8679c3960fc87a1371166cd5

3 / The verified repair

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

N = 1
observations = []
def solve(x):
    pool,identity,borrowed,limit,live=x
    if borrowed:return [pool,False,live,[]]
    references=[]
    combined=pool+[identity]
    saved=combined[-limit:] if limit else []
    disposed=combined[:len(combined)-len(saved)]
    return [saved,True,references,disposed]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[1,2],3,False,2,[N,N+1]]), {1: [[2, 3], True, [], [1]], 2: [[2, 3], True, [], [1]], 3: [[2, 3], True, [], [1]], 4: [[2, 3], True, [], [1]], 5: [[2, 3], True, [], [1]]}[N])
check('1', solve([[1],2,True,3,[N]]), {1: [[1], False, [1], []], 2: [[1], False, [2], []], 3: [[1], False, [3], []], 4: [[1], False, [4], []], 5: [[1], False, [5], []]}[N])
check('2', solve([[],4,False,0,[N,N+1]]), {1: [[], True, [], [4]], 2: [[], True, [], [4]], 3: [[], True, [], [4]], 4: [[], True, [], [4]], 5: [[], True, [], [4]]}[N])
check('3', solve([[2],5,False,3,[N]]), {1: [[2, 5], True, [], []], 2: [[2, 5], True, [], []], 3: [[2, 5], True, [], []], 4: [[2, 5], True, [], []], 5: [[2, 5], True, [], []]}[N])
check('4', solve([[1,2,3],4,False,1,[N]]), {1: [[4], True, [], [1, 2, 3]], 2: [[4], True, [], [1, 2, 3]], 3: [[4], True, [], [1, 2, 3]], 4: [[4], True, [], [1, 2, 3]], 5: [[4], True, [], [1, 2, 3]]}[N])
check('5', solve([[],7,False,2,[]]), {1: [[7], True, [], []], 2: [[7], True, [], []], 3: [[7], True, [], []], 4: [[7], True, [], []], 5: [[7], True, [], []]}[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[[2, 3], True, [], [1]][[2, 3], True, [], [1]]Passed
1[[1], False, [1], []][[1], False, [1], []]Passed
2[[], True, [], [4]][[], True, [], [4]]Passed
3[[2, 5], True, [], []][[2, 5], True, [], []]Passed
4[[4], True, [], [1, 2, 3]][[4], True, [], [1, 2, 3]]Passed
5[[7], True, [], []][[7], True, [], []]Passed

SHA-256 / e0dfa3c1510b34330ba19826d7a1d23d2fa44d854fcb297a228cd8d550ed424f

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

Case digest / f3e51a49a1ff2a4c123e33d2c2ec5fdb060757bf1e1be09ef6cc0707fcbba3a7