FAILURE MAP
← Case archive

FA-4231 / Collection algebra / Open access

Concatenation order and duplicates · case 01

The operation returns a result or retained state that violates this contract: Concatenate left then right, retaining every occurrence.

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

ROOT CAUSE

The operands are appended in reverse order.

VERIFIED REPAIR

Concatenate left then right, retaining every occurrence.

Unsuccessful approach: Deduplication discards intentional repeated values.

Case contract

Concatenate left then right, retaining every occurrence. 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 y+x
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), [])
check('empty right operand', solve(['a'], []), ['a'])
check('empty left operand', solve([], ['b']), ['b'])
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), ['b', 'a', 'b', 'b', 'c', 'c'])
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 empty[][]Passed
empty right operand['a']['a']Passed
empty left operand['b']['b']Passed
overlap and multiplicity['b', 'c', 'c', 'b', 'a', 'b']['b', 'a', 'b', 'b', 'c', 'c']Failed

SHA-256 / 0b3f2238274b87e4ffb4d86ffb299e46a808a6d5465f72fc60aff4c37fcef750

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 list(dict.fromkeys(x+y))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), [])
check('empty right operand', solve(['a'], []), ['a'])
check('empty left operand', solve([], ['b']), ['b'])
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), ['b', 'a', 'b', 'b', 'c', 'c'])
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 empty[][]Passed
empty right operand['a']['a']Passed
empty left operand['b']['b']Passed
overlap and multiplicity['b', 'a', 'c']['b', 'a', 'b', 'b', 'c', 'c']Failed

SHA-256 / 9213159ce2cd08626e7f58c4b3012e8fbdb177de455611caa8786f796fbc528a

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([], []), [])
check('empty right operand', solve(['a'], []), ['a'])
check('empty left operand', solve([], ['b']), ['b'])
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), ['b', 'a', 'b', 'b', 'c', 'c'])
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 empty[][]Passed
empty right operand['a']['a']Passed
empty left operand['b']['b']Passed
overlap and multiplicity['b', 'a', 'b', 'b', 'c', 'c']['b', 'a', 'b', 'b', 'c', 'c']Passed

SHA-256 / 073444a9d0e93dc7438938815b3510a68de19a76e8be2291adea235861895cab

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

Case digest / 10955c049d2f83edb7ce1fe66c99f912a2767d4de100e43eed66b49b3e02e723