Skip to content

runtime-async#649

Merged
tom-englert merged 15 commits intomasterfrom
#648_try_runtime-async
Apr 21, 2026
Merged

runtime-async#649
tom-englert merged 15 commits intomasterfrom
#648_try_runtime-async

Conversation

@tom-englert
Copy link
Copy Markdown
Member

@tom-englert tom-englert commented Mar 2, 2026

Support the new runtime-async feature of DotNet11

@tom-englert tom-englert force-pushed the #648_try_runtime-async branch from d4b6d2c to 0a0124a Compare March 2, 2026 12:26
@tom-englert tom-englert force-pushed the #648_try_runtime-async branch from ae62411 to fab8dd5 Compare April 12, 2026 11:12
@tom-englert tom-englert marked this pull request as ready for review April 12, 2026 14:26
Copilot AI review requested due to automatic review settings April 12, 2026 14:26
Copy link
Copy Markdown

Copilot AI left a comment

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 introduces an initial experiment to evaluate .NET 11 “runtime-async” output and updates the ConfigureAwait weaver + test suite to handle the new compiler/runtime async pattern (AsyncHelpers-based) alongside existing state-machine rewriting.

Changes:

  • Multi-target AssemblyToProcess and Tests to net10.0 + net11.0, enabling preview/runtime-async features for net11.0.
  • Extend the weaver to detect/handle “compiler service” async (runtime-async) by rewriting System.Runtime.CompilerServices.AsyncHelpers.Await(...) call sites.
  • Update/expand tests and verified IL baselines to cover ValueTask/runtime-async scenarios; update package versions and CI SDK installation.

Reviewed changes

Copilot reviewed 34 out of 35 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
Tests/xunit.runner.json Disables xUnit parallelization for more deterministic runs.
Tests/Tests.csproj Adds net10.0/net11.0, upgrades test packages, copies runner config.
Tests/ModuleWeaverTests.DecompileIssue1.Debug.DotNet.verified.txt Updates verified IL baseline for new output/runtime changes.
Tests/ModuleWeaverTests.DecompileGenericMethod.Debug.DotNet.verified.txt Updates verified IL baseline reflecting runtime-async patterns.
Tests/ModuleWeaverTests.DecompileGenericClass.Debug.DotNet.verified.txt Updates verified IL baseline reflecting runtime-async/ValueTask changes.
Tests/ModuleWeaverTests.DecompileExample.Debug.Net.verified.txt Updates verified IL baseline (Configured* awaiters, etc.).
Tests/ModuleWeaverTests.DecompileCatchAndFinally.Debug.Net.verified.txt Updates verified IL baseline (Configured* awaiters, etc.).
Tests/ModuleWeaverTests.DecompileCatchAndFinally.Debug.DotNet.verified.txt Updates verified IL baseline reflecting runtime-async patterns.
Tests/ModuleWeaverTests.cs Adjusts test bootstrap for updated xUnit/Fody APIs.
Tests/MethodWithUsing.cs Adds ValueTask variant test under #if NET.
Tests/MethodWithAttributeTests.cs Adds ValueTask variant test under #if NET.
Tests/DoNotWeaveTests.cs Adds ValueTask variant coverage under #if NET.
Tests/ClassWithAttributeTests.cs Adds ValueTask variant coverage under #if NET.
Tests/CatchAndFinallyTests.cs New test coverage for Catch/Finally scenarios + ValueTask variants.
global.json Removes SDK pinning.
Directory.Build.props Sets C# LangVersion to 13 and keeps common build settings.
ConfigureAwait/ConfigureAwait.csproj Bumps Fody/FodyPackaging versions.
ConfigureAwait.sln.DotSettings Updates user dictionary entries (IDE settings).
ConfigureAwait.Fody/ModuleWeaver.cs Adds runtime-async processing path and tightens method redirection rules.
ConfigureAwait.Fody/ModuleWeaver_TypeFinder.cs Renames/refocuses type discovery to runtime-related types.
ConfigureAwait.Fody/ModuleWeaver_CompilerServices.cs New IL rewriting for AsyncHelpers.Await(...)-based async (runtime-async).
ConfigureAwait.Fody/ConfigureAwait.Fody.csproj Bumps FodyHelpers version.
ConfigureAwait.Fody/CecilExtensions.cs Adds runtime-async detection helpers + refactors attribute checks.
AssemblyToProcess/MethodWithUsing.cs Expands conditional compilation from NETCOREAPP2_0 to NET.
AssemblyToProcess/MethodWithAttribute.cs Expands conditional compilation from NETCOREAPP2_0 to NET.
AssemblyToProcess/Issue1.cs Updates ValueTask + nullable string usage for ReadLineAsync.
AssemblyToProcess/GenericIssue.cs Expands conditional compilation from NETCOREAPP2_0 to NET.
AssemblyToProcess/FlagSynchronizationContext.cs Formatting change (single-line base type).
AssemblyToProcess/Example.cs Expands conditional compilation from NETCOREAPP2_0 to NET.
AssemblyToProcess/DoNotWeave.cs Uses a non-trivial async path to avoid optimizations; adds helper Return10.
AssemblyToProcess/ClassWithAttribute.cs Uses a non-trivial async path to avoid optimizations; adds helper Return10.
AssemblyToProcess/CatchAndFinally.cs Expands conditional compilation from NETCOREAPP2_0 to NET and adds ValueTask methods.
AssemblyToProcess/AssemblyToProcess.csproj Adds net10.0/net11.0; enables preview/runtime-async feature flags for net11.0.
appveyor.yml Installs .NET 10 + .NET 11 preview SDKs explicitly (no global.json).
Comments suppressed due to low confidence (1)

AssemblyToProcess/CatchAndFinally.cs:83

  • The methods inside the #if NET block are indented an extra level compared to the rest of the class, which makes the file hard to read and looks accidental. Align the indentation of these method declarations with the other members in the class.
#if NET
        public async Task Catch1_WithValueTask()
        {
            try
            {

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ConfigureAwait.Fody/ModuleWeaver.cs Outdated
Comment thread ConfigureAwait.Fody/ModuleWeaver_CompilerServices.cs Outdated
Comment thread Tests/Tests.csproj
@tom-englert tom-englert requested a review from Copilot April 12, 2026 14:42
@tom-englert tom-englert changed the title Try runtime-async runtime-async Apr 12, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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

Comments suppressed due to low confidence (1)

AssemblyToProcess/CatchAndFinally.cs:83

  • The #if NET block is indented as if it were nested, but it’s at class scope. This inconsistent indentation makes the file harder to read and can obscure brace/region structure; align these method declarations with the rest of the class members.
#if NET
        public async Task Catch1_WithValueTask()
        {
            try
            {

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Directory.Build.props Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Tests/Tests.csproj
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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

Comments suppressed due to low confidence (1)

AssemblyToProcess/CatchAndFinally.cs:90

  • Inside the #if NET region, the method declarations are indented by an extra level compared to the rest of the class, which makes the file inconsistent and harder to scan. Align the indentation of the NET-only methods with the surrounding methods in the class.
#if NET
        public async Task Catch1_WithValueTask()
        {
            try
            {
                throw new NotImplementedException();
            }
            catch
            {
                await new ValueTask(Task.Delay(1));
            }
        }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread appveyor.yml
@tom-englert tom-englert merged commit 31e61a8 into master Apr 21, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants