Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
cee9c9e
fix(playback): cap what one bitmap subtitle page may read of its source
Nov 13, 2026
c911389
feat(playback): serve bitmap subtitle pages from one progressive sour…
Nov 13, 2026
50e154e
fix(playback): engage the pgs page path and answer its failures retry…
Nov 13, 2026
bbf022f
merge: bring main (with the per-version track inventory fix) into the…
Nov 14, 2026
7dc8673
fix(playback): set page headers before the progressive copy
Nov 14, 2026
91a685e
fix(playback): clamp a page prefix to the source size
Nov 14, 2026
b8afd5f
fix(web): show declared track inventory before the probe lands
Nov 14, 2026
2dd5f94
fix(playback): serve bitmap pages the progressive artifact has partly…
Nov 14, 2026
d86c848
fix(web): commit only the subtitle coverage a response reports
Nov 14, 2026
59da456
fix(playback): keep size-gapped probe bytes usable
Nov 14, 2026
a6093a6
test(web): expect a declared inventory to be non-provisional
Nov 14, 2026
c62ac58
fix(web): start the version the viewer picked
Muse-spark Nov 14, 2026
2dfa271
fix(playback): keep version rotations from dropping selected tracks
Muse-spark Nov 14, 2026
28d0262
merge: take the #448 version-rotation track guard as this change's pr…
Muse-spark Nov 14, 2026
d518a5b
fix(web): check version liveness through the v2 operation
Muse-spark Nov 14, 2026
cb9e405
fix(player): only notice a version substitution for a different release
Muse-spark Nov 14, 2026
47b9553
fix(playback): keep a header-only subtitle failure out of a 200
Nov 14, 2026
6325eae
fix(playback): deliver ASS and PGS subtitles on virtual sources
Nov 14, 2026
4f8570b
fix(playback): bound virtual resolves by the time the request has left
Nov 14, 2026
af9ff35
fix(playback): keep the resolve fallback from losing the selected tracks
Nov 14, 2026
4b6be7c
fix(playback): report version substitutions on the v2 wire
Nov 14, 2026
5605408
merge: #447 size-mismatch tolerance (59da4565e)
Muse-spark Nov 14, 2026
25c24cc
merge: #448 rotation respects selection (2dfa271dc)
Muse-spark Nov 14, 2026
7e71843
merge: #452 fallback respects selection (4b6be7c84)
Muse-spark Nov 14, 2026
de9ba41
merge: #451 ass-pgs delivery (6325eae39)
Muse-spark Nov 14, 2026
d166866
merge: #444 pgs progressive sidecar (d86c84807)
Muse-spark Nov 14, 2026
7dabda3
merge: #446 actionbar inventory fast (a6093a65b)
Muse-spark Nov 14, 2026
a6b96d0
merge: #449 explicit version selection (c62ac5801)
Muse-spark Nov 14, 2026
2ec2dee
merge: #450 web v1 versions and notice (cb9e405c5)
Muse-spark Nov 14, 2026
fa9c0a9
merge: give the #444 bitmap warm call the unified force argument
Muse-spark Nov 15, 2026
8fe45c9
merge: #447 size-mismatch tolerance as this change's prerequisite
Muse-spark Nov 15, 2026
bfa78e5
merge: #452 fallback respects selection as this change's prerequisite
Muse-spark Nov 15, 2026
de56664
fix(player): bound the client's segment retry loop
Muse-spark Nov 15, 2026
3078f44
fix(player): offer a tap to play when autoplay is blocked
Muse-spark Nov 15, 2026
6f3ee26
fix(player): name the release in the version-substitution notice
Muse-spark Nov 15, 2026
6a6ef85
fix(playback): bound a text subtitle window extract at its budget
Nov 15, 2026
055802a
fix(playback): stop unverified bytes from adopting a release
Muse-spark Nov 15, 2026
ca63532
merge: #455 unverified-identity refusal on the playback-final base
Muse-spark Nov 15, 2026
8d5a24b
merge: #454 bound a text subtitle window extract at its budget
Muse-spark Nov 15, 2026
39b217a
merge: #453 bounded segment retry, tap-to-play and release notice
Muse-spark Nov 15, 2026
207e14d
test(watch): assert the release name #453's notice now prints
Muse-spark Nov 15, 2026
854494c
fix(player): keep a version list change from rebuilding the transport
Muse-spark Nov 15, 2026
b8251e6
fix(web): coalesce and back off catalog version checks
Muse-spark Nov 15, 2026
c2aa7d0
fix(playback): serve a text subtitle retry from the breach warm
Muse-spark Nov 15, 2026
39086cd
fix(playback): keep a plan's effective row inside the version list
Muse-spark Nov 15, 2026
946130b
fix(playback): report a foreign-release refusal as source_mismatch
Muse-spark Nov 15, 2026
626407f
fix(player): stop a skipped version from dead-ending the item page
Muse-spark Nov 15, 2026
4720691
Merge fix/polling-does-not-restart-player (#456) into integration/pla…
Muse-spark Nov 15, 2026
26a5af6
Merge fix/ass-budget-serves-from-fill (#457) into integration/playbac…
Muse-spark Nov 15, 2026
b9fa5d5
Merge fix/plan-stays-in-version-list (#458) into integration/playback…
Muse-spark Nov 15, 2026
8ee5e54
chore(web): prune the ActionBar literal-string suppression #458 retired
Muse-spark Nov 15, 2026
0e6a004
fix(player): keep the playhead when a replan reloads the transport
Muse-spark Nov 15, 2026
7d161d4
fix(player): one transport per plan and keep the playhead across a re…
Muse-spark Nov 15, 2026
ba85a49
fix(player): stop cancelling subtitle window extractions on playhead …
Muse-spark Nov 15, 2026
11d7161
fix(playback): name subtitle refusals and keep their fill reachable
Muse-spark Nov 15, 2026
0bcd123
fix(player): retry a subtitle refusal in the background instead of fa…
Muse-spark Nov 15, 2026
b2d0f87
fix(playback): stop an early Play from stalling on an unplayable dire…
Muse-spark Nov 16, 2026
18ac859
style(player): format the playback session test
Muse-spark Nov 16, 2026
da5643a
fix(player): back off segment loads while a start has no frame
Muse-spark Nov 16, 2026
0501b3a
fix(playback): bound a start's substitute probe to the start budget
Muse-spark Nov 16, 2026
6cc1d33
fix(playback): gate a video encode start on decoded frames
Muse-spark Nov 16, 2026
cde4b62
fix(playback): log frame progress for every hls video encode
Muse-spark Nov 16, 2026
1f1d07f
fix(player): start hls playback on the media the transport buffered
Muse-spark Nov 16, 2026
dd76eed
fix(playback): never hand back a direct route that failed or cannot b…
randrini Nov 16, 2026
4d7199e
test(playback): refresh the conformance matrix for the declared-evide…
randrini Nov 16, 2026
fe6a645
fix(jellycompat): make every media URL we hand a client self-authenti…
randrini Nov 16, 2026
5ea72fd
style(jellycompat): name the ApiKey query spellings instead of repeat…
randrini Nov 16, 2026
471a41e
fix(jellycompat): open the resolved relay input for local HLS transcodes
Nov 17, 2026
81b553e
fix(apiv2): project every declared playback start field onto the planner
randrini Nov 17, 2026
6881031
fix(playback): answer a server-side start fault as retryable and stor…
randrini Nov 17, 2026
eee7a1f
fix(player): retry a transient failure and keep the transport on a tr…
randrini Nov 17, 2026
c742816
fix(playback): reuse the discovery listing and join the pre-play probe
randrini Nov 17, 2026
8312361
fix(playback): size the start phase to the resolve and readiness it h…
randrini Nov 17, 2026
821bc7a
fix(playback): bound a bitmap page's wait for its progressive artifact
randrini Nov 18, 2026
93581e0
fix(playback): convert only ADTS AAC and keep a recipe fault out of t…
randrini Nov 18, 2026
951c303
fix(web): stop retrying a subtitle page the server has given up on
randrini Nov 18, 2026
c09432a
fix(web): fail a replan that never answers after its deadline
randrini Nov 18, 2026
eed0358
style(web): format the replan deadline and subtitle page changes
randrini Nov 18, 2026
6a9fea6
fix(playback): serve an explicit pick from its own release, not a sib…
randrini Nov 18, 2026
63cc01c
fix(playback): admit a selection probe and answer with its real inven…
randrini Nov 18, 2026
ccd1a3c
fix(catalog): list one version per provider candidate with consistent…
randrini Nov 18, 2026
cfa1768
fix(playback): refuse an audio codec only from measured evidence
randrini Nov 18, 2026
6264541
fix(playback): wait out a silent source before indicting the delivery
randrini Nov 18, 2026
dc7bb1f
fix(virtual): let a selection probe finish inside the item page's wait
randrini Nov 18, 2026
750bb83
fix(web): wait out the server's selection-probe bound instead of 15 s
randrini Nov 18, 2026
43cdf5d
fix(web): name an undeclared audio track by its format, not "unknown"
randrini Nov 18, 2026
8fba706
fix(web): bound the startup guard to a transport, not a plan
randrini Nov 18, 2026
9330fb2
fix(web): read one watch detail per item and bound the preparing gate
randrini Nov 18, 2026
38b2af5
fix(playback): end the subtitle serve dead ends
randrini Nov 18, 2026
21a10e4
fix(virtual): degrade a delisted pinned candidate for an automatic se…
randrini Nov 18, 2026
b804b14
fix(catalog): never list a failed duplicate over a live row
randrini Nov 18, 2026
b2f60c8
fix(jellycompat): name why a virtual probe fell back to declared meta…
randrini Nov 18, 2026
590593d
refactor(catalog): keep the duplicate rule in one decision function
randrini Nov 18, 2026
2eeb6e3
fix(playback): answer and end subtitle extracts honestly
randrini Nov 19, 2026
d31b6ed
fix(web): re-select a subtitle after a source rotation
randrini Nov 19, 2026
5ae2e2a
fix(web): stop the startup ladder at the session deadline
randrini Nov 19, 2026
49547b8
fix(api): land probe evidence on the row whose bytes were probed
randrini Nov 19, 2026
292b2e5
fix(playback): admit the recovery subtitle read on its own relay budget
randrini Nov 19, 2026
f785734
fix(playback): give a bitmap page one track-wide wait so its answer i…
randrini Nov 19, 2026
14fb088
fix(web): report a stalled subtitle track instead of an endless loader
randrini Nov 19, 2026
bae7d0f
fix(playback): keep a recovery read admitted when a guard has no reco…
randrini Nov 19, 2026
98b1f93
fix(playback): serve the retries a subtitle recovery warm covers, wit…
randrini Nov 19, 2026
8b7c01e
fix(playback): answer a deep bitmap page at its measured cost
randrini Nov 19, 2026
0f1278a
fix(playback): answer a Range on a progressive remux
randrini Nov 19, 2026
9eb18c3
test(playback): drop a duplicate budget override in the cooldown case
randrini Nov 19, 2026
a673ed0
fix(playback): answer a slow page for the client's wait, end its fill
randrini Nov 19, 2026
ee9d4d8
feat(player): give the narrow bar and the minimised bar an audio sele…
randrini Nov 19, 2026
02808b5
fix(playback): flatten the page reach verdict for lint, keep a probed…
randrini Nov 19, 2026
288cf24
fix(playback): scope bitmap page waits to their session and degrade a…
randrini Nov 20, 2026
5aa4449
fix(playback): leave two pages of retry headroom before a page jump i…
randrini Nov 20, 2026
2d97b38
docs(playback): say what the bitmap page wait is scoped to
randrini Nov 20, 2026
361d3a1
fix(playback): never refuse a progressive remux range on a seek
randrini Nov 20, 2026
04370e0
fix(playback): size a slow copy seek anchor probe from its own cost
randrini Nov 20, 2026
da1127b
fix(playback): price a bitmap page's window, not the prefix it seeks …
randrini Nov 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions contracts/api/v2/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -45114,6 +45114,18 @@
"stream": {
"$ref": "#/components/schemas/StreamV3"
},
"substituted_from_file_id": {
"description": "Opaque identifier",
"examples": [
"1"
],
"minLength": 1,
"type": "string"
},
"substitution_reason": {
"description": "Machine-readable cause of a version substitution; only present with substituted_from_file_id. A client must treat an unknown value as a generic substitution.",
"type": "string"
},
"subtitle": {
"$ref": "#/components/schemas/SubtitleDecisionV3"
},
Expand Down
7 changes: 7 additions & 0 deletions docs/architecture/playback-planner.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ Each one is commented where it is implemented.
- **Server cap.** When the source must be encoded to fit the cap, only
encoding candidates exist, and a refusal is renamed
`bitrate_policy_unavailable`, keeping `retryable`.
- **Declared container claim on Matroska.** When the selected plan would be
`original_http` on an mkv/matroska source and the client's `video_evidence` is
`declared`, the planner re-plans with direct play excluded and takes the
packaged candidate instead (`route_downgrade: unverified_container`). If no
packaged candidate exists the direct plan is kept, because the re-plan is a
preference, not a prohibition. Probed evidence (`exact`,
`platform_attested`) is unaffected.

When nothing is selected, a video file's refusal is the last route's: the
encode's `adaptation_exhausted`, or `adaptation_unavailable` when no encode was
Expand Down
151 changes: 134 additions & 17 deletions docs/architecture/playback-protocol-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,22 @@ client advertising a strict tier must populate `video_decode[]`; the flat lists
alone earn it nothing. On `declared` the flat lists grant eligibility and any
`video_decode[]` entry only restricts it, so that tier never produces this signal.

**A declared container claim does not earn direct play for Matroska.** A
`containers` list says the player accepted the container *type*, not that it can
render the particular bytes: one mkv file can carry any video or audio codec and
arbitrary track layouts. When the route would be `original_http` on an mkv or
matroska source and `video_evidence` is `declared`, the planner re-plans with
direct play excluded and prefers a codec-copy MP4 remux (or the transcode that
follows it), and logs the rule as `route_downgrade: unverified_container` beside
`decision_reason`. A probed tier (`exact`, `platform_attested`) keeps direct
play for containers it genuinely supports, which is what the ExoPlayer-class
clients that play Matroska report; the Apple AVPlayer Matroska mis-advertisement
is corrected separately by its device quirk. If no packaged route exists — a
source only the original bytes can carry, such as a client-managed Dolby Vision
Profile 7 file — the direct plan is kept rather than turning a playable file into
a terminal. This is a server-side rule precisely because the clients that
over-claim cannot all be updated.

Note the precise trigger: the signal fires only when *no* entry named the codec.
If an entry matched the codec but the source exceeded one of its bounds — a
4K file against a `max_height: 1080` decoder — that is a real device limit, and
Expand Down Expand Up @@ -1518,6 +1534,24 @@ An audio-output initialization failure is a verdict on the audio shape the
recipe delivered (§6.2.1); once its one stereo retry is spent, the class retires
as it always did.

**A failed direct play retires direct play for the attempt.** `original_http`
ships the source container untouched, so it has no server-side executor that can
transform the bytes around what a device could not render. Any recognized
client-reported failure — decode, parser, `player_failure`, `http_failure`,
`startup_timeout`, a connectivity loss before the transport's first frame, or an
`unsupported_*` engine refusal — therefore disqualifies the direct class, not
just the failed recipe. The next plan is a packaged route (a codec-copy remux or
a transcode). This is stricter than the class-vs-recipe rule above on purpose:
for a packaged class an abort cannot prove the class unusable, but for the
original bytes it is the only route that can ever carry them, so handing the
same file back is the loop that stalled a browser claiming Matroska. The
documented connectivity reissue after a rendered first frame is unchanged, and
the audio-shape retry keeps direct play while its one stereo retry is untried.
The retirement is durable attempt evidence: every later replan in the attempt
reads it, and a fresh start negotiates normally. When the packaged ladder is
also spent, the terminal is the retryable `routes_exhausted` (a new start
negotiates again) rather than a non-retryable exhaustion.

The server applies one more distinction from its own evidence: whether the
client ever read from the stream it is indicting. A `failure_recovery` that
arrives after the server answered this attempt's playlist but before a single
Expand Down Expand Up @@ -1738,7 +1772,10 @@ help. Delivered inside a `201` (start) or `200` (replan), never a 4xx.
`video_conversion_unsupported`,
`dv_conversion_unsupported`, `transcoding_disabled`,
`subtitle_conversion_unsupported`, `bitrate_policy_unavailable` (no route fits
the administrator's local or remote per-stream bitrate limit). `audio_conversion_unsupported` is not
the administrator's local or remote per-stream bitrate limit), `routes_exhausted`
(retryable: attempt history already retired the source-preserving routes — or the
client reported the direct route failing — and the remaining route needs video
adaptation; a fresh start negotiates again). `audio_conversion_unsupported` is not
retryable when the selected audio track has no codec FFmpeg can name, and so
no decoder: the planner refuses it before any route is tried, and choosing
another track is the remedy. `audio_output_unsupported` is the audio-output
Expand Down Expand Up @@ -2275,11 +2312,14 @@ The implicit window starts on a fixed grid derived from its own length, not at
the live playhead. A page anchored a few seconds behind the playhead is never
reused: the next request's range runs past the page the previous one produced,
no stored page contains it, and the server demuxes the source again for every
request. Text pages are 600 s. A bitmap (PGS) page is 120 s, the page the web
player already requests, because a bitmap page can only be produced by demuxing
the container: on a 50 GB / 2h52m release a 600 s page reads about 2.9 GB and
measured 65-105 s per request, longer than the fetch that asked for it, so it
was abandoned and never stored.
request. Text and bitmap pages are both 120 s, the page the web player already
requests, because a page can only be produced by demuxing the container up to
its end: a 600 s text page measured 41-63 s per extract on a virtual source for
a few kilobytes of output, and on a 50 GB / 2h52m release a 600 s bitmap page
reads about 2.9 GB and measured 65-105 s per request, longer than the fetch that
asked for it, so it was abandoned and never stored. The shorter text page also
keeps an ASS retry inside a client fetch deadline instead of re-reading ten
minutes of container for four kilobytes of script.

The same grid is what a windowed request and the window prefetch use, so the page
one stores is the page the client asks for next. Per class: a bitmap client asks
Expand Down Expand Up @@ -2307,19 +2347,19 @@ or failed extracts are never published. Text and ASS cache misses stream while
extracting; repeated complete requests reuse the finished artifact. A windowed
miss on a large virtual source starts detached fill work so later requests do
not re-demux the source. A session still at the start warms the complete track
(text and ASS while playing, bitmap while paused), and later requests read the
(text and ASS while playing, a bitmap track while paused — a bitmap *page* starts
its progressive fill while playing, see below), and later requests read the
small cached artifact.

A session past the start never builds a complete-track artifact, and that is a
correctness rule rather than a capacity one: a complete extract always starts at
source zero, so one started from a mid-file playhead would publish a tail slice
as the whole track, with offsets that do not match the source timeline and
without every cue before the seek. Playback there is served by bounded windows
only. Such a session prefetches at most two bounded windows on the request grid
above — the cell the live playhead falls in and the cell after it — and keeps
them as last-good window slices. That bounded prefetch runs for a bitmap track
while playing too, because a playing bitmap track otherwise re-demuxes the source
at every page boundary; the complete-track bitmap warm itself stays paused-only. A
A session past the start never builds a complete-track artifact on its own
initiative, and that is a correctness rule rather than a capacity one: a complete
extract always starts at source zero, so one started from a mid-file playhead
would publish a tail slice as the whole track, with offsets that do not match the
source timeline and without every cue before the seek. Playback there is served by
bounded windows only. Such a session prefetches at most two bounded windows on the
request grid above — the cell the live playhead falls in and the cell after it —
and keeps them as last-good window slices. That bounded prefetch runs for a text
track while playing. A
warm that cannot reserve the track because a fill already owns it (typically the
client's own whole-track request, or another warm) skips instead of queueing
behind that fill and logs `subtitle cache warm skipped: a fill already owns this
Expand All @@ -2337,6 +2377,83 @@ the requested range. A failed extraction returns an error response before
output begins, or aborts an already-started stream so clients can distinguish
failure from a complete track and retry.

A bitmap (PGS) track is the exception, because a page is not a slice the source
can produce cheaply. A bounded bitmap page that missed the cache starts the
track's progressive fill while the viewer is playing: that one unbounded demux
from source zero is what publishes the pages the client keeps asking for. It
replaces the bounded prefetch for bitmap pages, which would read the same source
again for pages the fill is already producing, and it goes through the cache's
warm slot and detached relay budget, never the request path. It is single-flighted
per source identity, track and format, so a burst of pages starts exactly one
fill. Every other bitmap request keeps its existing admission rules: the
full-track warm is paused-only, and a request whose window names a playhead uses
the bounded prefetch.

A bounded bitmap page is extracted with an input seek to its own start (`-ss
<start>` before `-i`, `-copyts` after it), so against a source that honors Range
and a container with a usable index it reads its window and not the container
prefix before it. Measured with the production argument shape on a 3600 s,
101 MB Matroska: a 120 s page at 3000 s read 13.0 MB, where the same page read
without Range (or from an MKV with its cues stripped) read 94-114 MB and the
whole file 102 MB.

Before a page reads its source, the server therefore prices that window, not the
prefix: its span times the container's byte rate (the row's declared size and
runtime, or its bitrate), and in wall-clock terms the read rate the identity's
own extracts have measured. Only a window that cannot be read inside one page
extract (120 s at the measured rate) is refused before the extract, with
`503 subtitle_page_too_costly`, `Retry-After`, and `X-Subtitle-Coverage`
describing the progressive artifact's watermark; that refusal is what starts the
fill when the handler does not already own one. An opening page always extracts
normally. A page nothing can price (no size, runtime or bitrate) is not priced
from the link's throughput, which says nothing about how many bytes a window
holds.

The extract itself is capped at 48 MB of fixed opening cost plus twice its
window, floored at 64 MB and capped at 3 GB; an unpriceable window keeps the
256 MB cap. A page killed that way, or one that runs out the two-minute window
extract deadline without emitting a byte, answers the same retryable shape
instead of a 500. The cap stops the case the seek cannot help — a container
without an index, or a provider that answers every range request with 200.

A windowed text extract is held until it completes, so a slice cut short by that
deadline or by a canceled request is never committed as a 200 carrying a header
and half a cue: nothing is written and the client receives the retryable
answer.

A page whose start the artifact has parsed is served from it even while the page's
own end is still ahead of the watermark: the display sets that show in the parsed
prefix are complete on disk, so the response answers them as a 200 and its
`X-Subtitle-Coverage` reports the shorter range it really produced. The watermark
is the last display set read in full (`PCS … END`), so a run still arriving never
travels with a page. A page that starts at or past the watermark is not ready, not
unavailable: it answers `503 subtitle_page_not_ready` with `Retry-After` and the
same coverage header, which is a distinct code from `subtitle_source_unavailable`
because the source was never the problem. A client that receives less than it
asked for keeps the covered range only and asks for the same page again, so the
part the server had not parsed is never treated as delivered.

A text or ASS window the client is waiting on is bounded: an extract started for
a relay input that has not finished after 20 s is killed. If it produced
nothing, the answer is `503 subtitle_window_budget_exceeded` with `Retry-After`
and the identity enters its usual extraction cooldown so a retry does not repeat
the read; if part of the slice had already streamed, the response is aborted
rather than completed. The code is distinct from `subtitle_source_unavailable`
because the source is reachable and only this window is too expensive for one
request. The breach also
starts a detached recovery warm for the breached window extended by one client
grid cell, so both an exact retry and the shifted window the client asks for
next are covered; a retry whose range lies inside an in-flight warm joins that
warm instead of starting a second read. The recovery warm is exempt from the
cooldown the breach armed and is not bounded by the 20 s request budget. The
budget never applies to a whole-track extract, to a window read from a committed
artifact, or to a bitmap page (PGS keeps its own page path and bounds), and the
detached warm may run to the window timeout because it is what fills the window
cache. 20 s sits under the web player's 30 s subtitle fetch stall deadline, so
the server answers before the client gives up. An opening window is attempted
like any other rather than refused up front, so a relay too slow to deliver a
page still gets the retryable answer instead of silence.

---

## 9. Plan identity
Expand Down
Loading
Loading