FAILURE MAP
← Case archive

FA-4686 / Multiset accounting / Open access

Counter unary plus filters strictly positive · case 01

The operation returns a result or retained state that violates this contract: Unary counter normalization retains strictly positive counts without changing them.

Verified by executionVariant 1 · 4 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Returning the raw mapping leaves zero and negative entries present.

VERIFIED REPAIR

Unary counter normalization retains strictly positive counts without changing them.

Unsuccessful approach: An inclusive zero boundary retains zero entries.

Case contract

Unary counter normalization retains strictly positive counts without changing them. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

Why this case matters

A controlled local-runtime regression for collection APIs, language semantics, or ownership wrappers. Fixtures include boundary and interaction cases.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
from collections import Counter, ChainMap, deque
import heapq
N = 1
observations = []
def solve(x, y=None):
    return dict(x)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('mixed signs', solve({'a': 2, 'b': 0, 'c': -1}), {'a': 2})
check('zero', solve({'a': 0}), {})
check('negative', solve({'a': -2}), {})
check('empty', solve({}), {})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
mixed signs{'a': 2, 'b': 0, 'c': -1}{'a': 2}Failed
zero{'a': 0}{}Failed
negative{'a': -2}{}Failed
empty{}{}Passed

SHA-256 / 7092f2abfaf112ae5c059b3eef316c97441e27a6b1eff5790c67a54ec39b8acf

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
from collections import Counter, ChainMap, deque
import heapq
N = 1
observations = []
def solve(x, y=None):
    return {k:v for k,v in x.items() if v>=0}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('mixed signs', solve({'a': 2, 'b': 0, 'c': -1}), {'a': 2})
check('zero', solve({'a': 0}), {})
check('negative', solve({'a': -2}), {})
check('empty', solve({}), {})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
mixed signs{'a': 2, 'b': 0}{'a': 2}Failed
zero{'a': 0}{}Failed
negative{}{}Passed
empty{}{}Passed

SHA-256 / 60d4b8f1221681eae4fde78861e3e3d2ddf0143e07f48c157d71581074744b8f

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
from collections import Counter, ChainMap, deque
import heapq
N = 1
observations = []
def solve(x, y=None):
    return dict(+Counter(x))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('mixed signs', solve({'a': 2, 'b': 0, 'c': -1}), {'a': 2})
check('zero', solve({'a': 0}), {})
check('negative', solve({'a': -2}), {})
check('empty', solve({}), {})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
mixed signs{'a': 2}{'a': 2}Passed
zero{}{}Passed
negative{}{}Passed
empty{}{}Passed

SHA-256 / 7694401d1bcf209cbfa4d5362cfe1876ca7470f19a367e05c6c138e41a3b8587

Verification & scope

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.

Observations recorded using Python 3.12.14 at 2026-09-29T14:37:41.742655+00:00.

Case digest / 2745c5cc9f7c3a5beb40e8a6681f4e762063418271f2cf33b62832c406f4a01d