Repository navigation
[browser][CoreCLR] Collect ReadyToRun PGO with indexed schemas - #137491
pavelsavara wants to merge 2 commits into
Conversation
Collect 64-bit IL block profiles through normal JIT instrumentation and preserve distinct intrinsic and interpreter invocation contributions. Resolve indexed R2R schemas to stable counter storage and carry the profiles through EventPipe, MIBC, and partial ReadyToRun consumption. Add publish configuration, schema and compiler regressions, browser round trips, and usage documentation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Design differences from #136860This is a separate implementation on a fresh main baseline. The earlier PR remains unchanged.
The fundamental change is richer execution information, not more precise counting of every logical invocation around exceptions. Reusing JIT instrumentation avoids a separate importer-driven block profiler and accommodates multiple counters per method. IL0 is not inherently an entry counter: it can be a loop backedge target. The consumer therefore reconstructs method-entry flow from the measured graph where possible rather than equating IL0 hotness with invocation count. Synthetic/split compiler blocks do not acquire duplicate IL-block probes. Invocation-only records are still necessary for intrinsic expansions and coarse interpreter execution. They describe omitted-body contributions, not a fabricated complete block profile. A method may legitimately have both kinds of data; the consumer preserves measured branch information while adding invocation contributions. Several foundations are deliberately retained: 64-bit counters, allocation-base-plus-offset addressing, the shared The initial scope remains single-threaded Browser/CoreCLR with diagnostics and original IL. It does not introduce edge probes, histogram collection, or precise exception-flow parity. Training incurs counter-update overhead; these changes do not establish an application-level consumer speedup. Note This comparison was generated with GitHub Copilot assistance. |
Retained MIBC comparison and interpretationCompared the latest successful Release, unfiltered PGO browser runs from the two implementations, decoding both MIBCs with the same current
Coverage and profile size
The compressed profile grows 71.8%, principally because ordinary methods now carry multiple block records instead of one invocation record. Both files remain MIBC format 1.1: the indexed schema table changes the R2R producer's wire format, not the MIBC container format. The current profile contains 7,471 block-only, 598 invocation-only, and 49 mixed method records, plus 81 without counters. Method coverage is nearly unchanged. The display-name sets share 8,187 names, with 11 current-only and 22 previous-only. Each dump also has one repeated display name for a Both have 225 Vector128/PackedSimd-related method records. This comparison does not show a new large set of SIMD roots: the improvement is richer information about already-covered algorithms. For example, These are representative retained runs, not a controlled same-build experiment. Main revisions, test sources, and runtime execution differ. Some set differences are explicitly new/removed scenarios; the remainder cannot all be attributed to instrumentation design. Profile candidates also do not guarantee additional standalone R2R bodies: canonical sharing, eligibility, dependencies, and inlining still determine the output. Concrete counter differences
The new Zero-valued body blocks now express unexecuted paths in the measured body schema, not a guess derived from entry hotness. Invocation-only contributions remain separate:
What the consumer demonstrably changesThe retained consumer listing for However, The practical benefit is measured loop hotness and more constrained branch-flow reconstruction instead of relying only on heuristic internal flow seeded from invocation counts. This is evidence of better profile information and consumption, not a measured application speedup or proof of complete exception/edge-profile parity. Note These comparison notes were generated with GitHub Copilot assistance. |
|
Azure Pipelines: Successfully started running 6 pipeline(s). 9 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
Tagging @dotnet/jit-contrib for JIT-EE GUID update |
|
Tagging subscribers to this area: @dotnet/crossgen-contrib |
|
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara |
Preserve legacy interpreter profiling outside single-threaded Browser, use per-method schema allocation chains, and handle sparse flow inference conservatively when exception exits are not measurable. Include the pending main merge and all local PGO fixes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Superseded by dotnet/runtime#137502. The branch was copied into Note This comment was generated with GitHub Copilot assistance. |
Summary
Enable opt-in PGO collection from published Browser/CoreCLR ReadyToRun applications and consume the resulting MIBC in a subsequent optimized, partial ReadyToRun publish.
Design
PgoInstrumentationSchemasReadyToRun section and an indexedPgoInstrumentationDatafixup. Deterministic, deduplicated schemas describe instrumentation kinds, IL offsets, counts, and aligned byte offsets into counter storage. The ReadyToRun format becomes 34.1.Integration and scope
WasmPgoInstrumentation=allor a MethodSet filter through application and framework ReadyToRun publishing, independently of CPU sampling. Recompile framework images when instrumentation changes and invalidate the corresponding incremental stamps.DOTNET_WasmPgoInstrumentationfor ordinary interpreter collection through the same profiling infrastructure.Tracking: #130521.
Note
This PR description was generated with GitHub Copilot assistance.