FAILURE MAP
← Case archive

FA-11186 / Streaming segment lifecycle / Open access

Segment priority seek distance · case 01

Numeric download order fills old segments before the seek target.

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

ROOT CAUSE

Numeric download order fills old segments before the seek target.

VERIFIED REPAIR

Preserve the media contract: Prioritize known sequence IDs by distance from seek target; at equal distance prefer forward data, then numeric ID.

Unsuccessful approach: Stable distance-only sorting may prioritize backward data on a tie.

Case contract

Prioritize known sequence IDs by distance from seek target; at equal distance prefer forward data, then numeric ID.

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(sequences, target):
    return sorted(sequences)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([8, 9, 10, 11, 12], 10)),[10, 11, 9, 12, 8])
check('fixture 2',solve(*([2, 0], 1)),[2, 0])
check('fixture 3',solve(*([], 3)),[])
check('fixture 4',solve(*([3], 3)),[3])
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[8, 9, 10, 11, 12][10, 11, 9, 12, 8]Failed
fixture 2[0, 2][2, 0]Failed
fixture 3[][]Passed
fixture 4[3][3]Passed

SHA-256 / 4825ee1f110724e89cef66dc3470f04ac327f04433532ea073e2e155296b07df

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(sequences, target):
    return sorted(sequences,key=lambda s:abs(s-target))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([8, 9, 10, 11, 12], 10)),[10, 11, 9, 12, 8])
check('fixture 2',solve(*([2, 0], 1)),[2, 0])
check('fixture 3',solve(*([], 3)),[])
check('fixture 4',solve(*([3], 3)),[3])
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[10, 9, 11, 8, 12][10, 11, 9, 12, 8]Failed
fixture 2[2, 0][2, 0]Passed
fixture 3[][]Passed
fixture 4[3][3]Passed

SHA-256 / 64d9657ee9afc7853f50fa5a57ebb58876b71ec0b8b86c2f17aa7b25b9696dcb

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(sequences, target):
    return sorted(sequences,key=lambda s:(abs(s-target),s<target,s))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([8, 9, 10, 11, 12], 10)),[10, 11, 9, 12, 8])
check('fixture 2',solve(*([2, 0], 1)),[2, 0])
check('fixture 3',solve(*([], 3)),[])
check('fixture 4',solve(*([3], 3)),[3])
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[10, 11, 9, 12, 8][10, 11, 9, 12, 8]Passed
fixture 2[2, 0][2, 0]Passed
fixture 3[][]Passed
fixture 4[3][3]Passed

SHA-256 / baa6fd09f097566d0228340bdf964a5bfd4541d4ca0780e2bad825d08df30869

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

Case digest / 505464618aee1bacc1e3554e2b79bb1e0c5eff7a5afa56009604be2a185e6241