Skip to content

[WIP] [cDAC] Expose ilc descriptors for cdac - #132304

Closed
rcj1 wants to merge 2 commits into
dotnet:mainfrom
rcj1:expose-aot-internal-descriptors
Closed

[WIP] [cDAC] Expose ilc descriptors for cdac#132304
rcj1 wants to merge 2 commits into
dotnet:mainfrom
rcj1:expose-aot-internal-descriptors

Conversation

@rcj1

@rcj1 rcj1 commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Expose some internals to the descriptor.

Copilot AI lite review requested due to automatic review settings August 14, 2026 05:08
@azure-pipelines

Copy link
Copy Markdown
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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the NativeAOT/ILC managed cDAC descriptor generation so that additional “layout-only” types (not necessarily having an emitted EEType/MethodTable) can be included in the JSON descriptor, and adds a small test to validate that thread-static related descriptor types are produced.

Changes:

  • Add a mechanism (IDataDescriptorTypeProvider + MetadataManager tracking) for dependency graph nodes to register additional managed descriptor types.
  • Extend ManagedDataDescriptorNode descriptor emission to include the registered descriptor types (with [DataContract] enforcement).
  • Add NativeAOT runtime structs (TypeManagerSlot, TypeThreadStaticIndex) annotated with [DataContract], and add a unit test validating their emitted layout.
Show a summary per file
File Description
src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj Adds friend access for compiler tests; includes new interface source file.
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/MetadataManager.cs Tracks and exposes registered descriptor types via Graph_NewMarkedNode.
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ManagedDataDescriptorProvider.cs Updates doc comment describing how descriptor types are discovered.
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/TypeThreadStaticIndexNode.cs Registers TypeThreadStaticIndex layout type for descriptor emission.
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/TypeManagerIndirectionNode.cs Registers TypeManagerSlot layout type for descriptor emission.
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/NodeFactory.cs Ensures MetadataManager subscribes to graph marking early enough to observe roots.
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ManagedDataDescriptorNode.cs Emits registered descriptor types into the JSON descriptor; exposes helper for tests.
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/IDataDescriptorTypeProvider.cs New internal interface used by nodes to supply descriptor types.
src/coreclr/tools/aot/ILCompiler.Compiler.Tests/ILCompiler.Compiler.Tests.Assets/DependencyGraph.cs Adds a new asset test case and custom attribute for asserting descriptor types.
src/coreclr/tools/aot/ILCompiler.Compiler.Tests/DependencyGraphTests.cs Adds validation that registered descriptor types appear in the emitted JSON descriptor.
src/coreclr/nativeaot/Test.CoreLib/src/Test.CoreLib.csproj Ensures DataContractAttribute is available in Test.CoreLib for compilation/tests.
src/coreclr/nativeaot/Common/src/Internal/Runtime/CompilerHelpers/StartupCodeHelpers.cs Introduces [DataContract]-annotated runtime structs matching ILC-emitted layouts.

Review details

  • Files reviewed: 12/12 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment on lines +10 to +11
/// The node discovers [DataContract]-annotated runtime types and layouts registered by
/// ILC object nodes during object data emission.
class ThreadStaticDataDescriptorTest
{
[ThreadStatic]
public static object Value = null;
Copilot AI review requested due to automatic review settings August 14, 2026 16:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Note

This error may be related to your runner configuration. You can now configure runners for Copilot code review separately from Copilot cloud agent by creating a copilot-code-review.yml file with your setup steps. Read the docs for details.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants