{"abstract":"Bounded deque producer wakeup grants newest waiters first.","category":"Bounded deques","checks":6,"contract":"After cancellation by waiter identity, fill free bounded-deque slots from FIFO blocked producers. Return updated queue, remaining waiters, resumed IDs, cancelled IDs and remaining free slots.","evaluation_group":"s3-bounded-deques-producer-waiters","failed_approach":"The partial repair still applies the incorrect transition to an admitted boundary or multi-element case.","family":"s3-bounded-deques-producer-waiters-fifo-grant","id":"FA-46831","implementations":{"attempt":{"sha256":"4d0b912f8f46a4dd40f90cbe9fccda1fafb0c6c340a0d2ce795211a576abe032","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    a,cap,waiters,cancel=x\n    active=[w for w in waiters if w[0]!=cancel]\n    cancelled=[w[0] for w in waiters if w[0]==cancel]\n    room=cap-len(a)\n    selected=active[:room] if room<=1 else active[::-1][:room]\n    remaining=active[room:]\n    result=a+[w[1] for w in selected]\n    resumed=[w[0] for w in selected]\n    return [result,remaining,resumed,cancelled,room-len(selected)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('0', solve([[N],3,[[1,N+1],[2,N+2],[3,N+3]],2]), {1: [[1, 2, 4], [], [1, 3], [2], 0], 2: [[2, 3, 5], [], [1, 3], [2], 0], 3: [[3, 4, 6], [], [1, 3], [2], 0], 4: [[4, 5, 7], [], [1, 3], [2], 0], 5: [[5, 6, 8], [], [1, 3], [2], 0]}[N])\ncheck('1', solve([[N,N+1],2,[[1,N+2]],9]), {1: [[1, 2], [[1, 3]], [], [], 0], 2: [[2, 3], [[1, 4]], [], [], 0], 3: [[3, 4], [[1, 5]], [], [], 0], 4: [[4, 5], [[1, 6]], [], [], 0], 5: [[5, 6], [[1, 7]], [], [], 0]}[N])\ncheck('2', solve([[],2,[[1,N],[2,N+1],[3,N+2]],9]), {1: [[1, 2], [[3, 3]], [1, 2], [], 0], 2: [[2, 3], [[3, 4]], [1, 2], [], 0], 3: [[3, 4], [[3, 5]], [1, 2], [], 0], 4: [[4, 5], [[3, 6]], [1, 2], [], 0], 5: [[5, 6], [[3, 7]], [1, 2], [], 0]}[N])\ncheck('3', solve([[N],4,[],8]), {1: [[1], [], [], [], 3], 2: [[2], [], [], [], 3], 3: [[3], [], [], [], 3], 4: [[4], [], [], [], 3], 5: [[5], [], [], [], 3]}[N])\ncheck('4', solve([[],3,[[1,N],[2,N]],1]), {1: [[1], [], [2], [1], 2], 2: [[2], [], [2], [1], 2], 3: [[3], [], [2], [1], 2], 4: [[4], [], [2], [1], 2], 5: [[5], [], [2], [1], 2]}[N])\ncheck('5', solve([[N],2,[[1,N+1],[2,N+2],[3,N+3]],1]), {1: [[1, 3], [[3, 4]], [2], [1], 0], 2: [[2, 4], [[3, 5]], [2], [1], 0], 3: [[3, 5], [[3, 6]], [2], [1], 0], 4: [[4, 6], [[3, 7]], [2], [1], 0], 5: [[5, 7], [[3, 8]], [2], [1], 0]}[N])\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"3de80ccb2561fdd2569bb64e0d25a95e62825126bd644f4ee81fd236b71342b9","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    a,cap,waiters,cancel=x\n    active=[w for w in waiters if w[0]!=cancel]\n    cancelled=[w[0] for w in waiters if w[0]==cancel]\n    room=cap-len(a)\n    selected=active[::-1][:room]\n    remaining=active[room:]\n    result=a+[w[1] for w in selected]\n    resumed=[w[0] for w in selected]\n    return [result,remaining,resumed,cancelled,room-len(selected)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('0', solve([[N],3,[[1,N+1],[2,N+2],[3,N+3]],2]), {1: [[1, 2, 4], [], [1, 3], [2], 0], 2: [[2, 3, 5], [], [1, 3], [2], 0], 3: [[3, 4, 6], [], [1, 3], [2], 0], 4: [[4, 5, 7], [], [1, 3], [2], 0], 5: [[5, 6, 8], [], [1, 3], [2], 0]}[N])\ncheck('1', solve([[N,N+1],2,[[1,N+2]],9]), {1: [[1, 2], [[1, 3]], [], [], 0], 2: [[2, 3], [[1, 4]], [], [], 0], 3: [[3, 4], [[1, 5]], [], [], 0], 4: [[4, 5], [[1, 6]], [], [], 0], 5: [[5, 6], [[1, 7]], [], [], 0]}[N])\ncheck('2', solve([[],2,[[1,N],[2,N+1],[3,N+2]],9]), {1: [[1, 2], [[3, 3]], [1, 2], [], 0], 2: [[2, 3], [[3, 4]], [1, 2], [], 0], 3: [[3, 4], [[3, 5]], [1, 2], [], 0], 4: [[4, 5], [[3, 6]], [1, 2], [], 0], 5: [[5, 6], [[3, 7]], [1, 2], [], 0]}[N])\ncheck('3', solve([[N],4,[],8]), {1: [[1], [], [], [], 3], 2: [[2], [], [], [], 3], 3: [[3], [], [], [], 3], 4: [[4], [], [], [], 3], 5: [[5], [], [], [], 3]}[N])\ncheck('4', solve([[],3,[[1,N],[2,N]],1]), {1: [[1], [], [2], [1], 2], 2: [[2], [], [2], [1], 2], 3: [[3], [], [2], [1], 2], 4: [[4], [], [2], [1], 2], 5: [[5], [], [2], [1], 2]}[N])\ncheck('5', solve([[N],2,[[1,N+1],[2,N+2],[3,N+3]],1]), {1: [[1, 3], [[3, 4]], [2], [1], 0], 2: [[2, 4], [[3, 5]], [2], [1], 0], 3: [[3, 5], [[3, 6]], [2], [1], 0], 4: [[4, 6], [[3, 7]], [2], [1], 0], 5: [[5, 7], [[3, 8]], [2], [1], 0]}[N])\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"541bb5005675062bbde1975109dd95832353d2621e984dbf350b18742fb6d466","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    a,cap,waiters,cancel=x\n    active=[w for w in waiters if w[0]!=cancel]\n    cancelled=[w[0] for w in waiters if w[0]==cancel]\n    room=cap-len(a)\n    selected=active[:room]\n    remaining=active[room:]\n    result=a+[w[1] for w in selected]\n    resumed=[w[0] for w in selected]\n    return [result,remaining,resumed,cancelled,room-len(selected)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('0', solve([[N],3,[[1,N+1],[2,N+2],[3,N+3]],2]), {1: [[1, 2, 4], [], [1, 3], [2], 0], 2: [[2, 3, 5], [], [1, 3], [2], 0], 3: [[3, 4, 6], [], [1, 3], [2], 0], 4: [[4, 5, 7], [], [1, 3], [2], 0], 5: [[5, 6, 8], [], [1, 3], [2], 0]}[N])\ncheck('1', solve([[N,N+1],2,[[1,N+2]],9]), {1: [[1, 2], [[1, 3]], [], [], 0], 2: [[2, 3], [[1, 4]], [], [], 0], 3: [[3, 4], [[1, 5]], [], [], 0], 4: [[4, 5], [[1, 6]], [], [], 0], 5: [[5, 6], [[1, 7]], [], [], 0]}[N])\ncheck('2', solve([[],2,[[1,N],[2,N+1],[3,N+2]],9]), {1: [[1, 2], [[3, 3]], [1, 2], [], 0], 2: [[2, 3], [[3, 4]], [1, 2], [], 0], 3: [[3, 4], [[3, 5]], [1, 2], [], 0], 4: [[4, 5], [[3, 6]], [1, 2], [], 0], 5: [[5, 6], [[3, 7]], [1, 2], [], 0]}[N])\ncheck('3', solve([[N],4,[],8]), {1: [[1], [], [], [], 3], 2: [[2], [], [], [], 3], 3: [[3], [], [], [], 3], 4: [[4], [], [], [], 3], 5: [[5], [], [], [], 3]}[N])\ncheck('4', solve([[],3,[[1,N],[2,N]],1]), {1: [[1], [], [2], [1], 2], 2: [[2], [], [2], [1], 2], 3: [[3], [], [2], [1], 2], 4: [[4], [], [2], [1], 2], 5: [[5], [], [2], [1], 2]}[N])\ncheck('5', solve([[N],2,[[1,N+1],[2,N+2],[3,N+3]],1]), {1: [[1, 3], [[3, 4]], [2], [1], 0], 2: [[2, 4], [[3, 5]], [2], [1], 0], 3: [[3, 5], [[3, 6]], [2], [1], 0], 4: [[4, 6], [[3, 7]], [2], [1], 0], 5: [[5, 7], [[3, 8]], [2], [1], 0]}[N])\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"Offline finite deterministic model; no claim of production implementation or concurrent memory-model conformance. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"s3-bounded-deques-producer-waiters-fifo-grant","generated_at":"2026-09-29T14:44:35.868277+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Controlled bounded deque implementation model with explicit storage and lifecycle observations.","repair":"Restore the documented fifo grant invariant in producer-waiters.","root_cause":"Bounded deque producer wakeup grants newest waiters first.","sha256":"10bc3dcfdee87936aa50251443474508802e8dac1a4758f3cf18c7f05a05e1a0","title":"Bounded deque producer wakeup grants newest waiters first · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":42.218,"exit_code":1,"observations":[{"actual":[[1,4,2],[],[3,1],[2],0],"check":"0","expected":[[1,2,4],[],[1,3],[2],0],"passed":false},{"actual":[[1,2],[[1,3]],[],[],0],"check":"1","expected":[[1,2],[[1,3]],[],[],0],"passed":true},{"actual":[[3,2],[[3,3]],[3,2],[],0],"check":"2","expected":[[1,2],[[3,3]],[1,2],[],0],"passed":false},{"actual":[[1],[],[],[],3],"check":"3","expected":[[1],[],[],[],3],"passed":true},{"actual":[[1],[],[2],[1],2],"check":"4","expected":[[1],[],[2],[1],2],"passed":true},{"actual":[[1,3],[[3,4]],[2],[1],0],"check":"5","expected":[[1,3],[[3,4]],[2],[1],0],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"0\", \"actual\": [[1, 4, 2], [], [3, 1], [2], 0], \"expected\": [[1, 2, 4], [], [1, 3], [2], 0], \"passed\": false}, {\"check\": \"1\", \"actual\": [[1, 2], [[1, 3]], [], [], 0], \"expected\": [[1, 2], [[1, 3]], [], [], 0], \"passed\": true}, {\"check\": \"2\", \"actual\": [[3, 2], [[3, 3]], [3, 2], [], 0], \"expected\": [[1, 2], [[3, 3]], [1, 2], [], 0], \"passed\": false}, {\"check\": \"3\", \"actual\": [[1], [], [], [], 3], \"expected\": [[1], [], [], [], 3], \"passed\": true}, {\"check\": \"4\", \"actual\": [[1], [], [2], [1], 2], \"expected\": [[1], [], [2], [1], 2], \"passed\": true}, {\"check\": \"5\", \"actual\": [[1, 3], [[3, 4]], [2], [1], 0], \"expected\": [[1, 3], [[3, 4]], [2], [1], 0], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.331,"exit_code":1,"observations":[{"actual":[[1,4,2],[],[3,1],[2],0],"check":"0","expected":[[1,2,4],[],[1,3],[2],0],"passed":false},{"actual":[[1,2],[[1,3]],[],[],0],"check":"1","expected":[[1,2],[[1,3]],[],[],0],"passed":true},{"actual":[[3,2],[[3,3]],[3,2],[],0],"check":"2","expected":[[1,2],[[3,3]],[1,2],[],0],"passed":false},{"actual":[[1],[],[],[],3],"check":"3","expected":[[1],[],[],[],3],"passed":true},{"actual":[[1],[],[2],[1],2],"check":"4","expected":[[1],[],[2],[1],2],"passed":true},{"actual":[[1,4],[[3,4]],[3],[1],0],"check":"5","expected":[[1,3],[[3,4]],[2],[1],0],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"0\", \"actual\": [[1, 4, 2], [], [3, 1], [2], 0], \"expected\": [[1, 2, 4], [], [1, 3], [2], 0], \"passed\": false}, {\"check\": \"1\", \"actual\": [[1, 2], [[1, 3]], [], [], 0], \"expected\": [[1, 2], [[1, 3]], [], [], 0], \"passed\": true}, {\"check\": \"2\", \"actual\": [[3, 2], [[3, 3]], [3, 2], [], 0], \"expected\": [[1, 2], [[3, 3]], [1, 2], [], 0], \"passed\": false}, {\"check\": \"3\", \"actual\": [[1], [], [], [], 3], \"expected\": [[1], [], [], [], 3], \"passed\": true}, {\"check\": \"4\", \"actual\": [[1], [], [2], [1], 2], \"expected\": [[1], [], [2], [1], 2], \"passed\": true}, {\"check\": \"5\", \"actual\": [[1, 4], [[3, 4]], [3], [1], 0], \"expected\": [[1, 3], [[3, 4]], [2], [1], 0], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":44.967,"exit_code":0,"observations":[{"actual":[[1,2,4],[],[1,3],[2],0],"check":"0","expected":[[1,2,4],[],[1,3],[2],0],"passed":true},{"actual":[[1,2],[[1,3]],[],[],0],"check":"1","expected":[[1,2],[[1,3]],[],[],0],"passed":true},{"actual":[[1,2],[[3,3]],[1,2],[],0],"check":"2","expected":[[1,2],[[3,3]],[1,2],[],0],"passed":true},{"actual":[[1],[],[],[],3],"check":"3","expected":[[1],[],[],[],3],"passed":true},{"actual":[[1],[],[2],[1],2],"check":"4","expected":[[1],[],[2],[1],2],"passed":true},{"actual":[[1,3],[[3,4]],[2],[1],0],"check":"5","expected":[[1,3],[[3,4]],[2],[1],0],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"0\", \"actual\": [[1, 2, 4], [], [1, 3], [2], 0], \"expected\": [[1, 2, 4], [], [1, 3], [2], 0], \"passed\": true}, {\"check\": \"1\", \"actual\": [[1, 2], [[1, 3]], [], [], 0], \"expected\": [[1, 2], [[1, 3]], [], [], 0], \"passed\": true}, {\"check\": \"2\", \"actual\": [[1, 2], [[3, 3]], [1, 2], [], 0], \"expected\": [[1, 2], [[3, 3]], [1, 2], [], 0], \"passed\": true}, {\"check\": \"3\", \"actual\": [[1], [], [], [], 3], \"expected\": [[1], [], [], [], 3], \"passed\": true}, {\"check\": \"4\", \"actual\": [[1], [], [2], [1], 2], \"expected\": [[1], [], [2], [1], 2], \"passed\": true}, {\"check\": \"5\", \"actual\": [[1, 3], [[3, 4]], [2], [1], 0], \"expected\": [[1, 3], [[3, 4]], [2], [1], 0], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}