Repository navigation
Delete the Library Body Analysis infrastructure #9959
Description
Goal
Delete the Library Body Analysis infrastructure: every LibraryBody* type, LibraryMethodAnalysisRunner, and MethodDefinitionMap in src/ILInspector.Analysis, plus docs/design/library-body-analysis-service.md. This follows the deletion of LibraryBodyIndex (#9307).
Why Library Body Analysis is retired gives the reasons:
- its cost follows the assembly, not the question;
- its results don't decompose;
- its hubs are closed;
- its receipt can't prove scope.
Role map says where each of its roles moves.
Relation to existing trackers
- Retire Library Body Analysis producer hubs through Assembly Analysis Operation #8965 retires the producer hubs through Assembly Analysis Operation and keeps the live drain map. This issue doesn't duplicate that map.
- This issue owns the endpoint: the inventory of what still depends on the infrastructure, and the final deletion.
- Producer planning: declared producers, fused execution, LibraryBodyIndex retirement #8568 owns Producer Planning and the broader retirement program.
Remaining dependencies (main at 813406e7f)
Production and tool consumers of LibraryBodyAnalysisService (24 files)
- CLI:
Commands/ILOffsetQuery.csInspectors/MethodBodyInspectionSession.cs
- Queries:
AssemblyContextCallGraphAnalysisAssemblyContextImplementationProfileFamilyQueryAssemblyContextImplementationProfilesQueryAssemblyContextMethodAnalysisQuery(Adopt focused exact-member Analysis in AssemblyContextMethodAnalysisQuery #9832)AssemblyContextOptimizationOpportunitiesQueryAssemblyContextResourceTriageQueryAssemblyContextTypeImplementationHeatQueryAssemblyContextTypeMethodLeverageQueryAssemblyPairClusterRootPathQueryMemberCallGraphSession
- Research queries:
AssemblyContextImplementationDiffQueryAssemblyContextLibraryDependencyStructureQueryAssemblyContextLibraryMetricsQueryAssemblyContextResearchProjectionQueriesDirectMemberComparisonQuery
- Sections:
LibraryAddressInspectionOperation - Research:
MemberProjectionProducerResearchDiffResearchDiff.BodySignals
- Tools:
ILInspector.Analysis.App/Program.csILInspector.TypeScriptGeneration/JsExportSurfaceLoader.csrunfaster/Program.cs
Repository tools under tools/ (added at bafc7ab38)
The first inventory listed only src/ consumers. These tools also build on the infrastructure. Each must either move to the new stack or be deleted; neither may keep Library Body Analysis alive.
AnalysisHarness(12 files):AllocationMetadataReadout.csAnalysisFixtureRunner.csBodyUseScorecardKernel.cs, which usesLibraryBodyAnalysisBuilder,LibraryMethodAnalysisRunner, and theLibraryBodyUse*serviceCallerLoopCensus.csCorpusSensor.csDeferredCallbackCensus.csImplementationMetricPerformance.csLeakActionabilitySensor.csMemberBodySizeScorecard.cs, which also usesLibraryMethodAnalysisRunnerPrecisionRecall.csRecursiveTraversalCensus.csREADME.md
AddressTerminalScorecard/Program.csCatalogCallGraphScorecard/Program.csOwnershipIncidenceScorecard/Program.csDecompilerHarness/AnnotationCheck.cs, plus three corpus baselines that nameLibraryBody*typesAnalysisLibraryBodyUseAdmissionBenchmark(Program.csandREADME.md)
Tests that name these types (about 125 files across 8 test projects, most in ILInspector.Analysis.Tests) move or are deleted with the code they cover; they are not tracked one by one here.
Method Query Source's own dependencies on the legacy runner and builder
The owner-issued source still borrows the legacy machinery internally. These dependencies must go too, or a consumer that has "moved" still runs Library Body Analysis code:
- Module lookup is the legacy runner.
MethodDefinitionView.Lookupis aLibraryMethodAnalysisRunner.MethodDefinitionExecutionbuilds aLibraryBodyAnalysisBuilderper lane to obtain it, andMethodDefinitionPredicates,MethodRowGate, andMethodDefinitionProducersread through it. It needs an owner-issued module-lookup support. - Unsafe evidence presence probes through
LibraryMethodAnalysisRunner.ProbeUnsafeDeclarationandProbeUnsafeBody. This is inherited from the consolidated Unsafe work, and must agree with the census (Make Analysis memory-safety evidence model-aware #5254). - Generated-body expansion delegates discovery and authentication to
LibraryBodyDeclaredSourceResolver,LibraryBodyAsyncSourceResolver, andLibraryBodyLiftedSourceOwnerResolver. Publish the declared-source relation over all-definition and exact-type breadth #9864 moves them out ofLibraryBody*into a focused declared-source owner, and grounds state-machine identity and roles inStateMachineRelationshipIndex. Library Body Analysis then consumes the new owner until it is deleted. - Runner reads:
AsyncSiblingProducer,MethodCallCountProducer, andAnalysisLibraryBodyUsealso read through the runner.
Infrastructure files (35)
- The hub:
LibraryBodyAnalysisServiceLibraryBodyAnalysisExecutionLibraryBodyAnalysisBuilder(5 files)LibraryBodyAnalysisAccumulatorLibraryBodyAnalysisFeaturesLibraryBodyAnalysisPlanLibraryBodyAnalysisRequestLibraryBodyAnalysisResultLibraryBodyAnalysisStageParticipationLibraryMethodAnalysisRunner(3 files)MethodDefinitionMap, which is now a subclass of the sharedSameModuleMethodResolver(Receipt same-module call-target support as a Method Query Source capability #9938)
- Classifiers and resolvers that hold reusable judgment:
- async-sibling (5 files)
- declared, async, and lifted source resolvers
- exception type, generated provenance, generic constraint, and stable receiver getter classifiers
- method, primary, and reference metadata resolvers
- module identity
- root paths
- TypeDef resolution
Each reusable piece either moves to its focused owner under a name without LibraryBody, as SameModuleMethodResolver did, or is deleted with its last caller. It never stays behind as a dependency of the new stack.
Done when
- No type named
LibraryBody*,LibraryMethodAnalysisRunner, orMethodDefinitionMapremains insrc/. src/ILInspector.Analysis/Planning/references none of them.library-body-analysis-service.mdis deleted, and AAO's migration section, including the Role map, is reduced to history or removed. Its focused result semantics move to their owner documents first.
🤖 Generated with Claude Code
Activity
Move the declared-source resolvers out of Library Body Analysis (#10203)