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

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.

CopilotAI 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
FileDescription
src/native/managed/cdac/tools/CdacUsageGraph/tests/CdacUsageGraph.Tests/UsageWalkerIntegrationTests.csUpdates usage-graph integration assertions for renumbered contract versions/fields.
src/native/managed/cdac/tests/UnitTests/PrecodeStubsTests.csCollapses multi-version PrecodeStubs tests to c1 and updates mock descriptor layout accordingly.
src/native/managed/cdac/tests/UnitTests/MockDescriptors/MockDescriptors.ExecutionManager.csRemoves c2 nibblemap builder selection; c1 now uses the remaining builder.
src/native/managed/cdac/tests/UnitTests/FunctionTableAccessTests.csSimplifies test matrix to only run against c1.
src/native/managed/cdac/tests/UnitTests/ExecutionManager/NibbleMapTests.csRemoves linear-lookup tests and reorients tests to helpers + constant-lookup behavior.
src/native/managed/cdac/tests/UnitTests/ExecutionManager/NibbleMapTestBuilder.csRemoves the *_2 builder and updates *_1 to emit constant-lookup pointer encoding.
src/native/managed/cdac/tests/UnitTests/ExecutionManager/ExecutionManagerTests.csUpdates version-driven tests to only cover c1.
src/native/managed/cdac/tests/UnitTests/ContractDescriptor/TargetTests.SubDescriptors.csAdjusts required-contract filtering to work with the new contract->version map.
src/native/managed/cdac/tests/UnitTests/ContractDescriptor/TargetTests.csSwitches required-contract list to a name->version dictionary (keeps StressLog at c2).
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Data/StubPrecodeData.csRemoves StubPrecodeData_1; keeps StubPrecodeData_2 as the sole representation.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Data/PrecodeMachineDescriptor.csRemoves older-version-only fields and standardizes on the newer descriptor set.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/CoreCLRContracts.csRegisters only the remaining contract versions (c1, plus StressLog c2).
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/PrecodeStubs_Common.csSimplifies the common precode-stubs abstraction by removing the stub-data generic.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/PrecodeStubs_1.csMoves c1 behavior to the newer precode-type detection + interpreter handling.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/PrecodeStubs_2.csDeleted (version consolidation).
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/PrecodeStubs_3.csDeleted (version consolidation).
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/ExecutionManager/Helpers/NibbleMapLinearLookup.csDeleted (no longer used after consolidation).
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/ExecutionManager/Helpers/NibbleMapConstantLookup.csUpdated comments; remains the nibblemap algorithm used by c1.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/ExecutionManager/ExecutionManager_1.csSwitches c1 to use NibbleMapConstantLookup.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/ExecutionManager/ExecutionManager_2.csDeleted (version consolidation).
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/DebugInfo/DebugInfo_1.csConsolidates DebugInfo behavior to the newer header/chunk decoding and APIs.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/DebugInfo/DebugInfo_2.csDeleted (version consolidation).
src/coreclr/vm/datadescriptor/datadescriptor.incUpdates advertised contract versions to match the new c1 set (StressLog stays c2).
docs/design/datacontracts/PrecodeStubs.mdUpdates the authoritative PrecodeStubs spec to the consolidated c1 shape/algorithm.
docs/design/datacontracts/ExecutionManager.mdUpdates nibblemap documentation to describe the constant-lookup algorithm as c1.
docs/design/datacontracts/DebugInfo.mdUpdates DebugInfo spec to a single c1 description (fat/slim header, vars, async).
docs/design/datacontracts/data-descriptor-overrides.jsonRemoves now-unneeded suppressions for retired contract versions.
docs/design/datacontracts/data-descriptor-meanings.jsonRemoves 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.
CopilotAI review requested due to automatic review settings August 5, 2026 21:20
@noahfalk
noahfalkforce-pushed the feature/cdac-contract-renumber-to-v1 branch from 63bf45a to a5b6f10CompareAugust 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.

CopilotAI 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:mainAug 6, 2026
139 of 141 checks passed
@dotnet-milestone-botdotnet-milestone-botBot added this to the 11.0-rc1 milestone Aug 7, 2026
Sign up for freeto 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

@noahfalk@hoyosjs@max-charlamb