FAILURE MAP
← Case archive

FA-11101 / Media playlist state / Open access

Shuffle preserves playing head · case 01

Shuffling replaces the playing entry with the first random candidate.

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

ROOT CAUSE

Shuffling replaces the playing entry with the first random candidate.

VERIFIED REPAIR

Preserve the media contract: Permutation contains every original index once. A deterministic shuffle places current first and remaining entries in permutation order without duplication.

Unsuccessful approach: Prepending current without excluding it from the permutation schedules it twice.

Case contract

Permutation contains every original index once. A deterministic shuffle places current first and remaining entries in permutation order without duplication.

Why this case matters

A deterministic local media controller stage; metadata and downloaded data are supplied explicitly. No external player, service or codec is required.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(entries, current, permutation):
    return [entries[i] for i in permutation]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*(['a', 'b', 'c'], 1, [2, 0, 1])),['b', 'c', 'a'])
check('fixture 2',solve(*(['a'], 0, [0])),['a'])
check('fixture 3',solve(*(['a', 'b'], 0, [0, 1])),['a', 'b'])
check('fixture 4',solve(*(['a', 'b', 'c'], 2, [0, 2, 1])),['c', 'a', 'b'])
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
fixture 1['c', 'a', 'b']['b', 'c', 'a']Failed
fixture 2['a']['a']Passed
fixture 3['a', 'b']['a', 'b']Passed
fixture 4['a', 'c', 'b']['c', 'a', 'b']Failed

SHA-256 / b91f9b5949af4a5320a82db26749cabd8db3a9d586b463fa4cf2c87e930b6777

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(entries, current, permutation):
    return [entries[current]]+[entries[i] for i in permutation]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*(['a', 'b', 'c'], 1, [2, 0, 1])),['b', 'c', 'a'])
check('fixture 2',solve(*(['a'], 0, [0])),['a'])
check('fixture 3',solve(*(['a', 'b'], 0, [0, 1])),['a', 'b'])
check('fixture 4',solve(*(['a', 'b', 'c'], 2, [0, 2, 1])),['c', 'a', 'b'])
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
fixture 1['b', 'c', 'a', 'b']['b', 'c', 'a']Failed
fixture 2['a', 'a']['a']Failed
fixture 3['a', 'a', 'b']['a', 'b']Failed
fixture 4['c', 'a', 'c', 'b']['c', 'a', 'b']Failed

SHA-256 / 21431fcbcbeea538e16888d57c2aef3576a576257ac2cc1b71679e272799fb31

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(entries, current, permutation):
    return [entries[current]]+[entries[i] for i in permutation if i!=current]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*(['a', 'b', 'c'], 1, [2, 0, 1])),['b', 'c', 'a'])
check('fixture 2',solve(*(['a'], 0, [0])),['a'])
check('fixture 3',solve(*(['a', 'b'], 0, [0, 1])),['a', 'b'])
check('fixture 4',solve(*(['a', 'b', 'c'], 2, [0, 2, 1])),['c', 'a', 'b'])
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
fixture 1['b', 'c', 'a']['b', 'c', 'a']Passed
fixture 2['a']['a']Passed
fixture 3['a', 'b']['a', 'b']Passed
fixture 4['c', 'a', 'b']['c', 'a', 'b']Passed

SHA-256 / cb3c5fa9d871cfbec1b5a58f31c429e46e32ecc2948611f8e51e01c50dbe7037

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

Case digest / dbdb38e8289af0926df82621a5877f58afb222ed9555c4a4694c7acd266a9949