Registry Mirror
Skip to content

Conversation

@jdalton

@jdalton jdalton commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

new WebAssembly.Module(bytes) rejects most real-world wasm binaries at load time with unexpected SIMD opcode: 0xfd.

The wasm SIMD proposal (128-bit vector instructions, all prefixed with the 0xfd opcode byte) has been a standard part of WebAssembly since 2021, and mainstream toolchains emit it by default — Rust's wasm32-unknown-unknown target under wasm-bindgen builds with +simd128 on, and Emscripten and AssemblyScript ship SIMD-enabled presets. A wasm engine with SIMD support compiled out therefore fails not on exotic payloads but on the typical output of today's toolchains, e.g. a wasm-bindgen module built with +simd128.

Root cause

crates/perry-wasm-host/Cargo.toml:19 pulls wasmi with default-features = false to keep binary size down (the comment documents a measured ~1.1 MB delta from the std-only string-interner extras). But wasmi's default feature set is also what carries simd — so the size optimization silently dropped SIMD decoding, and the interpreter's validator bails at the first 0xfd-prefixed instruction.

The fix re-enables exactly the one feature: wasmi = { version = "1.1", default-features = false, features = ["simd"] }. The string-interner extras the size note targets stay off.

Test plan
$ cargo build -p perry-wasm-host
Finished `dev` profile
$ cargo test -p perry-wasm-host
test result: ok. 3 passed; 0 failed

Verified end-to-end against a wasm-bindgen module built with +simd128: loads and instantiates where it previously threw at new WebAssembly.Module.

Found while compiling a manifest generation CLI — a real-world TypeScript CLI with a deep pnpm dependency graph. Independent of the other fixes from that effort; lands standalone.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue where SIMD-enabled WebAssembly modules could fail to load due to unsupported SIMD handling.
    • Improved compatibility with real-world WebAssembly payloads compiled with SIMD support.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@jdalton, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 34 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: edea09bb-2a36-4c68-95e3-0924d857140a

📥 Commits

Reviewing files that changed from the base of the PR and between ab9994b and 5363788.

📒 Files selected for processing (2)
  • changelog.d/7003-wasmi-simd.md
  • crates/perry-wasm-host/Cargo.toml
📝 Walkthrough

Walkthrough

The wasm host enables Wasmi’s simd feature while retaining disabled default features, allowing SIMD-enabled WebAssembly modules to load. A changelog entry records the fix.

Changes

Wasm host SIMD support

Layer / File(s) Summary
Enable Wasmi SIMD processing
crates/perry-wasm-host/Cargo.toml, changelog.d/7003-wasmi-simd.md
The Wasmi dependency explicitly enables simd with default features disabled, and the changelog documents the SIMD module loading fix.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the wasm-host fix and the wasmi SIMD feature change.
Description check ✅ Passed It covers the problem, fix, and test plan with concrete commands; only some template sections are missing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@proggeramlug
proggeramlug merged commit 00122f6 into PerryTS:main Jul 29, 2026
32 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants