{"abstract":"Replacing an entry double-counts its existing cache weight.","category":"Caching","checks":4,"contract":"Return total cache weight after inserting or replacing key with nonnegative weight in a unique key-to-weight mapping.","contract_signature":"weights, key, weight","evaluation_group":"xc-replacement-weight-delta","failed_approach":"Defaulting missing old weight to the new weight makes new entries consume no space.","family":"xc-replacement-weight-delta","id":"FA-10401","implementations":{"attempt":{"sha256":"679e190293518409fda3f2c477204edd5e442e7c15319a41e7c021c79796b632","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(weights, key, weight):\n    return sum(weights.values())+weight-weights.get(key, weight)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('fixture 1', solve(*({'a': 4, 'b': 3}, 'a', 6)), 9)\ncheck('fixture 2', solve(*({'a': 4}, 'b', 2)), 6)\ncheck('fixture 3', solve(*({}, 'a', 0)), 0)\ncheck('fixture 4', solve(*({'a': 4}, 'a', 1)), 1)\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":"5131514662e7c6ef818648637c971b87b3bb59b0a4efa3023024ce63db2550fc","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(weights, key, weight):\n    return sum(weights.values())+weight\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('fixture 1', solve(*({'a': 4, 'b': 3}, 'a', 6)), 9)\ncheck('fixture 2', solve(*({'a': 4}, 'b', 2)), 6)\ncheck('fixture 3', solve(*({}, 'a', 0)), 0)\ncheck('fixture 4', solve(*({'a': 4}, 'a', 1)), 1)\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-replacement-weight-delta","generated_at":"2026-09-29T14:38:38.675281+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.","root_cause":"Admission adds the new weight without subtracting the replaced value weight.","sha256":"379b769c7022478acac39d4359989f706e8baa2654e1eae570a27eee3b5b53b6","title":"Replacing an entry double-counts its existing cache weight · 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":38.655,"exit_code":1,"observations":[{"actual":9,"check":"fixture 1","expected":9,"passed":true},{"actual":4,"check":"fixture 2","expected":6,"passed":false},{"actual":0,"check":"fixture 3","expected":0,"passed":true},{"actual":1,"check":"fixture 4","expected":1,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1\", \"actual\": 9, \"expected\": 9, \"passed\": true}, {\"check\": \"fixture 2\", \"actual\": 4, \"expected\": 6, \"passed\": false}, {\"check\": \"fixture 3\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"fixture 4\", \"actual\": 1, \"expected\": 1, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.367,"exit_code":1,"observations":[{"actual":13,"check":"fixture 1","expected":9,"passed":false},{"actual":6,"check":"fixture 2","expected":6,"passed":true},{"actual":0,"check":"fixture 3","expected":0,"passed":true},{"actual":5,"check":"fixture 4","expected":1,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1\", \"actual\": 13, \"expected\": 9, \"passed\": false}, {\"check\": \"fixture 2\", \"actual\": 6, \"expected\": 6, \"passed\": true}, {\"check\": \"fixture 3\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"fixture 4\", \"actual\": 5, \"expected\": 1, \"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."}}