Skip to content

[wasm][R2R] Integrate CoreCLR ReadyToRun into wasi-wasm publish #132983

Description

@lewing

CoreCLR ReadyToRun code cannot be instantiated dynamically inside a WASI component, so publishing must place the generated R2R core module in the same component as the runtime. A prototype now demonstrates this end to end with a framework-scale composite: crossgen2 emits self-installing data/table segments, the non-PIC host supplies the shared memory/table/globals/tag, and a composition step merges the modules before rebuilding the component.

The remaining work is to integrate that proven path into the wasi-wasm publish pipeline rather than requiring a hand-driven splice.

Proposed scope:

  • Generate the composite R2R image before linking the per-app WASI host.
  • Derive the payload size and function-table requirement from that image.
  • Link the host with exact image and table capacity rather than fixed manual values.
  • Compose the host and R2R modules into the final WASI component.
  • Publish the component forwarding stubs alongside the application assemblies.
  • Preserve interpreter fallback for methods unsupported by wasm R2R.
  • Add an end-to-end test that proves an R2R method executes rather than accepting a successful interpreted run.

This issue tracks the non-PIC composition path. Emitting a conforming relocatable wasm object for direct wasm-ld integration, and making the complete runtime PIC for dylink.0 composition, are separate architectural follow-ups.

Note

This issue was drafted with GitHub Copilot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-ReadyToRununtriagedNew issue has not been triaged by the area owner

    Type

    No type

    Projects

    • Status
      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions