Repository navigation
Publish semantic MethodDef identity from Method Query Source - #9970
Merged
Merged
Conversation
Add the SemanticIdentity layer: per-method depth that publishes a MethodDef's detached structural identity, decoded once per physical MethodDef, shared across lanes, and receipted. MethodSemanticIdentityReader becomes the single owner of identity decoding; Library Body Analysis builds its MethodIdentity through it. An observing TypeRefDecoder counts decode work without changing results. Refs #9830 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Give the shared semantic-identity reader its own unreadable-metadata filter instead of borrowing LibraryMethodAnalysisRunner's, so the new owner has no dependency on Library Body Analysis. Refs #9830 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tity-shared-reader
Owner
Author
Round 1 reconciliation (head
|
This was referenced Oct 12, 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
Refs #9830. This is prerequisite 3 of 6 for the unsafe member census on Assembly Analysis Operation (#5254). The census keys each finding by the declared member's
MethodIdentity(Unsafe member findings). The exact-member consumer in #9832 needs the same identity.This PR adds a
SemanticIdentitylayer to Method Query Source: per-method depth that publishes a MethodDef's detached structural identity.One owner, two sources.
MethodSemanticIdentityReadertakes over identity decoding fromLibraryBodyPrimaryMetadataResolver. Library Body Analysis now builds itsMethodIdentitythrough it, so the two paths can't diverge. This follows the patternSameModuleMethodResolverset in #9938.Supersedes #9874, which publishes semantic identity only for exact-MethodDef plans, through a second decoder in
MethodRowGate. The census needs library and type scope. This PR serves every breadth and moves identity decoding out of Library Body Analysis instead of adding a copy beside it.Normative owner:
docs/design/method-query-source.md#semantic-identity.What the layer publishes
MethodSemanticIdentityhas every structural field ofMethodIdentityexceptCallerUnsafeMode:TypeRef;ToMethodIdentity(mode)composes it with a caller-unsafe mode from the separately declaredMemorySafetyContractssupport (#9831). That dependency stays visible in the declaration and the receipts.The result is typed:
DecodedSignatureBoundExceededMethodIdentityis today.MalformedThe layer:
ModuleLookup;IdentityTextbudget;MethodSemanticIdentityCoveragereceipts:The work is counted with a new observe-only mode of
TypeRefDecoder, which counts work without changing how it decodes.Evidence
Parity:
MethodQuerySource_SemanticIdentityMatchesLibraryBodyAnalysiscovers every MethodDef in:The source issues Library Body Analysis's
MethodIdentityfor every method it publishes, andMalformedfor every other. A shape check confirms the subjects include extension, generic, nested-type, bodiless, and virtual-dispatch methods.Synthetic cases: each
SameModuleTarget_*case now also asserts identity parity. New cases:SignatureBoundExceeded;Malformedoutcome, which Library Body Analysis omits.Receipt and boundary gates:
Suites (Release):
Performance
NativeAOT linux-x64 on
perf-2underperf-guard(CPU 96.90% idle), 2026-10-12T21:20:12Z–21:30:12Z, 25 interleaved samples per side after 3 warm-ups. Base is38cba3206(main) and head isa1df36faa. Binary size: 147,622,912 → 147,614,784 bytes (−8,128).No production producer declares
SemanticIdentityyet. Both sections build aMethodIdentityfor every method through Library Body Analysis, which now goes through the shared reader.Every difference is within noise. The layer's own cost will be measured when the census adopts it.
Review
a1df36faa. Four non-blocking observations carry forward to the census slice:Non-claims
IdentityText:MethodRowIdentitytext and anchors are unchanged.🤖 Generated with Claude Code