FA-4546 / Iterator consumption / Open access
Dropwhile stops testing after first failure · case 01
The operation returns a result or retained state that violates this contract: Drop an initial run of sentinel values; once a non-sentinel appears, retain the entire suffix including later sentinels.
ROOT CAUSE
Global filtering removes matching values after the initial dropped run.
VERIFIED REPAIR
Drop an initial run of sentinel values; once a non-sentinel appears, retain the entire suffix including later sentinels.
Unsuccessful approach: takewhile implements prefix retention rather than initial-run removal.
Case contract
Drop an initial run of sentinel values; once a non-sentinel appears, retain the entire suffix including later sentinels. 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 [v for v in x if v!=y]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('later sentinel retained', solve(['s', 'a', 's', 'b'], 's'), ['a', 's', 'b'])
check('all dropped', solve(['s', 's'], 's'), [])
check('no initial sentinel', solve(['a', 's'], 's'), ['a', 's'])
check('empty', solve([], 's'), [])
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 |
|---|---|---|---|
| later sentinel retained | ['a', 'b'] | ['a', 's', 'b'] | Failed |
| all dropped | [] | [] | Passed |
| no initial sentinel | ['a'] | ['a', 's'] | Failed |
| empty | [] | [] | Passed |
SHA-256 / 3469cbe416e5ccb94e6e59cc93a3bbee4a522728730ff3e30a9a9b81f8de515f
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 list(it.takewhile(lambda v:v!=y,iter(x)))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('later sentinel retained', solve(['s', 'a', 's', 'b'], 's'), ['a', 's', 'b'])
check('all dropped', solve(['s', 's'], 's'), [])
check('no initial sentinel', solve(['a', 's'], 's'), ['a', 's'])
check('empty', solve([], 's'), [])
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 |
|---|---|---|---|
| later sentinel retained | [] | ['a', 's', 'b'] | Failed |
| all dropped | [] | [] | Passed |
| no initial sentinel | ['a'] | ['a', 's'] | Failed |
| empty | [] | [] | Passed |
SHA-256 / 627976f8ddefa2f8cf1fc4fa600734c5e00f7785747cfd7f9d89ad92d079b647
3 / The verified repair
Exit 0"""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 list(it.dropwhile(lambda v:v==y,iter(x)))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('later sentinel retained', solve(['s', 'a', 's', 'b'], 's'), ['a', 's', 'b'])
check('all dropped', solve(['s', 's'], 's'), [])
check('no initial sentinel', solve(['a', 's'], 's'), ['a', 's'])
check('empty', solve([], 's'), [])
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 |
|---|---|---|---|
| later sentinel retained | ['a', 's', 'b'] | ['a', 's', 'b'] | Passed |
| all dropped | [] | [] | Passed |
| no initial sentinel | ['a', 's'] | ['a', 's'] | Passed |
| empty | [] | [] | Passed |
SHA-256 / f94df4eb7967e17b7eb17c94101fa03e16e8c874062623afa68e0360d50c184b
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:40.317540+00:00.
Case digest / f2c5766683cc93cffbcac4a3be6f6bb84125cc93194a84a1bae9913c549d4316