Repository navigation
The SDL shell is a crate of its own, plx_shell_sdl, behind the app-private Shell and Surface - #1498
Merged
Merged
Conversation
…ivate Shell and Surface
SDL's bring-up, the window and its GL context, the swap, the event poll and
decode, the synthetic events the dev tooling pushes back, and the text-input
calls leave the application crate for `rust-modules/shell-sdl`, a mounted
module of a new `[shell_sdl]` layer (`uses = base machine os`; the crate names
`plx_base` alone). The application keeps what is its own vocabulary: `Shell`,
`Surface`, `HostEvent` and `KeyPress` stay app-private (W7a publishes them), and
the television's LG half stays in `system.rs` and the webOS platform. The
`SDL_SysWMinfo` over-allocation, the opaque region and the LS2 pump do not move,
and a pin in the crate fails if it ever names the query that overruns it.
`Shell` gains `init` and `open`. `open` returns a `Surface` (window, swap, swap
interval, poll, an unsafe quit that `run::shutdown` calls), which `App` owns in
place of the raw window pointer. The order boot always had is kept and pinned:
SDL_Init and the GL request first, then the stored session is read, then the
window. The window's place and size are a value, `OpenAsk { title, placement,
high_dpi }`, so the panel's size with its smaller fallback and the desktop fit
(hostsim builds only) are the crate's. The two LG steps around SDL_Init, the
cursor-sleep hint before and the relaunch tap after, moved into `system.rs`
without their `hostsim` gates and are handed to `init` as two hooks by the webOS
shell; the cursor hint's SDL_SetHint goes through the crate's `set_hint`.
The byte layouts are written down once, in the crate, and both arms of every LG
versus stock layout still compile in every build (`cfg!`, not `#[cfg]`). The
byte-level tests moved with the code and run in the crate; the HostEvent-level
tests stay in the application over re-exports. The source-text pins that read
relocated code moved with it, and one new pin holds the application to declaring
SDL functions in `system.rs` and `app/clock.rs` only.
Three call sites that reach the shell from loop code had no test that would
notice the call going missing, and now have one each, each shown to fail with its
call deleted: the idle pointer hidden over the video in `playback_tick`,
`host_background`'s hand-back of the pointer Back hid, and a controlled pointer
input's wake in `controlled_key_input`.
Lists that name the layer crates gain the new one: the Makefile's suites and
inputs, the CI workflow, the build-budget source list, `check-deps.sh`'s scans,
`list-caps.ini` (the five moved cap sites re-keyed, one new), the release-config
hook, and the module-layers config. Both read-only certificates are re-sealed
over the new manifest set and lock file. The docs follow: the L15e row, the
shell_sdl layer paragraph, F14 and the W6 record in the platform plan, and the
two points the review of the L15g row left (telemetry's nine arm lines, and the
storage-authority part of W8a landing ahead of W7).
Co-Authored-By: Claude <noreply@anthropic.com>
…ld only The default-feature test build does not read them, and a re-export nothing reads is a deny(warnings) failure there. Co-Authored-By: Claude <noreply@anthropic.com>
…cates are re-sealed over it The doc-claim audit of the move found a handful of sentences it had made false or left behind. The module-layers paragraph for the new crate advertised a synthetic text event pushed back into the queue, the one push the crate documents as fatal under the Mac's SDL: it now names what is pushed (key, pointer, wheel, lifecycle) and who pushes it, and says a text event is built as bytes and handed to the decode. The record of the `hostsim` comment in `rust-modules/Cargo.toml` said W7 would reword it; W6 did, with the certificate. `docs/remote-keys.md` and the fw-compat reviewer's prompt named `decode_key` and the cursor-visibility probe where they used to live, and the reviewer's first-pass scan now reads the shell crate's directory so it still sees the SDL extern block. Inside the new crate, four comments named things that are not there (`app::decode_key`, `text::stubs`, an `app.rs`) or said a `make check` test binary pushes nothing while one of its tests drives SDL's real queue. The remaining mentions of an `app.rs` whose subject moved with the SDL shell (the text-input and window-flag prose, the depth and stencil request, the key decode named in `ui`'s key classifier) now name the crate that holds it. The "stock layouts" wording in the layer config, the manifest comments and the crate description now says both SDLs' layouts, since the crate decodes LG's fork on the television and stock SDL2 under `hostsim`. The comments in the two `Cargo.toml` files changed, so both read-only certificates are re-sealed over the final manifest set. Co-Authored-By: Claude <noreply@anthropic.com>
…evision's request reads `SCR_H` is read by the television's window request in `boot.rs` and by its tests. The desktop sizing that used to read it left for `plx_shell_sdl`, so in the one build that has neither (the simulator, `hostsim` without `cfg(test)`) it was a dead constant, and `-D warnings` made that an error in `make sim-macos`. `make lint`, the unit passes and `make check-nodef` all build with it live, which is why only the simulator link noticed. The constant now exists where it has a reader. Co-Authored-By: Claude <noreply@anthropic.com>
…onstant SCR_W was ungated, and its last non-test hostsim readers (`plan_desktop_window` and `desktop_window_ask`) moved to `plx_shell_sdl::window`. What still read it was the fps digits in `run.rs`, which sit under `devtools`, so every hostsim build without `devtools` had a dead constant, and `-D warnings` made that an error in the three jobs that build that feature set (`cargo check --lib --no-default-features --features hostsim,play-feed`, the macOS app's link line, and the HUD authoring simulator's build). `make sim-macos` builds with devtools and the unit passes with `cfg(test)`, so neither showed it. The fps digits now read `plx_base::surface::LOGICAL_W` directly, the logical width they are placed against, and `SCR_W` takes the gate `SCR_H` already has (`any(not(feature = "hostsim"), test)`): both are read only by the television's window request in `boot.rs`, so they now share one rule. The television build's values are unchanged. The `#[allow(dead_code)]` note on `glDeleteTextures` in `plx_gfx` cited the SDL text-input externs in `app/mod.rs`; they live in `plx_shell_sdl`'s `sys.rs` now, and the note says so. Co-Authored-By: Claude <noreply@anthropic.com>
…half pin covers the names it forbids `sys.rs` said every SDL2 symbol the crate calls is exported by all 14 firmware inventories. `tools/fwcompat.py --lib libSDL2-2.0.so.0` shows 23 of the 24 names it declares in 1.2.0 through 3.9.2 and all 24 from 4.4.2: the missing one is `SDL_GetDisplayUsableBounds`, which is declared under `cfg(feature = "hostsim")` only, so the ARM binary never imports it (it imports none of the three hostsim names). The sentence now covers the names declared outside the hostsim block and names that one as the exception. The `lib.rs` pin that keeps the Wayland and Luna half out of this crate checked four names (`wl_proxy`, `wl_display`, `LSRegister`, `g_main_context`), so a call into the LG fork or a Luna call by another name would have passed it. It now also forbids `wl_surface`, `LSCall`, `SDL_webOS` and `HELPER_`, and the pin on the over-writing `SDL_SysWMinfo` query also forbids `SDL_GetVersion`, the handshake that lives in the application crate's `system.rs`. None of the new names appears in the crate today, and each was made to fail the pin by writing it into `event.rs` once, then removed again. Co-Authored-By: Claude <noreply@anthropic.com>
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 W6 of the platform plan (discussion #1460). SDL's bring-up, the window and its GL context, the swap, the event poll and decode, the synthetic events the dev tooling pushes back, and the text-input calls leave the application crate for a new crate,
rust-modules/shell-sdl(plx_shell_sdl, layer[shell_sdl],uses = base machine os). The television and the simulator behave as before.What moves and what stays
Shell,Surface,HostEventandKeyPressstay app-private (W7a publishes them), andrust-modules/src/lib.rsis untouched.Shellgainsinitandopen.openreturns aSurface(window, swap, swap interval, poll, and an unsafequitthatrun::shutdowncalls), whichAppowns in place of the raw window pointer. The boot order is kept and pinned: SDL_Init and the GL request, then the stored session is read, then the window.OpenAsk { title, placement, high_dpi }, so the panel size with its smaller fallback and the desktop fit (hostsim builds only) belong to the crate.system.rs, without theirhostsimgates, and the webOS shell hands them toinitas two hooks. The cursor hint's SDL_SetHint goes through the crate'sset_hint. TheSDL_SysWMinfoover-allocation, the opaque region and the LS2 pump do not move, and a pin in the crate fails if it ever names the query that overruns it.cfg!, not#[cfg]). The byte-level tests moved with the code; the HostEvent-level tests stay in the application over re-exports.system.rsandapp/clock.rs. The crate's own pins fail if it ever names a Wayland or Luna symbol (wl_proxy,wl_display,wl_surface,LSRegister,LSCall,g_main_context,SDL_webOS,HELPER_) or the over-writing window query and its handshake (SDL_GetWindowWMInfo,SDL_GetVersion); each needle was shown to bite.playback_tick;host_background's hand-back of the pointer Back hid;controlled_key_input.SCR_WandSCR_Hinapp/mod.rsare now read only by the television's window request and tests, and share one gate,any(not(feature = "hostsim"), test); the devtools fps digits inrun.rsreadplx_base::surface::LOGICAL_Wdirectly. Every simulator feature set CI builds was built locally:ci.yml's twocargo checklines,simulators.yml's macOS app link, Makefile's screenshot and HUD-authoring builds, andmake sim-macos..github/workflows/ci.yml;ci/check-deps.sh's scans;ci/list-caps.ini(five moved cap sites re-keyed, one new);ci/module-layers.ini.ci/proofs/serde-json-immutable.json,ci/proofs/platform-generated-enums.json).docs/module-layers.md;docs/platform-ports.md;docs/agent-reference.md,docs/remote-keys.md,docs/search.md;rust-modules/shell-sdl/src.Build bench
make build-benchwith thetestsandarmrows not run, 3 interleaved runs each, Apple M4 (10 cores), rustc 1.100.0. Before isfb35a0e97(mainbefore #1493, which changed one file inplex/), after is1650db6be; both clean trees. Units 190 → 193.The first after-run of the two incremental rows had stalled samples (up to 1418.6 s and 482.4 s) from a host stall. Those two rows were re-measured alone on the same tree, and the table gives the re-measure. The new crate adds 2 rebuilt units on a
plx_baseedit and none on any other crate's edit.On the television
Base (
7a1e6c53c) and head, bothFLAVOR=debugtvdev, deployed in turn to the development set, with each binary's md5 checked on the set after its deploy. Harness cases only (mock content; the URI cases report only the synthetic server).pipe_h264_aac_mp4(Feed)pipe_uri_product_hls_720p24_20m_boundpipe_uri_product_hls_720p24_20m_bound_collapseuri_drain_warninginit_text ok: video driver, surface, GL, EGL, keyboard, FB bits and the wm line, plus the relaunch tap line. The whole-log multiset of key lines is identical too.SDL_Init failed,CreateWindow failed,GL ctx failed,wm: NO wl_surface,surface: retrying) appears in any log._collapsecase fails the same way on both builds; every other assertion in it passes.Gates (on the committed tree)
The full set ran at 1650db6. At 8b534a6 (the
SCR_Wfix) the simulator feature sets above, lint,check-nodef, the static gates and the default and hostsim unit passes were re-run, and the ARM build was compared again. At 3cec9e3 (comments and a crate pin) the crate's tests, lint,check-nodef, the macOS app link line and the static gates were re-run.ok. Among them:plx_shell_sdl:test result: ok. 45 passed; 0 failed; 0 ignored; 0 measured; 0 filtered outtest result: ok. 1489 passed; 0 failed; 0 ignored; 0 measured; 1 filtered outplx_screens:test result: ok. 2285 passed; 0 failed; 0 ignored; 0 measured; 1 filtered outplx_media:test result: ok. 2159 passed; 0 failed; 104 ignored; 0 measured; 0 filtered outok. Among them:test result: ok. 1760 passed; 0 failed; 0 ignored; 0 measured; 2 filtered outplx_media:test result: ok. 2479 passed; 0 failed; 104 ignoredplx_shell_sdl:test result: ok. 46 passed; 0 failedmake check-cargo-lint,make check-nodef,make sim-macosandmake check-pythonare green.check-pythonreports145 steps — all okandRan 748 tests ... OK.make check-replay:6 fixtures, 12 replays, SAME=4 REFUSED_EXPECTED=8 unexpected=0.ci/check-deps.sh,ci/check-module-layers.py(20 layers, 2022 modules … 0 migration entries left),ci/check-ledger-ratchet.pyandci/check-statics.share green.test_readonly_generated,test_readonly_dependenciesandtest_rename_os_layer.tools/fwcompat.py --min-release 4.4.2gives the same verdict for every firmware. The 8b534a6 binary differs from the 1650db6 one only in the embedded commit sha, the build-id and one panic-location line number.fw-compat-reviewerread that binary and the source: OK, no blocker or major.Reproduced on base
All four of these fail the same way on
7a1e6c53c.an_unregistered_product_screen_uses_generic_navigation_and_actual_store_effectsin the application crate andactual_visible_player_paint_reports_typed_watch_without_mutating_itinplx_screens. So a plainmake checkexits non-zero here at base and head alike.make test-hostsimat the default thread count failsa_play_landing_behind_a_preview_that_never_returns_gives_upanda_play_landing_waits_for_an_abandoning_preview. Base fails the same two at--test-threads=10. Head is green at 2, 6 and 16 threads and single-threaded.ci/check-elf.shon atvdevbuild exits 1 at "storage helper DT_NEEDED drifted" on both binaries. All of the main binary's assertions pass._collapseURI case fails, as shown above.Not covered
tv-sessionboot to Home was made; the harness cases cover boot, the window and both drivers.🤖 Generated with Claude Code