FA-11146 / Streaming segment lifecycle / Open access
Download chunks offset assembly · case 01
Appending in download completion order corrupts segment byte order.
ROOT CAUSE
Appending in download completion order corrupts segment byte order.
VERIFIED REPAIR
Preserve the media contract: Assemble nonoverlapping contiguous downloaded byte chunks supplied in arbitrary completion order, ordered by their absolute byte offsets. Coverage validity is prevalidated.
Unsuccessful approach: Sorting byte payloads instead of offsets also corrupts assembly.
Case contract
Assemble nonoverlapping contiguous downloaded byte chunks supplied in arbitrary completion order, ordered by their absolute byte offsets. Coverage validity is prevalidated.
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(chunks):
return [byte for offset,data in chunks for byte in data]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([[2, [1, 2]], [0, [8, 9]]],)),[8, 9, 1, 2])
check('fixture 2',solve(*([[0, [3]]],)),[3])
check('fixture 3',solve(*([],)),[])
check('fixture 4',solve(*([[1, [0]], [0, [9]]],)),[9, 0])
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 |
|---|---|---|---|
| fixture 1 | [1, 2, 8, 9] | [8, 9, 1, 2] | Failed |
| fixture 2 | [3] | [3] | Passed |
| fixture 3 | [] | [] | Passed |
| fixture 4 | [0, 9] | [9, 0] | Failed |
SHA-256 / bcbcc17232cec1d9e2675bd0eb7b5eed3165236959e300643b9450c2cd2d3b80
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(chunks):
return [byte for offset,data in sorted(chunks,key=lambda x:x[1]) for byte in data]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([[2, [1, 2]], [0, [8, 9]]],)),[8, 9, 1, 2])
check('fixture 2',solve(*([[0, [3]]],)),[3])
check('fixture 3',solve(*([],)),[])
check('fixture 4',solve(*([[1, [0]], [0, [9]]],)),[9, 0])
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 |
|---|---|---|---|
| fixture 1 | [1, 2, 8, 9] | [8, 9, 1, 2] | Failed |
| fixture 2 | [3] | [3] | Passed |
| fixture 3 | [] | [] | Passed |
| fixture 4 | [0, 9] | [9, 0] | Failed |
SHA-256 / 03a2c348b0e591d38e0757efa7158bcfeabf554b990b0dd87388148ec2690216
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(chunks):
return [byte for offset,data in sorted(chunks,key=lambda x:x[0]) for byte in data]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([[2, [1, 2]], [0, [8, 9]]],)),[8, 9, 1, 2])
check('fixture 2',solve(*([[0, [3]]],)),[3])
check('fixture 3',solve(*([],)),[])
check('fixture 4',solve(*([[1, [0]], [0, [9]]],)),[9, 0])
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 |
|---|---|---|---|
| fixture 1 | [8, 9, 1, 2] | [8, 9, 1, 2] | Passed |
| fixture 2 | [3] | [3] | Passed |
| fixture 3 | [] | [] | Passed |
| fixture 4 | [9, 0] | [9, 0] | Passed |
SHA-256 / 443b92e845b02c53136cd505d7c203ac4d13ac37df77c60882d113dbbf270d8c
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.397883+00:00.
Case digest / 0b6b88f47e361ccf25fce8d294a48bcf00b4655c24c81ffb91513e535c4cd3ba