Skip to content

Rename runtime-async contract types and methods to follow framework guidelines#124097

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/update-async-helpers-names
Draft

Rename runtime-async contract types and methods to follow framework guidelines#124097
Copilot wants to merge 4 commits intomainfrom
copilot/update-async-helpers-names

Conversation

Copy link
Contributor

Copilot AI commented Feb 6, 2026

Description

Runtime-async contract types and methods become immutable once baked into ReadyToRun images. The original names were implementation-focused and unclear for a public-facing contract.

Changes

Renamed three core runtime-async contract elements across C#, C++, and IL generation code:

  • ExecutionAndSyncBlockStoreAsyncContextsSnapshot

    • Clarifies purpose: captures execution/synchronization context state at suspension points
    • Removes misleading "SyncBlock" term (distinct CLR concept)
    • Uses plural "Contexts" to reflect capturing multiple context types (ExecutionContext and SynchronizationContext)
  • FinalizeTaskReturningThunk[<T>]CreateAsyncMethodTask[<T>]

    • FinalizeValueTaskReturningThunk[<T>]CreateAsyncMethodValueTask[<T>]
    • Describes action: creates Task wrapper for suspended async method
    • "Create" semantics match framework patterns (cf. Task.FromResult)
  • CompletedTask(Result)ValidateCompletedTask / GetCompletedTaskResult<T>

    • Distinguishes validation from retrieval operations
    • Aligns with awaiter GetResult() pattern

Updated references in:

  • AsyncHelpers.CoreCLR.cs (managed implementations)
  • corelib.h (VM type/method definitions)
  • asyncthunks.cpp (thunk generation)
  • AsyncThunks.cs (NativeAOT IL stubs)
Original prompt

This section details on the original issue you should resolve

<issue_title>Names of types and methods that are part of the runtime-async contract should be updated according to framework guidelines.</issue_title>
<issue_description>These types and methods are basically set in stone once they become part of ReadyToRun images. We should update the names to be more clear and descriptive as if they are public framework APIs.

Most of these are in AsyncHelpers. For example, ExecutionAndSyncBlockStore, FinalizeTaskReturningThunk, and AsyncHelpers.CompletedTask aren't great names or don't make sense.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Feb 6, 2026
Copilot AI and others added 2 commits February 6, 2026 18:35
- Renamed ExecutionAndSyncBlockStore to ExecutionContextSnapshot
- Renamed FinalizeTaskReturningThunk/FinalizeValueTaskReturningThunk to CreateAsyncMethodTask/CreateAsyncMethodValueTask
- Renamed CompletedTask to ValidateCompletedTask
- Renamed CompletedTaskResult to GetCompletedTaskResult
- Updated all references in C#, C++, and TypeSystem code

Co-authored-by: agocke <515774+agocke@users.noreply.github.com>
Update METHOD definitions to reference EXECUTIONCONTEXTSNAPSHOT instead of EXECUTIONANDSYNCBLOCKSTORE

Co-authored-by: agocke <515774+agocke@users.noreply.github.com>
Copilot AI changed the title [WIP] Update types and methods in AsyncHelpers for clarity Rename runtime-async contract types and methods to follow framework guidelines Feb 6, 2026
Copilot AI requested a review from agocke February 6, 2026 19:00
@jakobbotsch
Copy link
Member

@copilot Rename ExecutionContextSnapshot to AsyncContextsSnapshot

Updated all references across C#, C++, and TypeSystem code per reviewer feedback

Co-authored-by: jakobbotsch <7887810+jakobbotsch@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 6, 2026

@copilot Rename ExecutionContextSnapshot to AsyncContextsSnapshot

Done in 0ba297b

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

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Names of types and methods that are part of the runtime-async contract should be updated according to framework guidelines.

4 participants