FA-4656 / Iterator consumption / Open access
Islice step consumes stop prefix · case 01
The operation returns a result or retained state that violates this contract: Exhausting islice(start,stop,step) consumes through stop regardless of the last yielded position; return [yielded,remaining].
ROOT CAUSE
Consumption stops after the last emitted position rather than the requested stop boundary.
THE FAILURE
Consumption stops after the last emitted position rather than the requested stop boundary.
Unsuccessful approach: Returning the suffix from start ignores every position consumed by slicing.
Case contract
Exhausting islice(start,stop,step) consumes through stop regardless of the last yielded position; return [yielded,remaining]. 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
import itertools as it
from collections import deque
N = 1
observations = []
def solve(x, y=None):
return [x[y[0]:y[1]:y[2]],x[(y[0]+((max(0,y[1]-y[0])-1)//y[2])*y[2]+1) if y[1]>y[0] else y[0]:]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('stop beyond last yield', solve(['a', 'b', 'c', 'd', 'e'], [0, 4, 3]), [['a', 'd'], ['e']])
check('skipped final position consumed', solve(['a', 'b', 'c', 'd', 'e'], [0, 4, 2]), [['a', 'c'], ['e']])
check('empty slice consumes start', solve(['a', 'b', 'c'], [2, 2, 1]), [[], ['c']])
check('empty input', solve([], [0, 3, 2]), [[], []])
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 |
|---|---|---|---|
| stop beyond last yield | [['a', 'd'], ['e']] | [['a', 'd'], ['e']] | Passed |
| skipped final position consumed | [['a', 'c'], ['d', 'e']] | [['a', 'c'], ['e']] | Failed |
| empty slice consumes start | [[], ['c']] | [[], ['c']] | Passed |
| empty input | [[], []] | [[], []] | Passed |
SHA-256 / beb784bff714fee722ec85c590de768f2b699232ac7eef2960999e92c9141858
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import itertools as it
from collections import deque
N = 1
observations = []
def solve(x, y=None):
return [x[y[0]:y[1]:y[2]],x[y[0]:]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('stop beyond last yield', solve(['a', 'b', 'c', 'd', 'e'], [0, 4, 3]), [['a', 'd'], ['e']])
check('skipped final position consumed', solve(['a', 'b', 'c', 'd', 'e'], [0, 4, 2]), [['a', 'c'], ['e']])
check('empty slice consumes start', solve(['a', 'b', 'c'], [2, 2, 1]), [[], ['c']])
check('empty input', solve([], [0, 3, 2]), [[], []])
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 |
|---|---|---|---|
| stop beyond last yield | [['a', 'd'], ['a', 'b', 'c', 'd', 'e']] | [['a', 'd'], ['e']] | Failed |
| skipped final position consumed | [['a', 'c'], ['a', 'b', 'c', 'd', 'e']] | [['a', 'c'], ['e']] | Failed |
| empty slice consumes start | [[], ['c']] | [[], ['c']] | Passed |
| empty input | [[], []] | [[], []] | Passed |
SHA-256 / 795892bfdc7cebfa5bf17617fe55dc94fffdf0e6e5a715693a8953dd8c12dd2a
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 4 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗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:41.473162+00:00.
Case digest / 169fa116af7d23dfd9258f2c9cc928fbabb042ea2fff3ce8bf0e6b09698f7a1e