prompt:
Copy-on-write exposes detached writes through the old view.

Write one logical deque position under copy-on-write. Shared storage is detached, leaving the old view unchanged and decrementing its reference count. Exclusive storage keeps identity. Every write advances the value epoch.

split: open-access


meaning: Fixture-count band, not measured model difficulty

deps: stdlib

prompt:
Copy-on-write detachment releases every old owner.

Write one logical deque position under copy-on-write. Shared storage is detached, leaving the old view unchanged and decrementing its reference count. Exclusive storage keeps identity. Every write advances the value epoch.

split: open-access


prompt:
Copy-on-write clone inherits the old sharing count.

Write one logical deque position under copy-on-write. Shared storage is detached, leaving the old view unchanged and decrementing its reference count. Exclusive storage keeps identity. Every write advances the value epoch.

split: open-access


prompt:
Copy-on-write clone retains old storage identity.

Write one logical deque position under copy-on-write. Shared storage is detached, leaving the old view unchanged and decrementing its reference count. Exclusive storage keeps identity. Every write advances the value epoch.

split: open-access


prompt:
Exclusive deque writes consume unused storage IDs.

Write one logical deque position under copy-on-write. Shared storage is detached, leaving the old view unchanged and decrementing its reference count. Exclusive storage keeps identity. Every write advances the value epoch.

split: open-access


prompt:
Deque range view pins the block at its exclusive stop.

Create a read-only deque block-range view over a valid half-open block interval. Pin each selected block exactly once, allocate one view identity, and retain the parent owner ID.

split: open-access


prompt:
Deque block view overwrites existing pin counts.

Create a read-only deque block-range view over a valid half-open block interval. Pin each selected block exactly once, allocate one view identity, and retain the parent owner ID.

split: open-access


prompt:
Deque block view reuses its parent identity.

Create a read-only deque block-range view over a valid half-open block interval. Pin each selected block exactly once, allocate one view identity, and retain the parent owner ID.

split: open-access


prompt:
Deque block view consumes one ID per selected block.

Create a read-only deque block-range view over a valid half-open block interval. Pin each selected block exactly once, allocate one view identity, and retain the parent owner ID.

split: open-access


prompt:
Deque view binds its owner to the first selected block.

Create a read-only deque block-range view over a valid half-open block interval. Pin each selected block exactly once, allocate one view identity, and retain the parent owner ID.

split: open-access


prompt:
Deque snapshot view is accidentally write-enabled.

Create a read-only deque block-range view over a valid half-open block interval. Pin each selected block exactly once, allocate one view identity, and retain the parent owner ID.

split: open-access


prompt:
Deque block view reports the parent directory length.

Create a read-only deque block-range view over a valid half-open block interval. Pin each selected block exactly once, allocate one view identity, and retain the parent owner ID.

split: open-access


prompt:
Deque retirement clears the neighboring slot instead of its target.

Retire one occupied deque slot. Clear its payload, advance that slot generation, append its index to the free list, decrement live count and invalidate the retired [index,generation] handle.

split: open-access


prompt:
Deque retirement advances every slot generation.

Retire one occupied deque slot. Clear its payload, advance that slot generation, append its index to the free list, decrement live count and invalidate the retired [index,generation] handle.

split: open-access


prompt:
Retired deque slot is prepended to FIFO reuse order.

Retire one occupied deque slot. Clear its payload, advance that slot generation, append its index to the free list, decrement live count and invalidate the retired [index,generation] handle.

split: open-access


prompt:
Deque retirement treats free-list length as live occupancy.

Retire one occupied deque slot. Clear its payload, advance that slot generation, append its index to the free list, decrement live count and invalidate the retired [index,generation] handle.

split: open-access


prompt:
Retirement receipt records the replacement handle generation.

Retire one occupied deque slot. Clear its payload, advance that slot generation, append its index to the free list, decrement live count and invalidate the retired [index,generation] handle.

split: open-access


prompt:
Retired deque handle remains marked usable.

Retire one occupied deque slot. Clear its payload, advance that slot generation, append its index to the free list, decrement live count and invalidate the retired [index,generation] handle.

split: open-access


prompt:
Deque retirement reports free capacity before returning its slot.

Retire one occupied deque slot. Clear its payload, advance that slot generation, append its index to the free list, decrement live count and invalidate the retired [index,generation] handle.

split: open-access


prompt:
Deque borrow validates against allocation capacity instead of live extent.

Borrow a valid logical subrange from a bounded ring as at most two physical spans. Reject negative or out-of-live-range requests. Borrow captures the current epoch and pins storage only for nonempty ranges.

split: open-access


prompt:
Deque borrow accepts a negative logical start.

Borrow a valid logical subrange from a bounded ring as at most two physical spans. Reject negative or out-of-live-range requests. Borrow captures the current epoch and pins storage only for nonempty ranges.

split: open-access


prompt:
Deque borrow forgets the requested logical displacement.

Borrow a valid logical subrange from a bounded ring as at most two physical spans. Reject negative or out-of-live-range requests. Borrow captures the current epoch and pins storage only for nonempty ranges.

split: open-access


prompt:
Deque borrow uses the live count as its physical contiguous span.

Borrow a valid logical subrange from a bounded ring as at most two physical spans. Reject negative or out-of-live-range requests. Borrow captures the current epoch and pins storage only for nonempty ranges.

split: open-access


prompt:
Wrapped borrow resumes after slot zero.

Borrow a valid logical subrange from a bounded ring as at most two physical spans. Reject negative or out-of-live-range requests. Borrow captures the current epoch and pins storage only for nonempty ranges.

split: open-access


prompt:
Deque borrow captures a future storage generation.

Borrow a valid logical subrange from a bounded ring as at most two physical spans. Reject negative or out-of-live-range requests. Borrow captures the current epoch and pins storage only for nonempty ranges.

split: open-access


prompt:
Empty deque borrow unnecessarily pins backing storage.

Borrow a valid logical subrange from a bounded ring as at most two physical spans. Reject negative or out-of-live-range requests. Borrow captures the current epoch and pins storage only for nonempty ranges.

split: open-access


prompt:
Deque iterator detects only increasing generation changes.

A fail-fast deque iterator tracks consumed logical count, captured structural epoch and traversal direction. Read at most limit elements; stale iterators emit no items and preserve position.

split: open-access


prompt:
Stale deque iterator advances before reporting invalidation.

A fail-fast deque iterator tracks consumed logical count, captured structural epoch and traversal direction. Read at most limit elements; stale iterators emit no items and preserve position.

split: open-access


prompt:
Deque iterator batch counts entries before its cursor as remaining.

A fail-fast deque iterator tracks consumed logical count, captured structural epoch and traversal direction. Read at most limit elements; stale iterators emit no items and preserve position.

split: open-access


prompt:
Deque iterator ignores the requested batch ceiling.

A fail-fast deque iterator tracks consumed logical count, captured structural epoch and traversal direction. Read at most limit elements; stale iterators emit no items and preserve position.

split: open-access


prompt:
Reverse deque iterator reads the forward storage sequence.

A fail-fast deque iterator tracks consumed logical count, captured structural epoch and traversal direction. Read at most limit elements; stale iterators emit no items and preserve position.

split: open-access


prompt:
Deque iterator rereads the beginning on subsequent batches.

A fail-fast deque iterator tracks consumed logical count, captured structural epoch and traversal direction. Read at most limit elements; stale iterators emit no items and preserve position.

split: open-access


prompt:
Deque iterator advances by request rather than actual delivery.

A fail-fast deque iterator tracks consumed logical count, captured structural epoch and traversal direction. Read at most limit elements; stale iterators emit no items and preserve position.

split: open-access


prompt:
Deque iterator split measures absolute stop as range length.

Split an iterator range into disjoint prefix and suffix if its length meets a positive minimum. Both halves retain the same captured deque epoch and cover every original element exactly once.

split: open-access


prompt:
Deque iterator refuses ranges at the minimum split length.

Split an iterator range into disjoint prefix and suffix if its length meets a positive minimum. Both halves retain the same captured deque epoch and cover every original element exactly once.

split: open-access


prompt:
Deque iterator split places midpoint relative to zero.

Split an iterator range into disjoint prefix and suffix if its length meets a positive minimum. Both halves retain the same captured deque epoch and cover every original element exactly once.

split: open-access


prompt:
Split prefix captures a new rather than original deque epoch.

Split an iterator range into disjoint prefix and suffix if its length meets a positive minimum. Both halves retain the same captured deque epoch and cover every original element exactly once.

split: open-access


prompt:
Iterator split leaves an overlap at its midpoint.

Split an iterator range into disjoint prefix and suffix if its length meets a positive minimum. Both halves retain the same captured deque epoch and cover every original element exactly once.

split: open-access


prompt:
Deque split traversal skips the first suffix element.

Split an iterator range into disjoint prefix and suffix if its length meets a positive minimum. Both halves retain the same captured deque epoch and cover every original element exactly once.

split: open-access


prompt:
Failed deque iterator split resets the retained start position.

Split an iterator range into disjoint prefix and suffix if its length meets a positive minimum. Both halves retain the same captured deque epoch and cover every original element exactly once.

split: open-access


prompt:
Bookmark batch insertion checks only current occupancy.

Insert a batch at a deque gap atomically. Left-biased bookmarks at that gap stay before inserted values, right-biased bookmarks move after them, and later gaps shift by inserted length.

split: open-access


prompt:
Bookmark insertion appends its values at the tail.

Insert a batch at a deque gap atomically. Left-biased bookmarks at that gap stay before inserted values, right-biased bookmarks move after them, and later gaps shift by inserted length.

split: open-access


prompt:
Deque gap insertion shifts left-biased bookmarks at the insertion point.

Insert a batch at a deque gap atomically. Left-biased bookmarks at that gap stay before inserted values, right-biased bookmarks move after them, and later gaps shift by inserted length.

split: open-access


prompt:
Deque gap insertion shifts only bookmarks at the exact insertion point.

Insert a batch at a deque gap atomically. Left-biased bookmarks at that gap stay before inserted values, right-biased bookmarks move after them, and later gaps shift by inserted length.

split: open-access


prompt:
Deque gap insertion shifts bookmarks by one rather than batch length.

Insert a batch at a deque gap atomically. Left-biased bookmarks at that gap stay before inserted values, right-biased bookmarks move after them, and later gaps shift by inserted length.

split: open-access


prompt:
Deque gap insertion erases bookmark bias.

Insert a batch at a deque gap atomically. Left-biased bookmarks at that gap stay before inserted values, right-biased bookmarks move after them, and later gaps shift by inserted length.

split: open-access


prompt:
Deque batch insertion resumes at the original gap.

Insert a batch at a deque gap atomically. Left-biased bookmarks at that gap stay before inserted values, right-biased bookmarks move after them, and later gaps shift by inserted length.

split: open-access


prompt:
Deque transaction accepts a snapshot from a future epoch.

Publish a complete staged bounded deque only if its captured epoch matches, its occupancy fits and allocation credits suffice. Failure preserves state, epoch and credits; success retires the old snapshot.

split: open-access


prompt:
Deque transaction validates old rather than staged occupancy.

Publish a complete staged bounded deque only if its captured epoch matches, its occupancy fits and allocation credits suffice. Failure preserves state, epoch and credits; success retires the old snapshot.

split: open-access


prompt:
Deque transaction accepts insufficient allocation credits.

Publish a complete staged bounded deque only if its captured epoch matches, its occupancy fits and allocation credits suffice. Failure preserves state, epoch and credits; success retires the old snapshot.

split: open-access


prompt:
Deque transaction publishes the old snapshot again.

Publish a complete staged bounded deque only if its captured epoch matches, its occupancy fits and allocation credits suffice. Failure preserves state, epoch and credits; success retires the old snapshot.

split: open-access


prompt:
Deque transaction commits without advancing structural epoch.

Publish a complete staged bounded deque only if its captured epoch matches, its occupancy fits and allocation credits suffice. Failure preserves state, epoch and credits; success retires the old snapshot.

split: open-access


prompt:
Deque transaction charges staged entries rather than allocation cost.

Publish a complete staged bounded deque only if its captured epoch matches, its occupancy fits and allocation credits suffice. Failure preserves state, epoch and credits; success retires the old snapshot.

split: open-access


prompt:
Deque transaction retires newly published entries.

Publish a complete staged bounded deque only if its captured epoch matches, its occupancy fits and allocation credits suffice. Failure preserves state, epoch and credits; success retires the old snapshot.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    a,closed,op,value,cap,waiters=x
    if op=='close':
        wakes=waiters if not closed else []
        return [a,True,None,wakes,not closed]
    if op=='push':
        if closed or len(a)==cap:return [a,closed,None,[],False]
        return [a+[value],closed,None,[],True]
    if not a:return [a,closed,'closed' if closed else 'empty',[],False]
    result=a[1:]
    wakes=waiters if closed and not result else []
    return [result,closed,a[0],wakes,True]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[N],False,"close",0,3,[1,2]]), {1: [[1], True, None, [], True], 2: [[2], True, None, [], True], 3: [[3], True, None, [], True], 4: [[4], True, None, [], True], 5: [[5], True, None, [], True]}[N])
check('1', solve([[],False,"close",0,3,[1,2]]), {1: [[], True, None, [1, 2], True], 2: [[], True, None, [1, 2], True], 3: [[], True, None, [1, 2], True], 4: [[], True, None, [1, 2], True], 5: [[], True, None, [1, 2], True]}[N])
check('2', solve([[],True,"close",0,3,[1,2]]), {1: [[], True, None, [], False], 2: [[], True, None, [], False], 3: [[], True, None, [], False], 4: [[], True, None, [], False], 5: [[], True, None, [], False]}[N])
check('3', solve([[N],True,"push",N+1,3,[1]]), {1: [[1], True, None, [], False], 2: [[2], True, None, [], False], 3: [[3], True, None, [], False], 4: [[4], True, None, [], False], 5: [[5], True, None, [], False]}[N])
check('4', solve([[N,N+1],True,"pop",0,3,[1]]), {1: [[2], True, 1, [], True], 2: [[3], True, 2, [], True], 3: [[4], True, 3, [], True], 4: [[5], True, 4, [], True], 5: [[6], True, 5, [], True]}[N])
check('5', solve([[N],True,"pop",0,3,[1,2]]), {1: [[], True, 1, [1, 2], True], 2: [[], True, 2, [1, 2], True], 3: [[], True, 3, [1, 2], True], 4: [[], True, 4, [1, 2], True], 5: [[], True, 5, [1, 2], True]}[N])
check('6', solve([[],True,"pop",0,3,[1]]), {1: [[], True, 'closed', [], False], 2: [[], True, 'closed', [], False], 3: [[], True, 'closed', [], False], 4: [[], True, 'closed', [], False], 5: [[], True, 'closed', [], False]}[N])
check('7', solve([[],False,"pop",0,3,[1]]), {1: [[], False, 'empty', [], False], 2: [[], False, 'empty', [], False], 3: [[], False, 'empty', [], False], 4: [[], False, 'empty', [], False], 5: [[], False, 'empty', [], False]}[N])
check('8', solve([[N],False,"push",N+1,3,[]]), {1: [[1, 2], False, None, [], True], 2: [[2, 3], False, None, [], True], 3: [[3, 4], False, None, [], True], 4: [[4, 5], False, None, [], True], 5: [[5, 6], False, None, [], 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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    a,closed,op,value,cap,waiters=x
    if op=='close':
        wakes=waiters if not closed and len(a)<=1 else []
        return [a,True,None,wakes,not closed]
    if op=='push':
        if closed or len(a)==cap:return [a,closed,None,[],False]
        return [a+[value],closed,None,[],True]
    if not a:return [a,closed,'closed' if closed else 'empty',[],False]
    result=a[1:]
    wakes=waiters if closed and not result else []
    return [result,closed,a[0],wakes,True]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[N],False,"close",0,3,[1,2]]), {1: [[1], True, None, [], True], 2: [[2], True, None, [], True], 3: [[3], True, None, [], True], 4: [[4], True, None, [], True], 5: [[5], True, None, [], True]}[N])
check('1', solve([[],False,"close",0,3,[1,2]]), {1: [[], True, None, [1, 2], True], 2: [[], True, None, [1, 2], True], 3: [[], True, None, [1, 2], True], 4: [[], True, None, [1, 2], True], 5: [[], True, None, [1, 2], True]}[N])
check('2', solve([[],True,"close",0,3,[1,2]]), {1: [[], True, None, [], False], 2: [[], True, None, [], False], 3: [[], True, None, [], False], 4: [[], True, None, [], False], 5: [[], True, None, [], False]}[N])
check('3', solve([[N],True,"push",N+1,3,[1]]), {1: [[1], True, None, [], False], 2: [[2], True, None, [], False], 3: [[3], True, None, [], False], 4: [[4], True, None, [], False], 5: [[5], True, None, [], False]}[N])
check('4', solve([[N,N+1],True,"pop",0,3,[1]]), {1: [[2], True, 1, [], True], 2: [[3], True, 2, [], True], 3: [[4], True, 3, [], True], 4: [[5], True, 4, [], True], 5: [[6], True, 5, [], True]}[N])
check('5', solve([[N],True,"pop",0,3,[1,2]]), {1: [[], True, 1, [1, 2], True], 2: [[], True, 2, [1, 2], True], 3: [[], True, 3, [1, 2], True], 4: [[], True, 4, [1, 2], True], 5: [[], True, 5, [1, 2], True]}[N])
check('6', solve([[],True,"pop",0,3,[1]]), {1: [[], True, 'closed', [], False], 2: [[], True, 'closed', [], False], 3: [[], True, 'closed', [], False], 4: [[], True, 'closed', [], False], 5: [[], True, 'closed', [], False]}[N])
check('7', solve([[],False,"pop",0,3,[1]]), {1: [[], False, 'empty', [], False], 2: [[], False, 'empty', [], False], 3: [[], False, 'empty', [], False], 4: [[], False, 'empty', [], False], 5: [[], False, 'empty', [], False]}[N])
check('8', solve([[N],False,"push",N+1,3,[]]), {1: [[1, 2], False, None, [], True], 2: [[2, 3], False, None, [], True], 3: [[3, 4], False, None, [], True], 4: [[4, 5], False, None, [], True], 5: [[5, 6], False, None, [], 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)

prompt:
Graceful deque close wakes consumers before buffered items drain.

Graceful close forbids future insertion but permits draining buffered values. Empty closed deque reports closed rather than empty. Terminal consumer waiters wake exactly on first empty close or final drain.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    a,closed,op,value,cap,waiters=x
    if op=='close':
        wakes=waiters if not a else []
        return [a,True,None,wakes,not closed]
    if op=='push':
        if closed or len(a)==cap:return [a,closed,None,[],False]
        return [a+[value],closed,None,[],True]
    if not a:return [a,closed,'closed' if closed else 'empty',[],False]
    result=a[1:]
    wakes=waiters if closed and not result else []
    return [result,closed,a[0],wakes,True]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[N],False,"close",0,3,[1,2]]), {1: [[1], True, None, [], True], 2: [[2], True, None, [], True], 3: [[3], True, None, [], True], 4: [[4], True, None, [], True], 5: [[5], True, None, [], True]}[N])
check('1', solve([[],False,"close",0,3,[1,2]]), {1: [[], True, None, [1, 2], True], 2: [[], True, None, [1, 2], True], 3: [[], True, None, [1, 2], True], 4: [[], True, None, [1, 2], True], 5: [[], True, None, [1, 2], True]}[N])
check('2', solve([[],True,"close",0,3,[1,2]]), {1: [[], True, None, [], False], 2: [[], True, None, [], False], 3: [[], True, None, [], False], 4: [[], True, None, [], False], 5: [[], True, None, [], False]}[N])
check('3', solve([[N],True,"push",N+1,3,[1]]), {1: [[1], True, None, [], False], 2: [[2], True, None, [], False], 3: [[3], True, None, [], False], 4: [[4], True, None, [], False], 5: [[5], True, None, [], False]}[N])
check('4', solve([[N,N+1],True,"pop",0,3,[1]]), {1: [[2], True, 1, [], True], 2: [[3], True, 2, [], True], 3: [[4], True, 3, [], True], 4: [[5], True, 4, [], True], 5: [[6], True, 5, [], True]}[N])
check('5', solve([[N],True,"pop",0,3,[1,2]]), {1: [[], True, 1, [1, 2], True], 2: [[], True, 2, [1, 2], True], 3: [[], True, 3, [1, 2], True], 4: [[], True, 4, [1, 2], True], 5: [[], True, 5, [1, 2], True]}[N])
check('6', solve([[],True,"pop",0,3,[1]]), {1: [[], True, 'closed', [], False], 2: [[], True, 'closed', [], False], 3: [[], True, 'closed', [], False], 4: [[], True, 'closed', [], False], 5: [[], True, 'closed', [], False]}[N])
check('7', solve([[],False,"pop",0,3,[1]]), {1: [[], False, 'empty', [], False], 2: [[], False, 'empty', [], False], 3: [[], False, 'empty', [], False], 4: [[], False, 'empty', [], False], 5: [[], False, 'empty', [], False]}[N])
check('8', solve([[N],False,"push",N+1,3,[]]), {1: [[1, 2], False, None, [], True], 2: [[2, 3], False, None, [], True], 3: [[3, 4], False, None, [], True], 4: [[4, 5], False, None, [], True], 5: [[5, 6], False, None, [], 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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    a,closed,op,value,cap,waiters=x
    if op=='close':
        wakes=waiters if not a and (not closed or len(waiters)>1) else []
        return [a,True,None,wakes,not closed]
    if op=='push':
        if closed or len(a)==cap:return [a,closed,None,[],False]
        return [a+[value],closed,None,[],True]
    if not a:return [a,closed,'closed' if closed else 'empty',[],False]
    result=a[1:]
    wakes=waiters if closed and not result else []
    return [result,closed,a[0],wakes,True]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[N],False,"close",0,3,[1,2]]), {1: [[1], True, None, [], True], 2: [[2], True, None, [], True], 3: [[3], True, None, [], True], 4: [[4], True, None, [], True], 5: [[5], True, None, [], True]}[N])
check('1', solve([[],False,"close",0,3,[1,2]]), {1: [[], True, None, [1, 2], True], 2: [[], True, None, [1, 2], True], 3: [[], True, None, [1, 2], True], 4: [[], True, None, [1, 2], True], 5: [[], True, None, [1, 2], True]}[N])
check('2', solve([[],True,"close",0,3,[1,2]]), {1: [[], True, None, [], False], 2: [[], True, None, [], False], 3: [[], True, None, [], False], 4: [[], True, None, [], False], 5: [[], True, None, [], False]}[N])
check('3', solve([[N],True,"push",N+1,3,[1]]), {1: [[1], True, None, [], False], 2: [[2], True, None, [], False], 3: [[3], True, None, [], False], 4: [[4], True, None, [], False], 5: [[5], True, None, [], False]}[N])
check('4', solve([[N,N+1],True,"pop",0,3,[1]]), {1: [[2], True, 1, [], True], 2: [[3], True, 2, [], True], 3: [[4], True, 3, [], True], 4: [[5], True, 4, [], True], 5: [[6], True, 5, [], True]}[N])
check('5', solve([[N],True,"pop",0,3,[1,2]]), {1: [[], True, 1, [1, 2], True], 2: [[], True, 2, [1, 2], True], 3: [[], True, 3, [1, 2], True], 4: [[], True, 4, [1, 2], True], 5: [[], True, 5, [1, 2], True]}[N])
check('6', solve([[],True,"pop",0,3,[1]]), {1: [[], True, 'closed', [], False], 2: [[], True, 'closed', [], False], 3: [[], True, 'closed', [], False], 4: [[], True, 'closed', [], False], 5: [[], True, 'closed', [], False]}[N])
check('7', solve([[],False,"pop",0,3,[1]]), {1: [[], False, 'empty', [], False], 2: [[], False, 'empty', [], False], 3: [[], False, 'empty', [], False], 4: [[], False, 'empty', [], False], 5: [[], False, 'empty', [], False]}[N])
check('8', solve([[N],False,"push",N+1,3,[]]), {1: [[1, 2], False, None, [], True], 2: [[2, 3], False, None, [], True], 3: [[3, 4], False, None, [], True], 4: [[4, 5], False, None, [], True], 5: [[5, 6], False, None, [], 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)

prompt:
Repeated deque close repeats terminal notifications.

Graceful close forbids future insertion but permits draining buffered values. Empty closed deque reports closed rather than empty. Terminal consumer waiters wake exactly on first empty close or final drain.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    a,closed,op,value,cap,waiters=x
    if op=='close':
        wakes=waiters if not a and not closed else []
        return [a,True,None,wakes,not closed]
    if op=='push':
        if len(a)==cap:return [a,closed,None,[],False]
        return [a+[value],closed,None,[],True]
    if not a:return [a,closed,'closed' if closed else 'empty',[],False]
    result=a[1:]
    wakes=waiters if closed and not result else []
    return [result,closed,a[0],wakes,True]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[N],False,"close",0,3,[1,2]]), {1: [[1], True, None, [], True], 2: [[2], True, None, [], True], 3: [[3], True, None, [], True], 4: [[4], True, None, [], True], 5: [[5], True, None, [], True]}[N])
check('1', solve([[],False,"close",0,3,[1,2]]), {1: [[], True, None, [1, 2], True], 2: [[], True, None, [1, 2], True], 3: [[], True, None, [1, 2], True], 4: [[], True, None, [1, 2], True], 5: [[], True, None, [1, 2], True]}[N])
check('2', solve([[],True,"close",0,3,[1,2]]), {1: [[], True, None, [], False], 2: [[], True, None, [], False], 3: [[], True, None, [], False], 4: [[], True, None, [], False], 5: [[], True, None, [], False]}[N])
check('3', solve([[N],True,"push",N+1,3,[1]]), {1: [[1], True, None, [], False], 2: [[2], True, None, [], False], 3: [[3], True, None, [], False], 4: [[4], True, None, [], False], 5: [[5], True, None, [], False]}[N])
check('4', solve([[N,N+1],True,"pop",0,3,[1]]), {1: [[2], True, 1, [], True], 2: [[3], True, 2, [], True], 3: [[4], True, 3, [], True], 4: [[5], True, 4, [], True], 5: [[6], True, 5, [], True]}[N])
check('5', solve([[N],True,"pop",0,3,[1,2]]), {1: [[], True, 1, [1, 2], True], 2: [[], True, 2, [1, 2], True], 3: [[], True, 3, [1, 2], True], 4: [[], True, 4, [1, 2], True], 5: [[], True, 5, [1, 2], True]}[N])
check('6', solve([[],True,"pop",0,3,[1]]), {1: [[], True, 'closed', [], False], 2: [[], True, 'closed', [], False], 3: [[], True, 'closed', [], False], 4: [[], True, 'closed', [], False], 5: [[], True, 'closed', [], False]}[N])
check('7', solve([[],False,"pop",0,3,[1]]), {1: [[], False, 'empty', [], False], 2: [[], False, 'empty', [], False], 3: [[], False, 'empty', [], False], 4: [[], False, 'empty', [], False], 5: [[], False, 'empty', [], False]}[N])
check('8', solve([[N],False,"push",N+1,3,[]]), {1: [[1, 2], False, None, [], True], 2: [[2, 3], False, None, [], True], 3: [[3, 4], False, None, [], True], 4: [[4, 5], False, None, [], True], 5: [[5, 6], False, None, [], 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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    a,closed,op,value,cap,waiters=x
    if op=='close':
        wakes=waiters if not a and not closed else []
        return [a,True,None,wakes,not closed]
    if op=='push':
        if (closed and not a) or len(a)==cap:return [a,closed,None,[],False]
        return [a+[value],closed,None,[],True]
    if not a:return [a,closed,'closed' if closed else 'empty',[],False]
    result=a[1:]
    wakes=waiters if closed and not result else []
    return [result,closed,a[0],wakes,True]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[N],False,"close",0,3,[1,2]]), {1: [[1], True, None, [], True], 2: [[2], True, None, [], True], 3: [[3], True, None, [], True], 4: [[4], True, None, [], True], 5: [[5], True, None, [], True]}[N])
check('1', solve([[],False,"close",0,3,[1,2]]), {1: [[], True, None, [1, 2], True], 2: [[], True, None, [1, 2], True], 3: [[], True, None, [1, 2], True], 4: [[], True, None, [1, 2], True], 5: [[], True, None, [1, 2], True]}[N])
check('2', solve([[],True,"close",0,3,[1,2]]), {1: [[], True, None, [], False], 2: [[], True, None, [], False], 3: [[], True, None, [], False], 4: [[], True, None, [], False], 5: [[], True, None, [], False]}[N])
check('3', solve([[N],True,"push",N+1,3,[1]]), {1: [[1], True, None, [], False], 2: [[2], True, None, [], False], 3: [[3], True, None, [], False], 4: [[4], True, None, [], False], 5: [[5], True, None, [], False]}[N])
check('4', solve([[N,N+1],True,"pop",0,3,[1]]), {1: [[2], True, 1, [], True], 2: [[3], True, 2, [], True], 3: [[4], True, 3, [], True], 4: [[5], True, 4, [], True], 5: [[6], True, 5, [], True]}[N])
check('5', solve([[N],True,"pop",0,3,[1,2]]), {1: [[], True, 1, [1, 2], True], 2: [[], True, 2, [1, 2], True], 3: [[], True, 3, [1, 2], True], 4: [[], True, 4, [1, 2], True], 5: [[], True, 5, [1, 2], True]}[N])
check('6', solve([[],True,"pop",0,3,[1]]), {1: [[], True, 'closed', [], False], 2: [[], True, 'closed', [], False], 3: [[], True, 'closed', [], False], 4: [[], True, 'closed', [], False], 5: [[], True, 'closed', [], False]}[N])
check('7', solve([[],False,"pop",0,3,[1]]), {1: [[], False, 'empty', [], False], 2: [[], False, 'empty', [], False], 3: [[], False, 'empty', [], False], 4: [[], False, 'empty', [], False], 5: [[], False, 'empty', [], False]}[N])
check('8', solve([[N],False,"push",N+1,3,[]]), {1: [[1, 2], False, None, [], True], 2: [[2, 3], False, None, [], True], 3: [[3, 4], False, None, [], True], 4: [[4, 5], False, None, [], True], 5: [[5, 6], False, None, [], 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)

prompt:
Gracefully closed deque accepts new producer values.

Graceful close forbids future insertion but permits draining buffered values. Empty closed deque reports closed rather than empty. Terminal consumer waiters wake exactly on first empty close or final drain.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    a,closed,op,value,cap,waiters=x
    if op=='close':
        wakes=waiters if not a and not closed else []
        return [a,True,None,wakes,not closed]
    if op=='push':
        if closed or len(a)==cap:return [a,closed,None,[],False]
        return [a+[value],closed,None,[],True]
    if not a:return [a,closed,'empty',[],False]
    result=a[1:]
    wakes=waiters if closed and not result else []
    return [result,closed,a[0],wakes,True]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[N],False,"close",0,3,[1,2]]), {1: [[1], True, None, [], True], 2: [[2], True, None, [], True], 3: [[3], True, None, [], True], 4: [[4], True, None, [], True], 5: [[5], True, None, [], True]}[N])
check('1', solve([[],False,"close",0,3,[1,2]]), {1: [[], True, None, [1, 2], True], 2: [[], True, None, [1, 2], True], 3: [[], True, None, [1, 2], True], 4: [[], True, None, [1, 2], True], 5: [[], True, None, [1, 2], True]}[N])
check('2', solve([[],True,"close",0,3,[1,2]]), {1: [[], True, None, [], False], 2: [[], True, None, [], False], 3: [[], True, None, [], False], 4: [[], True, None, [], False], 5: [[], True, None, [], False]}[N])
check('3', solve([[N],True,"push",N+1,3,[1]]), {1: [[1], True, None, [], False], 2: [[2], True, None, [], False], 3: [[3], True, None, [], False], 4: [[4], True, None, [], False], 5: [[5], True, None, [], False]}[N])
check('4', solve([[N,N+1],True,"pop",0,3,[1]]), {1: [[2], True, 1, [], True], 2: [[3], True, 2, [], True], 3: [[4], True, 3, [], True], 4: [[5], True, 4, [], True], 5: [[6], True, 5, [], True]}[N])
check('5', solve([[N],True,"pop",0,3,[1,2]]), {1: [[], True, 1, [1, 2], True], 2: [[], True, 2, [1, 2], True], 3: [[], True, 3, [1, 2], True], 4: [[], True, 4, [1, 2], True], 5: [[], True, 5, [1, 2], True]}[N])
check('6', solve([[],True,"pop",0,3,[1]]), {1: [[], True, 'closed', [], False], 2: [[], True, 'closed', [], False], 3: [[], True, 'closed', [], False], 4: [[], True, 'closed', [], False], 5: [[], True, 'closed', [], False]}[N])
check('7', solve([[],False,"pop",0,3,[1]]), {1: [[], False, 'empty', [], False], 2: [[], False, 'empty', [], False], 3: [[], False, 'empty', [], False], 4: [[], False, 'empty', [], False], 5: [[], False, 'empty', [], False]}[N])
check('8', solve([[N],False,"push",N+1,3,[]]), {1: [[1, 2], False, None, [], True], 2: [[2, 3], False, None, [], True], 3: [[3, 4], False, None, [], True], 4: [[4, 5], False, None, [], True], 5: [[5, 6], False, None, [], 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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    a,closed,op,value,cap,waiters=x
    if op=='close':
        wakes=waiters if not a and not closed else []
        return [a,True,None,wakes,not closed]
    if op=='push':
        if closed or len(a)==cap:return [a,closed,None,[],False]
        return [a+[value],closed,None,[],True]
    if not a:return [a,closed,'closed' if closed and not waiters else 'empty',[],False]
    result=a[1:]
    wakes=waiters if closed and not result else []
    return [result,closed,a[0],wakes,True]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[N],False,"close",0,3,[1,2]]), {1: [[1], True, None, [], True], 2: [[2], True, None, [], True], 3: [[3], True, None, [], True], 4: [[4], True, None, [], True], 5: [[5], True, None, [], True]}[N])
check('1', solve([[],False,"close",0,3,[1,2]]), {1: [[], True, None, [1, 2], True], 2: [[], True, None, [1, 2], True], 3: [[], True, None, [1, 2], True], 4: [[], True, None, [1, 2], True], 5: [[], True, None, [1, 2], True]}[N])
check('2', solve([[],True,"close",0,3,[1,2]]), {1: [[], True, None, [], False], 2: [[], True, None, [], False], 3: [[], True, None, [], False], 4: [[], True, None, [], False], 5: [[], True, None, [], False]}[N])
check('3', solve([[N],True,"push",N+1,3,[1]]), {1: [[1], True, None, [], False], 2: [[2], True, None, [], False], 3: [[3], True, None, [], False], 4: [[4], True, None, [], False], 5: [[5], True, None, [], False]}[N])
check('4', solve([[N,N+1],True,"pop",0,3,[1]]), {1: [[2], True, 1, [], True], 2: [[3], True, 2, [], True], 3: [[4], True, 3, [], True], 4: [[5], True, 4, [], True], 5: [[6], True, 5, [], True]}[N])
check('5', solve([[N],True,"pop",0,3,[1,2]]), {1: [[], True, 1, [1, 2], True], 2: [[], True, 2, [1, 2], True], 3: [[], True, 3, [1, 2], True], 4: [[], True, 4, [1, 2], True], 5: [[], True, 5, [1, 2], True]}[N])
check('6', solve([[],True,"pop",0,3,[1]]), {1: [[], True, 'closed', [], False], 2: [[], True, 'closed', [], False], 3: [[], True, 'closed', [], False], 4: [[], True, 'closed', [], False], 5: [[], True, 'closed', [], False]}[N])
check('7', solve([[],False,"pop",0,3,[1]]), {1: [[], False, 'empty', [], False], 2: [[], False, 'empty', [], False], 3: [[], False, 'empty', [], False], 4: [[], False, 'empty', [], False], 5: [[], False, 'empty', [], False]}[N])
check('8', solve([[N],False,"push",N+1,3,[]]), {1: [[1, 2], False, None, [], True], 2: [[2, 3], False, None, [], True], 3: [[3, 4], False, None, [], True], 4: [[4, 5], False, None, [], True], 5: [[5, 6], False, None, [], 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)

prompt:
Empty closed deque reports ordinary temporary emptiness.

Graceful close forbids future insertion but permits draining buffered values. Empty closed deque reports closed rather than empty. Terminal consumer waiters wake exactly on first empty close or final drain.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    a,closed,op,value,cap,waiters=x
    if op=='close':
        wakes=waiters if not a and not closed else []
        return [a,True,None,wakes,not closed]
    if op=='push':
        if closed or len(a)==cap:return [a,closed,None,[],False]
        return [a+[value],closed,None,[],True]
    if not a:return [a,closed,'closed' if closed else 'empty',[],False]
    result=a[1:]
    wakes=[]
    return [result,closed,a[0],wakes,True]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[N],False,"close",0,3,[1,2]]), {1: [[1], True, None, [], True], 2: [[2], True, None, [], True], 3: [[3], True, None, [], True], 4: [[4], True, None, [], True], 5: [[5], True, None, [], True]}[N])
check('1', solve([[],False,"close",0,3,[1,2]]), {1: [[], True, None, [1, 2], True], 2: [[], True, None, [1, 2], True], 3: [[], True, None, [1, 2], True], 4: [[], True, None, [1, 2], True], 5: [[], True, None, [1, 2], True]}[N])
check('2', solve([[],True,"close",0,3,[1,2]]), {1: [[], True, None, [], False], 2: [[], True, None, [], False], 3: [[], True, None, [], False], 4: [[], True, None, [], False], 5: [[], True, None, [], False]}[N])
check('3', solve([[N],True,"push",N+1,3,[1]]), {1: [[1], True, None, [], False], 2: [[2], True, None, [], False], 3: [[3], True, None, [], False], 4: [[4], True, None, [], False], 5: [[5], True, None, [], False]}[N])
check('4', solve([[N,N+1],True,"pop",0,3,[1]]), {1: [[2], True, 1, [], True], 2: [[3], True, 2, [], True], 3: [[4], True, 3, [], True], 4: [[5], True, 4, [], True], 5: [[6], True, 5, [], True]}[N])
check('5', solve([[N],True,"pop",0,3,[1,2]]), {1: [[], True, 1, [1, 2], True], 2: [[], True, 2, [1, 2], True], 3: [[], True, 3, [1, 2], True], 4: [[], True, 4, [1, 2], True], 5: [[], True, 5, [1, 2], True]}[N])
check('6', solve([[],True,"pop",0,3,[1]]), {1: [[], True, 'closed', [], False], 2: [[], True, 'closed', [], False], 3: [[], True, 'closed', [], False], 4: [[], True, 'closed', [], False], 5: [[], True, 'closed', [], False]}[N])
check('7', solve([[],False,"pop",0,3,[1]]), {1: [[], False, 'empty', [], False], 2: [[], False, 'empty', [], False], 3: [[], False, 'empty', [], False], 4: [[], False, 'empty', [], False], 5: [[], False, 'empty', [], False]}[N])
check('8', solve([[N],False,"push",N+1,3,[]]), {1: [[1, 2], False, None, [], True], 2: [[2, 3], False, None, [], True], 3: [[3, 4], False, None, [], True], 4: [[4, 5], False, None, [], True], 5: [[5, 6], False, None, [], 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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    a,closed,op,value,cap,waiters=x
    if op=='close':
        wakes=waiters if not a and not closed else []
        return [a,True,None,wakes,not closed]
    if op=='push':
        if closed or len(a)==cap:return [a,closed,None,[],False]
        return [a+[value],closed,None,[],True]
    if not a:return [a,closed,'closed' if closed else 'empty',[],False]
    result=a[1:]
    wakes=waiters if closed and not result and len(waiters)==1 else []
    return [result,closed,a[0],wakes,True]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[N],False,"close",0,3,[1,2]]), {1: [[1], True, None, [], True], 2: [[2], True, None, [], True], 3: [[3], True, None, [], True], 4: [[4], True, None, [], True], 5: [[5], True, None, [], True]}[N])
check('1', solve([[],False,"close",0,3,[1,2]]), {1: [[], True, None, [1, 2], True], 2: [[], True, None, [1, 2], True], 3: [[], True, None, [1, 2], True], 4: [[], True, None, [1, 2], True], 5: [[], True, None, [1, 2], True]}[N])
check('2', solve([[],True,"close",0,3,[1,2]]), {1: [[], True, None, [], False], 2: [[], True, None, [], False], 3: [[], True, None, [], False], 4: [[], True, None, [], False], 5: [[], True, None, [], False]}[N])
check('3', solve([[N],True,"push",N+1,3,[1]]), {1: [[1], True, None, [], False], 2: [[2], True, None, [], False], 3: [[3], True, None, [], False], 4: [[4], True, None, [], False], 5: [[5], True, None, [], False]}[N])
check('4', solve([[N,N+1],True,"pop",0,3,[1]]), {1: [[2], True, 1, [], True], 2: [[3], True, 2, [], True], 3: [[4], True, 3, [], True], 4: [[5], True, 4, [], True], 5: [[6], True, 5, [], True]}[N])
check('5', solve([[N],True,"pop",0,3,[1,2]]), {1: [[], True, 1, [1, 2], True], 2: [[], True, 2, [1, 2], True], 3: [[], True, 3, [1, 2], True], 4: [[], True, 4, [1, 2], True], 5: [[], True, 5, [1, 2], True]}[N])
check('6', solve([[],True,"pop",0,3,[1]]), {1: [[], True, 'closed', [], False], 2: [[], True, 'closed', [], False], 3: [[], True, 'closed', [], False], 4: [[], True, 'closed', [], False], 5: [[], True, 'closed', [], False]}[N])
check('7', solve([[],False,"pop",0,3,[1]]), {1: [[], False, 'empty', [], False], 2: [[], False, 'empty', [], False], 3: [[], False, 'empty', [], False], 4: [[], False, 'empty', [], False], 5: [[], False, 'empty', [], False]}[N])
check('8', solve([[N],False,"push",N+1,3,[]]), {1: [[1, 2], False, None, [], True], 2: [[2, 3], False, None, [], True], 3: [[3, 4], False, None, [], True], 4: [[4, 5], False, None, [], True], 5: [[5, 6], False, None, [], 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)

prompt:
Final drain fails to wake terminal deque consumers.

Graceful close forbids future insertion but permits draining buffered values. Empty closed deque reports closed rather than empty. Terminal consumer waiters wake exactly on first empty close or final drain.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    a,closed,op,value,cap,waiters=x
    if op=='close':
        wakes=waiters if not a and not closed else []
        return [a,True,None,wakes,not closed]
    if op=='push':
        if closed or len(a)==cap:return [a,closed,None,[],False]
        return [a+[value],closed,None,[],True]
    if not a:return [a,closed,'closed' if closed else 'empty',[],False]
    result=[] if closed else a[1:]
    wakes=waiters if closed and not result else []
    return [result,closed,a[0],wakes,True]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[N],False,"close",0,3,[1,2]]), {1: [[1], True, None, [], True], 2: [[2], True, None, [], True], 3: [[3], True, None, [], True], 4: [[4], True, None, [], True], 5: [[5], True, None, [], True]}[N])
check('1', solve([[],False,"close",0,3,[1,2]]), {1: [[], True, None, [1, 2], True], 2: [[], True, None, [1, 2], True], 3: [[], True, None, [1, 2], True], 4: [[], True, None, [1, 2], True], 5: [[], True, None, [1, 2], True]}[N])
check('2', solve([[],True,"close",0,3,[1,2]]), {1: [[], True, None, [], False], 2: [[], True, None, [], False], 3: [[], True, None, [], False], 4: [[], True, None, [], False], 5: [[], True, None, [], False]}[N])
check('3', solve([[N],True,"push",N+1,3,[1]]), {1: [[1], True, None, [], False], 2: [[2], True, None, [], False], 3: [[3], True, None, [], False], 4: [[4], True, None, [], False], 5: [[5], True, None, [], False]}[N])
check('4', solve([[N,N+1],True,"pop",0,3,[1]]), {1: [[2], True, 1, [], True], 2: [[3], True, 2, [], True], 3: [[4], True, 3, [], True], 4: [[5], True, 4, [], True], 5: [[6], True, 5, [], True]}[N])
check('5', solve([[N],True,"pop",0,3,[1,2]]), {1: [[], True, 1, [1, 2], True], 2: [[], True, 2, [1, 2], True], 3: [[], True, 3, [1, 2], True], 4: [[], True, 4, [1, 2], True], 5: [[], True, 5, [1, 2], True]}[N])
check('6', solve([[],True,"pop",0,3,[1]]), {1: [[], True, 'closed', [], False], 2: [[], True, 'closed', [], False], 3: [[], True, 'closed', [], False], 4: [[], True, 'closed', [], False], 5: [[], True, 'closed', [], False]}[N])
check('7', solve([[],False,"pop",0,3,[1]]), {1: [[], False, 'empty', [], False], 2: [[], False, 'empty', [], False], 3: [[], False, 'empty', [], False], 4: [[], False, 'empty', [], False], 5: [[], False, 'empty', [], False]}[N])
check('8', solve([[N],False,"push",N+1,3,[]]), {1: [[1, 2], False, None, [], True], 2: [[2, 3], False, None, [], True], 3: [[3, 4], False, None, [], True], 4: [[4, 5], False, None, [], True], 5: [[5, 6], False, None, [], 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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    a,closed,op,value,cap,waiters=x
    if op=='close':
        wakes=waiters if not a and not closed else []
        return [a,True,None,wakes,not closed]
    if op=='push':
        if closed or len(a)==cap:return [a,closed,None,[],False]
        return [a+[value],closed,None,[],True]
    if not a:return [a,closed,'closed' if closed else 'empty',[],False]
    result=a[1:] if not closed or len(a)==1 else []
    wakes=waiters if closed and not result else []
    return [result,closed,a[0],wakes,True]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[N],False,"close",0,3,[1,2]]), {1: [[1], True, None, [], True], 2: [[2], True, None, [], True], 3: [[3], True, None, [], True], 4: [[4], True, None, [], True], 5: [[5], True, None, [], True]}[N])
check('1', solve([[],False,"close",0,3,[1,2]]), {1: [[], True, None, [1, 2], True], 2: [[], True, None, [1, 2], True], 3: [[], True, None, [1, 2], True], 4: [[], True, None, [1, 2], True], 5: [[], True, None, [1, 2], True]}[N])
check('2', solve([[],True,"close",0,3,[1,2]]), {1: [[], True, None, [], False], 2: [[], True, None, [], False], 3: [[], True, None, [], False], 4: [[], True, None, [], False], 5: [[], True, None, [], False]}[N])
check('3', solve([[N],True,"push",N+1,3,[1]]), {1: [[1], True, None, [], False], 2: [[2], True, None, [], False], 3: [[3], True, None, [], False], 4: [[4], True, None, [], False], 5: [[5], True, None, [], False]}[N])
check('4', solve([[N,N+1],True,"pop",0,3,[1]]), {1: [[2], True, 1, [], True], 2: [[3], True, 2, [], True], 3: [[4], True, 3, [], True], 4: [[5], True, 4, [], True], 5: [[6], True, 5, [], True]}[N])
check('5', solve([[N],True,"pop",0,3,[1,2]]), {1: [[], True, 1, [1, 2], True], 2: [[], True, 2, [1, 2], True], 3: [[], True, 3, [1, 2], True], 4: [[], True, 4, [1, 2], True], 5: [[], True, 5, [1, 2], True]}[N])
check('6', solve([[],True,"pop",0,3,[1]]), {1: [[], True, 'closed', [], False], 2: [[], True, 'closed', [], False], 3: [[], True, 'closed', [], False], 4: [[], True, 'closed', [], False], 5: [[], True, 'closed', [], False]}[N])
check('7', solve([[],False,"pop",0,3,[1]]), {1: [[], False, 'empty', [], False], 2: [[], False, 'empty', [], False], 3: [[], False, 'empty', [], False], 4: [[], False, 'empty', [], False], 5: [[], False, 'empty', [], False]}[N])
check('8', solve([[N],False,"push",N+1,3,[]]), {1: [[1, 2], False, None, [], True], 2: [[2, 3], False, None, [], True], 3: [[3, 4], False, None, [], True], 4: [[4, 5], False, None, [], True], 5: [[5, 6], False, None, [], 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)

prompt:
Closed deque pop discards all buffered values.

Graceful close forbids future insertion but permits draining buffered values. Empty closed deque reports closed rather than empty. Terminal consumer waiters wake exactly on first empty close or final drain.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    a,closed,op,value,cap,waiters=x
    if op=='close':
        wakes=waiters if not a and not closed else []
        return [a,True,None,wakes,True]
    if op=='push':
        if closed or len(a)==cap:return [a,closed,None,[],False]
        return [a+[value],closed,None,[],True]
    if not a:return [a,closed,'closed' if closed else 'empty',[],False]
    result=a[1:]
    wakes=waiters if closed and not result else []
    return [result,closed,a[0],wakes,True]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[N],False,"close",0,3,[1,2]]), {1: [[1], True, None, [], True], 2: [[2], True, None, [], True], 3: [[3], True, None, [], True], 4: [[4], True, None, [], True], 5: [[5], True, None, [], True]}[N])
check('1', solve([[],False,"close",0,3,[1,2]]), {1: [[], True, None, [1, 2], True], 2: [[], True, None, [1, 2], True], 3: [[], True, None, [1, 2], True], 4: [[], True, None, [1, 2], True], 5: [[], True, None, [1, 2], True]}[N])
check('2', solve([[],True,"close",0,3,[1,2]]), {1: [[], True, None, [], False], 2: [[], True, None, [], False], 3: [[], True, None, [], False], 4: [[], True, None, [], False], 5: [[], True, None, [], False]}[N])
check('3', solve([[N],True,"push",N+1,3,[1]]), {1: [[1], True, None, [], False], 2: [[2], True, None, [], False], 3: [[3], True, None, [], False], 4: [[4], True, None, [], False], 5: [[5], True, None, [], False]}[N])
check('4', solve([[N,N+1],True,"pop",0,3,[1]]), {1: [[2], True, 1, [], True], 2: [[3], True, 2, [], True], 3: [[4], True, 3, [], True], 4: [[5], True, 4, [], True], 5: [[6], True, 5, [], True]}[N])
check('5', solve([[N],True,"pop",0,3,[1,2]]), {1: [[], True, 1, [1, 2], True], 2: [[], True, 2, [1, 2], True], 3: [[], True, 3, [1, 2], True], 4: [[], True, 4, [1, 2], True], 5: [[], True, 5, [1, 2], True]}[N])
check('6', solve([[],True,"pop",0,3,[1]]), {1: [[], True, 'closed', [], False], 2: [[], True, 'closed', [], False], 3: [[], True, 'closed', [], False], 4: [[], True, 'closed', [], False], 5: [[], True, 'closed', [], False]}[N])
check('7', solve([[],False,"pop",0,3,[1]]), {1: [[], False, 'empty', [], False], 2: [[], False, 'empty', [], False], 3: [[], False, 'empty', [], False], 4: [[], False, 'empty', [], False], 5: [[], False, 'empty', [], False]}[N])
check('8', solve([[N],False,"push",N+1,3,[]]), {1: [[1, 2], False, None, [], True], 2: [[2, 3], False, None, [], True], 3: [[3, 4], False, None, [], True], 4: [[4, 5], False, None, [], True], 5: [[5, 6], False, None, [], 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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    a,closed,op,value,cap,waiters=x
    if op=='close':
        wakes=waiters if not a and not closed else []
        return [a,True,None,wakes,not closed or not a]
    if op=='push':
        if closed or len(a)==cap:return [a,closed,None,[],False]
        return [a+[value],closed,None,[],True]
    if not a:return [a,closed,'closed' if closed else 'empty',[],False]
    result=a[1:]
    wakes=waiters if closed and not result else []
    return [result,closed,a[0],wakes,True]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[N],False,"close",0,3,[1,2]]), {1: [[1], True, None, [], True], 2: [[2], True, None, [], True], 3: [[3], True, None, [], True], 4: [[4], True, None, [], True], 5: [[5], True, None, [], True]}[N])
check('1', solve([[],False,"close",0,3,[1,2]]), {1: [[], True, None, [1, 2], True], 2: [[], True, None, [1, 2], True], 3: [[], True, None, [1, 2], True], 4: [[], True, None, [1, 2], True], 5: [[], True, None, [1, 2], True]}[N])
check('2', solve([[],True,"close",0,3,[1,2]]), {1: [[], True, None, [], False], 2: [[], True, None, [], False], 3: [[], True, None, [], False], 4: [[], True, None, [], False], 5: [[], True, None, [], False]}[N])
check('3', solve([[N],True,"push",N+1,3,[1]]), {1: [[1], True, None, [], False], 2: [[2], True, None, [], False], 3: [[3], True, None, [], False], 4: [[4], True, None, [], False], 5: [[5], True, None, [], False]}[N])
check('4', solve([[N,N+1],True,"pop",0,3,[1]]), {1: [[2], True, 1, [], True], 2: [[3], True, 2, [], True], 3: [[4], True, 3, [], True], 4: [[5], True, 4, [], True], 5: [[6], True, 5, [], True]}[N])
check('5', solve([[N],True,"pop",0,3,[1,2]]), {1: [[], True, 1, [1, 2], True], 2: [[], True, 2, [1, 2], True], 3: [[], True, 3, [1, 2], True], 4: [[], True, 4, [1, 2], True], 5: [[], True, 5, [1, 2], True]}[N])
check('6', solve([[],True,"pop",0,3,[1]]), {1: [[], True, 'closed', [], False], 2: [[], True, 'closed', [], False], 3: [[], True, 'closed', [], False], 4: [[], True, 'closed', [], False], 5: [[], True, 'closed', [], False]}[N])
check('7', solve([[],False,"pop",0,3,[1]]), {1: [[], False, 'empty', [], False], 2: [[], False, 'empty', [], False], 3: [[], False, 'empty', [], False], 4: [[], False, 'empty', [], False], 5: [[], False, 'empty', [], False]}[N])
check('8', solve([[N],False,"push",N+1,3,[]]), {1: [[1, 2], False, None, [], True], 2: [[2, 3], False, None, [], True], 3: [[3, 4], False, None, [], True], 4: [[4, 5], False, None, [], True], 5: [[5, 6], False, None, [], 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)

prompt:
Close receipt says an already-closed deque changed state.

Graceful close forbids future insertion but permits draining buffered values. Empty closed deque reports closed rather than empty. Terminal consumer waiters wake exactly on first empty close or final drain.

split: open-access


prompt:
Producer cancellation removes the first waiter regardless of identity.

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.

split: open-access


prompt:
Producer cancellation reports payloads as cancelled waiter identities.

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.

split: open-access


prompt:
Producer scheduling allocates full capacity despite resident entries.

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.

split: open-access


prompt:
Bounded deque producer wakeup grants newest waiters first.

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.

split: open-access


prompt:
Resumed deque producer stays registered as blocked.

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.

split: open-access


prompt:
Deque producer wakeup publishes waiter IDs as payloads.

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.

split: open-access


prompt:
Producer scheduler wakes every queued producer after a partial grant.

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.

split: open-access


prompt:
Deque block rebalance concatenates right before left.

Redistribute two adjacent deque blocks to a requested left occupancy without changing element order or block identities. Return signed left-to-right transfer count and new directory lengths.

split: open-access


prompt:
Deque block rebalance treats target occupancy as transfer count.

Redistribute two adjacent deque blocks to a requested left occupancy without changing element order or block identities. Return signed left-to-right transfer count and new directory lengths.

split: open-access


prompt:
Deque block rebalance cuts the right remainder at old occupancy.

Redistribute two adjacent deque blocks to a requested left occupancy without changing element order or block identities. Return signed left-to-right transfer count and new directory lengths.

split: open-access


prompt:
Deque rebalance gives the left block the right identity.

Redistribute two adjacent deque blocks to a requested left occupancy without changing element order or block identities. Return signed left-to-right transfer count and new directory lengths.

split: open-access


prompt:
Deque rebalance allocates a new identity for the right block.

Redistribute two adjacent deque blocks to a requested left occupancy without changing element order or block identities. Return signed left-to-right transfer count and new directory lengths.

split: open-access


prompt:
Deque rebalance loses direction of the transfer receipt.

Redistribute two adjacent deque blocks to a requested left occupancy without changing element order or block identities. Return signed left-to-right transfer count and new directory lengths.

split: open-access


prompt:
Deque rebalance keeps pre-transfer directory lengths.

Redistribute two adjacent deque blocks to a requested left occupancy without changing element order or block identities. Return signed left-to-right transfer count and new directory lengths.

split: open-access


prompt:
Deque savepoint insertion overwrites outer checkpoints.

Deque savepoints capture ordered snapshots by unique tag. Rolling back restores a named snapshot and discards it plus nested checkpoints. Release discards the same checkpoint suffix without restoring data. Unknown tags preserve state.

split: open-access


prompt:
Deque savepoint captures an empty snapshot.

Deque savepoints capture ordered snapshots by unique tag. Rolling back restores a named snapshot and discards it plus nested checkpoints. Release discards the same checkpoint suffix without restoring data. Unknown tags preserve state.

split: open-access


prompt:
Deque rollback chooses newest checkpoint regardless of requested tag.

Deque savepoints capture ordered snapshots by unique tag. Rolling back restores a named snapshot and discards it plus nested checkpoints. Release discards the same checkpoint suffix without restoring data. Unknown tags preserve state.

split: open-access


prompt:
Deque rollback leaves its target checkpoint active.

Deque savepoints capture ordered snapshots by unique tag. Rolling back restores a named snapshot and discards it plus nested checkpoints. Release discards the same checkpoint suffix without restoring data. Unknown tags preserve state.

split: open-access


prompt:
Deque rollback discards outer checkpoints and retains nested ones.

Deque savepoints capture ordered snapshots by unique tag. Rolling back restores a named snapshot and discards it plus nested checkpoints. Release discards the same checkpoint suffix without restoring data. Unknown tags preserve state.

split: open-access


prompt:
Deque checkpoint release unexpectedly rolls back values.

Deque savepoints capture ordered snapshots by unique tag. Rolling back restores a named snapshot and discards it plus nested checkpoints. Release discards the same checkpoint suffix without restoring data. Unknown tags preserve state.

split: open-access


prompt:
Unknown deque checkpoint request clears saved history.

Deque savepoints capture ordered snapshots by unique tag. Rolling back restores a named snapshot and discards it plus nested checkpoints. Release discards the same checkpoint suffix without restoring data. Unknown tags preserve state.

split: open-access


prompt:
Deque commit exposes slots the producer did not initialize.

A bounded deque write reservation publishes exactly its initialized prefix. Reject negative, uninitialized, over-reserved or over-capacity commit counts atomically. Successful commit releases the entire reservation and advances structure epoch only for nonempty publication.

split: open-access


prompt:
Deque commit exceeds the producer reserved grant.

A bounded deque write reservation publishes exactly its initialized prefix. Reject negative, uninitialized, over-reserved or over-capacity commit counts atomically. Successful commit releases the entire reservation and advances structure epoch only for nonempty publication.

split: open-access


prompt:
Deque commit forgets already-published resident values.

A bounded deque write reservation publishes exactly its initialized prefix. Reject negative, uninitialized, over-reserved or over-capacity commit counts atomically. Successful commit releases the entire reservation and advances structure epoch only for nonempty publication.

split: open-access


prompt:
Deque reservation commit publishes its uncommitted suffix.

A bounded deque write reservation publishes exactly its initialized prefix. Reject negative, uninitialized, over-reserved or over-capacity commit counts atomically. Successful commit releases the entire reservation and advances structure epoch only for nonempty publication.

split: open-access


prompt:
Deque reservation commit leaves unused reserved slots charged.

A bounded deque write reservation publishes exactly its initialized prefix. Reject negative, uninitialized, over-reserved or over-capacity commit counts atomically. Successful commit releases the entire reservation and advances structure epoch only for nonempty publication.

split: open-access


prompt:
Empty deque reservation commit invalidates all iterators.

A bounded deque write reservation publishes exactly its initialized prefix. Reject negative, uninitialized, over-reserved or over-capacity commit counts atomically. Successful commit releases the entire reservation and advances structure epoch only for nonempty publication.

split: open-access


prompt:
Deque reservation commit returns initialized entries as unused.

A bounded deque write reservation publishes exactly its initialized prefix. Reject negative, uninitialized, over-reserved or over-capacity commit counts atomically. Successful commit releases the entire reservation and advances structure epoch only for nonempty publication.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    pins,token,owner,retired,epoch=x
    found=any(p[1]==token for p in pins)
    active=[p for p in pins if p[0]!=token]
    can_reclaim=not active and not owner
    reclaimed=retired[:] if can_reclaim else []
    pending=[] if reclaimed else retired[:]
    version=epoch+(found and bool(reclaimed))
    return [active,found,pending,reclaimed,version,bool(active),owner]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[[1,N],[2,N+1]],1,False,[4,5],2]), {1: [[[2, 2]], True, [4, 5], [], 2, True, False], 2: [[[2, 3]], True, [4, 5], [], 2, True, False], 3: [[[2, 4]], True, [4, 5], [], 2, True, False], 4: [[[2, 5]], True, [4, 5], [], 2, True, False], 5: [[[2, 6]], True, [4, 5], [], 2, True, False]}[N])
check('1', solve([[[1,N]],1,False,[4,5],2]), {1: [[], True, [], [4, 5], 3, False, False], 2: [[], True, [], [4, 5], 3, False, False], 3: [[], True, [], [4, 5], 3, False, False], 4: [[], True, [], [4, 5], 3, False, False], 5: [[], True, [], [4, 5], 3, False, False]}[N])
check('2', solve([[[1,N]],1,True,[4],3]), {1: [[], True, [4], [], 3, False, True], 2: [[], True, [4], [], 3, False, True], 3: [[], True, [4], [], 3, False, True], 4: [[], True, [4], [], 3, False, True], 5: [[], True, [4], [], 3, False, True]}[N])
check('3', solve([[[1,N]],9,False,[4],1]), {1: [[[1, 1]], False, [4], [], 1, True, False], 2: [[[1, 2]], False, [4], [], 1, True, False], 3: [[[1, 3]], False, [4], [], 1, True, False], 4: [[[1, 4]], False, [4], [], 1, True, False], 5: [[[1, 5]], False, [4], [], 1, True, False]}[N])
check('4', solve([[],9,True,[],0]), {1: [[], False, [], [], 0, False, True], 2: [[], False, [], [], 0, False, True], 3: [[], False, [], [], 0, False, True], 4: [[], False, [], [], 0, False, True], 5: [[], False, [], [], 0, False, True]}[N])
check('5', solve([[[1,N],[2,N+1]],2,False,[],4]), {1: [[[1, 1]], True, [], [], 4, True, False], 2: [[[1, 2]], True, [], [], 4, True, False], 3: [[[1, 3]], True, [], [], 4, True, False], 4: [[[1, 4]], True, [], [], 4, True, False], 5: [[[1, 5]], True, [], [], 4, True, False]}[N])
check('pin identity differs from payload', solve([[[17,N],[18,N+1]],17,False,[4],3]), [[[18,N+1]],True,[4],[],3,True,False])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    pins,token,owner,retired,epoch=x
    found=any(p[0]==token for p in pins) if len(pins)==1 else any(p[1]==token for p in pins)
    active=[p for p in pins if p[0]!=token]
    can_reclaim=not active and not owner
    reclaimed=retired[:] if can_reclaim else []
    pending=[] if reclaimed else retired[:]
    version=epoch+(found and bool(reclaimed))
    return [active,found,pending,reclaimed,version,bool(active),owner]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[[1,N],[2,N+1]],1,False,[4,5],2]), {1: [[[2, 2]], True, [4, 5], [], 2, True, False], 2: [[[2, 3]], True, [4, 5], [], 2, True, False], 3: [[[2, 4]], True, [4, 5], [], 2, True, False], 4: [[[2, 5]], True, [4, 5], [], 2, True, False], 5: [[[2, 6]], True, [4, 5], [], 2, True, False]}[N])
check('1', solve([[[1,N]],1,False,[4,5],2]), {1: [[], True, [], [4, 5], 3, False, False], 2: [[], True, [], [4, 5], 3, False, False], 3: [[], True, [], [4, 5], 3, False, False], 4: [[], True, [], [4, 5], 3, False, False], 5: [[], True, [], [4, 5], 3, False, False]}[N])
check('2', solve([[[1,N]],1,True,[4],3]), {1: [[], True, [4], [], 3, False, True], 2: [[], True, [4], [], 3, False, True], 3: [[], True, [4], [], 3, False, True], 4: [[], True, [4], [], 3, False, True], 5: [[], True, [4], [], 3, False, True]}[N])
check('3', solve([[[1,N]],9,False,[4],1]), {1: [[[1, 1]], False, [4], [], 1, True, False], 2: [[[1, 2]], False, [4], [], 1, True, False], 3: [[[1, 3]], False, [4], [], 1, True, False], 4: [[[1, 4]], False, [4], [], 1, True, False], 5: [[[1, 5]], False, [4], [], 1, True, False]}[N])
check('4', solve([[],9,True,[],0]), {1: [[], False, [], [], 0, False, True], 2: [[], False, [], [], 0, False, True], 3: [[], False, [], [], 0, False, True], 4: [[], False, [], [], 0, False, True], 5: [[], False, [], [], 0, False, True]}[N])
check('5', solve([[[1,N],[2,N+1]],2,False,[],4]), {1: [[[1, 1]], True, [], [], 4, True, False], 2: [[[1, 2]], True, [], [], 4, True, False], 3: [[[1, 3]], True, [], [], 4, True, False], 4: [[[1, 4]], True, [], [], 4, True, False], 5: [[[1, 5]], True, [], [], 4, True, False]}[N])
check('pin identity differs from payload', solve([[[17,N],[18,N+1]],17,False,[4],3]), [[[18,N+1]],True,[4],[],3,True,False])
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)

prompt:
Deque borrow release mistakes payload identity for token identity.

Release a unique deque borrow token. Retired storage is reclaimed only when both the owner and all borrowers are gone; unknown releases are idempotent. Return active pins, receipt, retired/reclaimed sets, reclamation epoch and owner state.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    pins,token,owner,retired,epoch=x
    found=any(p[0]==token for p in pins)
    active=[]
    can_reclaim=not active and not owner
    reclaimed=retired[:] if can_reclaim else []
    pending=[] if reclaimed else retired[:]
    version=epoch+(found and bool(reclaimed))
    return [active,found,pending,reclaimed,version,bool(active),owner]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[[1,N],[2,N+1]],1,False,[4,5],2]), {1: [[[2, 2]], True, [4, 5], [], 2, True, False], 2: [[[2, 3]], True, [4, 5], [], 2, True, False], 3: [[[2, 4]], True, [4, 5], [], 2, True, False], 4: [[[2, 5]], True, [4, 5], [], 2, True, False], 5: [[[2, 6]], True, [4, 5], [], 2, True, False]}[N])
check('1', solve([[[1,N]],1,False,[4,5],2]), {1: [[], True, [], [4, 5], 3, False, False], 2: [[], True, [], [4, 5], 3, False, False], 3: [[], True, [], [4, 5], 3, False, False], 4: [[], True, [], [4, 5], 3, False, False], 5: [[], True, [], [4, 5], 3, False, False]}[N])
check('2', solve([[[1,N]],1,True,[4],3]), {1: [[], True, [4], [], 3, False, True], 2: [[], True, [4], [], 3, False, True], 3: [[], True, [4], [], 3, False, True], 4: [[], True, [4], [], 3, False, True], 5: [[], True, [4], [], 3, False, True]}[N])
check('3', solve([[[1,N]],9,False,[4],1]), {1: [[[1, 1]], False, [4], [], 1, True, False], 2: [[[1, 2]], False, [4], [], 1, True, False], 3: [[[1, 3]], False, [4], [], 1, True, False], 4: [[[1, 4]], False, [4], [], 1, True, False], 5: [[[1, 5]], False, [4], [], 1, True, False]}[N])
check('4', solve([[],9,True,[],0]), {1: [[], False, [], [], 0, False, True], 2: [[], False, [], [], 0, False, True], 3: [[], False, [], [], 0, False, True], 4: [[], False, [], [], 0, False, True], 5: [[], False, [], [], 0, False, True]}[N])
check('5', solve([[[1,N],[2,N+1]],2,False,[],4]), {1: [[[1, 1]], True, [], [], 4, True, False], 2: [[[1, 2]], True, [], [], 4, True, False], 3: [[[1, 3]], True, [], [], 4, True, False], 4: [[[1, 4]], True, [], [], 4, True, False], 5: [[[1, 5]], True, [], [], 4, True, False]}[N])
check('pin identity differs from payload', solve([[[17,N],[18,N+1]],17,False,[4],3]), [[[18,N+1]],True,[4],[],3,True,False])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    pins,token,owner,retired,epoch=x
    found=any(p[0]==token for p in pins)
    active=[] if found else pins
    can_reclaim=not active and not owner
    reclaimed=retired[:] if can_reclaim else []
    pending=[] if reclaimed else retired[:]
    version=epoch+(found and bool(reclaimed))
    return [active,found,pending,reclaimed,version,bool(active),owner]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[[1,N],[2,N+1]],1,False,[4,5],2]), {1: [[[2, 2]], True, [4, 5], [], 2, True, False], 2: [[[2, 3]], True, [4, 5], [], 2, True, False], 3: [[[2, 4]], True, [4, 5], [], 2, True, False], 4: [[[2, 5]], True, [4, 5], [], 2, True, False], 5: [[[2, 6]], True, [4, 5], [], 2, True, False]}[N])
check('1', solve([[[1,N]],1,False,[4,5],2]), {1: [[], True, [], [4, 5], 3, False, False], 2: [[], True, [], [4, 5], 3, False, False], 3: [[], True, [], [4, 5], 3, False, False], 4: [[], True, [], [4, 5], 3, False, False], 5: [[], True, [], [4, 5], 3, False, False]}[N])
check('2', solve([[[1,N]],1,True,[4],3]), {1: [[], True, [4], [], 3, False, True], 2: [[], True, [4], [], 3, False, True], 3: [[], True, [4], [], 3, False, True], 4: [[], True, [4], [], 3, False, True], 5: [[], True, [4], [], 3, False, True]}[N])
check('3', solve([[[1,N]],9,False,[4],1]), {1: [[[1, 1]], False, [4], [], 1, True, False], 2: [[[1, 2]], False, [4], [], 1, True, False], 3: [[[1, 3]], False, [4], [], 1, True, False], 4: [[[1, 4]], False, [4], [], 1, True, False], 5: [[[1, 5]], False, [4], [], 1, True, False]}[N])
check('4', solve([[],9,True,[],0]), {1: [[], False, [], [], 0, False, True], 2: [[], False, [], [], 0, False, True], 3: [[], False, [], [], 0, False, True], 4: [[], False, [], [], 0, False, True], 5: [[], False, [], [], 0, False, True]}[N])
check('5', solve([[[1,N],[2,N+1]],2,False,[],4]), {1: [[[1, 1]], True, [], [], 4, True, False], 2: [[[1, 2]], True, [], [], 4, True, False], 3: [[[1, 3]], True, [], [], 4, True, False], 4: [[[1, 4]], True, [], [], 4, True, False], 5: [[[1, 5]], True, [], [], 4, True, False]}[N])
check('pin identity differs from payload', solve([[[17,N],[18,N+1]],17,False,[4],3]), [[[18,N+1]],True,[4],[],3,True,False])
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)

prompt:
Deque borrow release discards every outstanding pin.

Release a unique deque borrow token. Retired storage is reclaimed only when both the owner and all borrowers are gone; unknown releases are idempotent. Return active pins, receipt, retired/reclaimed sets, reclamation epoch and owner state.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    pins,token,owner,retired,epoch=x
    found=any(p[0]==token for p in pins)
    active=[p for p in pins if p[0]!=token]
    can_reclaim=not active
    reclaimed=retired[:] if can_reclaim else []
    pending=[] if reclaimed else retired[:]
    version=epoch+(found and bool(reclaimed))
    return [active,found,pending,reclaimed,version,bool(active),owner]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[[1,N],[2,N+1]],1,False,[4,5],2]), {1: [[[2, 2]], True, [4, 5], [], 2, True, False], 2: [[[2, 3]], True, [4, 5], [], 2, True, False], 3: [[[2, 4]], True, [4, 5], [], 2, True, False], 4: [[[2, 5]], True, [4, 5], [], 2, True, False], 5: [[[2, 6]], True, [4, 5], [], 2, True, False]}[N])
check('1', solve([[[1,N]],1,False,[4,5],2]), {1: [[], True, [], [4, 5], 3, False, False], 2: [[], True, [], [4, 5], 3, False, False], 3: [[], True, [], [4, 5], 3, False, False], 4: [[], True, [], [4, 5], 3, False, False], 5: [[], True, [], [4, 5], 3, False, False]}[N])
check('2', solve([[[1,N]],1,True,[4],3]), {1: [[], True, [4], [], 3, False, True], 2: [[], True, [4], [], 3, False, True], 3: [[], True, [4], [], 3, False, True], 4: [[], True, [4], [], 3, False, True], 5: [[], True, [4], [], 3, False, True]}[N])
check('3', solve([[[1,N]],9,False,[4],1]), {1: [[[1, 1]], False, [4], [], 1, True, False], 2: [[[1, 2]], False, [4], [], 1, True, False], 3: [[[1, 3]], False, [4], [], 1, True, False], 4: [[[1, 4]], False, [4], [], 1, True, False], 5: [[[1, 5]], False, [4], [], 1, True, False]}[N])
check('4', solve([[],9,True,[],0]), {1: [[], False, [], [], 0, False, True], 2: [[], False, [], [], 0, False, True], 3: [[], False, [], [], 0, False, True], 4: [[], False, [], [], 0, False, True], 5: [[], False, [], [], 0, False, True]}[N])
check('5', solve([[[1,N],[2,N+1]],2,False,[],4]), {1: [[[1, 1]], True, [], [], 4, True, False], 2: [[[1, 2]], True, [], [], 4, True, False], 3: [[[1, 3]], True, [], [], 4, True, False], 4: [[[1, 4]], True, [], [], 4, True, False], 5: [[[1, 5]], True, [], [], 4, True, False]}[N])
check('pin identity differs from payload', solve([[[17,N],[18,N+1]],17,False,[4],3]), [[[18,N+1]],True,[4],[],3,True,False])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    pins,token,owner,retired,epoch=x
    found=any(p[0]==token for p in pins)
    active=[p for p in pins if p[0]!=token]
    can_reclaim=not active and (not owner or bool(retired))
    reclaimed=retired[:] if can_reclaim else []
    pending=[] if reclaimed else retired[:]
    version=epoch+(found and bool(reclaimed))
    return [active,found,pending,reclaimed,version,bool(active),owner]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[[1,N],[2,N+1]],1,False,[4,5],2]), {1: [[[2, 2]], True, [4, 5], [], 2, True, False], 2: [[[2, 3]], True, [4, 5], [], 2, True, False], 3: [[[2, 4]], True, [4, 5], [], 2, True, False], 4: [[[2, 5]], True, [4, 5], [], 2, True, False], 5: [[[2, 6]], True, [4, 5], [], 2, True, False]}[N])
check('1', solve([[[1,N]],1,False,[4,5],2]), {1: [[], True, [], [4, 5], 3, False, False], 2: [[], True, [], [4, 5], 3, False, False], 3: [[], True, [], [4, 5], 3, False, False], 4: [[], True, [], [4, 5], 3, False, False], 5: [[], True, [], [4, 5], 3, False, False]}[N])
check('2', solve([[[1,N]],1,True,[4],3]), {1: [[], True, [4], [], 3, False, True], 2: [[], True, [4], [], 3, False, True], 3: [[], True, [4], [], 3, False, True], 4: [[], True, [4], [], 3, False, True], 5: [[], True, [4], [], 3, False, True]}[N])
check('3', solve([[[1,N]],9,False,[4],1]), {1: [[[1, 1]], False, [4], [], 1, True, False], 2: [[[1, 2]], False, [4], [], 1, True, False], 3: [[[1, 3]], False, [4], [], 1, True, False], 4: [[[1, 4]], False, [4], [], 1, True, False], 5: [[[1, 5]], False, [4], [], 1, True, False]}[N])
check('4', solve([[],9,True,[],0]), {1: [[], False, [], [], 0, False, True], 2: [[], False, [], [], 0, False, True], 3: [[], False, [], [], 0, False, True], 4: [[], False, [], [], 0, False, True], 5: [[], False, [], [], 0, False, True]}[N])
check('5', solve([[[1,N],[2,N+1]],2,False,[],4]), {1: [[[1, 1]], True, [], [], 4, True, False], 2: [[[1, 2]], True, [], [], 4, True, False], 3: [[[1, 3]], True, [], [], 4, True, False], 4: [[[1, 4]], True, [], [], 4, True, False], 5: [[[1, 5]], True, [], [], 4, True, False]}[N])
check('pin identity differs from payload', solve([[[17,N],[18,N+1]],17,False,[4],3]), [[[18,N+1]],True,[4],[],3,True,False])
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)

prompt:
Deque borrow release reclaims storage while its owner is alive.

Release a unique deque borrow token. Retired storage is reclaimed only when both the owner and all borrowers are gone; unknown releases are idempotent. Return active pins, receipt, retired/reclaimed sets, reclamation epoch and owner state.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    pins,token,owner,retired,epoch=x
    found=any(p[0]==token for p in pins)
    active=[p for p in pins if p[0]!=token]
    can_reclaim=not active and not owner
    reclaimed=retired[::-1] if can_reclaim else []
    pending=[] if reclaimed else retired[:]
    version=epoch+(found and bool(reclaimed))
    return [active,found,pending,reclaimed,version,bool(active),owner]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[[1,N],[2,N+1]],1,False,[4,5],2]), {1: [[[2, 2]], True, [4, 5], [], 2, True, False], 2: [[[2, 3]], True, [4, 5], [], 2, True, False], 3: [[[2, 4]], True, [4, 5], [], 2, True, False], 4: [[[2, 5]], True, [4, 5], [], 2, True, False], 5: [[[2, 6]], True, [4, 5], [], 2, True, False]}[N])
check('1', solve([[[1,N]],1,False,[4,5],2]), {1: [[], True, [], [4, 5], 3, False, False], 2: [[], True, [], [4, 5], 3, False, False], 3: [[], True, [], [4, 5], 3, False, False], 4: [[], True, [], [4, 5], 3, False, False], 5: [[], True, [], [4, 5], 3, False, False]}[N])
check('2', solve([[[1,N]],1,True,[4],3]), {1: [[], True, [4], [], 3, False, True], 2: [[], True, [4], [], 3, False, True], 3: [[], True, [4], [], 3, False, True], 4: [[], True, [4], [], 3, False, True], 5: [[], True, [4], [], 3, False, True]}[N])
check('3', solve([[[1,N]],9,False,[4],1]), {1: [[[1, 1]], False, [4], [], 1, True, False], 2: [[[1, 2]], False, [4], [], 1, True, False], 3: [[[1, 3]], False, [4], [], 1, True, False], 4: [[[1, 4]], False, [4], [], 1, True, False], 5: [[[1, 5]], False, [4], [], 1, True, False]}[N])
check('4', solve([[],9,True,[],0]), {1: [[], False, [], [], 0, False, True], 2: [[], False, [], [], 0, False, True], 3: [[], False, [], [], 0, False, True], 4: [[], False, [], [], 0, False, True], 5: [[], False, [], [], 0, False, True]}[N])
check('5', solve([[[1,N],[2,N+1]],2,False,[],4]), {1: [[[1, 1]], True, [], [], 4, True, False], 2: [[[1, 2]], True, [], [], 4, True, False], 3: [[[1, 3]], True, [], [], 4, True, False], 4: [[[1, 4]], True, [], [], 4, True, False], 5: [[[1, 5]], True, [], [], 4, True, False]}[N])
check('pin identity differs from payload', solve([[[17,N],[18,N+1]],17,False,[4],3]), [[[18,N+1]],True,[4],[],3,True,False])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    pins,token,owner,retired,epoch=x
    found=any(p[0]==token for p in pins)
    active=[p for p in pins if p[0]!=token]
    can_reclaim=not active and not owner
    reclaimed=(retired[:] if len(retired)<2 else retired[::-1]) if can_reclaim else []
    pending=[] if reclaimed else retired[:]
    version=epoch+(found and bool(reclaimed))
    return [active,found,pending,reclaimed,version,bool(active),owner]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[[1,N],[2,N+1]],1,False,[4,5],2]), {1: [[[2, 2]], True, [4, 5], [], 2, True, False], 2: [[[2, 3]], True, [4, 5], [], 2, True, False], 3: [[[2, 4]], True, [4, 5], [], 2, True, False], 4: [[[2, 5]], True, [4, 5], [], 2, True, False], 5: [[[2, 6]], True, [4, 5], [], 2, True, False]}[N])
check('1', solve([[[1,N]],1,False,[4,5],2]), {1: [[], True, [], [4, 5], 3, False, False], 2: [[], True, [], [4, 5], 3, False, False], 3: [[], True, [], [4, 5], 3, False, False], 4: [[], True, [], [4, 5], 3, False, False], 5: [[], True, [], [4, 5], 3, False, False]}[N])
check('2', solve([[[1,N]],1,True,[4],3]), {1: [[], True, [4], [], 3, False, True], 2: [[], True, [4], [], 3, False, True], 3: [[], True, [4], [], 3, False, True], 4: [[], True, [4], [], 3, False, True], 5: [[], True, [4], [], 3, False, True]}[N])
check('3', solve([[[1,N]],9,False,[4],1]), {1: [[[1, 1]], False, [4], [], 1, True, False], 2: [[[1, 2]], False, [4], [], 1, True, False], 3: [[[1, 3]], False, [4], [], 1, True, False], 4: [[[1, 4]], False, [4], [], 1, True, False], 5: [[[1, 5]], False, [4], [], 1, True, False]}[N])
check('4', solve([[],9,True,[],0]), {1: [[], False, [], [], 0, False, True], 2: [[], False, [], [], 0, False, True], 3: [[], False, [], [], 0, False, True], 4: [[], False, [], [], 0, False, True], 5: [[], False, [], [], 0, False, True]}[N])
check('5', solve([[[1,N],[2,N+1]],2,False,[],4]), {1: [[[1, 1]], True, [], [], 4, True, False], 2: [[[1, 2]], True, [], [], 4, True, False], 3: [[[1, 3]], True, [], [], 4, True, False], 4: [[[1, 4]], True, [], [], 4, True, False], 5: [[[1, 5]], True, [], [], 4, True, False]}[N])
check('pin identity differs from payload', solve([[[17,N],[18,N+1]],17,False,[4],3]), [[[18,N+1]],True,[4],[],3,True,False])
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)

prompt:
Deque borrow release reverses deferred reclamation order.

Release a unique deque borrow token. Retired storage is reclaimed only when both the owner and all borrowers are gone; unknown releases are idempotent. Return active pins, receipt, retired/reclaimed sets, reclamation epoch and owner state.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    pins,token,owner,retired,epoch=x
    found=any(p[0]==token for p in pins)
    active=[p for p in pins if p[0]!=token]
    can_reclaim=not active and not owner
    reclaimed=retired[:] if can_reclaim else []
    pending=retired[:]
    version=epoch+(found and bool(reclaimed))
    return [active,found,pending,reclaimed,version,bool(active),owner]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[[1,N],[2,N+1]],1,False,[4,5],2]), {1: [[[2, 2]], True, [4, 5], [], 2, True, False], 2: [[[2, 3]], True, [4, 5], [], 2, True, False], 3: [[[2, 4]], True, [4, 5], [], 2, True, False], 4: [[[2, 5]], True, [4, 5], [], 2, True, False], 5: [[[2, 6]], True, [4, 5], [], 2, True, False]}[N])
check('1', solve([[[1,N]],1,False,[4,5],2]), {1: [[], True, [], [4, 5], 3, False, False], 2: [[], True, [], [4, 5], 3, False, False], 3: [[], True, [], [4, 5], 3, False, False], 4: [[], True, [], [4, 5], 3, False, False], 5: [[], True, [], [4, 5], 3, False, False]}[N])
check('2', solve([[[1,N]],1,True,[4],3]), {1: [[], True, [4], [], 3, False, True], 2: [[], True, [4], [], 3, False, True], 3: [[], True, [4], [], 3, False, True], 4: [[], True, [4], [], 3, False, True], 5: [[], True, [4], [], 3, False, True]}[N])
check('3', solve([[[1,N]],9,False,[4],1]), {1: [[[1, 1]], False, [4], [], 1, True, False], 2: [[[1, 2]], False, [4], [], 1, True, False], 3: [[[1, 3]], False, [4], [], 1, True, False], 4: [[[1, 4]], False, [4], [], 1, True, False], 5: [[[1, 5]], False, [4], [], 1, True, False]}[N])
check('4', solve([[],9,True,[],0]), {1: [[], False, [], [], 0, False, True], 2: [[], False, [], [], 0, False, True], 3: [[], False, [], [], 0, False, True], 4: [[], False, [], [], 0, False, True], 5: [[], False, [], [], 0, False, True]}[N])
check('5', solve([[[1,N],[2,N+1]],2,False,[],4]), {1: [[[1, 1]], True, [], [], 4, True, False], 2: [[[1, 2]], True, [], [], 4, True, False], 3: [[[1, 3]], True, [], [], 4, True, False], 4: [[[1, 4]], True, [], [], 4, True, False], 5: [[[1, 5]], True, [], [], 4, True, False]}[N])
check('pin identity differs from payload', solve([[[17,N],[18,N+1]],17,False,[4],3]), [[[18,N+1]],True,[4],[],3,True,False])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    pins,token,owner,retired,epoch=x
    found=any(p[0]==token for p in pins)
    active=[p for p in pins if p[0]!=token]
    can_reclaim=not active and not owner
    reclaimed=retired[:] if can_reclaim else []
    pending=[] if len(reclaimed)==1 else retired[:]
    version=epoch+(found and bool(reclaimed))
    return [active,found,pending,reclaimed,version,bool(active),owner]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('0', solve([[[1,N],[2,N+1]],1,False,[4,5],2]), {1: [[[2, 2]], True, [4, 5], [], 2, True, False], 2: [[[2, 3]], True, [4, 5], [], 2, True, False], 3: [[[2, 4]], True, [4, 5], [], 2, True, False], 4: [[[2, 5]], True, [4, 5], [], 2, True, False], 5: [[[2, 6]], True, [4, 5], [], 2, True, False]}[N])
check('1', solve([[[1,N]],1,False,[4,5],2]), {1: [[], True, [], [4, 5], 3, False, False], 2: [[], True, [], [4, 5], 3, False, False], 3: [[], True, [], [4, 5], 3, False, False], 4: [[], True, [], [4, 5], 3, False, False], 5: [[], True, [], [4, 5], 3, False, False]}[N])
check('2', solve([[[1,N]],1,True,[4],3]), {1: [[], True, [4], [], 3, False, True], 2: [[], True, [4], [], 3, False, True], 3: [[], True, [4], [], 3, False, True], 4: [[], True, [4], [], 3, False, True], 5: [[], True, [4], [], 3, False, True]}[N])
check('3', solve([[[1,N]],9,False,[4],1]), {1: [[[1, 1]], False, [4], [], 1, True, False], 2: [[[1, 2]], False, [4], [], 1, True, False], 3: [[[1, 3]], False, [4], [], 1, True, False], 4: [[[1, 4]], False, [4], [], 1, True, False], 5: [[[1, 5]], False, [4], [], 1, True, False]}[N])
check('4', solve([[],9,True,[],0]), {1: [[], False, [], [], 0, False, True], 2: [[], False, [], [], 0, False, True], 3: [[], False, [], [], 0, False, True], 4: [[], False, [], [], 0, False, True], 5: [[], False, [], [], 0, False, True]}[N])
check('5', solve([[[1,N],[2,N+1]],2,False,[],4]), {1: [[[1, 1]], True, [], [], 4, True, False], 2: [[[1, 2]], True, [], [], 4, True, False], 3: [[[1, 3]], True, [], [], 4, True, False], 4: [[[1, 4]], True, [], [], 4, True, False], 5: [[[1, 5]], True, [], [], 4, True, False]}[N])
check('pin identity differs from payload', solve([[[17,N],[18,N+1]],17,False,[4],3]), [[[18,N+1]],True,[4],[],3,True,False])
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)

prompt:
Deque borrow release retains already-reclaimed storage in its pending list.

Release a unique deque borrow token. Retired storage is reclaimed only when both the owner and all borrowers are gone; unknown releases are idempotent. Return active pins, receipt, retired/reclaimed sets, reclamation epoch and owner state.

split: open-access