{"abstract":"Shrinking cache capacity evicts only one excess entry.","category":"Caching","checks":4,"contract":"Capacity is a nonnegative integer. Retain at most capacity keys from the most-recent end of the ordered cache.","evaluation_group":"xc-lru-capacity-drain","failed_approach":"Keeping the prefix retains the least recent entries instead of the most recent.","family":"xc-lru-capacity-drain","id":"FA-10391","implementations":{"attempt":{"sha256":"c7c5767f091c465e688a9b93bd9242e55f5fc99fe51946c83599b12bd05c1ae2","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(order, capacity):\n    return list(order[:capacity])\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('fixture 1', solve(*(['a', 'b', 'c', 'd'], 1)), ['d'])\ncheck('fixture 2', solve(*(['a', 'b', 'c'], 2)), ['b', 'c'])\ncheck('fixture 3', solve(*(['a'], 0)), [])\ncheck('fixture 4', solve(*(['a', 'b'], 5)), ['a', 'b'])\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":"06b7b2d4a169450c91fe42217b0bb2e4096e6c8362beaab6b19f5a1748d9e724","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(order, capacity):\n    return order[1:] if len(order)>capacity else list(order)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('fixture 1', solve(*(['a', 'b', 'c', 'd'], 1)), ['d'])\ncheck('fixture 2', solve(*(['a', 'b', 'c'], 2)), ['b', 'c'])\ncheck('fixture 3', solve(*(['a'], 0)), [])\ncheck('fixture 4', solve(*(['a', 'b'], 5)), ['a', 'b'])\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":"d7eb55881303d126512ec8bb6a1f1f5bf21eb65150114b2ccf8e5d6f0e630274","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(order, capacity):\n    return list(order[-capacity:]) if capacity else []\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('fixture 1', solve(*(['a', 'b', 'c', 'd'], 1)), ['d'])\ncheck('fixture 2', solve(*(['a', 'b', 'c'], 2)), ['b', 'c'])\ncheck('fixture 3', solve(*(['a'], 0)), [])\ncheck('fixture 4', solve(*(['a', 'b'], 5)), ['a', 'b'])\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":" 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":"xc-lru-capacity-drain","generated_at":"2026-09-29T14:38:38.632910+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A deterministic cache state transformation. Inputs are copied or treated as immutable; no remote storage, real clock, or concurrent interleaving is simulated.","repair":"Preserve the cache-state invariant: Capacity is a nonnegative integer. Retain at most capacity keys from the most-recent end of the ordered cache.","root_cause":"A capacity reduction is handled as a single insertion overflow.","sha256":"d66b4b857cf8be554345ef9ae16ebe3b6e21ff098e894b0a085741a1a02efb81","title":"Shrinking cache capacity evicts only one excess entry · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":39.539,"exit_code":1,"observations":[{"actual":["a"],"check":"fixture 1","expected":["d"],"passed":false},{"actual":["a","b"],"check":"fixture 2","expected":["b","c"],"passed":false},{"actual":[],"check":"fixture 3","expected":[],"passed":true},{"actual":["a","b"],"check":"fixture 4","expected":["a","b"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1\", \"actual\": [\"a\"], \"expected\": [\"d\"], \"passed\": false}, {\"check\": \"fixture 2\", \"actual\": [\"a\", \"b\"], \"expected\": [\"b\", \"c\"], \"passed\": false}, {\"check\": \"fixture 3\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"fixture 4\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"b\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.16,"exit_code":1,"observations":[{"actual":["b","c","d"],"check":"fixture 1","expected":["d"],"passed":false},{"actual":["b","c"],"check":"fixture 2","expected":["b","c"],"passed":true},{"actual":[],"check":"fixture 3","expected":[],"passed":true},{"actual":["a","b"],"check":"fixture 4","expected":["a","b"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1\", \"actual\": [\"b\", \"c\", \"d\"], \"expected\": [\"d\"], \"passed\": false}, {\"check\": \"fixture 2\", \"actual\": [\"b\", \"c\"], \"expected\": [\"b\", \"c\"], \"passed\": true}, {\"check\": \"fixture 3\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"fixture 4\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"b\"], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":38.943,"exit_code":0,"observations":[{"actual":["d"],"check":"fixture 1","expected":["d"],"passed":true},{"actual":["b","c"],"check":"fixture 2","expected":["b","c"],"passed":true},{"actual":[],"check":"fixture 3","expected":[],"passed":true},{"actual":["a","b"],"check":"fixture 4","expected":["a","b"],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1\", \"actual\": [\"d\"], \"expected\": [\"d\"], \"passed\": true}, {\"check\": \"fixture 2\", \"actual\": [\"b\", \"c\"], \"expected\": [\"b\", \"c\"], \"passed\": true}, {\"check\": \"fixture 3\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"fixture 4\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"b\"], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}