Skip to content

Adopt focused exact-member Analysis in AssemblyContextMethodAnalysisQuery #9832

Closed

Description

@richlander

Goal

Move AssemblyContextMethodAnalysisQuery to focused exact-member Analysis
results without wrapping or filtering LibraryBodyAnalysisBuilder.Build.
This is the first consumer-adoption successor beneath the hub drain in #8965.

Prerequisites

Exact adoption

For one operation-subject-associated raw metadata token:

  1. Source admission distinguishes invalid token, valid bodiless method, and
    valid body without table traversal.
  2. Exact-target declaration publishes detached semantic identity.
  3. Direct-call production consumes the one physical EvidenceMethod and the
    Plan method-targeted direct-call populations and move call consumers off LibraryBodyIndex #8945 demand tier required by the query.
  4. Selected-method safety publishes declaration, local, instruction,
    UnsafetyOccurrence, and non-call UnsafeEvidence facts.
  5. Call safety composes typed same-image target resolution with the
    memory-safety contract lookup and normalizes unsafe-call evidence.
  6. The query returns its existing AssemblyMethodAnalysis shape and exception
    regions.

During this first mixed adoption, allocations, optimization opportunities, and
final MethodSignals composition remain explicitly on the old boundary. The
slice claims proportional migrated work, not proportional total query work.

Supported call-target fidelity

Preserve every current same-image resolver shape: MethodDef and peeled
MethodSpec; MemberRef parented by MethodDef, TypeDef, or constructed TypeSpec;
and local, module-alias, or assembly-alias TypeRefs. Cross-assembly callees keep
the current unset unsafe mode. All correspondence and contract-association work
is declared, bounded, and receipted; no target body is acquired.

Required evidence

  • Complete public outcome equivalence for valid, bodiless, and invalid targets.
  • Semantic identity equivalence, direct calls, local/non-call safety, call
    safety, diagnostics, and exception regions.
  • Every supported same-image target shape and property/event inherited unsafe
    contract.
  • Exact selected-body work plus separately receipted correspondence and
    contract-association support.
  • Explicit provenance for retained legacy MethodSignals, allocations, and
    optimization opportunities.
  • Typed rejection outside exact-member admission with no silent fallback.

Retirement action

Update #8965's live drain map with the moved result and consumer. Delete legacy
surface only when its final consumer moves; this first adopter must not claim
that incidental computation inside the still-required old path is retired.

Non-goals

  • Type-wide, predicate-scoped, or unscoped migration.
  • ILOffsetQuery; it is the next adopter after an owner can bind its prefetched
    image without reopening by path.
  • Final MethodSignals, allocation, or optimization producer migration.
  • Total-query performance claims while mixed execution remains.

Refs #7553 #8577 #8700 #8945 #8965 #9830 #9831

Activity

  1. richlander commented on Oct 10, 2026

    @richlander
    OwnerAuthor

    Operator requirement for the first production-caller adoption: include exact base/head NativeAOT performance analysis for the semantic MethodDef identity path. Run accepted measurements on one approved performance host through perf-guard, and publish the evidence before merge readiness. This requirement begins with the first production consumer; prerequisite-only PR #9874 has no production caller to measure.


    Authored with GitHub Copilot CLI.

  2. richlander commented on Oct 13, 2026

    @richlander
    OwnerAuthor

    Claimed for implementation on branch feature/exact-method-analysis from exact main tip 4b3db3bd709198efa56d5b6bf653349c65f2ab5d.

    The first block will reconcile this issue with the landed broader semantic-identity (#9970), memory-safety (#9901), and same-module target (#9938) APIs, then move only the focused AssemblyContextMethodAnalysisQuery result while retaining explicit legacy provenance for signals, allocations, and optimization opportunities. Exact base/head NativeAOT performance through perf-guard remains a merge-readiness gate.


    Authored with GitHub Copilot CLI.

  3. richlander commented on Oct 13, 2026

    @richlander
    OwnerAuthor

    Audit result: this slice is blocked on #9868, so I am releasing the current implementation claim.

    #8945 delivered discovery-native call counts and retained rich DirectCall rows on LibraryCallGraphAnalysisResult; it did not add a Method Query Source Calls layer. The current source has exact-body admission plus semantic identity, same-module target, and memory-safety capabilities, but no owner-issued call/member/field/signature operand population. #9868 explicitly owns that missing layer, including the local-signature and calli facts required by this query’s safety output.

    Implementing #9832 now would duplicate operand/signature decoding or route the new producer through the transitional Library Body Analysis lookup, both forbidden by the normative exact-member migration contract. Resume #9832 after #9868 lands and measure its first production adoption then.

    🤖 Generated with GitHub Copilot CLI

  4. richlander commented on Oct 13, 2026

    @richlander
    OwnerAuthor

    Reclaimed for implementation on branch feature/exact-method-analysis from
    exact main tip bafc7ab38e71bd922c22a62e6126937d78df71f2.

    The released blocker is now resolved: #10031 merged the owner-issued Calls,
    local-signature, field-operand, callee-identity, target, sharing, and receipt
    capabilities required by this production consumer. The implementation will
    resume the focused AssemblyContextMethodAnalysisQuery adoption without
    wrapping or filtering the legacy aggregate, while retaining explicit legacy
    provenance for allocations, optimization opportunities, and final
    MethodSignals.

    Exact base/head NativeAOT production measurements through perf-guard remain a
    merge-readiness gate. #9864 and #9865 are prerequisites for the later
    unsafe-member census, not for this exact-member consumer slice.

    🤖 Generated with GitHub Copilot

  5. richlander commented on Oct 18, 2026

    @richlander
    OwnerAuthor

    Claimed for implementation on branch feature/exact-method-analysis from exact main tip 159b2f3612e2ab045e7f1e98f3089eb923d9e18d.

    Normative owner: docs/design/assembly-analysis-operation.md#exact-member-scoped-producers. This slice will move exact admission, semantic identity, direct calls, safety evidence, diagnostics, and exception regions to owner-issued Method Query Source execution. Final MethodSignals, allocations, and optimization opportunities remain explicitly on LibraryBodyAnalysisService; no broad-builder wrapper, aggregate filtering, or second planner will be introduced.

    Exact base/head NativeAOT evidence through perf-guard remains a merge-readiness gate.

    Authored by GitHub Copilot CLI.

  6. richlander commented on Oct 19, 2026

    @richlander
    OwnerAuthor

    Implementation PR opened at #10275

    Exact candidate: 2751cccee49373b8bcd00d1f21539ae70be0b284. The focused producer now owns identity, direct calls, safety, diagnostics, and exception regions; signals, allocations, and optimization remain explicitly legacy-owned. Exact NativeAOT output parity and performance evidence are recorded in the PR.

    Authored by GitHub Copilot CLI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    architectureComponent boundaries, seams, and layeringdesign

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions