FAILURE MAP
← Case archive

FA-46081 / Bounded deques / Open access

Partition returns the pre-partition deque as its rejected view · case 01

Partition returns the pre-partition deque as its rejected view.

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

ROOT CAUSE

Partition returns the pre-partition deque as its rejected view.

VERIFIED REPAIR

Restore the documented reject view invariant in stable-partition.

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

Case contract

Stably partition a bounded deque into accepted and rejected values using an explicit set. Return the concatenation, split cursor, and rejected sequence.

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):
    items, allowed = x
    yes = [v for v in items if v in allowed]
    no = [v for v in items if v not in allowed]
    result = yes + no
    boundary = len(yes)
    return [result,boundary,items]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('alternating', solve([[N,N+1,N+2,N+1,N], [N,N+2]]), {1: [[1, 3, 1, 2, 2], 3, [2, 2]], 2: [[2, 4, 2, 3, 3], 3, [3, 3]], 3: [[3, 5, 3, 4, 4], 3, [4, 4]], 4: [[4, 6, 4, 5, 5], 3, [5, 5]], 5: [[5, 7, 5, 6, 6], 3, [6, 6]]}[N])
check('all reject', solve([[N,N+1],[]]), {1: [[1, 2], 0, [1, 2]], 2: [[2, 3], 0, [2, 3]], 3: [[3, 4], 0, [3, 4]], 4: [[4, 5], 0, [4, 5]], 5: [[5, 6], 0, [5, 6]]}[N])
check('all accept', solve([[N,N+1,N],[N,N+1]]), {1: [[1, 2, 1], 3, []], 2: [[2, 3, 2], 3, []], 3: [[3, 4, 3], 3, []], 4: [[4, 5, 4], 3, []], 5: [[5, 6, 5], 3, []]}[N])
check('empty', solve([[],[N]]), {1: [[], 0, []], 2: [[], 0, []], 3: [[], 0, []], 4: [[], 0, []], 5: [[], 0, []]}[N])
check('duplicate reject', solve([[N+1,N,N+1,N+2],[N]]), {1: [[1, 2, 2, 3], 1, [2, 2, 3]], 2: [[2, 3, 3, 4], 1, [3, 3, 4]], 3: [[3, 4, 4, 5], 1, [4, 4, 5]], 4: [[4, 5, 5, 6], 1, [5, 5, 6]], 5: [[5, 6, 6, 7], 1, [6, 6, 7]]}[N])
check('accepted reversed values', solve([[N+2,N,N+1],[N,N+2]]), {1: [[3, 1, 2], 2, [2]], 2: [[4, 2, 3], 2, [3]], 3: [[5, 3, 4], 2, [4]], 4: [[6, 4, 5], 2, [5]], 5: [[7, 5, 6], 2, [6]]}[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
alternating[[1, 3, 1, 2, 2], 3, [1, 2, 3, 2, 1]][[1, 3, 1, 2, 2], 3, [2, 2]]Failed
all reject[[1, 2], 0, [1, 2]][[1, 2], 0, [1, 2]]Passed
all accept[[1, 2, 1], 3, [1, 2, 1]][[1, 2, 1], 3, []]Failed
empty[[], 0, []][[], 0, []]Passed
duplicate reject[[1, 2, 2, 3], 1, [2, 1, 2, 3]][[1, 2, 2, 3], 1, [2, 2, 3]]Failed
accepted reversed values[[3, 1, 2], 2, [3, 1, 2]][[3, 1, 2], 2, [2]]Failed

SHA-256 / c97a9ea4625699970c3016612fc813a82b0a327aed7498bb43ba7ad065f084d2

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(x):
    items, allowed = x
    yes = [v for v in items if v in allowed]
    no = [v for v in items if v not in allowed]
    result = yes + no
    boundary = len(yes)
    return [result,boundary,no if boundary==0 else items]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('alternating', solve([[N,N+1,N+2,N+1,N], [N,N+2]]), {1: [[1, 3, 1, 2, 2], 3, [2, 2]], 2: [[2, 4, 2, 3, 3], 3, [3, 3]], 3: [[3, 5, 3, 4, 4], 3, [4, 4]], 4: [[4, 6, 4, 5, 5], 3, [5, 5]], 5: [[5, 7, 5, 6, 6], 3, [6, 6]]}[N])
check('all reject', solve([[N,N+1],[]]), {1: [[1, 2], 0, [1, 2]], 2: [[2, 3], 0, [2, 3]], 3: [[3, 4], 0, [3, 4]], 4: [[4, 5], 0, [4, 5]], 5: [[5, 6], 0, [5, 6]]}[N])
check('all accept', solve([[N,N+1,N],[N,N+1]]), {1: [[1, 2, 1], 3, []], 2: [[2, 3, 2], 3, []], 3: [[3, 4, 3], 3, []], 4: [[4, 5, 4], 3, []], 5: [[5, 6, 5], 3, []]}[N])
check('empty', solve([[],[N]]), {1: [[], 0, []], 2: [[], 0, []], 3: [[], 0, []], 4: [[], 0, []], 5: [[], 0, []]}[N])
check('duplicate reject', solve([[N+1,N,N+1,N+2],[N]]), {1: [[1, 2, 2, 3], 1, [2, 2, 3]], 2: [[2, 3, 3, 4], 1, [3, 3, 4]], 3: [[3, 4, 4, 5], 1, [4, 4, 5]], 4: [[4, 5, 5, 6], 1, [5, 5, 6]], 5: [[5, 6, 6, 7], 1, [6, 6, 7]]}[N])
check('accepted reversed values', solve([[N+2,N,N+1],[N,N+2]]), {1: [[3, 1, 2], 2, [2]], 2: [[4, 2, 3], 2, [3]], 3: [[5, 3, 4], 2, [4]], 4: [[6, 4, 5], 2, [5]], 5: [[7, 5, 6], 2, [6]]}[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
alternating[[1, 3, 1, 2, 2], 3, [1, 2, 3, 2, 1]][[1, 3, 1, 2, 2], 3, [2, 2]]Failed
all reject[[1, 2], 0, [1, 2]][[1, 2], 0, [1, 2]]Passed
all accept[[1, 2, 1], 3, [1, 2, 1]][[1, 2, 1], 3, []]Failed
empty[[], 0, []][[], 0, []]Passed
duplicate reject[[1, 2, 2, 3], 1, [2, 1, 2, 3]][[1, 2, 2, 3], 1, [2, 2, 3]]Failed
accepted reversed values[[3, 1, 2], 2, [3, 1, 2]][[3, 1, 2], 2, [2]]Failed

SHA-256 / bde2a37ab0bcade3a83f8a1ee849b6908bede46bd116503e2070d7b5740ee8ee

3 / The verified repair

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

N = 1
observations = []
def solve(x):
    items, allowed = x
    yes = [v for v in items if v in allowed]
    no = [v for v in items if v not in allowed]
    result = yes + no
    boundary = len(yes)
    return [result,boundary,no]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('alternating', solve([[N,N+1,N+2,N+1,N], [N,N+2]]), {1: [[1, 3, 1, 2, 2], 3, [2, 2]], 2: [[2, 4, 2, 3, 3], 3, [3, 3]], 3: [[3, 5, 3, 4, 4], 3, [4, 4]], 4: [[4, 6, 4, 5, 5], 3, [5, 5]], 5: [[5, 7, 5, 6, 6], 3, [6, 6]]}[N])
check('all reject', solve([[N,N+1],[]]), {1: [[1, 2], 0, [1, 2]], 2: [[2, 3], 0, [2, 3]], 3: [[3, 4], 0, [3, 4]], 4: [[4, 5], 0, [4, 5]], 5: [[5, 6], 0, [5, 6]]}[N])
check('all accept', solve([[N,N+1,N],[N,N+1]]), {1: [[1, 2, 1], 3, []], 2: [[2, 3, 2], 3, []], 3: [[3, 4, 3], 3, []], 4: [[4, 5, 4], 3, []], 5: [[5, 6, 5], 3, []]}[N])
check('empty', solve([[],[N]]), {1: [[], 0, []], 2: [[], 0, []], 3: [[], 0, []], 4: [[], 0, []], 5: [[], 0, []]}[N])
check('duplicate reject', solve([[N+1,N,N+1,N+2],[N]]), {1: [[1, 2, 2, 3], 1, [2, 2, 3]], 2: [[2, 3, 3, 4], 1, [3, 3, 4]], 3: [[3, 4, 4, 5], 1, [4, 4, 5]], 4: [[4, 5, 5, 6], 1, [5, 5, 6]], 5: [[5, 6, 6, 7], 1, [6, 6, 7]]}[N])
check('accepted reversed values', solve([[N+2,N,N+1],[N,N+2]]), {1: [[3, 1, 2], 2, [2]], 2: [[4, 2, 3], 2, [3]], 3: [[5, 3, 4], 2, [4]], 4: [[6, 4, 5], 2, [5]], 5: [[7, 5, 6], 2, [6]]}[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
alternating[[1, 3, 1, 2, 2], 3, [2, 2]][[1, 3, 1, 2, 2], 3, [2, 2]]Passed
all reject[[1, 2], 0, [1, 2]][[1, 2], 0, [1, 2]]Passed
all accept[[1, 2, 1], 3, []][[1, 2, 1], 3, []]Passed
empty[[], 0, []][[], 0, []]Passed
duplicate reject[[1, 2, 2, 3], 1, [2, 2, 3]][[1, 2, 2, 3], 1, [2, 2, 3]]Passed
accepted reversed values[[3, 1, 2], 2, [2]][[3, 1, 2], 2, [2]]Passed

SHA-256 / 6355d21b6e51fde06e1f0b0f07a1c314302d97dc46b46ecab84bdd2a4933087e

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

Case digest / f918b98c3588209dfb7d7d05a97e02fc2771a3380d37ba2703227c6cb880ded7