{"abstract":"Shrink decrements available capacity by pre-shrink occupancy.","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.","contract_signature":"x","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-free-after","id":"FA-45931","implementations":{"attempt":{"sha256":"b8f5b78c788caa475c898830117ae7e34a74abe7a4446a6fdb4b1ee1cd3eff51","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 = max(0, bound - len(items)) + lost\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":"c29d27245695afbd9056b02fe6bd96da931dc84a6f3296d17cebb97aef2da2a9","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(items)\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-free-after","generated_at":"2026-09-29T14:44:27.153197+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.","root_cause":"Free capacity is based on released entries as if they remained live.","sha256":"9bb6bef36c19512d7aebf2ddc979b6ef17f27e83172bf705645ee2f91ac2e706","title":"Shrink decrements available capacity by pre-shrink occupancy · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":43.985,"exit_code":1,"observations":[{"actual":[[3,4],[1,2],[3,4],2],"check":"drop oldest pair","expected":[[3,4],[1,2],[3,4],0],"passed":false},{"actual":[[],[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":[[2,3],[1],[2,3],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], 2], \"expected\": [[3, 4], [1, 2], [3, 4], 0], \"passed\": false}, {\"check\": \"zero bound\", \"actual\": [[], [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\": [[2, 3], [1], [2, 3], 1], \"expected\": [[2, 3], [1], [2, 3], 0], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":44.008,"exit_code":1,"observations":[{"actual":[[3,4],[1,2],[3,4],-2],"check":"drop oldest pair","expected":[[3,4],[1,2],[3,4],0],"passed":false},{"actual":[[],[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":[[2,3],[1],[2,3],-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], -2], \"expected\": [[3, 4], [1, 2], [3, 4], 0], \"passed\": false}, {\"check\": \"zero bound\", \"actual\": [[], [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\": [[2, 3], [1], [2, 3], -1], \"expected\": [[2, 3], [1], [2, 3], 0], \"passed\": false}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}