dotnet / dotnet/roslyn

Test Plan for Runtime Async

Open
#75,960 0 comments 16 reactions 2 assignees Claimed by @jcouv View on GitHub
Area-Compilers Feature - Runtime Async
Dominant language
C#
Stars
20.7k
Forks
4.3k
PR merge metrics
PR metrics pending

Description

Test plan for runtime-generated async state machines

Runtime open issues: https://github.com/dotnet/runtime/issues/109632
Runtime specification: https://github.com/dotnet/runtime/blob/main/docs/design/specs/runtime-async.md
Compiler implementation plan: https://github.com/dotnet/roslyn/blob/main/docs/compilers/CSharp/Runtime%20Async%20Design.md

# Included in .NET 10 (feature in preview)
- [x] turning feature on (see `IsRuntimeAsyncEnabledIn`)
- [x] presence of required `AsyncHelpers` APIs in corlib
- [x] honor `RuntimeAsyncMethodGenerationAttribute` attribute for override
- [x] check presence of feature flag `runtime-async=on`
- [x] check for return type
- [ ] codegen for async methods
- [x] set method flag `MethodImplOptions.Async`
- [x] calls optimized with `Await`
- [x] selection of appropriate helper
- [x] calls using `AwaitAwaiter`/`UnsafeAwaitAwaiter`
- [x] `await` in `catch`/`finally`
- [x] `await using`
- [x] `await foreach`
- [x] ref local lifting (https://github.com/dotnet/roslyn/issues/79763)
- methods of validation
- [x] direct IL verification
- [x] verifier (caught some issues, although verification rules not yet updated to understand return value expectations: https://github.com/dotnet/runtime/issues/118042)
- [x] block unsupported scenarios for .NET 10 RC1
- [x] disallow application of `MethodImplOptions.Async` in source
- [x] public APIs
- [x] IOperation (no impact)
- [x] GetAwaitExpressionInfo
- [x] consider removing or downgrading the "no await" warning (related [issue](https://github.com/dotnet/roslyn/issues/77001)) https://github.com/dotnet/roslyn/pull/80144
- [ ] analyzer work for `RequiresPreviewFeatures` (honor attribute on [helper APIs](https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.cs))

# Post-.NET 10
- [ ] PDBs/symbols for debugging (https://github.com/dotnet/roslyn/issues/79793)
- sequence points
- [ ] instrumentation
- [ ] dynamic (https://github.com/dotnet/roslyn/issues/79762)
- [ ] disallow directly calling `MethodImplOptions.Async` methods in some cases?
- [ ] disallow directly calling `AsyncHelpers` helper methods?
- [ ] manual smoke testing of various scenarios (debugging, EE, EnC)
- [x] execution (pending availability of new runtime, https://github.com/dotnet/roslyn/issues/79791)
- [ ] ensure that every async test also covers runtime-async
- [ ] remove `RuntimeAsyncMethodGenerationAttribute` and `DOTNET_RuntimeAsync` once feature is stable
- [ ] replace feature flag with a real switch and make the SDK set it by default
- [ ] use real `MethodImplOptions.Async` flag (https://github.com/dotnet/roslyn/issues/79792)
- [ ] partner validation (driven by runtime team)
- [ ] follow-up on public announcement
- [ ] codegen for async iterator methods ([notes](https://gist.github.com/jcouv/aa5359db1b15522013cf19ef52dcc18f))
- [ ] port fix for https://github.com/dotnet/roslyn/issues/81707 if needed
- [ ] port fix for https://github.com/dotnet/roslyn/issues/81467 if needed
- [ ] handle references in source to this issue

## Async-iterators
### Done
- [ ] codegen https://github.com/dotnet/roslyn/pull/81314

### Undone (PROTOTYPE markers)
- [ ] some doc follow-ups
- [ ] debug info/symbols
- [ ] confirm naming of the state machine method: MoveNext or MoveNextAsync?
- [ ] confirm what attributes should go on certain methods
- [ ] EnC

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.