FA-4151 / Sequence semantics / Open access
Even position selection · case 01
The operation returns a result or retained state that violates this contract: Select positions 0,2,4 and so on, retaining duplicates.
ROOT CAUSE
The stride begins at the wrong parity.
VERIFIED REPAIR
Select positions 0,2,4 and so on, retaining duplicates.
Unsuccessful approach: Deduplicating selected positions erases equal-valued occurrences.
Case contract
Select positions 0,2,4 and so on, retaining duplicates. 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[1::2]
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'])
check('nonadjacent duplicate and unsorted order', solve(['b', 'a', 'b', 'c']), ['b', '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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| empty collection | [] | [] | Passed |
| singleton collection | [] | ['a'] | Failed |
| two distinct elements | ['b'] | ['a'] | Failed |
| nonadjacent duplicate and unsorted order | ['a', 'c'] | ['b', 'b'] | Failed |
SHA-256 / f5f347effa3bc8bc13012c3fe0ade45a67fbbd988922673ffecf25f237610b9c
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[::2]))
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'])
check('nonadjacent duplicate and unsorted order', solve(['b', 'a', 'b', 'c']), ['b', '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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| empty collection | [] | [] | Passed |
| singleton collection | ['a'] | ['a'] | Passed |
| two distinct elements | ['a'] | ['a'] | Passed |
| nonadjacent duplicate and unsorted order | ['b'] | ['b', 'b'] | Failed |
SHA-256 / 3a16259c69a1ad5f5aa074fad556cb38646ec8adff30e867970e60373e012341
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[::2]
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'])
check('nonadjacent duplicate and unsorted order', solve(['b', 'a', 'b', 'c']), ['b', '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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| empty collection | [] | [] | Passed |
| singleton collection | ['a'] | ['a'] | Passed |
| two distinct elements | ['a'] | ['a'] | Passed |
| nonadjacent duplicate and unsorted order | ['b', 'b'] | ['b', 'b'] | Passed |
SHA-256 / 80e6042b28f8d29b92b87d3864444d4bc77849c509df8a92361e275b21fa85a3
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:36.294970+00:00.
Case digest / ffeb33b571956a974662e6817db26f89cafbc1eca10d43e540c664c791834f7c