merge train: land #10138 (Emscripten main + side modules) - #10140
Merged
Conversation
added 4 commits
September 12, 2026 17:53
(cherry picked from commit caab275)
Train168 (#10138) lands on main at 0.5.1540; the PR did not bump the version, which is the maintainer's job at merge time. Cargo.lock regenerated so every workspace member's inherited version moves with it.
The raw-handle ratchet went 944 -> 953 on this PR, with two violations that
ceilings cannot absorb: `webassembly_calls.rs` is new, and
`--no-raise-vs <merge-base>` refuses a ceiling on a file absent at the base,
while `webassembly.rs` cannot have its existing ceiling raised (20 -> 24).
All nine sites are argument-position reads handed straight to a non-allocating
store or a self-rooting entry point, which is what `with_{mut,const}_ptr` is
for:
- `webassembly_calls.rs`: the settle path's `js_promise_resolve`/`_reject` and
its boxed return, and the instance-result `then` closure's capture store and
boxed pointer.
- `webassembly.rs`: `object_set`'s receiver and key, and the two import-resolution
key reads feeding `js_object_get_field_by_name_f64`.
That also retires one pre-existing site, so the recorded total falls 944 -> 943
(`--no-raise-vs origin/main`: "none raised").
#10138 makes `wasm_memory_new_buffer` `#[cfg(not(feature = "wasm-host"))]` — with the host present, memory comes from the real wasm host instead of a registered ArrayBuffer — but leaves two tests calling it unconditionally: error[E0425]: cannot find function `wasm_memory_new_buffer` in this scope --> crates/perry-runtime/src/object/global_this_webassembly.rs:1629 --> crates/perry-runtime/src/object/global_this_webassembly.rs:1677 `cargo check -p perry-runtime --tests --features wasm-host` therefore fails on this branch while it passes on `main`. Both tests exercise the fallback the function implements, so they are gated the same way rather than given a wasm-host variant: with the feature on there is no such function to test. Worth noting how this was nearly missed. `webassembly.rs` and friends sit behind `#[cfg(feature = "wasm-host")]`, which is not a default feature, so the ordinary `cargo check -p perry-runtime --tests` and `cargo test -p perry-runtime` arms never compile them at all. A PR that rewrites 1,000 lines of WebAssembly support can pass both while its own subject is never built — including, in this train, the raw-handle conversions made to that same file.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (17)
📝 WalkthroughWalkthroughThe pull request extends the WebAssembly host with shared main/side-module resources, host-backed ChangesWebAssembly runtime and asset loading
Estimated code review effort: 5 (Critical) | ~90 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant JS
participant Runtime
participant Host
participant MainModule
participant SideModule
JS->>Runtime: instantiate module with imports
Runtime->>Host: compile and resolve imports
Host->>MainModule: create shared resources
Runtime->>Host: instantiate side module
Host->>SideModule: attach shared externals
SideModule->>MainModule: read and update shared memory, table, global, and function
MainModule-->>JS: return shared state and export results
Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Merge train landing #10138 (
fix(wasm): support Emscripten main and side modules, Fixes #10102) on top ofmain63910ad16.Close keywords do not fire through a train branch, so #10138 is closed with a
pointer comment after this lands and #10102 swept by hand.
The finding: this PR's subject is never built by the ordinary arms
perry-runtime's WebAssembly support is behind#[cfg(feature = "wasm-host")],which is not a default feature. So
cargo check -p perry-runtime --testsand
cargo test -p perry-runtime— which pass on this branch, 3670 tests, zerofailures — never compile
webassembly.rs,webassembly_calls.rsorwebassembly_host.rsat all. A PR that rewrites ~1,000 lines of that subsystemcan pass both with its own subject unbuilt.
Running the feature explicitly fails on this branch and passes on
main:#10138 gates
wasm_memory_new_buffertonot(feature = "wasm-host")— with thehost present, memory comes from the real wasm host rather than a registered
ArrayBuffer — but leaves two tests calling it unconditionally. Both exercise the
fallback that function is, so they are gated the same way rather than given a
wasm-host variant: with the feature on there is nothing there to test.
That arm is now permanent in this worktree's validation protocol. It is the only
thing standing between a wasm-subsystem PR and a green run over code that was
never compiled.
Maintainer fix commits
fix(wasm): scope #10138's handle reads to their non-allocating calls—the raw-handle ratchet went 944 -> 953 with two violations ceilings cannot
absorb:
webassembly_calls.rsis new (--no-raise-vs <merge-base>refuses aceiling on a file absent at the base) and
webassembly.rscannot have itsceiling raised (20 -> 24). All nine sites are argument-position reads handed to
a non-allocating store or a self-rooting entry point, so they become
with_{mut,const}_ptr. That retires one pre-existing site too: recorded total944 -> 943,
--no-raise-vs origin/mainreports "none raised". Theseconversions live in the
wasm-host-gated files, so they were themselves onlytype-checked once the feature arm was added.
fix(wasm): gate the ArrayBuffer-memory tests to not(wasm-host)— above.chore: bump workspace version to 0.5.1541.Validation
5667 tests, zero failures. Exit codes captured from each command itself.
Known red on
main, not from this traintest_gap_gc_http2_pending_event_callback_rootinghangs onmain, bisected to#10077 and tracked in #10137.
Summary by CodeRabbit
New Features
Bug Fixes
Chores