{"abstract":"Weighted deque enforces element count as its weight.","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-vs-count","id":"FA-46111","implementations":{"attempt":{"sha256":"d90e4aec445bb3e1d7b99caba4e59e3d9542ecbe6f561f352efca14a7d1eba1c","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) if len(keep)<2 else len(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"},"broken":{"sha256":"01607ad54cdcebb21482c987d3bd02f303948e57b8952dbe62d622e80cac079a","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=len(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"},"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-vs-count","generated_at":"2026-09-29T14:44:28.941043+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 vs count invariant in weighted-eviction.","root_cause":"Weighted deque enforces element count as its weight.","sha256":"bf6310e1e4208ab838b7bfd7883a80095c32e1f4f62ab9af561ab46d79de5876","title":"Weighted deque enforces element count as its weight · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":42.676,"exit_code":1,"observations":[{"actual":[[[1,3],[2,4],[3,2]],[],3,0],"check":"multiple evictions","expected":[[[3,2]],[[1,3],[2,4]],2,1],"passed":false},{"actual":[[[1,2],[2,3]],[],2,3],"check":"exact budget","expected":[[[1,2],[2,3]],[],5,0],"passed":false},{"actual":[[[3,0]],[[1,0],[2,4]],-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":[[[1,2],[2,1],[3,3]],[],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\": [[[1, 3], [2, 4], [3, 2]], [], 3, 0], \"expected\": [[[3, 2]], [[1, 3], [2, 4]], 2, 1], \"passed\": false}, {\"check\": \"exact budget\", \"actual\": [[[1, 2], [2, 3]], [], 2, 3], \"expected\": [[[1, 2], [2, 3]], [], 5, 0], \"passed\": false}, {\"check\": \"zero weights\", \"actual\": [[[3, 0]], [[1, 0], [2, 4]], -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\": [[[1, 2], [2, 1], [3, 3]], [], 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":40.486,"exit_code":1,"observations":[{"actual":[[[1,3],[2,4],[3,2]],[],3,0],"check":"multiple evictions","expected":[[[3,2]],[[1,3],[2,4]],2,1],"passed":false},{"actual":[[[1,2],[2,3]],[],2,3],"check":"exact budget","expected":[[[1,2],[2,3]],[],5,0],"passed":false},{"actual":[[[3,0]],[[1,0],[2,4]],-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":[[[1,2],[2,1],[3,3]],[],3,1],"check":"retain suffix","expected":[[[2,1],[3,3]],[[1,2]],4,0],"passed":false},{"actual":[[[1,8]],[],1,1],"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]], [], 3, 0], \"expected\": [[[3, 2]], [[1, 3], [2, 4]], 2, 1], \"passed\": false}, {\"check\": \"exact budget\", \"actual\": [[[1, 2], [2, 3]], [], 2, 3], \"expected\": [[[1, 2], [2, 3]], [], 5, 0], \"passed\": false}, {\"check\": \"zero weights\", \"actual\": [[[3, 0]], [[1, 0], [2, 4]], -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\": [[[1, 2], [2, 1], [3, 3]], [], 3, 1], \"expected\": [[[2, 1], [3, 3]], [[1, 2]], 4, 0], \"passed\": false}, {\"check\": \"heavy singleton\", \"actual\": [[[1, 8]], [], 1, 1], \"expected\": [[], [[1, 8]], 0, 2], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.995,"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"}