Repository navigation
Skip generating and retaining stripped ReadyToRun debug info - #137037
Merged
davidwrighton merged 2 commits intoNov 6, 2026
Merged
Conversation
Only request JIT debug information when it will be emitted. Skip copying and serializing stripped location and variable records while preserving native buffer ownership and NativeAOT behavior. Cover stripped and retained output, optimized and unoptimized compilation, empty callbacks, and Checked JIT debug-generation flags. Co-authored-by: Copilot <[email protected]> Copilot-Session: dd2ba419-783f-41d0-a638-82f3fbde9ea9
|
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. |
Contributor
|
Tagging subscribers to this area: @dotnet/crossgen-contrib |
jkotas
reviewed
Nov 5, 2026
jkotas
reviewed
Nov 5, 2026
Remove the redundant publishing guard, assert the JIT callback invariant, and drop the reflection-based callback test. Co-authored-by: Copilot <[email protected]> Copilot-Session: dd6ed1f7-f085-4a84-9769-9cc1fab81e69
jkotas
approved these changes
Nov 5, 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
When
--strip-debug-infois selected, crossgen2 currently still asks the JIT to generate debug information, copies the native location/variable records, and serializes them before discarding the debug-info table.Skip that unused work:
CORJIT_FLAG_DEBUG_INFOonly when debug information will be emitted. KeepCORJIT_FLAG_DEBUG_CODEindependent so unoptimized compilation retains its existing behavior.Tests cover stripped/retained output, optimized/unoptimized compilation, empty/nonempty JIT callbacks, and the actual debug-generation flags reported by a Checked JIT. The existing Wasm output test also gains a stripped-debug-info case.
Validation
Linux x64, based on
0894f48862a:./build.sh clr+libs+host -rc checked -lc release- clean baseline passed, zero warnings/errors../build.sh -s clr.r2rtests -test -rc checked -lc release '/p:XUnitMethodName=*DebugInfo*'- before the product change, the runner executed the full suite despite the requested filter: 206 total, 187 passed, 15 skipped, and exactly four expected new regression failures. The failures were the two stripped debug-generation cases and the two stripped callback-copy cases../build.sh -s clr.r2rtests -test -rc checked -lc release- changed compiler built successfully; 206 total, 191 passed, 15 skipped, zero failures, zero build warnings/errors. All 12 new theory cases ran and passed../dotnet.sh build src/coreclr/tools/aot/ILCompiler.RyuJit/ILCompiler.RyuJit.csproj -c Checked- passed, zero warnings/errors, checking the shared source's NativeAOT configuration.git diff --check- passed.Browser/Wasm execution, Windows, and other target architectures were not run locally; the Wasm-specific test is among the conditional skips.
Compiler-cost diagnostic
Compared the baseline and changed Checked crossgen2 builds compiling the same fresh CoreLib IL and references with
--optimize --parallelism 4 --targetos linux --targetarch x64, with and without--strip-debug-info. Linux/WSL2, Intel Core i7-7800X, 12 logical CPUs. Five fresh processes per build/configuration after discarding one warmup each, alternating baseline/changed order; no concurrent builds. These are end-to-end compiler measurements, not BenchmarkDotNet results or a statistical-significance claim.This sample does not demonstrate a peak-memory improvement: stripped peak RSS was higher, with individual runs ranging from 448,300 to 494,212 KiB on baseline and 452,284 to 514,664 KiB with the change. The allocation-skipping tests verify the removed copies directly; process-level RSS remains variable.
All compiler invocations succeeded. Outputs were byte-for-byte identical between baseline and changed builds in each configuration: 13,900,800 bytes stripped and 15,115,264 bytes retained.
Note
This pull request was prepared with GitHub Copilot.