Repository navigation
The simulator runs on its own platform - #1486
Merged
Merged
Conversation
…always compiled
The simulator and the macOS app are no longer the webOS port with its answers faked. A new module,
`platform_desktop`, states every hook the application reads from its platform: the shared NONE groups
of `plx_os::tv` wherever a host has nothing to say (the key manager, the settings service, the
device files, the URI media pipe), the Feed backend's host sink when the build has one, and its own
bodies for the three things a host does answer: the capability probe, the root press and the toast.
`src/bin/sim.rs` names it, so a desktop executable no longer references the television's tables.
With nothing on a desktop reaching them, the `hostsim` term leaves all 102 fenced cfg lines in
`system.rs`, `port.rs`, `webos.rs`, `webos/{caps,toast,jail_repair}.rs` and `keymanager.rs`. The
television's arms are now compiled into every build, the simulator's included, and the linker drops
what nothing reaches. The stand-ins that tests rely on stay, gated on `test` and `test-support`.
The frame-probe stubs are re-gated on `devtriggers` alone, and the simulator's two opaque-region
stubs and its `SINK` arms move to the desktop platform.
The dev triggers that force the Dolby Vision answer (`dvcaps0`, `dvcaps1`) and the probe's one log
line move from `webos::caps` into the neutral `devcaps::dv`, which the webOS probe and the desktop
probe both end in, so the simulator keeps both without a copy.
`ci/module-layers.ini` places `platform_desktop` and adds its `[platform desktop]` section, and
`ci/check-deps.sh`'s sink rule follows the moved sink arms.
Co-Authored-By: Claude <noreply@anthropic.com>
…op platform The simulator's television code is now compiled in every build and only the linker keeps it out of the executable, so the macOS simulator job links the shape `make macapp` ships (`--no-default-features --features hostsim,play-feed`, in debug, in its own target tree) and says why: it guards the dead-strip reliance until the platform crates split. `ci/test_sim_backend.py` scans `simulators.yml` for the same `play-feed` rule it holds for the other simulator builds. `ci.yml`'s comment that nothing else compiles the simulator feature set was stale before this change; it now names what does. `.gitignore` lists the `target-sim-ci*` trees that job builds into, and the `ci/mkmacapp.py`, `ci/test_sim_backend.py` and `docs/macos-app.md` prose names the desktop platform where it said the simulator swaps the television's sink in. Co-Authored-By: Claude <noreply@anthropic.com>
…t has its own platform
`docs/module-layers.md` told a reader that the simulator runs the same `port.rs` tables with
`hostsim` arms, that the stand-ins in `webos` and `keymanager` are what it executes, that it
enters through `port::plex_run`, and that W4 was planned. Each of those is now the other way
round, so the L15 to L15d status cells, the L15b item 2 paragraph, the sink rule's path list and
the entry description follow `platform_desktop`.
The same claim sat in `app/exit.rs`, `play-feed`'s `ffi_host`, `app/adapters/{hostsim,backends}.rs`,
four comments of `webos.rs` that put the simulator on the webOS probe, the `hostsim` feature's
comment in `rust-modules/Cargo.toml`, and the fuzz package's account of why `hostsim` is the one
configuration a host executable links: the television's externs are compiled in every build now and
only the linker keeps them out, which those lines say instead.
Co-Authored-By: Claude <noreply@anthropic.com>
GLinnik21
marked this pull request as ready for review
November 20, 2026 11:34
…ndency certificate pins them The previous commit reworded a comment in `rust-modules/Cargo.toml` (the `hostsim` feature) and two in `fuzz/Cargo.toml`. `ci/readonly_generated.py` reads the certificate under `ci/proofs/` and pins every `Cargo.toml`, `Cargo.lock` and `.cargo` config byte for byte, so those three comments turned `make check-python-rest` red (`check-machine-shape.py`, `test_check_machine_shape.py`, `test_transition_arguments.py`, `test_readonly_dependencies.py`). A comment is not worth a certificate review, so both files return to the bytes `main` has, and the certificate is not re-sealed. Those comments therefore still say, for now, that `hostsim` is the only configuration a host executable can link because the television build declares symbols only the television's own libraries define, and that the feature switches the wayland and glib calls. The television's arms are compiled into every build today and only the linker keeps them out. The platform crates' split changes both files and re-seals the certificate, and rewords them then. Co-Authored-By: Claude <noreply@anthropic.com>
…e old `hostsim` arms now names both entries `app/mod.rs` (the module doc and two comments) and `app/boot.rs` said the entry that ends the process is `port::plex_run`. That is the television's; the desktop executable ends it in `src/bin/sim.rs` after `platform_desktop::run`, and each of those lines now names both. `Services::HOST_TEST`'s comment in `os/src/tv.rs` called the arm it replaced `cfg(any(hostsim, test))`; the arm is `cfg(any(test, feature = "test-support"))`. `fuzz/Cargo.toml` is not a member of the certified workspace, so its two comments get the wording the last commit gave them before the certificate forced it back: `hostsim` selects the host configuration of the layers below, the television's declarations are compiled in every build, and the linker keeps them out of a host executable. The fuzz package does not depend on `plxnative-modules`, so it no longer lists the desktop platform among what `hostsim` selects. `ci/test_readonly_dependencies.py` and `ci/test_readonly_generated.py` pass with the edit. `rust-modules/Cargo.toml`'s comment on `hostsim` stays as it is, because the certificate pins that file; `docs/module-layers.md` says in the L15b item 2 paragraph what `hostsim` selects now, that the television's wayland and glib calls are compiled either way and dropped by the linker, and that W7 rewords the comment when it re-seals. 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 W4 of the platform plan (discussion #1460): the simulator becomes its own platform. It no longer runs the television's service tables through
hostsimarms insystem.rs,port.rs,webos*.rsandkeymanager.rs. A newplatform_desktopsupplies its owntv::Services,ShellandFrameProbe. The television's code is now always compiled, and the linker strips it from the simulator because nothing reaches it. webOS is unchanged, and the simulator boots to Home with its replay fixtures identical.What changes
src/platform_desktop.rs(new,[platform desktop]inci/module-layers.ini) never namesport,system,webosorkeymanager.Services:NONEgroups for the hooks a desktop host has nothing for:probe_device,repair_native_video,device_files,system_locale,sound_output,poll_home,uri_media, and all ofsecure(SecureHooks::NONE,mode: Durable). Before, the simulator ran the webOS bodies of some of these, and they failed or answered nothing on a Mac. The visible differences are listed below.start_capability_probe, which publishes the DV probe (ProbeSource::Host);go_home, which keeps both log lines verbatim, with no worker thread and no trigger legs;deliver_toast(Sent{None, NoBus}, "no system notifications on this host");sink/display_sink(HOST_SINKunderplay-feed, elseNoSink, as before).ShellandFrameProbeare explicit no-ops. The entry installs no activator and no clear probe.run(&CStr, u16) -> c_intreturns the code.bin/sim.rs, already an allowedexit_nowowner, ends the process. The run_application returns its exit; only the executable entry ends the process #1479 scan and its owner list are unedited.The fence falls from 102 lines to 0. These are the lines naming
feature = "hostsim"insystem.rs,port.rs,os/webos.rs,os/webos/{caps,toast,jail_repair}.rs,os/keymanager.rsandos/webos/video_sink.rs. Per file, base to head: 53→0, 7→0, 22→0, 8→0, 5→0, 5→0, 2→0, 0→0.hostsimterm.platform_desktop.rs: the twoSINKarms, the two opaque-region stubs and the sink table's test.any(test, feature = "test-support"), which test builds use, andport.rs'sDISPLAYbecomescfg(test).not(devtriggers).The dev-trigger DV override (
dvcaps0/dvcaps1, the precedence and the publish-with-log line) moves fromwebos/caps.rsto the neutralos/src/devcaps/dv.rs. The webOS probe and the desktop probe both end in it, so the simulator keeps the triggers and thewebos-capsline without a copy.CI:
simulators.yml's macOS job gains "Link the macOS app's feature set":--no-default-features --features hostsim,play-feed, in debug, the harder dead-strip case, in its owntarget-sim-ci-macapp. Its comment says it guards the dead-strip reliance until W7 takeswebosout of the desktop build.ci/test_sim_backend.pyholdssimulators.ymlto itsplay-feedrule.ci.ymlcomment saying nothing else compiles the simulator feature set now names what does.ci/check-deps.sh's sink rule follows the moved arms..gitignoregainsrust-modules/target-sim-ci*/.Prose that put the simulator on the television's tables or on
port::plex_runnow says it has its own platform:docs/module-layers.md(the L15-L15d cells, L15b item 2, the sink rule, the entry, and whathostsimselects now);docs/agent-reference.md;docs/macos-app.md,ci/mkmacapp.py;fuzz/Cargo.toml;app/mod.rs,app/boot.rsandos/src/tv.rs.rust-modules/Cargo.toml'shostsimcomment stays as it was, although it still lists "the wayland/glib calls that have no host equivalent". Theci/proofscertificates pin that file byte for byte, so it is not edited here.docs/module-layers.mdsays what the feature selects now and notes the stale comment, which W7 rewords when it re-seals.fuzz/Cargo.tomllies outside the certified workspace and is corrected here.os/src/webos.rs,play-feed/src/ffi_host.rs,app/adapters/{backends,hostsim}.rs,app/exit.rs.No ledger line, and
ci/allow/layers.txtstays empty. No newAppfield.What the simulator now does differently
Nothing in
tests/,tools/,ci/,.agents/or the replay fixtures reads any of these, andcheck-replayis unchanged. Older simulator logs such asdocs/measurements/offline-picker-sim-{green,kid,nocache}-2026-09-06.logstill show the removed lines.The device probe (
probe_deviceNONE). The simulator ran the webOS probe. It logged three lines that are now gone:webos: /var/run/nyx/os_info.json unreadable (…) — version unknown;webos: …/device_info.json unreadable (…) — model/board unknown;devjail: soc= rtkmem=n/a.It also published
Probe{Unreadable, Unreadable}, so the simulator's Sentryprobecontext now readsunprobed/unprobedwhere it readunreadable/unreadable.The surface grab (
grab_surfaceno-op). The webOS shell's grab loggedFB bits: …andwm sdl=… subsys=0 …on the simulator, and recorded thewm_querycrash step. Desktop does none of this.Device files (
Files::NONE). The firstdevcaps:line's error text changes:devcaps: /etc/umediaserver/device_codec_capability_config.json unreadable (No such file or directory (os error 2)) — assuming the 49SM9000PLA profile… unreadable (entity not found) — assuming the 49SM9000PLA profileThe secure store (
SecureHooks::NONE). The keymanager stand-in loggedsession protection: no usable key manager; using the 0600 file fallbackat sign-in, and that line is gone. A sign-in through the mock plex.tv still stores the plaintext session instate/session.jsonwith nosealedkey, as the harnesses (tests/controlled_bootstrap.py,tests/playback_navigation_sim.py,tools/hud_preview.py) expect.Toasts. The line reads
toast: no system notifications on this host — …where it readtoast: no LS2 bus off-device — {identity} call to luna://com.webos.notification/createToast not sent. The outcome is the same:Sent{None, NoBus}.The DV capability probe. It runs synchronously on the main thread, with no
dv-caps-probeworker. It answersunknownat once (webos-caps: … answer=unknown stage=host, the same line as before), and thedvcaps0/dvcaps1dev triggers still apply.Native-video repair. It answers
Failure::Unsupporteddirectly. Before, the simulator reached the same answer throughvalidated_install, which rejects any directory that is not an on-device install path.The
plxnative-gohometrigger is not read on desktop.go_homelogsgohome: request mode=auto, then the no-LS2-bus line, as before.X-Plex-Platform. Desktop publishes noPlatform, so it stays thewebOSdefault the simulator sent before. Changing it is not this PR's job.Tests
Base
d166f5fcbagainst head, on the committed tree:test result: ok. 1726 passed; 0 failed; 0 ignored; 0 measured; 2 filtered outtest result: ok. 1726 passed; 0 failed; 0 ignored; 0 measured; 2 filtered outmake test-hostsim C=plx_mediatest result: ok. 2478 passed; 0 failed; 104 ignored; 0 measured; 0 filtered outtest result: ok. 2478 passed; 0 failed; 104 ignored; 0 measured; 0 filtered outmake test-crate C=plx_ostest result: ok. 460 passed; 0 failed; 0 ignored; 0 measured; 0 filtered outtest result: ok. 460 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out--list), base against head: app 1728/1728, media 2582/2582,plx_os460/460. No test was lost. Two moved with their code:port::tests::the_simulator_port_display_is_the_host_sink_the_acb_init_readsis now underplatform_desktop::tests, andwebos::caps::tests::dv_caps_override_precedenceis nowdevcaps::dv::tests::dv_caps_override_precedence.make check-replay:6 fixtures, 12 replays, SAME=4 REFUSED_EXPECTED=8 unexpected=0.make sim-macos-shotagainsttests/mock_pms.pyreaches Home.make macappbuilds: arm64, 11 bundled libraries, signature ok.make sim-macosand the macapp feature set link locally in release and debug.nm -ushows no Wayland, LS2, ACB, Starfish or luna symbol in any simulator binary or in the app.--gc-sectionsand-dead_strip) were green.ci.test_sim_backend(3),ci.test_test_crate(13),ci.test_platform_axis(22) andtests/test_harness.pyDepGates (91) passed.ci/check-module-layers.py,ci/check-ledger-ratchet.py,ci/check-statics.shandci/check-deps.share green.plx_launch_argsandacb_on_eventare still not exported.port,system,webos,keymanager) contribute 0 symbols to the macOS binary.rust-modules/Cargo.tomlcomment described above.make check-python-rest(all 145 steps, including the certificate gatesci/test_readonly_generated.py,ci/test_readonly_dependencies.pyandci/check-machine-shape.py) is all ok on the final head.Not run here:
make check,check-nodef, the ARM cross-build and the fuzz link. This PR's own CI gates them, andfuzz.ymlruns becausefuzz/Cargo.tomlchanged.build-bench
make build-bench ARGS='--only noop,leaf,app --runs 3', based166f5fcbac0then head3069d8f53c82, run one at a time under the exclusive lock. M4, 10 cores, rustc 1.100.0.plx_basecbuf.rs), non-incrementalcoldstart.rs), non-incrementalplx_baserow and 1/190 for the app row.plx_basegap is inside the base's own spread. Head ran straight after base, with load average 5.1 at its start.🤖 Generated with Claude Code