Repository navigation
The platform supplies the media composition, and the app publishes it once - #1489
Merged
Merged
Conversation
… once Platform gains a MediaBoot: early_init runs at the old acb_init line, before the first adapter, and compose installs the platform's drivers on the adapter and returns a Composition, the resolver and nothing else. Compose takes no session and publishes nothing. The boot then calls one function, publish_composition, which gives the route session the resolver and then the set the adapter's installed drivers form, every boot, a zero-driver platform included, and logs one "compose: backends=<set> resolver=<yes|no>" line. The set and the resolver can no longer disagree: a refused URI install returns no resolver, and the adapter holds no URI driver. The webOS port fills the table with backends::acb_init and backends::compose_native; the desktop installs the Feed over the host sink and no URI driver, with a no-op early_init; the host-test platform composes nothing. The bodies stay in adapters/backends.rs until W11a: dev and the tests name UriProduct and its siblings, and the layer fence forbids them naming port. compose_backends is gone, split into compose_feed (shared), compose_native and the compose_with core the host rig drives over its own ports. install_uri_product(_with_ports) now return the resolver instead of writing it into a session. The ten play-uri gates in playback.rs and run.rs that only read what the installed drivers do at run time are removed; the 41 that name ACB or the URI product stay. install_uri_preflight_port takes a bare port or an Option, and the session has a reader for it. The 18 URI boot rig tests now publish through the same function as the boot instead of installing the resolver by hand; none changed its outcome. New tests cover a composed URI driver, a refused install, a controlled boot and a platform that composed nothing, each asserting the session's set and resolver agree. Co-Authored-By: Claude <noreply@anthropic.com>
…ollows the desktop change A platform that composed no URI driver returns Composition::default(). The NONE constant was read only by the simulator's platform, so a television build that does not compile the simulator saw it as dead code and refused to build. Three sentences that the desktop change made false are corrected: the module-layers note that every play-uri build resolves the URI media pipe at boot, the desktop DISPLAY constant's note about a plane boot the simulator no longer runs, and the per-file counts of the play-uri sites that remain. Co-Authored-By: Claude <noreply@anthropic.com>
…ition tests run the production seams `install_and_publish_uri_product` is used only by the lifecycle rig, which `run.rs` builds under `hostsim` and `play-feed`; a plain lib-test build found it dead. It carries the rig's own cfg now. The success and controlled composition tests ran an injected installer, so after the move no test reached `compose_native`, `install_uri_product` (with the refusal line that moved into it) or the desktop's `media_compose`. The two tests call `compose_native`, as the base test called `compose_backends`; the desktop's shape is asserted through `PLATFORM.media.compose` in `platform_desktop.rs`, where it used to be a copy of that function's body; `compose_with` keeps the refused-install case, the one outcome that needs an injected failure. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…orm/w6b-media-composition `Platform` keeps its `media` field and `Services` keeps #1488's `storage: StorageHooks` group (webOS `Helper`, the desktop `NONE`). `platform_desktop.rs` conflicted in its test module only: both the storage pin test and the display test (with this branch's doc, since the desktop no longer runs the plane boot) stay, beside the new `media.compose` test. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
GLinnik21
added a commit
that referenced
this pull request
Nov 20, 2026
…is the platform's (#1492) Step W5c of the platform plan (discussion #1460). Pointer and wheel input now reach the loop as `HostEvent`s, as keys and text did in W5b (#1487). The Magic Remote's cursor hide moves behind the platform's `Shell`. webOS hides and shows the pointer exactly as before. The desktop and the host-test platform hide nothing, which is what the simulator already did. ## What changes - **`HostEvent::Pointer { x: f32, y: f32, edge: PointerEdge }`**, where `PointerEdge` is `Move`, `Down` or `Up`, and **`HostEvent::Wheel { dy: i32 }`**. - `decode_host_event` (`app/events.rs`) maps `SDL_MOUSEMOTION`, `SDL_MOUSEBUTTONDOWN` and `SDL_MOUSEBUTTONUP` to `Pointer`, and `SDL_MOUSEWHEEL` to `Wheel`. - x and y are logical coordinates, from `plx_base::surface::to_logical`. At 1920x1080 that is the identity. Because they are floats, `HostEvent` keeps `PartialEq` but loses `Eq`. - `decode_wheel_dy` keeps the existing wheel-offset handling and its comment. Under hostsim it reads the float at +32 and rounds it; otherwise it reads the `Sint32` at +20. - **The plan proposed `Pointer { x, y, buttons, shown }`. This lands without `buttons` and `shown`:** - The loop never read which button was pressed: the edge is the SDL event type alone, whatever the button. `the_edge_is_the_event_type_whatever_the_button_bytes_say` pins that. - Whether the pointer is shown is the pointer machine's own `cur_hidden`, not event data. - **`ingest_host_event`** (`app/run.rs`) handles both events through `ingest_pointer_{motion,down,up}` and `ingest_wheel`. Effect order, the recorder rows (`enc_pointer`, and `("wheel", 0, dy)` after the 250 ms debounce) and the drop of real input under a controlled replay do not change. - **The cursor hide.** `app/boot.rs` gives up `hide_cursor`, `cursor_is_transparent`, `show_cursor_after_motion`, `hide_through`, `show_through`, `SHOWN_CURSOR`, `CursorDoor` and `cursor_door` to `rust-modules/src/system.rs`. `system` already sits in `[platform webos]`, so no module is added. - `Shell` gains `hide_pointer`, `show_pointer_after_motion` and `hide_is_cursor_swap`. - `WebosShell` forwards each one to `system`. `DesktopShell` and `HostShell` are no-ops and answer `hide_is_cursor_swap` false. A test-only `SwapShell` counts its calls and says true. - Callers in `input.rs`, `playback.rs` (through a new `Bridge::shell()`) and `run.rs` reach the hide through the shell. - Apart from the cfg lines, the television's code paths are unchanged. The hostsim gates and arms are gone, the three wrappers are safe `fn`s, and `wl_sym` is renamed `self_sym`. - `SHOWN_CURSOR` moves with no new ledger line. - `boot.rs` keeps the pre-`SDL_Init` cursor sleep hint (`webos3_cursor_sleep_hint`, `cursor_sleep_hint`, its own `self_sym`) and its source-order pins. - **`feature = "hostsim"` occurrences.** The ones on the moved cursor functions go from 13 to 0. Across the touched files the count goes from 99 to 89: | file | before | after | |---|---|---| | `boot.rs` | 52 | 39 | | `run.rs` | 27 | 26 | | `events.rs` | 8 | 12 | `events.rs` rises by one production `cfg!` in `decode_wheel_dy` and three test-only gates. - **Carried from #1487's review:** - The `press()` helper's vacuous `armed` assertions now observe the real press with `is_live`, with a direction-key control. - The "minted by `plex_run`" prose is fixed. The main-thread token is minted in `enter_application`. The fix covers `base/src/task.rs`, `media/src/player/{adapter,mod}.rs`, `dev.rs`, `docs/async-model-decision.md`, `docs/agent-reference.md` and `docs/remote-keys.md`. - The `docs/agent-reference.md` fuzz wording is fixed. ## Tests - **Decode:** - `pointer_event_tests`: the edge and position; the edge ignoring the button bytes; the synthesized bytes round-tripping; the wheel offset at +20; the FIFO token's television-shaped wheel decoding to 0 under hostsim; and, under hostsim, a fractional trackpad tick rounding to whole ticks. - `host_event_tests`. - **The loop** (`lifecycle_regression_tests`, hostsim): - pointer and wheel take the paths their SDL events took; - the D-pad motion gate; - OK-as-click under a cursor swap, and its button-up; - the D-pad hiding the pointer through the shell, and a motion showing it again; - the recorder rows; - the wheel FIFO token; - the controlled-replay drop. - **The hide door:** - `system::cursor_door_tests`, five tests, not gated; - `input::pointer_hide_tests`; - the shells' own tests in `platform.rs` and `platform_desktop.rs`. - **Mutations.** 21 mutants were applied one at a time, and each was killed by the test aimed at it. - No mutant exists for the three one-line `WebosShell` forwards or for the `sync_back_cursor` call in `playback.rs`, because the host cannot observe them. - Three more call sites are moved verbatim but no test guards them: - the idle-over-video hide in `run.rs`'s `playback_tick` (`shell.hide_pointer()` after 3000 ms without motion); - `host_background`'s `sync_back_cursor`; - `controlled_key_input`'s `note_cursor_motion`. `SwapShell` could now observe them, but no test drives those paths on it. Deleting any one of them fails no test. Results on the committed tree at 17d0574, after merging main at f7038a8 (W6b #1489, which contains #1488 and #1490): - Full hostsim suite, without the two tests that kill the test binary on the lane's Mac at base too: `test result: ok. 1781 passed; 0 failed; 0 ignored; 0 measured; 2 filtered out` - Default-feature suite, the same way: `test result: ok. 1514 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out` - `make test-hostsim T=uri_boot`: `test result: ok. 29 passed; 0 failed; 0 ignored; 0 measured; 1754 filtered out` - `make test-crate C=plxnative-modules`: - `T=port::tests`: `test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 1513 filtered out` - `T=pointer`: `test result: ok. 18 passed; 0 failed; 0 ignored; 0 measured; 1497 filtered out` - `T=cursor_door`: `test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 1510 filtered out` - `make check-nodef`: exit 0. `make lint` was exit 0 on b7ec914; the only edit since the merge is a test-only line. - `make check-replay`: `6 fixtures, 12 replays, SAME=4 REFUSED_EXPECTED=8 unexpected=0` - The merge needed one fix: `SwapShell::platform()` passes `MediaBoot::HOST_TEST` to W6b's four-argument `Platform::new`. `the_host_test_platform_answers_nothing_and_says_so` destructures all four `Platform` fields. Results on b0ad245, before the merge: - Full hostsim suite, without the two tests that kill the test binary on the lane's Mac at base too: `test result: ok. 1774 passed; 0 failed; 0 ignored; 0 measured; 2 filtered out` - The skipped tests are `player_owner_events_record_and_replay_through_the_actual_app_host` and `an_unregistered_product_screen_uses_generic_navigation_and_actual_store_effects`. - Default-feature suite, the same way: `test result: ok. 1509 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out` - `make check-replay`: `6 fixtures, 12 replays, SAME=4 REFUSED_EXPECTED=8 unexpected=0` - `tests/keytable.json` is unchanged. - `ci/check-deps.sh`, `ci/check-module-layers.py`, `ci/check-ledger-ratchet.py` and `ci/check-statics.sh` are green. - `ci/test_readonly_generated.py` and `ci/test_readonly_dependencies.py` pass. - No change under `ci/`, to any Cargo file or `.cargo`, or to `rust-modules/src/lib.rs`. - `fw-compat-reviewer`: no findings. It graded the source only. The same `SDL_*` symbols are looked up in the same order, with the same hide method per firmware release. The 3.x releases sit below the graded floor. - `doc-claim-auditor`: five findings, all fixed. ## Not covered - **No television run.** Not checked on a set: the pointer hide and show on a 3.x set against a 4.5+ set, the `WebosShell` forwards, and the Back sync in `playback.rs`. - **The `wheel:<dy>` FIFO token.** It builds the television's +20 layout, so under hostsim it decodes to 0. This was already true before this PR, and a test now pins it.
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.
Step W6b of the platform plan (discussion #1460): the platform supplies the playback composition, in two boot phases. The app publishes what it gets once, on every boot. Before,
app/boot.rscalledacb_initandcompose_backendsdirectly, andplayback.rsandrun.rschose code paths withfeature = "play-uri"gates. NowPlatformcarries aMediaBoot: webOS fills it with today's bodies, the desktop with the Feed host sink alone, andPlatform::HOST_TESTwith nothing. webOS boots the same way at the same points, with one new log line.What changes
app/platform.rsPlatformgainsmedia: MediaBoot { early_init: fn(&MainThread), compose: fn(&mut PlayerAdapter, controlled: bool) -> Composition }.Platform::newtakes it as a fourth argument.Composition { resolver: Option<ResolvePort> }derivesDefault, which means no resolver.publish_composition(session, adapter, Composition)publishes the resolver first, theninstall_backends(adapter.composed_backends()).BackendSet::NONEand no resolver. The session's set and its resolver can no longer disagree.compose: backends=<uri+feed|uri|feed|none> resolver=<yes|no>. Every existing log line is unchanged.HOST_TESTcomposes nothing, and the pin test covers the new field.app/boot.rs: two hunks.acb_initcall becomes(platform.media.early_init)(&mt). It stays on the same line, inside the sameif !controlled, beforeffi::boot().compose_backendsblock becomes(platform.media.compose)(…), thenpublish_composition(…), at the same site.src/port.rs(webOS):MediaBoot { early_init: backends::acb_init, compose: backends::compose_native }.src/platform_desktop.rs: a no-opearly_init. Itscomposecallscompose_feedand returnsComposition::default().app/adapters/backends.rscompose_backendsis split intocompose_feed(shared),compose_native, andcompose_with(adapter, controlled, install_uri), which the tests use.install_uri_productandinstall_uri_product_with_portsno longer take the session. They returnOption<ResolvePort>, built only after the physical URI install succeeds.uri: product driver installation refusedline moved intoinstall_uri_product, with its text unchanged.media/src/route/decision.rsinstall_uri_preflight_porttakesimpl Into<Option<ResolvePort>>, so an absent resolver clears the slot, and the existing callers that pass a resolver compile unchanged.uri_preflight_port(), is added for the tests.playback.rsandrun.rs: the tenfeature = "play-uri"lines that chose a path at build time are deleted, six inplayback.rsand four inrun.rs. Those paths now read the published set at run time. Nothing else in either file changes.docs/platform-ports.mdgains an "As landed" note, anddocs/module-layers.mdfollows.Deviations from the plan
port.rspoints at functions inapp/adapters/backends.rsinstead of owning their bodies, because those bodies name ACB, and the app crate's own ACB names leave it only in W11a. The 6a text and the W6b paragraph say so.composetakes no&PlaybackSession. The only use of the session was the old resolver publication, which now happens inpublish_composition. 6a records that W10 adds a read-only session parameter if a Tizen driver needs one.play-urilines remain: 40 inbackends.rs, 1 in arun.rstest fixture, 3 indev.rs, 1 inlib.rsand 1 in the rig. None remain inboot.rs, productionrun.rs,playback.rsorplatform.rs. This commit adds five gated lines tobackends.rs, so the docs give the grep instead of a count.Composition::NONEbecameDefault: the constant was read only by the desktop platform, andmake check-nodeffailed on it as dead code.What the simulator does differently
play-uriis a default feature, so before this change the simulator composed the product URI driver over null ports. Its session set is now Feed alone, with no resolver.vplane: exported window …orvplane: this device has NEITHER libAcbAPI …line, nor theuri: product binding=…anduri: display path=…lines.PlaneOwner::boot(ABSENT)is no longer called. The default plane facts are the same absent facts.dev::uriprobe::installno longer runs in a simulatordevtriggersbuild.Tests
In each case, the published set and resolver must agree:
a_composed_uri_driver_is_published_with_its_resolveranda_controlled_boot_composes_no_uri_driver_and_no_resolvercall webOS's owncompose_native, the functionport.rsinstalls asPlatform.media.compose;a_refused_uri_install_publishes_neither_the_driver_nor_a_resolverdrivescompose_withwith an injected install failure;the_desktop_platform_composes_the_feed_and_no_resolver(inplatform_desktop.rs) calls the desktop'sPLATFORM.media.compose;The URI boot rig's 18 calls, and
install_exported_uri, now publish throughpublish_composition. A rig adapter is Feed plus URI, so its session set is nowBOTH(it wasFEED). That is the set a production boot publishes with both drivers.Results on the committed tree at 036034f:
hostsim(make test-crate C=app), each by name:a_composed_uri_driver_is_published_with_its_resolver,a_refused_uri_install_publishes_neither_the_driver_nor_a_resolveranda_controlled_boot_composes_no_uri_driver_and_no_resolver, eachtest result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1503 filtered outmake test-hostsim T=uri_boot:test result: ok. 29 passed; 0 failed; 0 ignored; 0 measured; 1725 filtered outmake test-hostsim T=the_desktop_platform_composes_the_feed_and_no_resolver:test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1753 filtered outmake check-nodef PLAYBACK_BACKENDS=feed: exit 0Results on b951d2a, the head before the test-only fix commit:
make test-crate C=plx_media:test result: ok. 2159 passed; 0 failed; 104 ignored; 0 measured; 0 filtered outmake test-hostsim, without two tests that kill the test binary (SIGSEGV) on the lane's Mac at base 8f55751 as well: 1750 passed, 2 failed. The two failures were indeeplink_route_tests, which passed on rerun:test result: ok. 9 passed; 0 failed.make check-nodef PLAYBACK_BACKENDS=both|uri|feed|none: all four compile.make check-replay:6 fixtures, 12 replays, SAME=4 REFUSED_EXPECTED=8 unexpected=0ci/test_readonly_generated.py(22 tests) andci/test_readonly_dependencies.py(64 tests) pass..cargoor certificate-pinned file changes. Both spellings of every touched path were checked againstci/proofs/*.json.Reviews
fw-compat-revieweron b951d2a found nothing. CI's firmware load matrix passes on all 9 gated releases, from 4.4.2 to 11.2.0. The binary still has 15 DT_NEEDED entries and 371 undefined symbols, as at base.acb_initstill runs beforeffi::boot()inside the sameif !controlled, and no FFI, link directive ordynlib!changes.doc-claim-auditorfound three stale claims, all fixed.On the television
On the dev TV (webOS 4.x, ACB),
--guest --mock, base 8f55751 against b951d2a. Both binaries were md5-verified on the set. No key was sent and no setting changed.vplane: ACB (webOS 4.x),ptype=10, theacb initialize/create/handle=feedlines,ff: bound …,uri: product binding=Acb mode=1 …anduri: display path=acb ready. Head addscompose: backends=uri+feed resolver=yesonce, right after the display-path line. Neither build logs an installation-refused line.pipe_h264_aac_mp4passes on both:feed: presented, 24.1 fps,dropped=0.pipe_uri_product_hls_720p24_20m_boundpasses all 10 checks on both, includinguri_plane_bound,uri_presentedanduri_service_playing.…_bound_collapsefails identically on base and head. The check isuri_drain_warning: buffered lead fell 3 -> 2 …. This change does not cause it.pms: server 0 version=…, comes beforevplane:on base and afterptype=10on head, 4 of 4 boots each way, including an interleaved repeat. That line comes from theserverinfoworker thread, not the main thread, so its position is a race; nothing at that point reads the version. The main thread's own order does not change.Not covered
check-nodefonly compiles. The single-backend shapes (uri,feed,none) are not built as tests or run anywhere in CI.🤖 Generated with Claude Code