FAILURE MAP
← Case archive

FA-4596 / Iterator consumption / Open access

Permutations use positions not distinct values · case 01

The operation returns a result or retained state that violates this contract: Return ordered length-r permutations of distinct input positions; equal values may produce equal output tuples.

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

ROOT CAUSE

Deduplicating the source merges distinct equal-valued positions.

VERIFIED REPAIR

Return ordered length-r permutations of distinct input positions; equal values may produce equal output tuples.

Unsuccessful approach: Combinations omit alternative positional orderings.

Case contract

Return ordered length-r permutations of distinct input positions; equal values may produce equal output tuples. 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 [list(v) for v in it.permutations(dict.fromkeys(x),y)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('duplicate positions', solve(['a', 'a'], 2), [['a', 'a'], ['a', 'a']])
check('orderings', solve(['a', 'b'], 2), [['a', 'b'], ['b', 'a']])
check('zero length', solve(['a'], 0), [[]])
check('insufficient positions', solve(['a'], 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 fixtureActualExpectedOutcome
duplicate positions[][['a', 'a'], ['a', 'a']]Failed
orderings[['a', 'b'], ['b', 'a']][['a', 'b'], ['b', 'a']]Passed
zero length[[]][[]]Passed
insufficient positions[][]Passed

SHA-256 / 061c0dccff4b609b067bf21b264e0b5464bb09fc7b2eb56b0afe2378d2bddd14

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(v) for v in it.combinations(x,y)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('duplicate positions', solve(['a', 'a'], 2), [['a', 'a'], ['a', 'a']])
check('orderings', solve(['a', 'b'], 2), [['a', 'b'], ['b', 'a']])
check('zero length', solve(['a'], 0), [[]])
check('insufficient positions', solve(['a'], 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 fixtureActualExpectedOutcome
duplicate positions[['a', 'a']][['a', 'a'], ['a', 'a']]Failed
orderings[['a', 'b']][['a', 'b'], ['b', 'a']]Failed
zero length[[]][[]]Passed
insufficient positions[][]Passed

SHA-256 / 42629902cde49cd67fc1e49d20dd05ddf81ea8aae903a0a12a9e18bf60b2730d

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(v) for v in it.permutations(x,y)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('duplicate positions', solve(['a', 'a'], 2), [['a', 'a'], ['a', 'a']])
check('orderings', solve(['a', 'b'], 2), [['a', 'b'], ['b', 'a']])
check('zero length', solve(['a'], 0), [[]])
check('insufficient positions', solve(['a'], 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 fixtureActualExpectedOutcome
duplicate positions[['a', 'a'], ['a', 'a']][['a', 'a'], ['a', 'a']]Passed
orderings[['a', 'b'], ['b', 'a']][['a', 'b'], ['b', 'a']]Passed
zero length[[]][[]]Passed
insufficient positions[][]Passed

SHA-256 / f2690f2a91b539c127138700f1c1175ccdbca594537f2c030a47a13ba3d4cab4

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

Case digest / a2013e168e9a6fe55db828a800c94f6b1da4aef3d1a3502392cdc06075051fff