FAILURE MAP
← Case archive

FA-4291 / Collection algebra / Open access

Contiguous sublist search · case 01

The operation returns a result or retained state that violates this contract: Return whether right occurs as a contiguous sublist of left; empty right is always present.

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

ROOT CAUSE

Independent membership tests ignore contiguity and positional order.

VERIFIED REPAIR

Return whether right occurs as a contiguous sublist of left; empty right is always present.

Unsuccessful approach: An empty haystack offers no starting position under an exclusive range.

Case contract

Return whether right occurs as a contiguous sublist of left; empty right is always present. 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 all(v in x for v in 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'], []), True)
check('empty left operand', solve([], ['b']), False)
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), False)
check('gaps are not contiguous', solve(['a','b','c'], ['a','c']), 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 operandTrueTruePassed
empty left operandFalseFalsePassed
overlap and multiplicityFalseFalsePassed
gaps are not contiguousTrueFalseFailed

SHA-256 / 65c9aaba8f9871a9a8c1afb9745b26a2166e8e3a3ceaca22fa4cdc44c0570e2a

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 any(x[i:i+len(y)]==y for i in range(len(x)))
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'], []), True)
check('empty left operand', solve([], ['b']), False)
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), False)
check('gaps are not contiguous', solve(['a','b','c'], ['a','c']), 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 emptyFalseTrueFailed
empty right operandTrueTruePassed
empty left operandFalseFalsePassed
overlap and multiplicityFalseFalsePassed
gaps are not contiguousFalseFalsePassed

SHA-256 / b0e629a107c7616d54435d094cbacc491ce8121ab373b8da6a7cdbc9434cb1af

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 any(x[i:i+len(y)]==y for i in range(len(x)+1))
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'], []), True)
check('empty left operand', solve([], ['b']), False)
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), False)
check('gaps are not contiguous', solve(['a','b','c'], ['a','c']), 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 operandTrueTruePassed
empty left operandFalseFalsePassed
overlap and multiplicityFalseFalsePassed
gaps are not contiguousFalseFalsePassed

SHA-256 / 06e48b365ecf9abeb1e8e180456e6826efa99000b3af881b718ba8274dd8c9a7

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

Case digest / a1d377ff33aa8a160836a5933d0e9cadf5e4b703e00f85d63fb1edf1d0ed9b95