{"abstract":"Shrink reports evicted objects in reverse release order.","category":"Bounded deques","checks":6,"contract":"Shrink an occupied logical deque to a smaller bound, retaining the newest suffix. Return retained values, evicted prefix, a linear backing allocation, and free capacity.","evaluation_group":"s3-bounded-deques-ring-shrink","failed_approach":"The partial repair still applies the incorrect transition to an admitted boundary or multi-element case.","family":"s3-bounded-deques-ring-shrink-eviction-order","id":"FA-45921","implementations":{"attempt":{"sha256":"d888303592d48c89f3310fb0ae0ba8ccdb825ef2bba41b2f7b20ede852e0ea29","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    items, bound = x\n    lost = max(0, len(items) - bound)\n    evicted = items[:lost] if lost <= 1 else items[:lost][::-1]\n    kept = items[lost:]\n    slots = kept + [None] * (bound - len(kept))\n    free = bound - len(kept)\n    return [kept, evicted, slots, free]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('drop oldest pair', solve([[N,N+1,N+2,N+3],2]), [[N+2,N+3],[N,N+1],[N+2,N+3],0])\ncheck('zero bound', solve([[N,N+1],0]), [[],[N,N+1],[],0])\ncheck('spare capacity', solve([[N],3]), [[N],[],[N,None,None],2])\ncheck('same bound', solve([[N,N+1],2]), [[N,N+1],[],[N,N+1],0])\ncheck('empty', solve([[],2]), [[],[],[None,None],2])\ncheck('drop one of three', solve([[N,N+1,N+2],2]), [[N+1,N+2],[N],[N+1,N+2],0])\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":"35b97f93b15e9a6fc7439eecc67e5e004d822bb2e4e0a6cf5d4a98754092db9a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    items, bound = x\n    lost = max(0, len(items) - bound)\n    evicted = items[:lost][::-1]\n    kept = items[lost:]\n    slots = kept + [None] * (bound - len(kept))\n    free = bound - len(kept)\n    return [kept, evicted, slots, free]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('drop oldest pair', solve([[N,N+1,N+2,N+3],2]), [[N+2,N+3],[N,N+1],[N+2,N+3],0])\ncheck('zero bound', solve([[N,N+1],0]), [[],[N,N+1],[],0])\ncheck('spare capacity', solve([[N],3]), [[N],[],[N,None,None],2])\ncheck('same bound', solve([[N,N+1],2]), [[N,N+1],[],[N,N+1],0])\ncheck('empty', solve([[],2]), [[],[],[None,None],2])\ncheck('drop one of three', solve([[N,N+1,N+2],2]), [[N+1,N+2],[N],[N+1,N+2],0])\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":"e177ee7c52852ab57671bec37ef4707a6a3004f09b1466111f2b41edb51aff2e","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    items, bound = x\n    lost = max(0, len(items) - bound)\n    evicted = items[:lost]\n    kept = items[lost:]\n    slots = kept + [None] * (bound - len(kept))\n    free = bound - len(kept)\n    return [kept, evicted, slots, free]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('drop oldest pair', solve([[N,N+1,N+2,N+3],2]), [[N+2,N+3],[N,N+1],[N+2,N+3],0])\ncheck('zero bound', solve([[N,N+1],0]), [[],[N,N+1],[],0])\ncheck('spare capacity', solve([[N],3]), [[N],[],[N,None,None],2])\ncheck('same bound', solve([[N,N+1],2]), [[N,N+1],[],[N,N+1],0])\ncheck('empty', solve([[],2]), [[],[],[None,None],2])\ncheck('drop one of three', solve([[N,N+1,N+2],2]), [[N+1,N+2],[N],[N+1,N+2],0])\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-ring-shrink-eviction-order","generated_at":"2026-09-29T14:44:27.106652+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 eviction order invariant in ring-shrink.","root_cause":"The oldest-first release contract is reversed by a stack-style cleanup loop.","sha256":"44eed361a350b1046472640a69cdd5ec0cb8d0047315201115704037c48eb312","title":"Shrink reports evicted objects in reverse release order · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":44.298,"exit_code":1,"observations":[{"actual":[[3,4],[2,1],[3,4],0],"check":"drop oldest pair","expected":[[3,4],[1,2],[3,4],0],"passed":false},{"actual":[[],[2,1],[],0],"check":"zero bound","expected":[[],[1,2],[],0],"passed":false},{"actual":[[1],[],[1,null,null],2],"check":"spare capacity","expected":[[1],[],[1,null,null],2],"passed":true},{"actual":[[1,2],[],[1,2],0],"check":"same bound","expected":[[1,2],[],[1,2],0],"passed":true},{"actual":[[],[],[null,null],2],"check":"empty","expected":[[],[],[null,null],2],"passed":true},{"actual":[[2,3],[1],[2,3],0],"check":"drop one of three","expected":[[2,3],[1],[2,3],0],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"drop oldest pair\", \"actual\": [[3, 4], [2, 1], [3, 4], 0], \"expected\": [[3, 4], [1, 2], [3, 4], 0], \"passed\": false}, {\"check\": \"zero bound\", \"actual\": [[], [2, 1], [], 0], \"expected\": [[], [1, 2], [], 0], \"passed\": false}, {\"check\": \"spare capacity\", \"actual\": [[1], [], [1, null, null], 2], \"expected\": [[1], [], [1, null, null], 2], \"passed\": true}, {\"check\": \"same bound\", \"actual\": [[1, 2], [], [1, 2], 0], \"expected\": [[1, 2], [], [1, 2], 0], \"passed\": true}, {\"check\": \"empty\", \"actual\": [[], [], [null, null], 2], \"expected\": [[], [], [null, null], 2], \"passed\": true}, {\"check\": \"drop one of three\", \"actual\": [[2, 3], [1], [2, 3], 0], \"expected\": [[2, 3], [1], [2, 3], 0], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":49.637,"exit_code":1,"observations":[{"actual":[[3,4],[2,1],[3,4],0],"check":"drop oldest pair","expected":[[3,4],[1,2],[3,4],0],"passed":false},{"actual":[[],[2,1],[],0],"check":"zero bound","expected":[[],[1,2],[],0],"passed":false},{"actual":[[1],[],[1,null,null],2],"check":"spare capacity","expected":[[1],[],[1,null,null],2],"passed":true},{"actual":[[1,2],[],[1,2],0],"check":"same bound","expected":[[1,2],[],[1,2],0],"passed":true},{"actual":[[],[],[null,null],2],"check":"empty","expected":[[],[],[null,null],2],"passed":true},{"actual":[[2,3],[1],[2,3],0],"check":"drop one of three","expected":[[2,3],[1],[2,3],0],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"drop oldest pair\", \"actual\": [[3, 4], [2, 1], [3, 4], 0], \"expected\": [[3, 4], [1, 2], [3, 4], 0], \"passed\": false}, {\"check\": \"zero bound\", \"actual\": [[], [2, 1], [], 0], \"expected\": [[], [1, 2], [], 0], \"passed\": false}, {\"check\": \"spare capacity\", \"actual\": [[1], [], [1, null, null], 2], \"expected\": [[1], [], [1, null, null], 2], \"passed\": true}, {\"check\": \"same bound\", \"actual\": [[1, 2], [], [1, 2], 0], \"expected\": [[1, 2], [], [1, 2], 0], \"passed\": true}, {\"check\": \"empty\", \"actual\": [[], [], [null, null], 2], \"expected\": [[], [], [null, null], 2], \"passed\": true}, {\"check\": \"drop one of three\", \"actual\": [[2, 3], [1], [2, 3], 0], \"expected\": [[2, 3], [1], [2, 3], 0], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":44.511,"exit_code":0,"observations":[{"actual":[[3,4],[1,2],[3,4],0],"check":"drop oldest pair","expected":[[3,4],[1,2],[3,4],0],"passed":true},{"actual":[[],[1,2],[],0],"check":"zero bound","expected":[[],[1,2],[],0],"passed":true},{"actual":[[1],[],[1,null,null],2],"check":"spare capacity","expected":[[1],[],[1,null,null],2],"passed":true},{"actual":[[1,2],[],[1,2],0],"check":"same bound","expected":[[1,2],[],[1,2],0],"passed":true},{"actual":[[],[],[null,null],2],"check":"empty","expected":[[],[],[null,null],2],"passed":true},{"actual":[[2,3],[1],[2,3],0],"check":"drop one of three","expected":[[2,3],[1],[2,3],0],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"drop oldest pair\", \"actual\": [[3, 4], [1, 2], [3, 4], 0], \"expected\": [[3, 4], [1, 2], [3, 4], 0], \"passed\": true}, {\"check\": \"zero bound\", \"actual\": [[], [1, 2], [], 0], \"expected\": [[], [1, 2], [], 0], \"passed\": true}, {\"check\": \"spare capacity\", \"actual\": [[1], [], [1, null, null], 2], \"expected\": [[1], [], [1, null, null], 2], \"passed\": true}, {\"check\": \"same bound\", \"actual\": [[1, 2], [], [1, 2], 0], \"expected\": [[1, 2], [], [1, 2], 0], \"passed\": true}, {\"check\": \"empty\", \"actual\": [[], [], [null, null], 2], \"expected\": [[], [], [null, null], 2], \"passed\": true}, {\"check\": \"drop one of three\", \"actual\": [[2, 3], [1], [2, 3], 0], \"expected\": [[2, 3], [1], [2, 3], 0], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}