Skip to content

Upgrade track to .NET 11 - #2500

Open
BNAndras wants to merge 7 commits into
exercism:mainfrom
BNAndras:dotnet11
Open

BNAndras wants to merge 7 commits into
exercism:mainfrom
BNAndras:dotnet11

Conversation

@BNAndras

Copy link
Copy Markdown
Member

Don't merge until exercism/csharp-test-runner#329 is merged and the test runner is also on .NET 11

@github-actions

Copy link
Copy Markdown
Contributor

This PR touches files which potentially affect the outcome of the tests of an exercise. This will cause all students' solutions to affected exercises to be re-tested.

If this PR does not affect the result of the test (or, for example, adds an edge case that is not worth rerunning all tests for), please add the following to the merge-commit message which will stops student's tests from re-running. Please copy-paste to avoid typos.

[no important files changed]

For more information, refer to the documentation. If you are unsure whether to add the message or not, please ping @exercism/maintainers-admin in a comment. Thank you!

@BNAndras

Copy link
Copy Markdown
Member Author

interest-is-interesting fails, and I think it's because of this change in .NET 11 regarding float and decimal conversions. I think it would be cleaner to update the test suite in a separate targeted PR and then rebase this PR when it's merged. That way, we can update the test suite without rerunning all solutions across the entire track.

@ErikSchierboom

Copy link
Copy Markdown
Member

@exercism-agent could you check to see what performance benefit this or has?

@exercism-agent

Copy link
Copy Markdown

@ErikSchierboom Once the runner is on .NET 11, runs are 10 to 13% faster with a warm cache and about 3% faster with a cold one. That needs exercism/csharp-test-runner#329 rebuilt on current main, though. As it stands, #329 is based on main from before exercism/csharp-test-runner#330, so it has no fast path and runs are about 7x slower.

I ran all 186 example solutions on a test box set up like the production machines. The first row is the current production image. The other two rows are a .NET 11 runner built on main, running the track as it is on main and with the project files from #2500.

Image Warm median Warm mean Warm p95 Cold median Cold p95
Production (.NET 10) 1.64s 1.74s 2.20s 4.59s 6.09s
.NET 11, track on main 1.43s 1.53s 1.95s 4.43s 5.52s
.NET 11, track with #2500 1.47s 1.58s 2.27s 4.45s 5.51s
#329 as it is (38 of the solutions) 11.4s 11.7s 13.8s 16.4s 18.6s

Every test result and message was the same on all four images. The .NET 11 image is 1.65 GB, against 1.46 GB for the production image.

Rebuilding #329 on main needs these changes:

  1. Bump Microsoft.CodeAnalysis.CSharp from 5.9.0 to 5.12.0. The .NET 11 SDK compiles with /langversion:15.0, and 5.9.0 rejects it. Without the bump, every run will fall back to MSBuild and take about 11s.
  2. Rewrite both net9.0 and net10.0 to net11.0 in Rewriter.cs. This replaces the TestSuite.cs change. Also change net10.0 to net11.0 in Options.cs and InMemoryCompiledTestRunner.cs.
  3. Regenerate shapes/ with bin/generate-shapes.cs (changed to map to net11.0) from a track checkout that includes Upgrade track to .NET 11 #2500. This adds 8 shapes for the new project files, so there are 24 in all.
  4. Install the three new packages in the Dockerfile, as Implement Collatz Conjecture #329 already does.

#2500 can only be merged after this is deployed. Today's runner fails every net11.0 project with NETSDK1045.

I have these changes as a branch on top of main. Let me know if you would like me to push them to #329 or open a separate PR.

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