FAILURE MAP
← Case archive

FA-4176 / Sequence semantics / Open access

Nonoverlapping pairs keep tail · case 01

The operation returns a result or retained state that violates this contract: Split into nonoverlapping pairs and preserve a final singleton.

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

ROOT CAUSE

Sliding windows duplicate positions that belong to separate chunks.

VERIFIED REPAIR

Split into nonoverlapping pairs and preserve a final singleton.

Unsuccessful approach: Restricting output to complete pairs discards a final singleton.

Case contract

Split into nonoverlapping pairs and preserve a final singleton. 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[i],x[i+1]] for i in range(len(x)-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']])
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']]Failed
two distinct elements[['a', 'b']][['a', 'b']]Passed
nonadjacent duplicate and unsorted order[['b', 'a'], ['a', 'b'], ['b', 'c']][['b', 'a'], ['b', 'c']]Failed

SHA-256 / bac05dca933df6174c5f9a19bdb87dbd5b4729ae1136e5c45d87ecb66376cc87

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 [x[i:i+2] for i in range(0,len(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', 'b']])
check('nonadjacent duplicate and unsorted order', solve(['b', 'a', 'b', 'c']), [['b', 'a'], ['b', '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
empty collection[][]Passed
singleton collection[][['a']]Failed
two distinct elements[['a', 'b']][['a', 'b']]Passed
nonadjacent duplicate and unsorted order[['b', 'a'], ['b', 'c']][['b', 'a'], ['b', 'c']]Passed

SHA-256 / f440cea22ec7fd95d2fec5a5bdee173f7c38c8080bd887a10fe118fdc3ab4104

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[i:i+2] for i in range(0,len(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', 'b']])
check('nonadjacent duplicate and unsorted order', solve(['b', 'a', 'b', 'c']), [['b', 'a'], ['b', '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
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

SHA-256 / f2ba15391387e83ca5257312ec42345287d4bf7b2abaea66e625a00df5270782

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

Case digest / b889e3bee33f76fe6747ab131312fa8a0ce71fb88a11d469b1ff905a3a889a56