Skip to content

Feature/cdac contract renumber to v1 - #131855

Merged
noahfalk merged 1 commit into
dotnet:mainfrom
noahfalk:feature/cdac-contract-renumber-to-v1
Aug 6, 2026
Merged

Feature/cdac contract renumber to v1#131855
noahfalk merged 1 commit into
dotnet:mainfrom
noahfalk:feature/cdac-contract-renumber-to-v1

Conversation

@noahfalk

@noahfalk noahfalk commented Aug 5, 2026

Copy link
Copy Markdown
Member

Follow up to #131790 to renumber the contracts starting from 1.

This PR includes all the commits in the previous one. As soon as 131790 gets merged I'll rebase and squash so this becomes a single commit.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 5 pipeline(s).
11 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

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

Renumbers cDAC contracts to start from c1 by folding previously-development-only contract versions into the remaining version(s), updating CoreCLR contract advertisements/registrations, tests, and the authoritative data contract docs accordingly.

Changes:

  • Consolidate PrecodeStubs/ExecutionManager/DebugInfo implementations to c1 and delete superseded versioned implementations/helpers.
  • Update CoreCLR contract registrations/advertisements and align unit/integration tests to the new version set.
  • Refresh docs/design/datacontracts/* specs and descriptor-meaning/override metadata to match the new contract shapes.

Reviewed changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/native/managed/cdac/tools/CdacUsageGraph/tests/CdacUsageGraph.Tests/UsageWalkerIntegrationTests.cs Updates usage-graph integration assertions for renumbered contract versions/fields.
src/native/managed/cdac/tests/UnitTests/PrecodeStubsTests.cs Collapses multi-version PrecodeStubs tests to c1 and updates mock descriptor layout accordingly.
src/native/managed/cdac/tests/UnitTests/MockDescriptors/MockDescriptors.ExecutionManager.cs Removes c2 nibblemap builder selection; c1 now uses the remaining builder.
src/native/managed/cdac/tests/UnitTests/FunctionTableAccessTests.cs Simplifies test matrix to only run against c1.
src/native/managed/cdac/tests/UnitTests/ExecutionManager/NibbleMapTests.cs Removes linear-lookup tests and reorients tests to helpers + constant-lookup behavior.
src/native/managed/cdac/tests/UnitTests/ExecutionManager/NibbleMapTestBuilder.cs Removes the *_2 builder and updates *_1 to emit constant-lookup pointer encoding.
src/native/managed/cdac/tests/UnitTests/ExecutionManager/ExecutionManagerTests.cs Updates version-driven tests to only cover c1.
src/native/managed/cdac/tests/UnitTests/ContractDescriptor/TargetTests.SubDescriptors.cs Adjusts required-contract filtering to work with the new contract->version map.
src/native/managed/cdac/tests/UnitTests/ContractDescriptor/TargetTests.cs Switches required-contract list to a name->version dictionary (keeps StressLog at c2).
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Data/StubPrecodeData.cs Removes StubPrecodeData_1; keeps StubPrecodeData_2 as the sole representation.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Data/PrecodeMachineDescriptor.cs Removes older-version-only fields and standardizes on the newer descriptor set.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/CoreCLRContracts.cs Registers only the remaining contract versions (c1, plus StressLog c2).
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/PrecodeStubs_Common.cs Simplifies the common precode-stubs abstraction by removing the stub-data generic.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/PrecodeStubs_1.cs Moves c1 behavior to the newer precode-type detection + interpreter handling.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/PrecodeStubs_2.cs Deleted (version consolidation).
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/PrecodeStubs_3.cs Deleted (version consolidation).
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/ExecutionManager/Helpers/NibbleMapLinearLookup.cs Deleted (no longer used after consolidation).
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/ExecutionManager/Helpers/NibbleMapConstantLookup.cs Updated comments; remains the nibblemap algorithm used by c1.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/ExecutionManager/ExecutionManager_1.cs Switches c1 to use NibbleMapConstantLookup.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/ExecutionManager/ExecutionManager_2.cs Deleted (version consolidation).
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/DebugInfo/DebugInfo_1.cs Consolidates DebugInfo behavior to the newer header/chunk decoding and APIs.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/DebugInfo/DebugInfo_2.cs Deleted (version consolidation).
src/coreclr/vm/datadescriptor/datadescriptor.inc Updates advertised contract versions to match the new c1 set (StressLog stays c2).
docs/design/datacontracts/PrecodeStubs.md Updates the authoritative PrecodeStubs spec to the consolidated c1 shape/algorithm.
docs/design/datacontracts/ExecutionManager.md Updates nibblemap documentation to describe the constant-lookup algorithm as c1.
docs/design/datacontracts/DebugInfo.md Updates DebugInfo spec to a single c1 description (fat/slim header, vars, async).
docs/design/datacontracts/data-descriptor-overrides.json Removes now-unneeded suppressions for retired contract versions.
docs/design/datacontracts/data-descriptor-meanings.json Removes version-qualified phrasing and updates meanings to match consolidated contracts.
Suppressed comments (1)

src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/PrecodeStubs_1.cs:82

  • TryGetKnownPrecodeType returns KnownPrecodeType.DynamicHelper here, but PrecodeStubsCommon.GetPrecodeFromEntryPoint() doesn't handle DynamicHelper (or UMEntry) and will throw InvalidOperationException if GetMethodDescFromStubAddress is called for such a precode. Either implement handling for these precode types in PrecodeStubsCommon (and provide GetMethodDesc behavior), or avoid reporting them as "known" until they are supported.
            else if (precodeMachineDescriptor.DynamicHelperPrecodeType is byte compareByte5 && compareByte5 == exactPrecodeType)
            {
                return KnownPrecodeType.DynamicHelper;
            }

A previous PR removed some unneeded contract versions that got created during .NET 11 development.
This followup change renumbers so that the contract versions start at 1 for consistency.
Copilot AI review requested due to automatic review settings August 5, 2026 21:20
@noahfalk
noahfalk force-pushed the feature/cdac-contract-renumber-to-v1 branch from 63bf45a to a5b6f10 Compare August 5, 2026 21:20
@noahfalk
noahfalk marked this pull request as ready for review August 5, 2026 21:22
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 5 pipeline(s).
11 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

Copilot reviewed 16 out of 16 changed files in this pull request and generated no new comments.

@noahfalk
noahfalk enabled auto-merge (squash) August 5, 2026 22:26
@noahfalk
noahfalk merged commit 367f831 into dotnet:main Aug 6, 2026
139 of 141 checks passed
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.

4 participants