Skip to content

Add wasm coverage to SuperPMI CI pipelines#128669

Merged
AndyAyersMS merged 5 commits into
dotnet:mainfrom
AndyAyersMS:WasmSPMICollection
May 29, 2026
Merged

Add wasm coverage to SuperPMI CI pipelines#128669
AndyAyersMS merged 5 commits into
dotnet:mainfrom
AndyAyersMS:WasmSPMICollection

Conversation

@AndyAyersMS
Copy link
Copy Markdown
Member

Enable SuperPMI collection, replay, and asmdiffs for the wasm cross-targeting JIT (clrjit_universal_wasm_<host_arch>).

Collection:

  • Build clr.wasmjit alongside other JITs in collect/replay/diffs pipelines
  • Pass -target_os browser and -target_arch wasm to collection setup
  • Overlay the checked JIT for corelib crossgen2 collection so the MCH records the additional EE queries made by checked builds
  • Partition corelib collection per assembly for wasm

Replay and diffs:

  • Add a daily superpmi-replay-wasm pipeline (windows_x64)
  • Handle wasm as a cross-target altjit in replay and asmdiffs scripts: re-derive host OS/arch, select the correct JIT name, pass --altjit and RunAltJitCode=0
  • Auto-set --altjit in superpmi.py when target_arch is wasm so users don't need to pass it manually

Rolling build:

  • Add clr.wasmjit to jitrollingbuild so the wasm JIT is uploaded to Azure Storage as the asmdiffs baseline

Enable SuperPMI collection, replay, and asmdiffs for the wasm
cross-targeting JIT (clrjit_universal_wasm_<host_arch>).

Collection:
- Build clr.wasmjit alongside other JITs in collect/replay/diffs pipelines
- Pass -target_os browser and -target_arch wasm to collection setup
- Overlay the checked JIT for corelib crossgen2 collection so the MCH
  records the additional EE queries made by checked builds
- Partition corelib collection per assembly for wasm

Replay and diffs:
- Add a daily superpmi-replay-wasm pipeline (windows_x64)
- Handle wasm as a cross-target altjit in replay and asmdiffs scripts:
  re-derive host OS/arch, select the correct JIT name, pass --altjit
  and RunAltJitCode=0
- Auto-set --altjit in superpmi.py when target_arch is wasm so users
  don't need to pass it manually

Rolling build:
- Add clr.wasmjit to jitrollingbuild so the wasm JIT is uploaded to
  Azure Storage as the asmdiffs baseline

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 27, 2026 23:07
@AndyAyersMS AndyAyersMS requested a review from akoeplinger as a code owner May 27, 2026 23:07
@github-actions github-actions Bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label May 27, 2026
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

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

@AndyAyersMS
Copy link
Copy Markdown
Member Author

@dotnet/wasm-contrib PTAL
fyi @dotnet/jit-contrib

Have run most of this (stripped down) on the internal collect pipeline. Full run in progress. Also ran a jitrolling build job to populate a wasm jit there.

Was then able to do a local replay via:

python superpmi.py asmdiffs -target_arch wasm -target_os browser

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the CoreCLR SuperPMI collection/replay/diffs/asmdiffs infrastructure to cover the wasm cross-targeting JIT scenario by threading target OS/arch through the collection setup and teaching replay/asmdiffs/diffs scripts (and pipelines) to treat wasm as a cross-target altjit case.

Changes:

  • Add cross-target handling for wasm in SuperPMI scripts (crossgen2 rsp args, replay/asmdiffs JIT name selection, automatic --altjit when targeting wasm).
  • Extend SuperPMI Helix project files and AzDO templates to include a browser/wasm partition and to flow target OS/arch overrides for cross-target collections.
  • Add a scheduled superpmi-replay-wasm pipeline and ensure rolling build / replay / diffs pipelines build and publish clr.wasmjit.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/coreclr/scripts/superpmi.py Adds cross-target and wasm-specific crossgen2 rsp arguments (--targetos/--targetarch, wasm obj-format + codegenopt).
src/coreclr/scripts/superpmi-replay.proj Adds a browser/wasm replay partition for SuperPmiReplayType=wasm.
src/coreclr/scripts/superpmi-collect.proj Passes target OS/arch into superpmi.py collect for crossgen2, and adds Helix RID fallback for non-runtime targets (e.g., browser).
src/coreclr/scripts/superpmi-asmdiffs-checked-release.proj Adds a browser/wasm partition to checked-vs-release asmdiffs.
src/coreclr/scripts/superpmi_replay.py Implements wasm replay as a cross-target altjit scenario and re-derives host OS/arch at runtime.
src/coreclr/scripts/superpmi_replay_setup.py Extends replay setup -type validation to include wasm.
src/coreclr/scripts/superpmi_diffs.py Auto-adds --altjit when the partition target arch is wasm.
src/coreclr/scripts/superpmi_diffs_setup.py Teaches partition discovery to find wasm collections stored under host-arch blob paths while recording target arch as wasm.
src/coreclr/scripts/superpmi_collect_setup.py Adds -target_os/-target_arch, adds corelib-specific single-assembly partitioning, and overlays checked JIT over release Core_Root for corelib.
src/coreclr/scripts/superpmi_asmdiffs_checked_release.py Handles wasm JIT naming as cross-target and appends --altjit for wasm asmdiffs runs.
eng/pipelines/coreclr/templates/superpmi-send-to-helix.yml Adds optional targetOS/targetArch parameters to override TargetOS/TargetArchitecture env vars.
eng/pipelines/coreclr/templates/superpmi-collect-job.yml Threads targetOS/targetArch through, and downloads wasm build artifacts for the corelib wasm collection.
eng/pipelines/coreclr/templates/run-superpmi-collect-job.yml Threads target OS/arch through setup, Helix submission, and upload to storage for cross-target collections.
eng/pipelines/coreclr/templates/jit-replay-pipeline.yml Ensures wasm replay builds include clr.wasmjit.
eng/pipelines/coreclr/superpmi-replay-wasm.yml New scheduled pipeline for daily wasm SuperPMI replay (windows_x64).
eng/pipelines/coreclr/superpmi-diffs.yml Ensures diffs pipeline builds include clr.wasmjit.
eng/pipelines/coreclr/superpmi-asmdiffs-checked-release.yml Ensures checked-vs-release asmdiffs pipeline builds include clr.wasmjit.
eng/pipelines/coreclr/jitrollingbuild.yml Ensures rolling build uploads include clr.wasmjit for wasm asmdiffs baselines.

Comment thread src/coreclr/scripts/superpmi_collect_setup.py
Comment thread src/coreclr/scripts/superpmi_replay_setup.py Outdated
Comment thread src/coreclr/scripts/superpmi-collect.proj
@AndyAyersMS
Copy link
Copy Markdown
Member Author

Also need to look into a coredistools update for Wasm. Not sure what that means yet.

Comment thread src/coreclr/scripts/superpmi.py
Copy link
Copy Markdown
Member

@kg kg left a comment

Choose a reason for hiding this comment

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

LGTM other than Copilot's feedback

- Fix help text in superpmi_replay_setup.py: 'Type of diff' -> 'Type of replay'
- Guard TargetArgs in superpmi-collect.proj on TargetOS/TargetArchitecture being non-empty
- Add FIXME comment on JitWasmNyiToR2RUnsupported in superpmi.py

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 28, 2026 18:00
@AndyAyersMS AndyAyersMS force-pushed the WasmSPMICollection branch from 9b14dd3 to 86445e1 Compare May 28, 2026 18:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Comment thread src/coreclr/scripts/superpmi.py Outdated
AndyAyersMS and others added 2 commits May 28, 2026 11:13
Use getattr(args, 'altjit', False) since upload/download subcommands
don't include --altjit in their parser.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 28, 2026 19:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@AndyAyersMS
Copy link
Copy Markdown
Member Author

/ba-g unrelated failures and timeouts

@AndyAyersMS
Copy link
Copy Markdown
Member Author

Going to merge this despite the CI issues. For new PRs it will only impact replay and there won't be a Wasm replay until a new collection is done.

@AndyAyersMS AndyAyersMS merged commit 0f9f5ec into dotnet:main May 29, 2026
151 of 163 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants