{"abstract":"A successful read resets LFU frequency instead of accumulating it.","category":"Caching","checks":4,"contract":"Increment the count only for a resident key; a lookup miss must not insert a frequency entry.","evaluation_group":"xc-lfu-hit-increments","failed_approach":"Incrementing with a default count accidentally caches missed keys.","family":"xc-lfu-hit-increments","id":"FA-10431","implementations":{"attempt":{"sha256":"0c179a015341a52b5cd71a88b1c6774a1b0dbfe15156699406d784471726c8d5","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(counts, key):\n    out=dict(counts)\n    out[key]=out.get(key,0)+1\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('fixture 1', solve(*({'a': 3}, 'a')), {'a': 4})\ncheck('fixture 2', solve(*({'a': 0}, 'a')), {'a': 1})\ncheck('fixture 3', solve(*({'a': 2}, 'b')), {'a': 2})\ncheck('fixture 4', solve(*({}, 'a')), {})\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":"e63505245fa93086bfd9e89697f4db09a15558f0c1cbbdd83f6c7f146b60e1ad","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(counts, key):\n    out=dict(counts)\n    if key in out: out[key]=1\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('fixture 1', solve(*({'a': 3}, 'a')), {'a': 4})\ncheck('fixture 2', solve(*({'a': 0}, 'a')), {'a': 1})\ncheck('fixture 3', solve(*({'a': 2}, 'b')), {'a': 2})\ncheck('fixture 4', solve(*({}, 'a')), {})\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":"0b19a8ce9d920128e77ae2858fddd5e8025a0b9b81e3dd9d37790a1f8660e4f9","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(counts, key):\n    out=dict(counts)\n    if key in out: out[key]+=1\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('fixture 1', solve(*({'a': 3}, 'a')), {'a': 4})\ncheck('fixture 2', solve(*({'a': 0}, 'a')), {'a': 1})\ncheck('fixture 3', solve(*({'a': 2}, 'b')), {'a': 2})\ncheck('fixture 4', solve(*({}, 'a')), {})\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-lfu-hit-increments","generated_at":"2026-09-29T14:38:38.963785+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: Increment the count only for a resident key; a lookup miss must not insert a frequency entry.","root_cause":"Read accounting initializes rather than increments an existing frequency.","sha256":"500ae73cc0e370a19fe3036a2a8860bb0720d91dfaa65b94e732a65d570c2876","title":"A successful read resets LFU frequency instead of accumulating it · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":37.445,"exit_code":1,"observations":[{"actual":{"a":4},"check":"fixture 1","expected":{"a":4},"passed":true},{"actual":{"a":1},"check":"fixture 2","expected":{"a":1},"passed":true},{"actual":{"a":2,"b":1},"check":"fixture 3","expected":{"a":2},"passed":false},{"actual":{"a":1},"check":"fixture 4","expected":{},"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1\", \"actual\": {\"a\": 4}, \"expected\": {\"a\": 4}, \"passed\": true}, {\"check\": \"fixture 2\", \"actual\": {\"a\": 1}, \"expected\": {\"a\": 1}, \"passed\": true}, {\"check\": \"fixture 3\", \"actual\": {\"a\": 2, \"b\": 1}, \"expected\": {\"a\": 2}, \"passed\": false}, {\"check\": \"fixture 4\", \"actual\": {\"a\": 1}, \"expected\": {}, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.542,"exit_code":1,"observations":[{"actual":{"a":1},"check":"fixture 1","expected":{"a":4},"passed":false},{"actual":{"a":1},"check":"fixture 2","expected":{"a":1},"passed":true},{"actual":{"a":2},"check":"fixture 3","expected":{"a":2},"passed":true},{"actual":{},"check":"fixture 4","expected":{},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1\", \"actual\": {\"a\": 1}, \"expected\": {\"a\": 4}, \"passed\": false}, {\"check\": \"fixture 2\", \"actual\": {\"a\": 1}, \"expected\": {\"a\": 1}, \"passed\": true}, {\"check\": \"fixture 3\", \"actual\": {\"a\": 2}, \"expected\": {\"a\": 2}, \"passed\": true}, {\"check\": \"fixture 4\", \"actual\": {}, \"expected\": {}, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.834,"exit_code":0,"observations":[{"actual":{"a":4},"check":"fixture 1","expected":{"a":4},"passed":true},{"actual":{"a":1},"check":"fixture 2","expected":{"a":1},"passed":true},{"actual":{"a":2},"check":"fixture 3","expected":{"a":2},"passed":true},{"actual":{},"check":"fixture 4","expected":{},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1\", \"actual\": {\"a\": 4}, \"expected\": {\"a\": 4}, \"passed\": true}, {\"check\": \"fixture 2\", \"actual\": {\"a\": 1}, \"expected\": {\"a\": 1}, \"passed\": true}, {\"check\": \"fixture 3\", \"actual\": {\"a\": 2}, \"expected\": {\"a\": 2}, \"passed\": true}, {\"check\": \"fixture 4\", \"actual\": {}, \"expected\": {}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}