You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Crossgen2 uses a private tokenType marker while resolving static virtual interface calls. Since getCallInfo receives the resolved token as input, mutating the caller's token causes SuperPMI to record a different lookup key after the call completes.
Copy the resolved token before applying Crossgen2's internal bookkeeping and use the copy throughout getCallInfo.
Validation:
Browser/wasm CoreLib collection: GetCallInfo replay failures reduced from 1,089 to zero.
Windows x64 CoreLib Crossgen2 collection replayed clean.
Note
This pull request was created with GitHub Copilot.
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a Crossgen2 correctness issue where getCallInfo (which conceptually treats the resolved token as an input) was mutating the caller-provided CORINFO_RESOLVED_TOKEN as a side effect of internal constraint-resolution bookkeeping, causing SuperPMI to record an inconsistent lookup key after the call.
Changes:
Copy pResolvedToken into a local resolvedToken at the start of getCallInfo.
Route internal calls that may observe/modify token bookkeeping (ceeInfoGetCallInfo and subsequent ComputeMethodWithToken uses) through the copied token, preventing mutation from leaking to the caller.
Crossgen2 was mutating a CORINFO_RESOLVED_TOKEN input. This mutation was never seen by the JIT, but was captured by SPMI, leading to a key mismatch on replay.
Note these 1000+ contexts with failures were filtered out during SPMI collection's cleanup phase, so we never would see them in the downloaded file.
The reason will be displayed to describe this comment to others. Learn more.
The fix makes sense to me, but I'm wondering why this case only comes up on Wasm?
EDIT: I guess it isn't specific to Wasm since I see you mentioned Windows x64 CoreLib as validation too.
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
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.
Crossgen2 uses a private
tokenTypemarker while resolving static virtual interface calls. SincegetCallInforeceives the resolved token as input, mutating the caller's token causes SuperPMI to record a different lookup key after the call completes.Copy the resolved token before applying Crossgen2's internal bookkeeping and use the copy throughout
getCallInfo.Validation:
GetCallInforeplay failures reduced from 1,089 to zero.Note
This pull request was created with GitHub Copilot.