Skip to content

Avoid text PGO input/output on interpreter-only runtimes - #137402

Merged
davidwrighton merged 1 commit into
dotnet:mainfrom
davidwrighton:RemoveTextPgoDataOnInterpreterPlatforms
Nov 12, 2026
Merged

davidwrighton merged 1 commit into
dotnet:mainfrom
davidwrighton:RemoveTextPgoDataOnInterpreterPlatforms

Conversation

@davidwrighton

Copy link
Copy Markdown
Member

Summary

Avoid rooting the legacy text PGO reader and writer on interpreter-only runtimes by guarding their startup/shutdown calls with FEATURE_DYNAMIC_CODE_COMPILED. Text profile consumption is a native JIT optimization path, not an interpreter compilation path.

Keep text input/output on JIT-capable builds, including when those builds run in interpreter mode. Move shutdown EventPipe logging outside the text writer so it remains independent of text export. Interpreter method/loop counters and threadless EventPipe session-stop export are unchanged.

This is a standalone change to pgo.cpp; it contains no interpreter callback interface changes.

Native size

Matching browser-wasm Release builds on the standalone base (491df16a213), measuring corerun.wasm:

Baseline Changed Saved
Raw bytes 4,406,307 4,392,972 13,335
Brotli quality 11 bytes 1,319,455 1,313,771 5,684

The text writer's *** START PGO Data marker is present in the baseline module and absent from the changed module.

Validation

  • Standalone browser build: ./build.sh clr.runtime+clr.hosts -os browser -arch wasm -c Release /p:RuntimeFlavor=CoreCLR passed before and after the change.
  • Standalone Wasm JIT.CodeGenBringUpTests_r.dll, hosted by the resulting corerun.js with DOTNET_InterpPGO=1: 8 tests passed; expected managed exit code 100.
  • Additional JIT-capable Linux x64 Debug build: ./build.sh clr.runtime+clr.hosts -c Debug /p:FeatureInterpreter=true /p:FeatureDynamicCodeCompiled=true passed. This reused the original callback branch's existing build with identical pgo.cpp changes, rather than the standalone worktree.
  • That Linux runtime passed 9 bring-up tests in normal JIT mode and 9 with DOTNET_InterpMode=3 DOTNET_InterpPGO=1 DOTNET_WritePGOData=1. Both returned 100; the latter also produced a nonempty text profile containing 2,820 method records.
  • git diff --check passed.

Apple/WASI execution and end-to-end EventPipe trace collection were not run.

Note

This pull request was prepared with GitHub Copilot.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 0450a1a5-696d-455f-8288-4924e23b62d7
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 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.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

@davidwrighton
davidwrighton marked this pull request as ready for review November 12, 2026 17:10
@davidwrighton
davidwrighton merged commit 73134cb into dotnet:main Nov 12, 2026
101 of 103 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants