FA-4266 / Collection algebra / Open access
Cartesian product order · case 01
The operation returns a result or retained state that violates this contract: Emit all ordered pairs in left-major, right-minor order, retaining duplicates.
ROOT CAUSE
Loop nesting changes the required left-major product order.
VERIFIED REPAIR
Emit all ordered pairs in left-major, right-minor order, retaining duplicates.
Unsuccessful approach: Position-wise zipping does not enumerate every pair.
Case contract
Emit all ordered pairs in left-major, right-minor order, retaining duplicates. 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 [[a,b] for b in y for a in x]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), [])
check('empty right operand', solve(['a'], []), [])
check('empty left operand', solve([], ['b']), [])
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), [['b', 'b'], ['b', 'c'], ['b', 'c'], ['a', 'b'], ['a', 'c'], ['a', 'c'], ['b', 'b'], ['b', 'c'], ['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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| both empty | [] | [] | Passed |
| empty right operand | [] | [] | Passed |
| empty left operand | [] | [] | Passed |
| overlap and multiplicity | [['b', 'b'], ['a', 'b'], ['b', 'b'], ['b', 'c'], ['a', 'c'], ['b', 'c'], ['b', 'c'], ['a', 'c'], ['b', 'c']] | [['b', 'b'], ['b', 'c'], ['b', 'c'], ['a', 'b'], ['a', 'c'], ['a', 'c'], ['b', 'b'], ['b', 'c'], ['b', 'c']] | Failed |
SHA-256 / e604369870e63bd6b23f66d8b6ca4af0fb08ee223ec9aeb8456600d7cab630bf
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 [[a,b] for a,b in zip(x,y)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), [])
check('empty right operand', solve(['a'], []), [])
check('empty left operand', solve([], ['b']), [])
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), [['b', 'b'], ['b', 'c'], ['b', 'c'], ['a', 'b'], ['a', 'c'], ['a', 'c'], ['b', 'b'], ['b', 'c'], ['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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| both empty | [] | [] | Passed |
| empty right operand | [] | [] | Passed |
| empty left operand | [] | [] | Passed |
| overlap and multiplicity | [['b', 'b'], ['a', 'c'], ['b', 'c']] | [['b', 'b'], ['b', 'c'], ['b', 'c'], ['a', 'b'], ['a', 'c'], ['a', 'c'], ['b', 'b'], ['b', 'c'], ['b', 'c']] | Failed |
SHA-256 / c0fb05cc033ed0c1d47fddbf8688898cac1248d74d82a13001d43eb16d658fcf
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 [[a,b] for a in x for b in y]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), [])
check('empty right operand', solve(['a'], []), [])
check('empty left operand', solve([], ['b']), [])
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), [['b', 'b'], ['b', 'c'], ['b', 'c'], ['a', 'b'], ['a', 'c'], ['a', 'c'], ['b', 'b'], ['b', 'c'], ['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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| both empty | [] | [] | Passed |
| empty right operand | [] | [] | Passed |
| empty left operand | [] | [] | Passed |
| overlap and multiplicity | [['b', 'b'], ['b', 'c'], ['b', 'c'], ['a', 'b'], ['a', 'c'], ['a', 'c'], ['b', 'b'], ['b', 'c'], ['b', 'c']] | [['b', 'b'], ['b', 'c'], ['b', 'c'], ['a', 'b'], ['a', 'c'], ['a', 'c'], ['b', 'b'], ['b', 'c'], ['b', 'c']] | Passed |
SHA-256 / 8a4b75dbb5d4e54fd94bf5a86d0eb5768093670239bc192cc4c1bfe73ceb5f31
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.379418+00:00.
Case digest / 0412e4d60d07b03530b1ec3730df9146e042f90073cc225d1540b06a414db9f2