Skip to content

[wasm64] Add browser-wasm64 CoreCLR interpreter support - #138166

Open
lewing wants to merge 10 commits into
feature/wasm-arch-renamefrom
feature/wasm64-interpreter
Open

lewing wants to merge 10 commits into
feature/wasm-arch-renamefrom
feature/wasm64-interpreter

Conversation

@lewing

@lewing lewing commented Nov 23, 2026

Copy link
Copy Markdown
Member

Adds browser-wasm64 (memory64) support to the CoreCLR interpreter. This is layer 1 of a stack: ReadyToRun (JIT/crossgen2) and library outerloop CI follow in separate PRs.

  • Build plumbing for -os browser -arch wasm64. The cross components build only the jitinterface; there is no wasm64 JIT in this layer.
  • VM/PAL/GC interpreter runtime changes, plus generated wasm64 call-helper tables under src/coreclr/vm/wasm/browser-wasm64/.
  • Browser host, JS interop, and Webcil for memory64, including the Emscripten __sig declarations for pointer-taking imports.
  • SDK/workload targeting for browser-wasm64. ReadyToRun is disabled and rejected for wasm64 until the R2R layer.
  • A wasm64 interpreter runtime-test lane, with R2R passes off, and its test exclusions.

Validated locally (macOS arm64):

  • ./build.sh clr+libs+host -os browser -arch wasm64 -c Debug -lc Release passed.
  • ./build.sh clr+libs -os browser -c Debug -lc Release passed (wasm32 regression check).
  • The call-helper generator reproduces the checked-in wasm64 and wasm32 tables with no diff.
  • A smoke app (collections, EH, GC) ran on the wasm64 corerun.js under node 26 and exited 100.

Note

This PR description was generated with GitHub Copilot.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 8 pipeline(s).
7 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@lewing
lewing force-pushed the feature/wasm64-interpreter branch from c562509 to dd5154f Compare November 23, 2026 23:20
@lewing lewing added arch-wasm WebAssembly architecture area-CodeGen-Interpreter-coreclr os-browser Browser variant of arch-wasm and removed area-Build-mono labels Nov 23, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara
See info in area-owners.md if you want to be subscribed.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @BrzVlad, @janvorli
See info in area-owners.md if you want to be subscribed.

@lewing

lewing commented Nov 23, 2026

Copy link
Copy Markdown
Member Author

This is the parts of #138027 required to stand up the browser-wasm64 interpreter.

Excluding the newly generated call helpers the diff is +1,311 / −647 lines

@davidwrighton davidwrighton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks pretty good.

Comment thread src/coreclr/vm/codeman.cpp Resolved
Comment thread src/coreclr/vm/dynamicmethod.cpp Resolved
@lewing
lewing force-pushed the feature/wasm64-interpreter branch from dd5154f to 8370fed Compare November 24, 2026 01:06
Comment thread eng/native/build-commons.sh Resolved
@lewing
lewing force-pushed the feature/wasm64-interpreter branch from a4c1d0c to e7e829a Compare November 24, 2026 04:46
@lewing
lewing removed this pull request from stack #138173 November 24, 2026 04:48
@lewing
lewing changed the base branch from main to feature/wasm-arch-rename November 24, 2026 04:48
@lewing
lewing added this pull request to stack #138191 November 24, 2026 04:48
lewing and others added 10 commits November 24, 2026 10:59
Recognize the wasm64 architecture in the build scripts, CMake configuration and subsets. The wasm64 cross components build only the jitinterface needed by crossgen2; there is no wasm64 JIT yet.

Co-authored-by: Copilot App <[email protected]>
VM, PAL, GC and CoreLib changes for 64-bit pointers on browser-wasm64, plus corerun host updates.

Co-authored-by: Copilot App <[email protected]>
Teach the call-helper generator and its crossgen2 calling-convention and instruction-set support about wasm64, and check in the generated tables. The tables are produced by generate-coreclr-helpers.proj.

Co-authored-by: Copilot App <[email protected]>
Includes the Emscripten __sig declarations for pointer-taking browser imports.

Co-authored-by: Copilot App <[email protected]>
Add the browser-wasm64 RID and packs. ReadyToRun is disabled and rejected for wasm64 until R2R support lands.

Co-authored-by: Copilot App <[email protected]>
Add the CI lane with ReadyToRun passes disabled, wasm64 test infrastructure, and test exclusions.

Co-authored-by: Copilot App <[email protected]>
memory64 lifts the 4 GB address limit; use the engine's memory64 cap rather
than the wasm32 2 GB default so large-allocation workloads can run.

Co-authored-by: Copilot App <[email protected]>
(cherry picked from commit 081c20e)
Architecture has no Wasm64 value, so browser-wasm64 reports Architecture.Wasm.

Co-authored-by: Copilot App <[email protected]>
(cherry picked from commit 0d8a717)
…ated source

The ExecutionManager.md usage table is generated from data-descriptor-meanings.json,
so record the wasm-optional field description there.

Co-authored-by: Copilot App <[email protected]>
crossgen2 rejects wasm64 until ReadyToRun support is added, so tests with
AlwaysUseCrossGen2 can't run on the wasm64 interpreter lane yet.

Co-authored-by: Copilot App <[email protected]>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arch-wasm WebAssembly architecture area-CodeGen-Interpreter-coreclr os-browser Browser variant of arch-wasm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants