{"abstract":"Weighted deque evicts entries when the budget is exactly met.","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.","contract_signature":"x","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-exact-weight","id":"FA-46116","implementations":{"attempt":{"sha256":"4bac6aa4e23ad0d9bd97404e219db361bdd199e01b02f3dafbab3e8f43e38447","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 weight>0 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"},"broken":{"sha256":"e601e70a9d669c5d3979ff49806cabe281fcd5f89346eef19bfae42e1ad91a35","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-exact-weight","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.","root_cause":"Weighted deque evicts entries when the budget is exactly met.","sha256":"6b5edadf524c97f2928a61716cf8c68d1a2dd83f1703523c7e48f434293251fc","title":"Weighted deque evicts entries when the budget is exactly met · 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.699,"exit_code":1,"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":[[[2,3]],[[1,2]],3,2],"check":"exact budget","expected":[[[1,2],[2,3]],[],5,0],"passed":false},{"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":[[[3,3]],[[1,2],[2,1]],3,1],"check":"retain suffix","expected":[[[2,1],[3,3]],[[1,2]],4,0],"passed":false},{"actual":[[],[[1,8]],0,2],"check":"heavy singleton","expected":[[],[[1,8]],0,2],"passed":true}],"passed":false,"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\": [[[2, 3]], [[1, 2]], 3, 2], \"expected\": [[[1, 2], [2, 3]], [], 5, 0], \"passed\": false}, {\"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\": [[[3, 3]], [[1, 2], [2, 1]], 3, 1], \"expected\": [[[2, 1], [3, 3]], [[1, 2]], 4, 0], \"passed\": false}, {\"check\": \"heavy singleton\", \"actual\": [[], [[1, 8]], 0, 2], \"expected\": [[], [[1, 8]], 0, 2], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.687,"exit_code":1,"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":[[[2,3]],[[1,2]],3,2],"check":"exact budget","expected":[[[1,2],[2,3]],[],5,0],"passed":false},{"actual":[[],[[1,0],[2,4],[3,0]],0,0],"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]],3,1],"check":"retain suffix","expected":[[[2,1],[3,3]],[[1,2]],4,0],"passed":false},{"actual":[[],[[1,8]],0,2],"check":"heavy singleton","expected":[[],[[1,8]],0,2],"passed":true}],"passed":false,"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\": [[[2, 3]], [[1, 2]], 3, 2], \"expected\": [[[1, 2], [2, 3]], [], 5, 0], \"passed\": false}, {\"check\": \"zero weights\", \"actual\": [[], [[1, 0], [2, 4], [3, 0]], 0, 0], \"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]], 3, 1], \"expected\": [[[2, 1], [3, 3]], [[1, 2]], 4, 0], \"passed\": false}, {\"check\": \"heavy singleton\", \"actual\": [[], [[1, 8]], 0, 2], \"expected\": [[], [[1, 8]], 0, 2], \"passed\": true}], \"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."}}