Skip to content

Acquire type-loading completion flags in MethodTable and TypeDesc - #135180

Merged
jkotas merged 3 commits into
mainfrom
copilot/resolve-null-inherited-dictionaries
Oct 5, 2026
Merged

jkotas merged 3 commits into
mainfrom
copilot/resolve-null-inherited-dictionaries

Conversation

Copilot AI commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Plain readiness reads can observe completed type loading before its payload writes on Arm64, allowing a child type to retain null inherited dictionary pointers.

  • MethodTable: Centralize an acquire snapshot using VolatileLoad for GetLoadLevel, IsFullyLoaded, and HasApproxParent.
  • TypeDesc: Use an acquire snapshot for GetLoadLevel and IsFullyLoaded, with one flags read per load-level query.
  • Scope: Preserve interlocked writers, flag values, layouts, and loader locking. No new tests.

@azure-pipelines

azure-pipelines Bot commented Oct 4, 2026 •

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.

Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix concurrent generic type loading issue on Arm64 Acquire type-loading completion flags in MethodTable and TypeDesc Oct 4, 2026
Copilot AI requested a review from jkotas October 4, 2026 03:25
Comment thread src/coreclr/vm/methodtable.h Outdated
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Copilot AI requested a review from jkotas October 4, 2026 03:59
@jkotas
jkotas marked this pull request as ready for review October 4, 2026 04:22
@jkotas
jkotas requested a balanced review from Copilot October 4, 2026 04:22

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 review overview

🔵 Needs a closer look

The low-level concurrency fix appears sound but lacks targeted validation on weakly ordered architectures.

Review effort: Balanced
Findings: None

What changed in this PR

Adds acquire semantics to CoreCLR type-loading completion checks, preventing stale payload reads on weakly ordered architectures.

Changes:

  • Uses VolatileLoad for MethodTable readiness flags.
  • Applies equivalent semantics to TypeDesc.
  • Reuses one acquired snapshot per load-level query.
File Description
src/​coreclr/​vm/​methodtable.h Acquires MethodTable loading flags.
src/​coreclr/​vm/​typedesc.h Acquires fully-loaded state.
src/​coreclr/​vm/​typedesc.cpp Acquires one load-level snapshot.

@jkotas
jkotas merged commit dd39def into main Oct 5, 2026
110 of 112 checks passed
@jkotas
jkotas deleted the copilot/resolve-null-inherited-dictionaries branch October 5, 2026 20:23
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Oct 6, 2026
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.

Concurrent generic type loading can leave inherited dictionaries null on Arm64

4 participants