Repository navigation
feat(aetherctl): a harness for the native subtitle rendition, and the fix it measured (Sodalite#156) - #564
Merged
Conversation
…ite#156) The path a host uses whenever the picture leaves its own layer (PiP, AirPlay, a wired external display) had no VOD harness. `serve --native-subs` could stand the renditions up and `live --force-master` could route a channel behind them, but no VOD session here ever loaded with `prepareNativeSubtitles`, so the half that matters was untestable from the Mac: whether AVPlayer actually HOLDS a legible selection, and whether the engine keeps feeding the one it holds. AE#359 was found the day the live side got a harness; this is the same gap on the other side, and Sodalite#156 is what walked into it. Four host calls, no new flags (the tokens ride `--host-calls`, which is already threaded through): `nativesubs` sets the load option, `nativerender@N` is the call a host makes when the picture leaves, `subsoff@N` / `subson@N` are the viewer turning subtitles off and back on while it is away. The observable is a `LEGIBLE` line with the selection AVPlayer holds next to the track the engine thinks is active. It is printed a tick AFTER each transition, never inside it: both calls finish on a detached task and the select waits on a cue pre-fill first, so an immediate read reports what the host asked for rather than what the item ended up with, which is the whole distinction being made. It reproduces the field report on the first run, headless, in 30 seconds: `after off: selected=German engineActive=nil` is a rendition nobody is filling any more, which on a receiver is an empty caption box with no text in it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015PM3xUJB6ZQyqnmGK1fp6F
…directions (Sodalite#156)
Second attempt, and this time it is measured. The first shipped only the off
half, which uncovered that the on half had never existed either, and the two had
been hiding each other: nothing deselected the rendition, so a pick that never
reached it still left the right language on screen.
The harness in the previous commit shows all three transitions in 30 s:
before after render on selected=German engineActive=2
after off selected=German engineActive=nil <- box
after on selected=German engineActive=2 <- accident
first try after off selected=none engineActive=nil
after on selected=none engineActive=2 <- reverted
now after off selected=none engineActive=nil
after on selected=German engineActive=2
switch after on selected=Englisch - English engineActive=3
`setNativeSubtitleRendering` now records a STANDING request rather than acting
once. It says where the picture is and holds until the picture comes back or the
session ends, which is what lets the two ends know that the rendition is the
display: a host pick re-asserts it (mapping included, and it latches correctly
mid-reload), and subtitles-off takes it down.
Off stays the item-level deselect rather than `setNativeSubtitleSelected(nil)`,
whose job this otherwise is: that call also clears `nativeSubtitleReapplyOrdinal`
and `nativeOrdinalToReplay` is guarded on `currentOrdinal == nil`, so clearing it
here would ARM the #170 carryover replay and re-select on the next
session-preserving reload.
Full suite, both runners: swift-testing 3104 in 423 suites, XCTest 17, 0 failures.
Device round still outstanding: macOS has no receiver, so what is proven here is
that AVPlayer's legible selection ends up where the host asked for it.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015PM3xUJB6ZQyqnmGK1fp6F
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two commits: the harness first, then the fix it made measurable. Replaces #563, which shipped half of this and was reverted the same day.
The harness
The native rendition path, the one a host uses whenever the picture leaves its own layer (PiP, AirPlay, a wired display), had no VOD harness.
serve --native-subscould stand the renditions up andlive --force-mastercould route a channel behind them, but no VOD session here ever loaded withprepareNativeSubtitles, so the half that matters was untestable from the Mac: whether AVPlayer actually holds a legible selection, and whether the engine keeps feeding the one it holds. AE#359 was found the day the live side got a harness; this is the same gap on the other side, and Sodalite#156 walked into it.Four tokens on the existing
--host-calls, no new flags:aetherctl play --subs ger --seconds 32 \ --host-calls nativesubs,nativerender@8,subsoff@14,subson@20 file://$PWD/subs.mkvThe observable is a
LEGIBLEline with the selection AVPlayer holds next to the track the engine thinks is active. It prints four ticks after a transition, not one: a deselect is a single hop but a select waits on the cue pre-fill, which is seconds. At +1 it reported everyonas a failure, i.e. the harness lying in the expensive direction, which is why that offset carries a comment.What it found, in one table
German/ 2German/ nilGerman/ 2German/ 2none/ nilnone/ 2German/ 2none/ nilGerman/ 2Row 1 column 2 is the reported bug: a rendition nobody is filling any more, which on a receiver is an empty caption box. Row 1 column 3 is the accident that hid the other half, and row 2 column 3 is the regression that got #563 reverted within the hour.
The track-switch case reads
selected=Englisch - English/ 3 on a two-track fixture (subson@N:eng).The fix
setNativeSubtitleRenderingrecords a standing request rather than acting once. It says where the picture is and holds until the picture comes back or the session ends, which is what lets both ends know the rendition is the display: a host pick re-asserts it, and subtitles-off takes it down. The two were missing together and hid each other.Off stays the item-level deselect rather than
setNativeSubtitleSelected(nil), whose job this otherwise is: that call also clearsnativeSubtitleReapplyOrdinalandnativeOrdinalToReplayis guarded oncurrentOrdinal == nil, so clearing it here would arm the #170 carryover replay and re-select on the next session-preserving reload.Verification
Full suite, both runners: swift-testing 3104 tests in 423 suites, XCTest 17 tests, 0 failures. Every row of the table above reproduced on demand in 30 s.
Still outstanding: a device round. macOS has no receiver, so what is proven here is that AVPlayer's legible selection ends up where the host asked for it, not that the Apple TV's caption box goes with it.
🤖 Generated with Claude Code
https://claude.ai/code/session_015PM3xUJB6ZQyqnmGK1fp6F