{"abstract":"Weighted eviction subtracts one unit per removed object.","category":"Bounded deques","checks":6,"contract":"Deque entries have nonnegative weights. Evict the shortest oldest prefix sufficient to satisfy the weight budget; preserve zero-weight entries unless preceding a required eviction. Return survivors, releases, weight and free budget.","evaluation_group":"s3-bounded-deques-weighted-eviction","failed_approach":"The partial repair still applies the incorrect transition to an admitted boundary or multi-element case.","family":"s3-bounded-deques-weighted-eviction-weight-decrement","id":"FA-46131","implementations":{"attempt":{"sha256":"48973eccc0c2bba80540fbec3c5e73a0713c9122abf2a762dbf8383732403ac4","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    items,budget=x\n    keep=items[:]\n    weight=sum(v[1] for v in keep)\n    dropped=[]\n    while weight>budget and keep:\n        victim=keep.pop(0)\n        dropped.append(victim)\n        weight-=victim[1] if victim[1]==0 else 1\n    return [keep,dropped,weight,budget-weight]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('multiple evictions', solve([[[N,3],[N+1,4],[N+2,2]],3]), {1: [[[3, 2]], [[1, 3], [2, 4]], 2, 1], 2: [[[4, 2]], [[2, 3], [3, 4]], 2, 1], 3: [[[5, 2]], [[3, 3], [4, 4]], 2, 1], 4: [[[6, 2]], [[4, 3], [5, 4]], 2, 1], 5: [[[7, 2]], [[5, 3], [6, 4]], 2, 1]}[N])\ncheck('exact budget', solve([[[N,2],[N+1,3]],5]), {1: [[[1, 2], [2, 3]], [], 5, 0], 2: [[[2, 2], [3, 3]], [], 5, 0], 3: [[[3, 2], [4, 3]], [], 5, 0], 4: [[[4, 2], [5, 3]], [], 5, 0], 5: [[[5, 2], [6, 3]], [], 5, 0]}[N])\ncheck('zero weights', solve([[[N,0],[N+1,4],[N+2,0]],0]), {1: [[[3, 0]], [[1, 0], [2, 4]], 0, 0], 2: [[[4, 0]], [[2, 0], [3, 4]], 0, 0], 3: [[[5, 0]], [[3, 0], [4, 4]], 0, 0], 4: [[[6, 0]], [[4, 0], [5, 4]], 0, 0], 5: [[[7, 0]], [[5, 0], [6, 4]], 0, 0]}[N])\ncheck('empty', solve([[],4]), {1: [[], [], 0, 4], 2: [[], [], 0, 4], 3: [[], [], 0, 4], 4: [[], [], 0, 4], 5: [[], [], 0, 4]}[N])\ncheck('retain suffix', solve([[[N,2],[N+1,1],[N+2,3]],4]), {1: [[[2, 1], [3, 3]], [[1, 2]], 4, 0], 2: [[[3, 1], [4, 3]], [[2, 2]], 4, 0], 3: [[[4, 1], [5, 3]], [[3, 2]], 4, 0], 4: [[[5, 1], [6, 3]], [[4, 2]], 4, 0], 5: [[[6, 1], [7, 3]], [[5, 2]], 4, 0]}[N])\ncheck('heavy singleton', solve([[[N,8]],2]), {1: [[], [[1, 8]], 0, 2], 2: [[], [[2, 8]], 0, 2], 3: [[], [[3, 8]], 0, 2], 4: [[], [[4, 8]], 0, 2], 5: [[], [[5, 8]], 0, 2]}[N])\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":"d414713e131187e09edb696672d448dd22fb1623e41ccec96828da1736ecf439","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    items,budget=x\n    keep=items[:]\n    weight=sum(v[1] for v in keep)\n    dropped=[]\n    while weight>budget and keep:\n        victim=keep.pop(0)\n        dropped.append(victim)\n        weight-=1\n    return [keep,dropped,weight,budget-weight]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('multiple evictions', solve([[[N,3],[N+1,4],[N+2,2]],3]), {1: [[[3, 2]], [[1, 3], [2, 4]], 2, 1], 2: [[[4, 2]], [[2, 3], [3, 4]], 2, 1], 3: [[[5, 2]], [[3, 3], [4, 4]], 2, 1], 4: [[[6, 2]], [[4, 3], [5, 4]], 2, 1], 5: [[[7, 2]], [[5, 3], [6, 4]], 2, 1]}[N])\ncheck('exact budget', solve([[[N,2],[N+1,3]],5]), {1: [[[1, 2], [2, 3]], [], 5, 0], 2: [[[2, 2], [3, 3]], [], 5, 0], 3: [[[3, 2], [4, 3]], [], 5, 0], 4: [[[4, 2], [5, 3]], [], 5, 0], 5: [[[5, 2], [6, 3]], [], 5, 0]}[N])\ncheck('zero weights', solve([[[N,0],[N+1,4],[N+2,0]],0]), {1: [[[3, 0]], [[1, 0], [2, 4]], 0, 0], 2: [[[4, 0]], [[2, 0], [3, 4]], 0, 0], 3: [[[5, 0]], [[3, 0], [4, 4]], 0, 0], 4: [[[6, 0]], [[4, 0], [5, 4]], 0, 0], 5: [[[7, 0]], [[5, 0], [6, 4]], 0, 0]}[N])\ncheck('empty', solve([[],4]), {1: [[], [], 0, 4], 2: [[], [], 0, 4], 3: [[], [], 0, 4], 4: [[], [], 0, 4], 5: [[], [], 0, 4]}[N])\ncheck('retain suffix', solve([[[N,2],[N+1,1],[N+2,3]],4]), {1: [[[2, 1], [3, 3]], [[1, 2]], 4, 0], 2: [[[3, 1], [4, 3]], [[2, 2]], 4, 0], 3: [[[4, 1], [5, 3]], [[3, 2]], 4, 0], 4: [[[5, 1], [6, 3]], [[4, 2]], 4, 0], 5: [[[6, 1], [7, 3]], [[5, 2]], 4, 0]}[N])\ncheck('heavy singleton', solve([[[N,8]],2]), {1: [[], [[1, 8]], 0, 2], 2: [[], [[2, 8]], 0, 2], 3: [[], [[3, 8]], 0, 2], 4: [[], [[4, 8]], 0, 2], 5: [[], [[5, 8]], 0, 2]}[N])\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":"057455ee2271685ee13d84aee6fd213f48ad858c337a2c8eea74ebcc1dc97eb8","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    items,budget=x\n    keep=items[:]\n    weight=sum(v[1] for v in keep)\n    dropped=[]\n    while weight>budget and keep:\n        victim=keep.pop(0)\n        dropped.append(victim)\n        weight-=victim[1]\n    return [keep,dropped,weight,budget-weight]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('multiple evictions', solve([[[N,3],[N+1,4],[N+2,2]],3]), {1: [[[3, 2]], [[1, 3], [2, 4]], 2, 1], 2: [[[4, 2]], [[2, 3], [3, 4]], 2, 1], 3: [[[5, 2]], [[3, 3], [4, 4]], 2, 1], 4: [[[6, 2]], [[4, 3], [5, 4]], 2, 1], 5: [[[7, 2]], [[5, 3], [6, 4]], 2, 1]}[N])\ncheck('exact budget', solve([[[N,2],[N+1,3]],5]), {1: [[[1, 2], [2, 3]], [], 5, 0], 2: [[[2, 2], [3, 3]], [], 5, 0], 3: [[[3, 2], [4, 3]], [], 5, 0], 4: [[[4, 2], [5, 3]], [], 5, 0], 5: [[[5, 2], [6, 3]], [], 5, 0]}[N])\ncheck('zero weights', solve([[[N,0],[N+1,4],[N+2,0]],0]), {1: [[[3, 0]], [[1, 0], [2, 4]], 0, 0], 2: [[[4, 0]], [[2, 0], [3, 4]], 0, 0], 3: [[[5, 0]], [[3, 0], [4, 4]], 0, 0], 4: [[[6, 0]], [[4, 0], [5, 4]], 0, 0], 5: [[[7, 0]], [[5, 0], [6, 4]], 0, 0]}[N])\ncheck('empty', solve([[],4]), {1: [[], [], 0, 4], 2: [[], [], 0, 4], 3: [[], [], 0, 4], 4: [[], [], 0, 4], 5: [[], [], 0, 4]}[N])\ncheck('retain suffix', solve([[[N,2],[N+1,1],[N+2,3]],4]), {1: [[[2, 1], [3, 3]], [[1, 2]], 4, 0], 2: [[[3, 1], [4, 3]], [[2, 2]], 4, 0], 3: [[[4, 1], [5, 3]], [[3, 2]], 4, 0], 4: [[[5, 1], [6, 3]], [[4, 2]], 4, 0], 5: [[[6, 1], [7, 3]], [[5, 2]], 4, 0]}[N])\ncheck('heavy singleton', solve([[[N,8]],2]), {1: [[], [[1, 8]], 0, 2], 2: [[], [[2, 8]], 0, 2], 3: [[], [[3, 8]], 0, 2], 4: [[], [[4, 8]], 0, 2], 5: [[], [[5, 8]], 0, 2]}[N])\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-weighted-eviction-weight-decrement","generated_at":"2026-09-29T14:44:29.171375+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 weight decrement invariant in weighted-eviction.","root_cause":"Weighted eviction subtracts one unit per removed object.","sha256":"cc86ac3eb5b31b812bacf9f5a96855425706ac1a3a5b9e92fafb1e37d0ad9328","title":"Weighted eviction subtracts one unit per removed object · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":42.698,"exit_code":1,"observations":[{"actual":[[],[[1,3],[2,4],[3,2]],6,-3],"check":"multiple evictions","expected":[[[3,2]],[[1,3],[2,4]],2,1],"passed":false},{"actual":[[[1,2],[2,3]],[],5,0],"check":"exact budget","expected":[[[1,2],[2,3]],[],5,0],"passed":true},{"actual":[[],[[1,0],[2,4],[3,0]],3,-3],"check":"zero weights","expected":[[[3,0]],[[1,0],[2,4]],0,0],"passed":false},{"actual":[[],[],0,4],"check":"empty","expected":[[],[],0,4],"passed":true},{"actual":[[[3,3]],[[1,2],[2,1]],4,0],"check":"retain suffix","expected":[[[2,1],[3,3]],[[1,2]],4,0],"passed":false},{"actual":[[],[[1,8]],7,-5],"check":"heavy singleton","expected":[[],[[1,8]],0,2],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"multiple evictions\", \"actual\": [[], [[1, 3], [2, 4], [3, 2]], 6, -3], \"expected\": [[[3, 2]], [[1, 3], [2, 4]], 2, 1], \"passed\": false}, {\"check\": \"exact budget\", \"actual\": [[[1, 2], [2, 3]], [], 5, 0], \"expected\": [[[1, 2], [2, 3]], [], 5, 0], \"passed\": true}, {\"check\": \"zero weights\", \"actual\": [[], [[1, 0], [2, 4], [3, 0]], 3, -3], \"expected\": [[[3, 0]], [[1, 0], [2, 4]], 0, 0], \"passed\": false}, {\"check\": \"empty\", \"actual\": [[], [], 0, 4], \"expected\": [[], [], 0, 4], \"passed\": true}, {\"check\": \"retain suffix\", \"actual\": [[[3, 3]], [[1, 2], [2, 1]], 4, 0], \"expected\": [[[2, 1], [3, 3]], [[1, 2]], 4, 0], \"passed\": false}, {\"check\": \"heavy singleton\", \"actual\": [[], [[1, 8]], 7, -5], \"expected\": [[], [[1, 8]], 0, 2], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":47.649,"exit_code":1,"observations":[{"actual":[[],[[1,3],[2,4],[3,2]],6,-3],"check":"multiple evictions","expected":[[[3,2]],[[1,3],[2,4]],2,1],"passed":false},{"actual":[[[1,2],[2,3]],[],5,0],"check":"exact budget","expected":[[[1,2],[2,3]],[],5,0],"passed":true},{"actual":[[],[[1,0],[2,4],[3,0]],1,-1],"check":"zero weights","expected":[[[3,0]],[[1,0],[2,4]],0,0],"passed":false},{"actual":[[],[],0,4],"check":"empty","expected":[[],[],0,4],"passed":true},{"actual":[[[3,3]],[[1,2],[2,1]],4,0],"check":"retain suffix","expected":[[[2,1],[3,3]],[[1,2]],4,0],"passed":false},{"actual":[[],[[1,8]],7,-5],"check":"heavy singleton","expected":[[],[[1,8]],0,2],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"multiple evictions\", \"actual\": [[], [[1, 3], [2, 4], [3, 2]], 6, -3], \"expected\": [[[3, 2]], [[1, 3], [2, 4]], 2, 1], \"passed\": false}, {\"check\": \"exact budget\", \"actual\": [[[1, 2], [2, 3]], [], 5, 0], \"expected\": [[[1, 2], [2, 3]], [], 5, 0], \"passed\": true}, {\"check\": \"zero weights\", \"actual\": [[], [[1, 0], [2, 4], [3, 0]], 1, -1], \"expected\": [[[3, 0]], [[1, 0], [2, 4]], 0, 0], \"passed\": false}, {\"check\": \"empty\", \"actual\": [[], [], 0, 4], \"expected\": [[], [], 0, 4], \"passed\": true}, {\"check\": \"retain suffix\", \"actual\": [[[3, 3]], [[1, 2], [2, 1]], 4, 0], \"expected\": [[[2, 1], [3, 3]], [[1, 2]], 4, 0], \"passed\": false}, {\"check\": \"heavy singleton\", \"actual\": [[], [[1, 8]], 7, -5], \"expected\": [[], [[1, 8]], 0, 2], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":46.495,"exit_code":0,"observations":[{"actual":[[[3,2]],[[1,3],[2,4]],2,1],"check":"multiple evictions","expected":[[[3,2]],[[1,3],[2,4]],2,1],"passed":true},{"actual":[[[1,2],[2,3]],[],5,0],"check":"exact budget","expected":[[[1,2],[2,3]],[],5,0],"passed":true},{"actual":[[[3,0]],[[1,0],[2,4]],0,0],"check":"zero weights","expected":[[[3,0]],[[1,0],[2,4]],0,0],"passed":true},{"actual":[[],[],0,4],"check":"empty","expected":[[],[],0,4],"passed":true},{"actual":[[[2,1],[3,3]],[[1,2]],4,0],"check":"retain suffix","expected":[[[2,1],[3,3]],[[1,2]],4,0],"passed":true},{"actual":[[],[[1,8]],0,2],"check":"heavy singleton","expected":[[],[[1,8]],0,2],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"multiple evictions\", \"actual\": [[[3, 2]], [[1, 3], [2, 4]], 2, 1], \"expected\": [[[3, 2]], [[1, 3], [2, 4]], 2, 1], \"passed\": true}, {\"check\": \"exact budget\", \"actual\": [[[1, 2], [2, 3]], [], 5, 0], \"expected\": [[[1, 2], [2, 3]], [], 5, 0], \"passed\": true}, {\"check\": \"zero weights\", \"actual\": [[[3, 0]], [[1, 0], [2, 4]], 0, 0], \"expected\": [[[3, 0]], [[1, 0], [2, 4]], 0, 0], \"passed\": true}, {\"check\": \"empty\", \"actual\": [[], [], 0, 4], \"expected\": [[], [], 0, 4], \"passed\": true}, {\"check\": \"retain suffix\", \"actual\": [[[2, 1], [3, 3]], [[1, 2]], 4, 0], \"expected\": [[[2, 1], [3, 3]], [[1, 2]], 4, 0], \"passed\": true}, {\"check\": \"heavy singleton\", \"actual\": [[], [[1, 8]], 0, 2], \"expected\": [[], [[1, 8]], 0, 2], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}