-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Quality Week] Improve quality of Crossgen2 testing, most notably in context of library tests #74681
Comments
/cc @dotnet/crossgen-contrib, @davidwrighton, @AntonLapounov, @jkotas, @jkoritzinsky, @ViktorHofer, @danmoseley, @stephentoub, @agocke. Just for visibility I'm also /cc-ing @SamMonoRT even though at this point I'm not aware of any particular Mono impact of this work. |
Related to (precursor issue): #50127 |
Cc @LakshanF since moving where we AOT compile crossgen2 is similar to AOT compiling ILC that Lakshan has been looking at. |
I think we may be able to have a relatively minor variation to our test build and setup. In particular, I think the following approaches may be viable:
I do not yet have a strategy for how to run crossgen2 on the actual libraries tests. I think we may just want to run crossgen2 directly before sending to helix. |
Thanks David, that is an interesting direction - while using the packs-produced Crossgen2 (and framework) for local CoreCLR / libraries testing may be challenging due to the build ordering issues, for lab testing it's a no-concern as we have all the dependencies readily available. On the other hand, generally speaking we should strive to keep most lab chores reproducible locally for the purpose of bug investigation i.o.w. once we start running crossgenned library tests in the lab, we should have at least a non-trivial recipe for doing the same thing locally. By non-trivial I mean that e.g. developers will newly need to build the packs along with clr+libs prior to running tests to make this work, otherwise in 99% of cases running the "raw" Crossgen2 should yield the same result as using the "nuget"-one and for normal developer innerloop that should be typically sufficient. |
I agree that one needs to be able to replicate the lab testing locally. It does not need to be as efficient as dev inner loop, it is fine to require building the whole repo for that. In general, I think we should be making stronger distinction between dev inner loop where a dev iterates on a specific component or a specific test, and lab testing where we want to run all tests as efficiently as possible in number of configuration, including configurations that are identical to installed product. |
Yes. For instance, we could easily have another flag to the build script for the |
Adding a new option to |
The bigger question is about running the libraries tests with official bits, and crossgening the libraries tests themselves. @danmoseley, do you have someone who we could talk to about various options around the libraries tests? |
While I made the speculative syntax |
In a way it's an interesting question whether, if we decide to add support for using the nuget framework for runtime testing, it makes any sense to keep the pre-existing logic of custom crossgenning of the framework using R2RTest - my gut feeling is that two different versions of R2R framework would do more harm than good and we should just use the one we ultimately ship. |
And David's question for Dan made me realize that we can already start actually building up an ordering of tasks:
|
@ViktorHofer is a great person to include for discussion of libraries test execution. |
When single file testing was added for the libraries, the approach that was chosen was to do the end user flow: inject Of course one needs to mess with thing a little bit to make it use the live built bits, but going through the E2E workflow provides additional testing for the build targets, constructing the command line to invoke the compiler, etc. |
@MichalStrehovsky that sounds good. Can you point me at the logic for doing that, or the PR which introduced that testing? |
The meat is in the tests.singlefile.targets file I linked, but the PRs are #42972 for single file testing and #63781 for NativeAOT testing. |
@MichalStrehovsky is talking about self-contained testing which is the more prominent mode these days. Back in the 2.0 days, it was mostly framework dependent testing as features that made self-contained deployment more useful link the linker integration, single-file, crossgen2, nativeAOT, etc. didn't exist. Our testhost folder is a fake representation to make testing framework dependent apps possible. With the rising popularity of self-contained deployment modes, I think that we should prefer self-contained over framework-dependent for new workloads like this one. Some thoughts from my side:
If you need any further help from my side please let me know. Ideally this is just about flipping the already exposed crossgen2 switch and making sure that tests are submitted in self-contained deployment mode to helix. |
#75230 contributes the basic ability to run the library tests under R2R, we'll need some follow on to enable testing in the lab. We may also need to implement a selection of various crossgen2 modes (composite, cross-module inlining enabled, etc) |
This is a work item that will certainly improve our Crossgen2 testing coverage. It's been almost a year though since this issue in particular was touched and commented on. So, I would like to ask for an overall rundown of the current status of things, so I can get an idea on where I need to start :) |
Moving the milestone to .NET 9 so that it doesn't appear to be blocking RC1 fork, infra work is generally orthogonal to shipping schedule. |
I just reread through all the conversation in this thread and I think we're still mostly following the design proposed initially. Here's the plan of action I've devised and would like to share and hear everyone's thoughts.
|
We publish crossgen2 as a self-contained app during the build that is native AOT compiled where supported. Why can't you use that? It should be faster and it would have better fidelity with how customers run crossgen. |
Can you explain where this self-contained crossgen2 is and how do we build it? |
It is built by publish target in src/coreclr/tools/aot/crossgen2/crossgen2.csproj project. It gets built to artifacts\bin\coreclr\windows.x64.Release\crossgen2\win-x64\publish. In regular build, the publish target is invoked from under src/installer. |
@ivdiazsa - am I right to believe that your PR introducing library testing using Crossgen2 has been merged in and this issue can be closed? Please correct me if I'm wrong. As Crossgen2 is moving under your new team led by Steve Pfister, I'm trying to slightly simplify matters for him by going over the Crossgen2 backlog and closing obsolete issues. |
@trylek Yes I think we can close this issue now. All related stuff has been either merged or is being tracked elsewhere in more highlighted places |
Over the course of 2 years since we shipped the first preview of Crossgen2 we have identified several testing gaps that bit us in various phases of development. We would like to at least create an action plan how to address them and ideally implement at least part of the work in context of the Core Runtime team Quality Weeks.
The problem
Library testing in the runtime repo doesn't target Crossgen2 at all, neither for compiling the framework nor the individual test apps.
While CoreCLR does implement Crossgen2 testing, it does so using a raw freshly built Crossgen2, not the NativeAOT-compiled package we ship to customers. Ideally we should test what customers are using both in CoreCLR and in library testing.
Implementing support for Crossgen2 in the library tests would let us expand testing in directions that weren't previously possible - e.g. testing of the new feature of "speculative" cross-version inlining - that would have very limited coverage in many of the tiny runtime tests.
Overall approach
To address these issues, we're broadly thinking about the following:
Somehow restructuring the runtime build so that both CoreCLR and library testing can leverage the "final" Crossgen2 produced as part of packs.product.
Modifying src\tests\build.proj to publish the customer Crossgen2 to CORE_ROOT for the purpose of CoreCLR testing.
Modifying library build scripts to provide more flexibility regarding framework and / or test compilation using Crossgen2 and passing additional flags to Crossgen2.
Open issues
The proposed build restructuring goes largely against the current build pipeline (build clr + libs, then the packs). We need to figure out something that doesn't place additional burden on runtime developers (too many new switches or steps) and doesn't substantially regress local innerloop (runtime build perf)
At this point it's unclear to me whether library testing with Crossgenned framework should also just grab the pack-produced framework package or basically duplicate the step (perhaps by just calling into the already existing SDK target).
The text was updated successfully, but these errors were encountered: