Repository navigation
Add a test harness, caching pins, and a baseline benchmark for the V2 generator (S1) - #8525
Merged
Merged
Conversation
This was referenced Sep 9, 2026
Aaronontheweb
added this pull request to stack #8531
September 9, 2026 01:53
This was referenced Sep 9, 2026
Merged
Aaronontheweb
force-pushed
the
feature/serialization-v2-generator-harness
branch
from
September 9, 2026 13:31
18f1728 to
217e16f
Compare
Aaronontheweb
force-pushed
the
feature/serialization-v2-generator-harness
branch
from
September 9, 2026 17:14
217e16f to
f51e528
Compare
…lity scenarios, baseline benchmark Sets up the test infrastructure for the generator architecture pass: promotes the pipeline's cached models to internal, adds a shared GeneratorTestHarness that builds the metadata reference set once per process instead of once per test, migrates the diagnostics and cross-assembly specs onto it, adds a ParseMessageForTests entry point plus a Verify snapshot of the golden corpus's extracted models, pins today's incrementality behavior across five edit scenarios, adds reflection-based structural guards over the model types, and adds a baseline BenchmarkDotNet suite for the generator's incremental driver.
Aaronontheweb
force-pushed
the
feature/serialization-v2-generator-harness
branch
from
September 9, 2026 18:08
f51e528 to
28e6987
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
Nothing in what the generator emits. This PR adds the tools the later steps are measured with. The only edits to the generator project make twelve model classes
internalinstead ofprivateand add a 48-line entry point that runs the existing extraction code, so tests can call it without a compiler driver.What it adds
Tests/Harness/GeneratorTestHarness.csbuilds the set of referenced assemblies once per test process and offers three calls: run the generator, compile a helper assembly to reference, and run the generator twice across an edit. It reports which pipeline steps ran and why. The diagnostics and cross-assembly test files moved onto it without changing any test name or assertion. The diagnostics tests went from about 10 seconds to about 2.Akka.Benchmarks/Serialization/SourceGeneratorBenchmarks.csbuilds a synthetic project of 5 serializers with 100 messages each and measures a cold run plus three kinds of edit on a warm generator, with the memory diagnoser on.Baseline numbers
Two things stand out. Renaming one field costs more than a cold run, because the generator re-extracts every type and then regenerates every file as well. An edit that changes nothing still costs most of a cold run, because Roslyn re-runs the per-type step on any change and only the later collect step reuses a cached result.
Pinned scenarios, today
S3 targets the rename row. S5 targets the no-change rows. S6 targets locations.
How it was checked
278 tests pass. Generator builds with warnings as errors.
Akka.Benchmarksbuilds. No golden or wire snapshot changed.