FAILURE MAP
← Case archive

FA-4326 / Collection algebra / Open access

Set equality ignores counts · case 01

The operation returns a result or retained state that violates this contract: Return true for equal member sets regardless of counts and order.

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

ROOT CAUSE

Positional equality treats repeated occurrences and order as significant.

VERIFIED REPAIR

Return true for equal member sets regardless of counts and order.

Unsuccessful approach: Sorting still retains multiplicity although the contract is set equality.

Case contract

Return true for equal member sets regardless of counts and order. 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

N = 1
observations = []
def solve(x, y=None):
    return x==y
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), True)
check('empty right operand', solve(['a'], []), False)
check('empty left operand', solve([], ['b']), False)
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), False)
check('duplicate count ignored', solve(['a','a'], ['a']), True)
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
both emptyTrueTruePassed
empty right operandFalseFalsePassed
empty left operandFalseFalsePassed
overlap and multiplicityFalseFalsePassed
duplicate count ignoredFalseTrueFailed

SHA-256 / c2689ca3ac2167c0b3894eba64f3250db6d939dbdcb5960a38d38d4e72fb8eba

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x, y=None):
    return sorted(x)==sorted(y)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), True)
check('empty right operand', solve(['a'], []), False)
check('empty left operand', solve([], ['b']), False)
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), False)
check('duplicate count ignored', solve(['a','a'], ['a']), True)
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
both emptyTrueTruePassed
empty right operandFalseFalsePassed
empty left operandFalseFalsePassed
overlap and multiplicityFalseFalsePassed
duplicate count ignoredFalseTrueFailed

SHA-256 / 42ead49dd777a16a19f43b28da10c82d8fd83efb7409ce14956f172fea509b14

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x, y=None):
    return set(x)==set(y)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), True)
check('empty right operand', solve(['a'], []), False)
check('empty left operand', solve([], ['b']), False)
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), False)
check('duplicate count ignored', solve(['a','a'], ['a']), True)
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
both emptyTrueTruePassed
empty right operandFalseFalsePassed
empty left operandFalseFalsePassed
overlap and multiplicityFalseFalsePassed
duplicate count ignoredTrueTruePassed

SHA-256 / 35904ea8ba6c208cfd43769b2199fe05940749236814fe7813abaaae6117c76f

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:37.866698+00:00.

Case digest / 66ebf5c08beca6cc8252667254272d7ae5f84514afdd4250625af8f9fe4c5c51