Skip to content

[cDAC] Remove vestigial JupiterRefCount from HandleData contract - #130448

Merged
max-charlamb merged 1 commit into
dotnet:mainfrom
max-charlamb:max-charlamb/cdac-remove-jupiterrefcount
Jul 10, 2026
Merged

max-charlamb merged 1 commit into
dotnet:mainfrom
max-charlamb:max-charlamb/cdac-remove-jupiterrefcount

Conversation

@max-charlamb

Copy link
Copy Markdown
Member

Summary

  • Remove the vestigial JupiterRefCount member from the managed cDAC HandleData contract type.
  • Preserve the public SOSHandleData.JupiterRefCount COM ABI field and report it as 0.
  • Keep the DEBUG cDAC-vs-DAC parity assert intact; both implementations continue to expose 0 for this field.

Details

JupiterRefCount represents a dead Windows 8-era WinRT/Jupiter concept. The cDAC contract never populated meaningful data for it, and the legacy DAC also hardcodes this value to 0. This cleanup removes the field from the internal managed contract surface while leaving the shipped COM struct unchanged for compatibility.

Testing

  • build.cmd clr+libs -rc release (after cleaning stale native CMake cache directories)
  • dotnet build src\native\managed\cdac\cdac.slnx -c Debug -m:1
  • dotnet test src\native\managed\cdac\tests\UnitTests\Microsoft.Diagnostics.DataContractReader.Tests.csproj -c Debug --no-build

Note

This PR was generated with the assistance of GitHub Copilot.

Remove the vestigial JupiterRefCount member from the managed cDAC HandleData contract while preserving the SOSHandleData COM field by reporting 0.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: f2aa5dc4-0c99-43f0-af14-734143849c4a
@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

This PR updates the managed cDAC GC handle contract shape by removing the JupiterRefCount member from HandleData, while keeping the COM-facing SOSHandleData.JupiterRefCount field intact (now explicitly reported as 0).

Changes:

  • Removed JupiterRefCount from Microsoft.Diagnostics.DataContractReader.Contracts.HandleData (Abstractions surface).
  • Updated the GC contract implementation (GC_1) to stop initializing HandleData.JupiterRefCount.
  • Updated the legacy SOS DAC COM adapter (SOSDacImpl) to always emit SOSHandleData.JupiterRefCount = 0.

Reviewed changes

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

File Description
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/SOSDacImpl.cs Hardcodes SOSHandleData.JupiterRefCount to 0 when projecting handle data to the COM struct.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/GC/GC_1.cs Removes initialization of the now-deleted HandleData.JupiterRefCount field.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IGC.cs Removes JupiterRefCount from the public HandleData record struct contract.

@max-charlamb
max-charlamb merged commit fdbf6b5 into dotnet:main Jul 10, 2026
85 of 87 checks passed
@max-charlamb
max-charlamb deleted the max-charlamb/cdac-remove-jupiterrefcount branch July 10, 2026 15:32
@@ -644,7 +644,6 @@ private HandleData CreateHandleData(TargetPointer handleAddress, byte uBlock, ui
HandleData handleData = default;
handleData.Handle = handleAddress;
handleData.Type = GetInternalHandleType(type);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This change isn't in the contract documentation. Please fix.

max-charlamb pushed a commit to max-charlamb/runtime that referenced this pull request Jul 10, 2026
PR dotnet#130448 removed the vestigial JupiterRefCount field from the cDAC HandleData
contract, but left the GC data-contract doc pseudocode setting it. Remove the
stale handleData.JupiterRefCount assignment from CreateHandleData. (The COM ABI
struct still exposes the field and reports 0, unchanged.)

Co-authored-by: Copilot <[email protected]>
max-charlamb added a commit that referenced this pull request Jul 10, 2026
…leData changes (#130531)

## Summary
Small docs-only follow-up aligning the cDAC data-contract documentation
with two recently merged changes that updated the contract
implementations but not their docs.

### 1. `RuntimeTypeSystem.md` -- big-RVA offset masking (follow-up to
#130501)
#130501 fixed big-RVA field-offset detection by masking the packed type
bits before comparing `FieldDesc::DWord2` against the
`FIELD_OFFSET_BIG_RVA` sentinel, but left the `GetFieldDescOffset`
pseudocode showing the old unmasked comparison. Updated the pseudocode
to mask the offset out of the packed `DWord2` (27-bit offset + 5-bit
type) before the sentinel check, matching the shipped implementation and
native `FieldDesc::GetOffset`.

### 2. `GC.md` -- `JupiterRefCount` removal (follow-up to #130448)
#130448 removed the vestigial `JupiterRefCount` field from the cDAC
`HandleData` contract, but left the `CreateHandleData` pseudocode
setting it. Removed the stale `handleData.JupiterRefCount = 0;`
assignment. (The COM ABI struct still exposes the field and reports `0`,
unchanged.)

Docs-only change.

---------

Co-authored-by: Max Charlamb <[email protected]>
Co-authored-by: Copilot <[email protected]>
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview7 milestone Jul 11, 2026
eiriktsarpalis pushed a commit that referenced this pull request Jul 15, 2026
…0448)

## Summary

- Remove the vestigial `JupiterRefCount` member from the managed cDAC
`HandleData` contract type.
- Preserve the public `SOSHandleData.JupiterRefCount` COM ABI field and
report it as `0`.
- Keep the DEBUG cDAC-vs-DAC parity assert intact; both implementations
continue to expose `0` for this field.

## Details

`JupiterRefCount` represents a dead Windows 8-era WinRT/Jupiter concept.
The cDAC contract never populated meaningful data for it, and the legacy
DAC also hardcodes this value to `0`. This cleanup removes the field
from the internal managed contract surface while leaving the shipped COM
struct unchanged for compatibility.

## Testing

- `build.cmd clr+libs -rc release` (after cleaning stale native CMake
cache directories)
- `dotnet build src\native\managed\cdac\cdac.slnx -c Debug -m:1`
- `dotnet test
src\native\managed\cdac\tests\UnitTests\Microsoft.Diagnostics.DataContractReader.Tests.csproj
-c Debug --no-build`

> [!NOTE]
> This PR was generated with the assistance of GitHub Copilot.

Co-authored-by: Max Charlamb <[email protected]>
eiriktsarpalis pushed a commit that referenced this pull request Jul 15, 2026
…leData changes (#130531)

## Summary
Small docs-only follow-up aligning the cDAC data-contract documentation
with two recently merged changes that updated the contract
implementations but not their docs.

### 1. `RuntimeTypeSystem.md` -- big-RVA offset masking (follow-up to
#130501)
#130501 fixed big-RVA field-offset detection by masking the packed type
bits before comparing `FieldDesc::DWord2` against the
`FIELD_OFFSET_BIG_RVA` sentinel, but left the `GetFieldDescOffset`
pseudocode showing the old unmasked comparison. Updated the pseudocode
to mask the offset out of the packed `DWord2` (27-bit offset + 5-bit
type) before the sentinel check, matching the shipped implementation and
native `FieldDesc::GetOffset`.

### 2. `GC.md` -- `JupiterRefCount` removal (follow-up to #130448)
#130448 removed the vestigial `JupiterRefCount` field from the cDAC
`HandleData` contract, but left the `CreateHandleData` pseudocode
setting it. Removed the stale `handleData.JupiterRefCount = 0;`
assignment. (The COM ABI struct still exposes the field and reports `0`,
unchanged.)

Docs-only change.

---------

Co-authored-by: Max Charlamb <[email protected]>
Co-authored-by: Copilot <[email protected]>
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants