Repository navigation
[browser][coreCLR] R2R: Enable PGO instrumentation for the WASM RyuJIT #130521
Description
Activity
- addedarch-wasmWebAssembly architectureWebAssembly architectureos-browserBrowser variant of arch-wasmBrowser variant of arch-wasm
on Jul 10, 2026 dotnet-policy-service commented
on Jul 10, 2026 ContributorMore actionsTagging subscribers to 'arch-wasm': @lewing, @pavelsavara
See info in area-owners.md if you want to be subscribed.- addedarea-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
on Jul 10, 2026 dotnet-policy-service commented
on Jul 10, 2026 ContributorMore actionsTagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.- changed the title
[-][browser][coreCLR] R2R: X2 — Enable PGO instrumentation for the WASM RyuJIT[/-][+][browser][coreCLR] R2R: Enable PGO instrumentation for the WASM RyuJIT[/+]on Jul 10, 2026 For the EventPipe-based PGO producer, the profile records should identify methods (and their blocks) purely by IL-level identity:
- Module MVID — via
LoaderModuleIDon theMethodDetailsevent (→ module signature) - Metadata token —
MethodToken - Generic instantiation —
TypeID/BulkTypefor generic type/method arguments - IL offset — per block-count record (the
BasicBlockIntCountschema entry'sILOffset)
This is exactly what the existing
MethodDetails(event 72) +BulkType(15) +MethodJitInstrumentationDataVerbose(298) events already carry, and it's whatdotnet-pgouses to resolve methods against the reference assemblies (matched by MVID + token). It is engine-independent, so the interpreter producer (#130517) and the RyuJIT producer tracked here emit the same schema and are resolved identically — the only requirement is that--referencepoints at the assemblies whose MVIDs match the trace (on browser/wasm that's the IL-trimmedlinked/*.dll, since ILLink regenerates the MVID and webcil preserves it).This path does not need a PerfMap. PerfMap /
.r2rmapis a native-address → method map used to symbolicate CPU samples; it's a different axis from instrumentation PGO. Because block counts are keyed by MVID + token + IL offset (never by native code addresses), no native symbolication is involved in producing or consuming the.mibc. PerfMap only becomes relevant for the sample-based path (dotnet-pgo --spgo) over R2R-compiled native code, where samples are native addresses that must be mapped back to those same method tokens — but that's out of scope for instrumentation PGO.Note
This comment was generated with GitHub Copilot assistance.
- Module MVID — via
Enable PGO instrumentation for the WASM RyuJIT
Part of #130524.
Status: draft / issue candidate · Area: CoreCLR JIT, PGO, WASM build · Related: #130517 (interpreter PGO producer)
Goal
Bring the full dynamic-profile (PGO) subsystem online for the WebAssembly RyuJIT target, so the JIT on WASM can both produce and consume profile data at parity with the desktop runtime. This is the follow-up that removes the platform limitation #130517 works around, and it is the general enabler for profile-guided precompilation and codegen on WASM.
Because dev-loop/Debug app uses R2R images from runtime pack, this feature would only supported for
publish.Why
PGO (and tiered compilation) are currently disabled for the browser/WASM build, so the shared profile subsystem and the JIT's profiling entry points are absent or stubbed there. As long as that is the case, only a narrow interpreter-only producer (#130517) is possible, and the JIT cannot participate in profiling at all. Enabling the feature is the difference between a one-off prototype path and durable, first-class PGO support on WASM.
Direction
Scope
In: enabling the profile feature in the WASM build configuration; reconciling profiling with the tiering-off reality on WASM; validating the JIT produce/consume round trip on WASM.
Out: interpreter-side counting (that is #130517); precompiled-code packaging and loading; profile-export transport specifics.
Success criteria
Dependencies & relationship to #130517
Open questions
Note
This issue was drafted with GitHub Copilot assistance.