{"abstract":"Shrink uses new capacity as the eviction count.","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-drop-count","id":"FA-45916","implementations":{"attempt":{"sha256":"9b167ef7f28d991fa2052f7ddd96ec3f509fd53ea35c5f228fd8ed77c6446066","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    items, bound = x\n    lost = 0 if len(items) <= bound else min(bound, len(items))\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"},"broken":{"sha256":"05759f3f038b60576f44a3d331d1b472b0c71efc9a32bd33620b989c44834a6e","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    items, bound = x\n    lost = min(bound, len(items))\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"},"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-drop-count","generated_at":"2026-09-29T14:44:27.097803+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 drop count invariant in ring-shrink.","root_cause":"The new bound is mistaken for the number of excess live entries.","sha256":"be16f2fcfba7d6c8468843614f3e99cb3fb402c0b780850500237acaad8ff56c","title":"Shrink uses new capacity as the eviction count · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.82,"exit_code":1,"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],[],[1,2],-2],"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":[[3],[1,2],[3,null],1],"check":"drop one of three","expected":[[2,3],[1],[2,3],0],"passed":false}],"passed":false,"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], [], [1, 2], -2], \"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\": [[3], [1, 2], [3, null], 1], \"expected\": [[2, 3], [1], [2, 3], 0], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":44.481,"exit_code":1,"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],[],[1,2],-2],"check":"zero bound","expected":[[],[1,2],[],0],"passed":false},{"actual":[[],[1],[null,null,null],3],"check":"spare capacity","expected":[[1],[],[1,null,null],2],"passed":false},{"actual":[[],[1,2],[null,null],2],"check":"same bound","expected":[[1,2],[],[1,2],0],"passed":false},{"actual":[[],[],[null,null],2],"check":"empty","expected":[[],[],[null,null],2],"passed":true},{"actual":[[3],[1,2],[3,null],1],"check":"drop one of three","expected":[[2,3],[1],[2,3],0],"passed":false}],"passed":false,"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], [], [1, 2], -2], \"expected\": [[], [1, 2], [], 0], \"passed\": false}, {\"check\": \"spare capacity\", \"actual\": [[], [1], [null, null, null], 3], \"expected\": [[1], [], [1, null, null], 2], \"passed\": false}, {\"check\": \"same bound\", \"actual\": [[], [1, 2], [null, null], 2], \"expected\": [[1, 2], [], [1, 2], 0], \"passed\": false}, {\"check\": \"empty\", \"actual\": [[], [], [null, null], 2], \"expected\": [[], [], [null, null], 2], \"passed\": true}, {\"check\": \"drop one of three\", \"actual\": [[3], [1, 2], [3, null], 1], \"expected\": [[2, 3], [1], [2, 3], 0], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":47.594,"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"}