FAILURE MAP
← Case archive

FA-11326 / Media playlist lifecycle / Open access

Previous track history: Collapses repeated playback occurrences in the remaining history · case 01

Collapses repeated playback occurrences in the remaining history and produces an incorrect media-control or presentation result.

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

ROOT CAUSE

Collapses repeated playback occurrences in the remaining history. The fixture suite isolates this decision from network delivery and codec details.

VERIFIED REPAIR

Previous restarts the current item at zero when position_ms is at least threshold; otherwise it pops the most recently played history occurrence and prepends current to forward history. With no past item, restart current. Inputs have nonnegative positions and positive threshold; duplicate history occurrences are meaningful.

Unsuccessful approach: The alternative still fails because it visits the oldest history entry instead of the most recent.

Case contract

Previous restarts the current item at zero when position_ms is at least threshold; otherwise it pops the most recently played history occurrence and prepends current to forward history. With no past item, restart current. Inputs have nonnegative positions and positive threshold; duplicate history occurrences are meaningful.

Why this case matters

A deterministic in-memory media application model with explicit playlist, timeline or synchronization semantics. Does not implement codecs, transport protocols, rendering hardware or concurrent playback.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(current, position_ms, threshold, history, future):
    back=list(history); forward=list(future)
    if position_ms >= threshold:
        return [current,0,back,forward]
    if not back: return [current,0,back,forward]
    previous=back.pop()
    if current is not None: forward.insert(0,current)
    return [previous,0,list(dict.fromkeys(back)),forward]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('recent history selected', solve('c', 0, 3000, ['a', 'b'], []), ['b', 0, ['a'], ['c']])
check('restart at exact threshold', solve('c', 3000, 3000, ['a', 'b'], ['d']), ['c', 0, ['a', 'b'], ['d']])
check('forward stack preserves order', solve('c', 100, 3000, ['a', 'b'], ['d', 'e']), ['b', 0, ['a'], ['c', 'd', 'e']])
check('duplicate past retained', solve('c', 0, 3000, ['a', 'a', 'b'], []), ['b', 0, ['a', 'a'], ['c']])
check('no past restarts', solve('a', 0, 3000, [], ['b']), ['a', 0, [], ['b']])
check('absent current not inserted', solve(None, 0, 3000, ['a'], ['b']), ['a', 0, [], ['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
recent history selected['b', 0, ['a'], ['c']]['b', 0, ['a'], ['c']]Passed
restart at exact threshold['c', 0, ['a', 'b'], ['d']]['c', 0, ['a', 'b'], ['d']]Passed
forward stack preserves order['b', 0, ['a'], ['c', 'd', 'e']]['b', 0, ['a'], ['c', 'd', 'e']]Passed
duplicate past retained['b', 0, ['a'], ['c']]['b', 0, ['a', 'a'], ['c']]Failed
no past restarts['a', 0, [], ['b']]['a', 0, [], ['b']]Passed
absent current not inserted['a', 0, [], ['b']]['a', 0, [], ['b']]Passed

SHA-256 / 05eede6dbadf752543d89ccfd5d83ebb72662f99d7f5a4f2fd1a63e1bf2896ea

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(current, position_ms, threshold, history, future):
    back=list(history); forward=list(future)
    if position_ms >= threshold:
        return [current,0,back,forward]
    if not back: return [current,0,back,forward]
    previous=back.pop(0)
    if current is not None: forward.insert(0,current)
    return [previous,0,back,forward]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('recent history selected', solve('c', 0, 3000, ['a', 'b'], []), ['b', 0, ['a'], ['c']])
check('restart at exact threshold', solve('c', 3000, 3000, ['a', 'b'], ['d']), ['c', 0, ['a', 'b'], ['d']])
check('forward stack preserves order', solve('c', 100, 3000, ['a', 'b'], ['d', 'e']), ['b', 0, ['a'], ['c', 'd', 'e']])
check('duplicate past retained', solve('c', 0, 3000, ['a', 'a', 'b'], []), ['b', 0, ['a', 'a'], ['c']])
check('no past restarts', solve('a', 0, 3000, [], ['b']), ['a', 0, [], ['b']])
check('absent current not inserted', solve(None, 0, 3000, ['a'], ['b']), ['a', 0, [], ['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
recent history selected['a', 0, ['b'], ['c']]['b', 0, ['a'], ['c']]Failed
restart at exact threshold['c', 0, ['a', 'b'], ['d']]['c', 0, ['a', 'b'], ['d']]Passed
forward stack preserves order['a', 0, ['b'], ['c', 'd', 'e']]['b', 0, ['a'], ['c', 'd', 'e']]Failed
duplicate past retained['a', 0, ['a', 'b'], ['c']]['b', 0, ['a', 'a'], ['c']]Failed
no past restarts['a', 0, [], ['b']]['a', 0, [], ['b']]Passed
absent current not inserted['a', 0, [], ['b']]['a', 0, [], ['b']]Passed

SHA-256 / 8a2d0da38368d902b4cdda403629fded632dbafb4094cb9759434edb667d5a31

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(current, position_ms, threshold, history, future):
    back=list(history); forward=list(future)
    if position_ms >= threshold:
        return [current,0,back,forward]
    if not back: return [current,0,back,forward]
    previous=back.pop()
    if current is not None: forward.insert(0,current)
    return [previous,0,back,forward]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('recent history selected', solve('c', 0, 3000, ['a', 'b'], []), ['b', 0, ['a'], ['c']])
check('restart at exact threshold', solve('c', 3000, 3000, ['a', 'b'], ['d']), ['c', 0, ['a', 'b'], ['d']])
check('forward stack preserves order', solve('c', 100, 3000, ['a', 'b'], ['d', 'e']), ['b', 0, ['a'], ['c', 'd', 'e']])
check('duplicate past retained', solve('c', 0, 3000, ['a', 'a', 'b'], []), ['b', 0, ['a', 'a'], ['c']])
check('no past restarts', solve('a', 0, 3000, [], ['b']), ['a', 0, [], ['b']])
check('absent current not inserted', solve(None, 0, 3000, ['a'], ['b']), ['a', 0, [], ['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
recent history selected['b', 0, ['a'], ['c']]['b', 0, ['a'], ['c']]Passed
restart at exact threshold['c', 0, ['a', 'b'], ['d']]['c', 0, ['a', 'b'], ['d']]Passed
forward stack preserves order['b', 0, ['a'], ['c', 'd', 'e']]['b', 0, ['a'], ['c', 'd', 'e']]Passed
duplicate past retained['b', 0, ['a', 'a'], ['c']]['b', 0, ['a', 'a'], ['c']]Passed
no past restarts['a', 0, [], ['b']]['a', 0, [], ['b']]Passed
absent current not inserted['a', 0, [], ['b']]['a', 0, [], ['b']]Passed

SHA-256 / 9e77392382e214e4dbf5348c16cf086c9897be742885fcc3e91e1524107b25b5

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

Case digest / a28dbd87440cc601f335710ceae073cd06c72d66267d4accd2f24f3442f1bccc