roslyn icon indicating copy to clipboard operation
roslyn copied to clipboard

Test Plan for Runtime Async

Open 333fred opened this issue 1 year ago • 0 comments

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/pull/80144
  • [ ] analyzer work for RequiresPreviewFeatures (honor attribute on helper APIs)

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)

Async-iterators

  • [ ] codegen https://github.com/dotnet/roslyn/pull/81314
  • [ ] debug info/symbols
  • [ ] EnC

333fred avatar Nov 18 '24 22:11 333fred