Repository navigation
The platform interface is published through one module, host, with an EventSink for input - #1500
Merged
Merged
Conversation
… EventSink beside the SDL poll Shell, Surface, FrameProbe, Platform, MediaBoot, Composition, Exit and Release become pub items that a platform crate reaches only through plxnative_modules::host (owner ruling 2026-11-21, Decision 3 amended); HostEvent stays private. Surface::deliver(&self, &mut dyn EventSink) is additive beside poll, which is defaulted and hidden: the SDL surface delivers nothing and every SDL event still comes through poll. A private HostQueue is the one conversion, with one call in drain_sdl. RawKey moves to plx_ui::consts. host::run forwards to run_application. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…te, and check runs it too rust-modules/tests/host_interface.rs builds a static Platform from fakes and boots it through host::run to the fake shell's refusal. check-cargo-unit-hostsim gains the line, pinned in GATES. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… SDL delivery test polls both edges of a tap Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…face gate carries Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ed, Services is plx_os's, and the integration test exists Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… host docs name every simulator door The boot-to-refusal test asserted that a run created no plxnative-* entry in /tmp, but other checkouts' test runs write there concurrently, so the assertion was a race. It now asserts that the boot's event log landed in the throwaway runtime root, and prints both listings for a reader of --nocapture. host.rs named the simulator's hostsim doors by a sim_* glob, which misses publish_sim_webos_major and the synthetic_home_initial re-export; it now lists the six and says where to grep for them. The Makefile's HOST-ONLY comment lists test-host-interface beside test-hostsim. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…, and Services is a lower crate's type Decision 3's amendment listed nine types as "reachable only through host" and then said, in its own parenthetical, that Services is nameable both ways. host.rs and section 8 said eight. All four places (the amendment, section 8's interface bullet, the W7a landed bullet and host.rs's module doc) now say the same thing: Platform, Shell, Surface, FrameProbe, MediaBoot, Composition, Exit and Release are reachable only through host; Services is plx_os::tv::Services, already pub in a lower crate, which host re-exports so a platform crate names host alone; HostEvent stays private and EventSink is the public face. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ing a platform crate names host alone The owner's ruling that host is the only way into the application was held by nothing: the integration test reads only its own spelling, so `pub mod app;` or `pub use app::platform::Shell;` in lib.rs left every test green. host.rs now carries two pins in the style of port.rs and boot.rs. One holds lib.rs's pub items to host plus the simulator's hostsim-only doors (each checked to sit behind feature = "hostsim"). The other makes host.rs the only `pub use crate::app` site across src/**, apart from the root's hostsim-only synthetic_home_initial. Both fail with how to proceed: extend the set deliberately, and why Decision 3's 2026-11-21 amendment is the reason. The "names host alone" claim was false: building a Services names plx_os::tv's hook tables and MediaBoot::compose takes plx_media's PlayerAdapter, and host does not re-export them. The amendment, section 8's interface and gate bullets, the W7 entry, agent-reference and the host.rs and test-file docs now say a platform crate names the application crate's types through host alone and depends on plx_os and plx_media directly, and the test file claims only its own spelling. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…her `app` is anywhere in its tree
The first pin took any cfg attribute containing feature = "hostsim" and not(...) as confining a door to the
simulator. That passed `any(test, feature = "hostsim", feature = "devtriggers")`, which a default television
build compiles (devtriggers is on by default), and failed a multi-line attribute and an `all` with a `not`.
Each attribute is now joined across its lines and evaluated for a build without hostsim or test: the door
is confined only if the predicate cannot be true there.
The second pin read only a `pub use` that began crate::app or app::, so `super::app::...` in a module under
src/, `self::app::...` in lib.rs and `crate::{host, app::X}` slipped through. It now flags any `pub use`
outside host.rs whose tree has `app` as a path segment, keeping the one exception.
The failure message's first remedy is now to re-export the item from host.rs, which the second pin allows;
extending ROOT_ITEMS is for a new simulator door that is not an application item.
Co-Authored-By: Claude Sonnet 5.5 <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 W7a of the platform plan (discussion #1460). The application crate now publishes what a platform crate needs to build its
static Platformand hand it over, and it publishes this through one module,plxnative_modules::host. Nothing else of the application is public to a television build. Neither the television nor the simulator behaves differently: the SDL event path is the same bytes through the samepoll.What the interface is
rust-modules/src/host.rs(new) re-exports what a platform builds or implements:Platform,Shell,Surface,EventSink,FrameProbe,MediaBoot,Composition,ExitandRelease. It also re-exports the lower layers' vocabulary their signatures name:Services(plx_os::tv),MainThread,Edge,Action,RawKey,Lifecycle,PointerEdge,OpenAskandPlacement. With these, a platform crate names the application crate's types throughhostalone. Some types still come from their own crates, which a platform crate depends on directly:Servicesis built from (plx_os::tv:IdentityHooks,SecureHooks,SystemHooks,StorageHooks,LegacyWebosMedia,LocaleReply);PlayerAdapter(plx_media), whichMediaBoot::composetakes.host's one function isrun(&'static Platform, &CStr, u16) -> Exit, the application's entry.The owner's ruling (Decision 3 amended, 2026-11-21): the eight application-crate items are reachable only through
host, never as generalpubitems:Platform,Shell,SurfaceandFrameProbe;MediaBoot,Composition,ExitandRelease.Servicesis already apubtype ofplx_os, andhostre-exports it.HostEvent, the loop's own event type, stays private.Input has a public face,
EventSink(key,text,pointer,wheel,lifecycle). A platform reports input throughSurface::deliver(&self, &mut dyn EventSink), and the application converts each call into itsHostEventin one place,HostQueueinapp/events.rs.deliveris required.Window::deliverdelivers nothing, because every SDL event, a synthetic one included, still comes throughpoll.pollis now defaulted to none and#[doc(hidden)]. It retires when the SDL shells deliver through the sink, at W9 at the latest.Shell(12 methods) andSurfaceare published as they are. W9 folds the per-window calls that still take a raw handle intoSurface.The split is by thread. A
Platformis registration data in astatic(function pointers and&'static dynofSynctypes,Shellincluded as a factory). The thread-affine window and GL state live only in theSurfacethatShell::openreturns on the loop thread.RawKeymoves toplx_ui::constsbesideAction, so the key vocabulary sits in the layer that names keys.Left for W7b:
sdl_initandsdl_open, the SDL helpers the two real platforms need, ship with those platform crates.How it is held
Two source pins in
host.rs(surface_pin_tests) hold the ruling inside the crate:pubitems are a known set:host, plus the simulator's six doors. Each door'scfgmust be false in every build that has neitherhostsimnortest. A multi-line attribute is joined and evaluated, soall(feature = "hostsim", not(..))passes, and anany(..)naming another feature (devtriggersis on by default) fails. The test also fails if a known item disappears.host.rsis the onlypub useof the application: any otherpub usewhose tree hasappas a path segment fails. That coverscrate::,super::,self::, a bareapp::, and a group such ascrate::{host, app::Exit}. The one exception islib.rs'shostsim-onlysynthetic_home_initial.Each plant failed or passed as intended, then was reverted:
pub use app::platform::Shell;andpub use self::app::platform::Shell;inlib.rsfailed both pins;pub mod app;failed the first;devtriggersany(..)onhud_clifailed the first;pub use super::app::platform::Shell;andpub use crate::{host, app::Exit};inplatform_desktop.rsfailed the second;feature = "hostsim"attribute andall(feature = "hostsim", not(feature = "devtriggers"))passed.The failure message's first remedy is to re-export the item from
host.rs; W7b'ssdl_initandsdl_openare the example. Only a new simulator door that is not an application item extends the known set, with the reason recorded in the Decision 3 amendment. The pins are textual: they do not see apubitem inside a macro expansion, a glob re-export, or an alias that drops theappsegment.rust-modules/tests/host_interface.rs(new) is an integration test. It is a crate of its own, so it can name only the application'spubitems. It builds astatic Platformfrom a fakeShell, a!SyncfakeSurfaceand a fakeFrameProbe. Four tests:Platformis constructible in astatic;EventSinkfrom outside: it can be implemented outside the crate and receives events in order;plxnative_modulespath in this file goes through::host. That checks only the file's own spelling; the crate's surface is held by the pins above. The scan was shown to fail when a line namingapp::platform::Shellwas appended;initbeforeopen, theOpenAsk(title,Placement::Desktop, high-dpi), the installedServiceslocale hook, and the returnedExit { code: 73, release: Retained }. Its logs land in a throwaway runtime root. The boot goes no further without a GL context.In-crate tests:
HostQueue's conversion has 5 tests.drain_sdldelivering through the sink into the loop has one.make test-host-interfaceis the incremental loop for the integration test, intarget-hostsimbesidemake test-hostsim.DISK_ENTRIES,SIDE_EFFECT_FREEand the HOST-ONLY goals, and it is refused underRELEASE=1.make checkruns the same test non-incrementally as a second cargo line incheck-cargo-unit-hostsim.ci/test_ci_split.py,ci/test_arm_profile.py,ci/test_host_threads.py), andci/module-layers.iniplaceshostin[app].[[test]]entry and no manifest change, so no certificate is re-sealed.Two W6 review minors are done here:
plx_shell_sdl'severy_source_file_is_scanned, which now keeps only*.rsfiles and directories.Docs:
docs/platform-ports.md: §1, §2 and §8, the W7 entry, "As landed (W7a)", and the Decision 3 amendment with the Decision 4 pointer;docs/module-layers.mdanddocs/agent-reference.md.doc-claim-auditorran twice: round 1 found 8 contradictions and round 2 found 1, all fixed.Build bench
make build-bench, without thetestsandarmrows, 3 runs each. Apple M4 (10 cores), rustc 1.100.0. Before is7ceb6f76f(this PR's base), after is8f25da9f5; the two later commits change only doc text and comments. Both trees were clean. Units: 193 → 193.The non-incremental rows move between −7% and +8%, and every range overlaps. The rebuilt counts are identical.
The two incremental rows were measured twice, because they disagreed:
In fresh worktrees on the same machine the head is not slower, and the unit and rebuilt counts are the same in every run. The slowdown shows only in the long-lived checkout that built the lane. Its cause was not determined, and the incremental cache size was not measured.
Gates (on the committed tree)
The full set ran at
8f25da9f5. At06d95595b(one commit of doc and comment text) these were re-run:make check-python,make check-cargo-lint, the static gates and the certificate tests.At
b5d4098b8(the surface pins and the reworded dependency claim) these were re-run:test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1499 filtered outeach, and2 passedunderhostsim;make test-host-interface,make check-cargo-lint,make check-nodefandmake check-python;check-module-layers:20 layers, 2027 modules, one more for the pin module) and the certificate tests.At
9ce0310c5(the pins' cfg evaluation, path-segment match and remedy wording) these were re-run:make test-crate C=plxnative_modules T=surface_pin_tests:test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 1498 filtered out;make test-hostsim T=surface_pin_tests:2 passed;make test-host-interface,make check-cargo-lintandmake check-python;the static gates and the certificate tests.
Default unit pass, three tests that crash on this Mac skipped (below): 20 binaries
ok. Among them:test result: ok. 1497 passed; 0 failed; 0 ignored; 0 measured; 1 filtered outplx_screens:test result: ok. 2315 passed; 0 failed; 0 ignored; 0 measured; 1 filtered outplx_media:test result: ok. 2165 passed; 0 failed; 104 ignored; 0 measured; 0 filtered outHostsim pass, the same skips: 12 binaries
ok. Among them:test result: ok. 1774 passed; 0 failed; 0 ignored; 0 measured; 2 filtered outplx_media:test result: ok. 2485 passed; 0 failed; 104 ignoredThe host interface test, both as
check-cargo-unit-hostsim's second line and asmake test-host-interface:test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out.Green:
make check-cargo-lint,make check-nodef,make sim-macosandmake check-python.Every simulator feature set CI builds was built:
ci.yml's twocargo checklines andsimulators.yml's macOS app link. The Makefile's screenshot and site-video feature sets were type-checked withcargo check, not built.make check-replay:6 fixtures, 12 replays, SAME=4 REFUSED_EXPECTED=8 unexpected=0.Static gates:
ci/check-deps.sh: all gates green;ci/check-module-layers.py:20 layers, 2026 modules, 173 Cargo layer declarations, 0 migration entries left;ci/check-ledger-ratchet.py:no count above 7ceb6f76f;ci/check-statics.sh: all gates green.Certificate tests:
ci/test_readonly_dependencies.pyandci/test_readonly_generated.pypass (64 and 22 tests).ARM, at
47df75e6eagainst the base'stvdevbinary:The later commits change doc comments, the test file and a Makefile comment only. There is no FFI, linkage or
dynlib!change, so fw-compat-reviewer was not run.Reproduced on base
Three tests crash with SIGSEGV in the macOS system libGL with no context, and were skipped:
player_owner_events_record_and_replay_through_the_actual_app_host(hostsim; known since Rename the bottom layer crate plx_platform to plx_os #1474);an_unregistered_product_screen_uses_generic_navigation_and_actual_store_effects;actual_visible_player_paint_reports_typed_watch_without_mutating_it.The first two were run directly at head and exit 139. The third is skipped on earlier lanes' records.
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. Base7ceb6f76ffails the same two with the identical recipe (1765 passed; 2 failed; head is1772 passed; 2 failed, base plus the 7 new tests). Both pass at--test-threads=6.Not covered
host-unit-hostsimjob is its first Linux run.make checkwas not run as one invocation. Its pieces ran separately, because of the skips above.deliverinto the loop is covered by the in-cratedrain_sdltest instead.ARM_PROFILE=releasesize measurement.rust-modules/src/lib.rspin inci/proofs/serde-json-immutable.jsonis not enforced.lib.rsandhost.rsanyway: the third review's one minor. An attribute and itspubitem written on one line (#[doc(hidden)] pub mod app;) are invisible to both surface pins. The fix is to read the text after the attribute's final]as the item.🤖 Generated with Claude Code