Add PerfMap OS/arch constants for wasm and wasi targets - #132693
Draft
pavelsavara wants to merge 1 commit into
Draft
Add PerfMap OS/arch constants for wasm and wasi targets#132693pavelsavara wants to merge 1 commit into
pavelsavara wants to merge 1 commit into
Conversation
Crossgen2 R2R compilation for browser-wasm and wasi-wasm targets threw System.NotImplementedException from PerfMapWriter.TranslateTargetDetailsToPerfmapConstants because PerfMapOSToken had no Browser/Wasi members and PerfMapArchitectureToken had no Wasm member, so the switch expressions hit their throwing default arms when PublishReadyToRunPerfmapFormatVersion was set. Add Browser/Wasi to PerfMapOSToken, Wasm to PerfMapArchitectureToken, map the corresponding TargetOS/TargetArchitecture values, and update the r2r-perfmap-format doc to match (also filling in the already-shipped OpenBSD/RiscV64/LoongArch64 rows). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 4 pipeline(s). 12 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds missing PerfMap v1 target OS/architecture tokens and wiring so Crossgen2 ReadyToRun perfmap emission can support WebAssembly targets (Browser/WASI) without falling into the “unknown target” throwing paths. Also updates the design doc to reflect the expanded token sets.
Changes:
- Extend
PerfMapOSTokenwithBrowser/WasiandPerfMapArchitectureTokenwithWasm. - Map
TargetOS.Browser/TargetOS.WasiandTargetArchitecture.Wasm32to the new tokens inPerfMapWriter. - Update
r2r-perfmap-format.mdto include the current token tables.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/coreclr/tools/aot/ILCompiler.Diagnostics/ReadyToRunDiagnosticsConstants.cs | Adds new perfmap OS/arch enum values used as the on-disk perfmap contract. |
| src/coreclr/tools/aot/ILCompiler.Diagnostics/PerfMapWriter.cs | Extends target-to-token translation to cover Browser/WASI and Wasm32. |
| docs/design/coreclr/botr/r2r-perfmap-format.md | Documents the updated token values for perfmap v1 headers. |
pavelsavara
marked this pull request as draft
August 24, 2026 16:43
lewing
approved these changes
Aug 24, 2026
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.
Summary
Crossgen2 ReadyToRun compilation for
browser-wasmandwasi-wasmtargets threwSystem.NotImplementedExceptionfromPerfMapWriter.TranslateTargetDetailsToPerfmapConstantswhenPublishReadyToRunPerfmapFormatVersionwas set.PerfMapOSTokenhad noBrowser/Wasimembers andPerfMapArchitectureTokenhad noWasmmember, so theswitchexpressions fell through to their throwing default arms.Observed stack:
Changes
Browser = 8andWasi = 9toPerfMapOSToken, andWasm = 7toPerfMapArchitectureToken(appended after the highest existing value to preserve the numeric contract consumed by symbol-upload / PerfView tooling).TargetOS.Browser/TargetOS.WasiandTargetArchitecture.Wasm32in thePerfMapWriterswitches.docs/design/coreclr/botr/r2r-perfmap-format.mdto match, also filling in the already-shippedOpenBSD/RiscV64/LoongArch64rows that were missing from the doc.Validation
ILCompiler.Diagnostics(Release) — clean.PublishReadyToRunPerfmapFormatVersion = 1— theCreateReadyToRunImagestarget now runs with 0 errors where it previously threw.Note
This PR description and the code changes were generated with the assistance of GitHub Copilot.