{"abstract":"The operation returns a result or retained state that violates this contract: Counter update adds supplied counts to existing counts, retaining zero and negative entries.","category":"Multiset accounting","checks":4,"contract":"Counter update adds supplied counts to existing counts, retaining zero and negative entries. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.","evaluation_group":"model-d5a3ff3b168458d4","failed_approach":"Positive-bag addition drops zero and negative entries required by update semantics.","family":"xr-counter-update-adds-not-replaces","id":"FA-4671","implementations":{"attempt":{"sha256":"7636eceb4396506465f9f03924abf28769d8afde1f27c6a69597cf4dc5a5a45b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom collections import Counter, ChainMap, deque\nimport heapq\nN = 1\nobservations = []\ndef solve(x, y=None):\n    return dict(Counter(x)+Counter(y))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('existing count accumulates', solve({'a': 2}, {'a': 3}), {'a': 5})\ncheck('zero retained', solve({'a': 2}, {'a': -2}), {'a': 0})\ncheck('negative retained', solve({}, {'a': -1}), {'a': -1})\ncheck('empty', solve({}, {}), {})\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":"a0ad2bfcfad056a0d09faa8dd8d5622de38a481a755d63bd80bdb3d0f579409c","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom collections import Counter, ChainMap, deque\nimport heapq\nN = 1\nobservations = []\ndef solve(x, y=None):\n    a=Counter(x); a=dict(a); a.update(y); return a\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('existing count accumulates', solve({'a': 2}, {'a': 3}), {'a': 5})\ncheck('zero retained', solve({'a': 2}, {'a': -2}), {'a': 0})\ncheck('negative retained', solve({}, {'a': -1}), {'a': -1})\ncheck('empty', solve({}, {}), {})\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":"e7d0190a0d1f1bf90c34c74caa3dcb5605a8128ae05c0ad0f559312bf2ba9fce","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom collections import Counter, ChainMap, deque\nimport heapq\nN = 1\nobservations = []\ndef solve(x, y=None):\n    a=Counter(x); a.update(y); return dict(a)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('existing count accumulates', solve({'a': 2}, {'a': 3}), {'a': 5})\ncheck('zero retained', solve({'a': 2}, {'a': -2}), {'a': 0})\ncheck('negative retained', solve({}, {'a': -1}), {'a': -1})\ncheck('empty', solve({}, {}), {})\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":"xr-counter-update-adds-not-replaces","generated_at":"2026-09-29T14:37:41.508716+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A controlled local-runtime regression for collection APIs, language semantics, or ownership wrappers. Fixtures include boundary and interaction cases.","repair":"Counter update adds supplied counts to existing counts, retaining zero and negative entries.","root_cause":"Dictionary assignment replaces counts instead of accumulating them.","sha256":"00e1467cf48361156a07a9a97c39e7a1b4fcc567033f0363b6b0f5e99f90c406","title":"Counter update adds not replaces · case 01","variant":1,"variant_policy":"Five execution reruns of a fixed adversarial fixture suite; variant number does not alter semantic inputs.","verification":{"attempt":{"elapsed_ms":38.622,"exit_code":1,"observations":[{"actual":{"a":5},"check":"existing count accumulates","expected":{"a":5},"passed":true},{"actual":{},"check":"zero retained","expected":{"a":0},"passed":false},{"actual":{},"check":"negative retained","expected":{"a":-1},"passed":false},{"actual":{},"check":"empty","expected":{},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"existing count accumulates\", \"actual\": {\"a\": 5}, \"expected\": {\"a\": 5}, \"passed\": true}, {\"check\": \"zero retained\", \"actual\": {}, \"expected\": {\"a\": 0}, \"passed\": false}, {\"check\": \"negative retained\", \"actual\": {}, \"expected\": {\"a\": -1}, \"passed\": false}, {\"check\": \"empty\", \"actual\": {}, \"expected\": {}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":33.593,"exit_code":1,"observations":[{"actual":{"a":3},"check":"existing count accumulates","expected":{"a":5},"passed":false},{"actual":{"a":-2},"check":"zero retained","expected":{"a":0},"passed":false},{"actual":{"a":-1},"check":"negative retained","expected":{"a":-1},"passed":true},{"actual":{},"check":"empty","expected":{},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"existing count accumulates\", \"actual\": {\"a\": 3}, \"expected\": {\"a\": 5}, \"passed\": false}, {\"check\": \"zero retained\", \"actual\": {\"a\": -2}, \"expected\": {\"a\": 0}, \"passed\": false}, {\"check\": \"negative retained\", \"actual\": {\"a\": -1}, \"expected\": {\"a\": -1}, \"passed\": true}, {\"check\": \"empty\", \"actual\": {}, \"expected\": {}, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":36.545,"exit_code":0,"observations":[{"actual":{"a":5},"check":"existing count accumulates","expected":{"a":5},"passed":true},{"actual":{"a":0},"check":"zero retained","expected":{"a":0},"passed":true},{"actual":{"a":-1},"check":"negative retained","expected":{"a":-1},"passed":true},{"actual":{},"check":"empty","expected":{},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"existing count accumulates\", \"actual\": {\"a\": 5}, \"expected\": {\"a\": 5}, \"passed\": true}, {\"check\": \"zero retained\", \"actual\": {\"a\": 0}, \"expected\": {\"a\": 0}, \"passed\": true}, {\"check\": \"negative retained\", \"actual\": {\"a\": -1}, \"expected\": {\"a\": -1}, \"passed\": true}, {\"check\": \"empty\", \"actual\": {}, \"expected\": {}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}