FAILURE MAP
← Case archive

FA-4561 / Iterator consumption / Open access

Chain drains current before next · case 01

The operation returns a result or retained state that violates this contract: Flatten exactly one iterable level in outer order, retaining empty and nested values at deeper levels.

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

ROOT CAUSE

Reversing outer iteration visits groups in the wrong order.

THE FAILURE

Reversing outer iteration visits groups in the wrong order.

Unsuccessful approach: Flattening an extra level destroys nested elements that should remain intact.

Case contract

Flatten exactly one iterable level in outer order, retaining empty and nested values at deeper levels. 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 group in reversed(x) for v in group]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('ordered groups', solve([['a', 'b'], ['c']]), ['a', 'b', 'c'])
check('nested remains nested', solve([[['a'], 'b'], ['c']]), [['a'], 'b', 'c'])
check('empty groups', solve([[], ['a'], []]), ['a'])
check('empty outer', solve([]), [])
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
ordered groups['c', 'a', 'b']['a', 'b', 'c']Failed
nested remains nested['c', ['a'], 'b'][['a'], 'b', 'c']Failed
empty groups['a']['a']Passed
empty outer[][]Passed

SHA-256 / 45b8e1468fc60f287f5546f6c16f0813aaed8cc1671da71898079ee0cf43852a

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 [z for group in x for v in group for z in (v if isinstance(v,list) else [v])]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('ordered groups', solve([['a', 'b'], ['c']]), ['a', 'b', 'c'])
check('nested remains nested', solve([[['a'], 'b'], ['c']]), [['a'], 'b', 'c'])
check('empty groups', solve([[], ['a'], []]), ['a'])
check('empty outer', solve([]), [])
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
ordered groups['a', 'b', 'c']['a', 'b', 'c']Passed
nested remains nested['a', 'b', 'c'][['a'], 'b', 'c']Failed
empty groups['a']['a']Passed
empty outer[][]Passed

SHA-256 / f5ddabca134f970c4eee5515a99749adeff6435248cff0cb33732844915e11d3

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

Case digest / fc0e4342d4828d7054e75302d4069bdb85303aa3678ba89a070330d40599a47f