FAILURE MAP
← Case archive

FA-4316 / Collection algebra / Open access

Sequence equality retains order · case 01

The operation returns a result or retained state that violates this contract: Return true only when both lists have the same values at the same positions.

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

ROOT CAUSE

Set equality discards both order and multiplicity.

VERIFIED REPAIR

Return true only when both lists have the same values at the same positions.

Unsuccessful approach: Sorting preserves counts but still discards positional order.

Case contract

Return true only when both lists have the same values at the same positions. 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 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('permutation is unequal', solve(['a','b'], ['b','a']), False)
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
permutation is unequalTrueFalseFailed

SHA-256 / 00ba74d6704352aaf43ebed09a278df0aab0740ec8885e350ec8b084afe92758

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('permutation is unequal', solve(['a','b'], ['b','a']), False)
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
permutation is unequalTrueFalseFailed

SHA-256 / 7c9c1820cef13e52971833108a2a9e3f35088de44df1e0782a7e2d54df91eec3

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 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('permutation is unequal', solve(['a','b'], ['b','a']), False)
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
permutation is unequalFalseFalsePassed

SHA-256 / c263485dbb5595efe1c3e454cbc8ea3ac20923bb4e8a4a38570759eee0fa49ee

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

Case digest / 65e07d2b680c54c2bdfcf8c2161e7ac32b3253b4658f68eea50fcbee6e6d6050