Conversation
Expose WebAssembly ReadyToRun virtual IP ranges through the runtime data descriptor and resolve them before the RangeSectionMap. Mask funclet flags and keep virtual code identity separate from loaded-image RVA reads. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 5 pipeline(s). 11 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: @steveisok, @tommcdon, @dotnet/dotnet-diag |
Contributor
|
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara |
Handle feature-gated hot/cold metadata, isolate candidate module validation during registration, and remove the unsupported virtual-IP list length limit. Match WASM descriptor layouts and cover long lists, partial registration, and root/funclet image metadata. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Allow up to 65,536 nodes while retaining full-list ambiguity and cycle checks. Reject an over-budget chain before reading its next node, even after a match. Document the budget as reader policy and cover exact-budget success, budget+1 rejection, and the read boundary with a compact fixture. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
lewing
marked this pull request as ready for review
September 15, 2026 00:33
|
Azure Pipelines: Successfully started running 5 pipeline(s). 11 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.
Copilot review overview
🔵 Needs a closer look
The changes require final human review because they are too complex or risky for automated approval.
Review tier: Lite
Findings: None
What changed in this PR
Fixes cDAC WebAssembly ReadyToRun virtual-IP resolution to match the runtime’s intrusive-list model and descriptor layout.
Changes:
- Adds virtual-IP range-list descriptors and bounded, cycle-safe lookup.
- Separates virtual code bases from loaded-image bases and masks WASM funclet flags.
- Adds extensive WASM-shaped mocks and regression tests.
| File | Description |
|---|---|
| src/native/managed/cdac/tests/UnitTests/WasmR2RInfoTests.cs | Updated as part of this pull request. |
| src/native/managed/cdac/tests/UnitTests/MockDescriptors/MockDescriptors.ExecutionManager.cs | Updated as part of this pull request. |
| src/native/managed/cdac/tests/UnitTests/ExecutionManager/ExecutionManagerTests.cs | Updated as part of this pull request. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/DataType.cs | Updated as part of this pull request. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Data/VirtualIPRangeSection.cs | Updated as part of this pull request. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Data/ReadyToRunInfo.cs | Updated as part of this pull request. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/StackWalk/Context/Wasm/WasmR2RInfo.cs | Updated as part of this pull request. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/ExecutionManager/Helpers/UnwindDataSize.cs | Updated as part of this pull request. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/ExecutionManager/Helpers/RuntimeFunctionLookup.cs | Updated as part of this pull request. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/ExecutionManager/ExecutionManagerCore.ReadyToRunJitManager.cs | Updated as part of this pull request. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/ExecutionManager/ExecutionManagerCore.cs | Updated as part of this pull request. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Constants.cs | Updated as part of this pull request. |
| src/coreclr/vm/datadescriptor/datadescriptor.inc | Updated as part of this pull request. |
| src/coreclr/vm/codeman.h | Updated as part of this pull request. |
| docs/design/datacontracts/ExecutionManager.md | Updated as part of this pull request. |
| docs/design/datacontracts/data-descriptor-meanings.json | Updated as part of this pull request. |
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
Fix cDAC live resolution of WebAssembly ReadyToRun virtual IPs by matching the runtime's existing lookup model:
ExecutionManager::s_pVirtualIPRangeListandVirtualIPRangeSectionthrough the data descriptor;RUNTIME_FUNCTION.BeginAddressfor ordering and address arithmetic while preserving funclet identity;MinVirtualIP) separate from the loaded-image base used for unwind, debug, GC, exception, and thunk RVA reads;Root cause
The model added in #130988 was already false when that PR merged. On
TARGET_WASM, ReadyToRun modules are not added toRangeSectionMap;ReadyToRunInfo::RegisterVirtualIPRangeregisters them inExecutionManager::s_pVirtualIPRangeList, and nativeFindCodeRangechecks that list first.The prior unit test synthesized a
RangeSectionMapentry with an address that did not satisfy nativeIsVirtualIP, so it validated a mock-only model rather than the live runtime layout. This is a test-model gap, not a reviewer fault. The prior review explicitly noted that the WebAssembly specifics had not been run locally and should be added to cDAC CI: #130988 (review).Blast radius and scope
This affects ReadyToRun code on all CoreCLR WebAssembly hosts, including browser and WASI. Interpreter code is unaffected.
The list lookup, descriptor feature gating, funclet masking, and image-base separation are inseparable: exposing the list alone would still throw while reading absent WASM fields, or could return the wrong method or read RVA data from the synthetic virtual address space.
This PR is independent of #133086 and intentionally excludes variable producer/decoder work. #133890 depends on this PR for correct shared code lookup and function identity.
Validation
./build.sh clr+libs+hostPATH="/opt/homebrew/bin:$PATH" ./build.sh -os browser -c Debug -subset clr+libsThe durable tests cover:
0x80010109, exactMethodDesc, module, and runtime-function index;RUNTIME_FUNCTIONrecords with noEndAddress, and absent hot/cold and delay-load thunk fields;RangeSectionMapfallback;MinVirtualIP;Mutation proofs were applied, confirmed in source, run red, restored, and rerun green:
0x80010109test at the exact code-block assertion.BeginAddressfails the funclet identity test.startVIPas the loaded-image base fails the GC/unwind test with a read at0x80010081instead of the loaded image.The finite list cutoff is an intentional diagnostic-reader resource policy, not a native registration limit or a claim that an over-budget list is corrupt.
Note
This pull request description was generated with GitHub Copilot.