Repository navigation
Exported window: a live-window instrument in the host seam, and the handoff and quarantine cases it pins - #1305
Merged
Merged
Conversation
…ases it pins The host seam's `vp_create_window` returned a constant and `vp_destroy_window` was a no-op, so no test could say how many exported windows a run left live (the URI engine on webOS 5+ plan, F19). The seam now keeps what the C seam's single window slot would hold: creates, destroy calls, live windows (a create over an occupied slot leaves two) and the peak, zeroed by `reset_native_lifecycle_for_test`. The application's hostsim rig gets a `CountingDisplay` (the URI driver's `display`, window verbs forwarded to `HOST_SINK`, the sink Feed's hooks run over there), so one instrument counts both backends' windows, and two cases: - a URI start that times out and hands the same request to Feed: the URI window is destroyed on the confirmed release before the Feed resolve begins, and the peak never passes one; - a new request over a quarantined URI registration, which still holds its window, makes no second window: the start is refused (`Failed`), counts stay at one create, one live. Both are green on the current code, so no lease is added. Disabling route_start's quarantine guard alone leaves the second case green (a mutant run); the Conflict branch under it, which sends the quarantined driver a Stop and fails the start on its refusal, is the second guard (read from the code, not traced in the mutant). The handoff case stops before Feed's own native start: under the armed seam that start's demux worker outlives the rig and fails the module's later Feed fixtures. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The handoff case never starts Feed, so its last assertion (no second window) could not fail and claimed Feed's window count. Rename it to what it pins, that the URI window is destroyed before the Feed resolve begins, and drop that assertion; the earlier ones (no resolve while the close is open, destroys 1 and live 0 before the resolve) stay. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Summary
The URI playback engine (Settings > Video & playback > Playback engine > Experimental) is being extended from webOS 4.x to
webOS 5+, where video binds through an exported window instead of the ACB plane. The C seam keeps ONE exported window per
process (
src/video_plane.cg_window_id):vp_create_windowoverwrites it and never destroys the window it held, andvp_destroy_windowends only what the slot names. Nothing in Rust enforces one window at a time across Feed, the URI backendand the probe, and the host test seam could not say how many windows a run left live (
vp_create_windowreturned a constant,vp_destroy_windowwas a no-op). The worry before production ever selects the exported binding: a NEW request arriving whilea quarantined URI registration still holds its window would create a second one.
This PR adds the missing instrument and two cases on it. Both cases are green on the current code, so no exported-window lease
is added and no production code changes.
The instrument
rust-modules/play-feed/src/ffi_host.rs(the host seam):vp_create_window/vp_destroy_windownow keep what the Cseam's single slot would hold:
createsanddestroys(calls),liveandpeak. A create over an occupied slot leaves twolive windows; a destroy ends only the window the slot names; an unarmed seam makes no window. Read with
window_counts_for_test(), zeroed byreset_windows_for_test()and byreset_native_lifecycle_for_test(). Test andtest-supportbuilds only.app/run_uri_boot_tests.rs(the application's hostsim rig,lifecycle_regression_tests): aCountingDisplaygiven to theURI driver as its
display. Its window verbs forward toHOST_SINK, the sink Feed's hooks run over in this rig(
backends.rsTEST_HOOKS->test_raw_sink), so one instrument counts both backends' windows. The driver is installedthrough
install_uri_backend_with_portswithBinding::Exported { canvas: (1920, 1080) }, a test clock and shortallowances (1 s startup, 0.5 s release), so a startup timeout and an unreleased close are reached by moving the clock.
The cases
a_new_request_over_a_quarantined_uri_driver_makes_no_second_live_window(written first, as the failing-first target)Quarantinedand the counts readcreates 1, destroys 0, live 1, peak 1. The new request is resolved,start_playback_trackedreturnsFailed(notLaunched), and the counts are unchanged after two more frames.a_timed_out_uri_start_destroys_its_live_window_before_the_feed_resolve(regression pin of the already-ordered path)creates 1, live 1. Startup timeout and close: the window is still held (live 1) and no Feed resolve is pending. On the confirmed release:destroys 1, live 0, and only thenplay_pending()is true.The instrument itself has a unit test (
ffi_host::tests::the_window_instrument_counts_a_create_over_an_occupied_slot_as_two_live_windows:create, create reads
live 2, peak 2; one destroy leaveslive 1). A mutant that disablesroute_start's quarantine guardalone still leaves the first case green: the
Conflictbranch below it (a Stop to the quarantined driver, refused withReleaseUncertain, thenFailed) is a second guard. That is read from the code, not traced in the mutant.The fix
None needed. The in-request handoff is ordered after the URI window's destroy, and a new request over a quarantined URI
registration is refused by the adapter's own start path. No exported-window lease was added to
tv::plane, and no C seamfile changed.
Verification
Gates ran on the committed tree,
git status --shortempty before and after.make test-hostsim T=live_window(application crate, both cases):make test-hostsim C=plx_play_feed T=the_window_instrument(the instrument's own test):make test-crate C=plx_play_feed:(That tier does not enable
hostsim, so it never runs the instrument's test; the line above does.) Also: the wholeuri_boot_testsmodule (make test-hostsim T=uri_boot_tests)test result: ok. 23 passed; 0 failed; 0 ignored; 0 measured; 1452 filtered out; finished in 3.82s,make check-nodefexit 0, andbash ci/check-deps.shcheck-deps: all gates green. Not run here: the python harness, screens,appkit and
make check(CI runs them).Not covered
Feed resolve and does not run Feed's native start. A first version did (it read
creates 2, live 1, peak 1), but under thearmed seam that start's demux worker outlives the rig and lands its failure in the next test's route control, which failed
two unrelated Feed fixtures in the same module, and Feed's release did not finish inside the rig's 5 s poll (cause not
determined). The hermetic place to pin it is the media crate's hostsim engine tests (
player/engine.rs,force_clocksink_for_test(true)), which already drivewith_window_idand the release.not a measurement of the compositor: it says the player never asks for a second window, not what a webOS 5+ set does if it
did. No webOS 5+ device is available to this work.
Part of the webOS 5+ URI work tracked in #1064; does not close it.
🤖 Generated with Claude Code