FAILURE MAP
← Case archive

FA-4096 / Sequence semantics / Open access

Adjacent run collapse · case 01

The operation returns a result or retained state that violates this contract: Collapse adjacent equal values only; separated repetitions remain.

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

ROOT CAUSE

Global deduplication collapses equal values from separate runs.

VERIFIED REPAIR

Collapse adjacent equal values only; separated repetitions remain.

Unsuccessful approach: Sorting and deduplicating both destroys run order and merges separate runs.

Case contract

Collapse adjacent equal values only; separated repetitions remain. 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 list(dict.fromkeys(x))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty collection', solve([]), [])
check('singleton collection', solve(['a']), ['a'])
check('two distinct elements', solve(['a', 'b']), ['a', 'b'])
check('nonadjacent duplicate and unsorted order', solve(['b', 'a', 'b', 'c']), ['b', 'a', 'b', 'c'])
check('adjacent duplicates collapse', solve(['b','b','a','b']), ['b','a','b'])
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
empty collection[][]Passed
singleton collection['a']['a']Passed
two distinct elements['a', 'b']['a', 'b']Passed
nonadjacent duplicate and unsorted order['b', 'a', 'c']['b', 'a', 'b', 'c']Failed
adjacent duplicates collapse['b', 'a']['b', 'a', 'b']Failed

SHA-256 / 837ad5dc985c94e85ec832b6d01c5c6f90f939983da4c42e85e2cf2e53cdc2c4

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(set(x))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty collection', solve([]), [])
check('singleton collection', solve(['a']), ['a'])
check('two distinct elements', solve(['a', 'b']), ['a', 'b'])
check('nonadjacent duplicate and unsorted order', solve(['b', 'a', 'b', 'c']), ['b', 'a', 'b', 'c'])
check('adjacent duplicates collapse', solve(['b','b','a','b']), ['b','a','b'])
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
empty collection[][]Passed
singleton collection['a']['a']Passed
two distinct elements['a', 'b']['a', 'b']Passed
nonadjacent duplicate and unsorted order['a', 'b', 'c']['b', 'a', 'b', 'c']Failed
adjacent duplicates collapse['a', 'b']['b', 'a', 'b']Failed

SHA-256 / 10f4b7b38e3475044b0b5e2a1243b452d5ba246f26b11b6871ec26dba45f7326

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 [v for i,v in enumerate(x) if i == 0 or v != x[i-1]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty collection', solve([]), [])
check('singleton collection', solve(['a']), ['a'])
check('two distinct elements', solve(['a', 'b']), ['a', 'b'])
check('nonadjacent duplicate and unsorted order', solve(['b', 'a', 'b', 'c']), ['b', 'a', 'b', 'c'])
check('adjacent duplicates collapse', solve(['b','b','a','b']), ['b','a','b'])
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
empty collection[][]Passed
singleton collection['a']['a']Passed
two distinct elements['a', 'b']['a', 'b']Passed
nonadjacent duplicate and unsorted order['b', 'a', 'b', 'c']['b', 'a', 'b', 'c']Passed
adjacent duplicates collapse['b', 'a', 'b']['b', 'a', 'b']Passed

SHA-256 / f28422db4de4fb02d1e1a015296226bf9b276e2c28af615f599ea64be9caa3da

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

Case digest / b03b4160b35e631cfebeec153a38ae86f1e51368a02c4a16a4730215d73fff6d