Skip to content
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

Add JIT stress mode testing using libraries tests #36486

Merged
merged 6 commits into from
Jun 16, 2020

Conversation

BruceForstall
Copy link
Member

@BruceForstall BruceForstall commented May 15, 2020

Add JIT stress mode testing using libraries tests

There are three separate pipelines, with different sets of JIT
stress modes enabled for each:

  • libraries-jitstress.yml
  • libraries-jitstress2-jitstressregs.yml
  • libraries-jitstressregs.yml

The live built Release libraries are used with a Checked CoreCLR.

The non-stress configuration is tested during normal PR testing.

The libraries sendtohelix.proj file is changed to take an optional
list of CoreCLR stress scenarios to run. If given, a set of environment
setting scripts is created and added to the Helix correlation payload.
Then, an auxiliary sendtohelixhelp.proj file is invoked for each
scenario (or just the default, empty scenario) to create and run the
Helix tasks.

Remove remnants of old corefx-on-coreclr test run infrastructure.

Disable tests:
src/libraries/System.Numerics.Vectors/tests/Matrix3x2Tests.cs
#36587
Matrix3x2CreateRotationCenterTest()

#36587
Matrix3x2CreateScaleCenterTest1()

#36587
Matrix3x2CreateScaleCenterTest3()

src/libraries/System.Numerics.Vectors/tests/Matrix4x4Tests.cs
#36586
Matrix4x4CreateFromAxisAngleTest()

@ghost
Copy link

ghost commented May 15, 2020

Tagging subscribers to this area: @ViktorHofer
Notify danmosemsft if you want to be subscribed.

@ViktorHofer
Copy link
Member

Would be nice if we could get rid of the corefx and replace it with libraries there.

@BruceForstall
Copy link
Member Author

@safern @ViktorHofer This PR will enable 3 new AzDO pipelines to test checked CoreCLR with various stress modes against the libraries test assets. Because these haven't been run in 6-9 months, there are some test failures. How should I disable these failing tests temporarily? Based on https://github.com/dotnet/runtime/blob/master/docs/workflow/testing/libraries/filtering-tests.md it looks like I should annotate the failing tests with something like [ActiveIssue("https://github.com/dotnet/runtime/issues/33993")], but that will disable it for all runs, not just JIT stress mode runs. That seems ok, but maybe there is something more specific I should use?

@safern
Copy link
Member

safern commented May 16, 2020

We should use SkipOnCoreClrAttribute that one has support for adding a string with an issue and also to disable on specific stress scenarios.

@BruceForstall BruceForstall force-pushed the LibrariesTestsForCoreClr branch from 3ae4eef to 652cc75 Compare May 17, 2020 19:36
@BruceForstall
Copy link
Member Author

Would be nice if we could get rid of the corefx and replace it with libraries there.

I're renamed the pipelines. I'd like to rename the files as a separate PR that only does the rename.

@BruceForstall BruceForstall marked this pull request as ready for review May 18, 2020 02:29
@BruceForstall
Copy link
Member Author

This is ready to be reviewed. I've triggered the pipelines, and they all seem to work as expected. I've had to up the timeout. I don't know if that's because I can't create/submit the helix jobs all at once due to a Helix synchronization issue, or if the jobs just take a long time. There are still some test failures that I need to repro and disable, if possible, especially on arm/arm64.

@BruceForstall BruceForstall requested a review from jashook May 18, 2020 02:32
<_Scenarios Include="$(_Scenarios.Split(','))" />

<!-- MSBuild creates a new instance of the project for each %(_Scenarios.Identity) and can build them in parallel. -->
<_ProjectsToBuild Include="$(MSBuildProjectFile)">
Copy link
Member

Choose a reason for hiding this comment

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

Why not instead use sendtohelix.proj? that way we don't have to duplicate all the helix targets and properties?

Copy link
Member

Choose a reason for hiding this comment

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

I would want to avoid so much duplication of the code as, as we move and add more features we would need to maintain both this projects (for example to add more helix data to kusto info, or other stuff).

Copy link
Member Author

Choose a reason for hiding this comment

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

The issue is that my new sendtohelix-scenarios.proj is quite a bit more complicated than the existing sendtohelix.proj. So I did it as-is to avoid perturbing (and potentially breaking) the existing queues, at least while I was doing development,

I can certainly make everyone use my new system, and have the existing pipelines use a default or empty scenario list. This would require more testing (maybe drastically more testing) to ensure existing pipelines aren't broken.

Copy link
Member

Choose a reason for hiding this comment

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

I didn't mean augmenting sendtohelix.proj -- I meant, calling into sendtohelix.proj from sendtohelix-scenarios.proj.

So basically sendtohelix-scenarios does the fan out of the scenarios and expands into sendtohelix.proj foreach scenario present. Then that way we avoid much duplication.

Then stuff specific to multiple scenarios like env vars and stuff like that, we could put it in a targets file and import that file when scenario is not null in sendtohelix.proj. Does that makes it easier/cleaner?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll look into this; I've thought before about whether that would be easier, but was following the previous model (this same basic code exists in the coreclr sendtohelix equivalent).

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, but now that we share the same sources, I think it makes sense to avoid duplication and this brings a lot of duplication, like the targets to zip the testhost and to build the helix workitems, etc.

@jashook
Copy link
Contributor

jashook commented May 19, 2020

/cc @naricc

@@ -0,0 +1,34 @@
parameters:
Copy link
Member

@safern safern May 19, 2020

Choose a reason for hiding this comment

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

I don't think we should introduce a new template just for this.

Maybe make the project a parameter?

parameters:
   helixProject: '$(Build.SourcesDirectory)/src/libraries/sendtohelix.proj'
  ...

steps:
  - script: ${{ parameters.msbuildScript }}
                ${{ parameters.helixProject }}
                 ...

Copy link
Member Author

Choose a reason for hiding this comment

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

I could do this, but if we decide to just augment the existing sendtohelix.proj with the new scenarios functionality, it won't be necessary.

There are three separate pipelines, with different sets of JIT
stress modes enabled for each:

- libraries-jitstress.yml
- libraries-jitstress2-jitstressregs.yml
- libraries-jitstressregs.yml

The live built Release libraries are used with a Checked CoreCLR.

The non-stress configuration is tested during normal PR testing.

The libraries `sendtohelix.proj` file is changed to take an optional
list of CoreCLR stress scenarios to run. If given, a set of environment
setting scripts is created and added to the Helix correlation payload.
Then, an auxiliary `sendtohelixhelp.proj` file is invoked for each
scenario (or just the default, empty scenario) to create and run the
Helix tasks.
```
src/libraries/System.Numerics.Vectors/tests/Matrix3x2Tests.cs
dotnet#36587
Matrix3x2CreateRotationCenterTest()

dotnet#36587
Matrix3x2CreateScaleCenterTest1()

dotnet#36587
Matrix3x2CreateScaleCenterTest3()

src/libraries/System.Numerics.Vectors/tests/Matrix4x4Tests.cs
dotnet#36586
Matrix4x4CreateFromAxisAngleTest()
```
@BruceForstall BruceForstall force-pushed the LibrariesTestsForCoreClr branch from c50a086 to c9ed92f Compare June 11, 2020 23:25
@BruceForstall
Copy link
Member Author

@safern @ViktorHofer @jashook This is ready to be reviewed again.

The main thing I've done is split the libraries sendtohelix.proj into two parts:

  • the "driver", still in sendtohelix.proj. This constructs and compresses the Helix correlation payload. In the case where a set of coreclr stress scenarios is given, it also constructs a set of environment-setting batch files to use, and includes them all in the payload (they are named by the scenario name).
  • the part that creates Helix work items and causes the jobs to be submitted. I put this in sendtohelixhelp.proj. This is called once per scenario (in parallel).

All libraries jobs go through this path, and the "no scenarios given" case, which is the default, should behave as before.

I've disabled a few tests, but I noticed while testing this today that there are additional regressions, so the test runs will not be clean. That's ok; we can clean those up after this gets checked in.

Triggered stress runs:

jitstress: https://dev.azure.com/dnceng/public/_build/results?buildId=684206&view=results
jitstressregs: https://dev.azure.com/dnceng/public/_build/results?buildId=684207&view=results
jitstress2-jitstressregs: https://dev.azure.com/dnceng/public/_build/results?buildId=684210&view=results

Copy link
Member

@trylek trylek left a comment

Choose a reason for hiding this comment

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

Great improvements and cleanup, thanks Bruce!

@BruceForstall BruceForstall merged commit 9929c07 into dotnet:master Jun 16, 2020
<!-- The helix runtime payload and the tests to run -->
<HelixCorrelationPayload Condition="'$(HelixCorrelationPayload)' == ''">$(TestArchiveRuntimeFile)</HelixCorrelationPayload>
<WorkItemArchiveWildCard Condition="'$(WorkItemArchiveWildCard)' == ''">$(TestArchiveTestsRoot)**/*.zip</WorkItemArchiveWildCard>
In the simple case, no scenarios are specified and the default CoreCLR optimization configuration
Copy link
Member

Choose a reason for hiding this comment

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

Nit, CoreCLR -> Runtime

<WorkItemArchiveWildCard Condition="'$(WorkItemArchiveWildCard)' == ''">$(TestArchiveTestsRoot)**/*.zip</WorkItemArchiveWildCard>
In the simple case, no scenarios are specified and the default CoreCLR optimization configuration
is used to run the tests. If a set of comma-separated scenarios are specified in the `_Scenarios`
property, then each test is run for each of the specified CoreCLR scenarios (e.g., COMPlus_JitStress=1;
Copy link
Member

Choose a reason for hiding this comment

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

Ditto.

<!-- Helix auto-magically imports local *.props files. We're not going to import the Helix Sdk,
so we need to import those files manually so we can reference the properties defined there.
-->
<Import Project="$(MSBuildThisFileDirectory)/*.props" />
Copy link
Member

Choose a reason for hiding this comment

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

Actually we just need to import Directory.Build.props no?

<IncludeDotNetCli>true</IncludeDotNetCli>
<DotNetCliPackageType>sdk</DotNetCliPackageType>
<!-- Re-invoke MSBuild on this project to create the correlation payload -->
<MSBuild Projects="$(MSBuildProjectFile)" Targets="PrepareCorrelationPayloadDirectory" Properties="Scenarios=$(_Scenarios)" />
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to re-invoke this project? We could just make the current target depend on PrepareCorrelationPayloadDirectory; we didn’t need to do this as an extra MSbuild node.

<DotNetCliVersion>$([System.Text.RegularExpressions.Regex]::Match($(GlobalJsonContent), '(%3F&lt;="dotnet": ").*(%3F=")'))</DotNetCliVersion>
</PropertyGroup>
<PropertyGroup>
<PerScenarioProjectFile>$(MSBuildProjectDirectory)\sendtohelixhelp.proj</PerScenarioProjectFile>
Copy link
Member

Choose a reason for hiding this comment

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

No need of \

<HelixCommand>$(HelixCommand) /p:RestorePackagesPath=%HELIX_WORKITEM_PAYLOAD%\packages</HelixCommand>
<HelixCommand>$(HelixCommand) /p:LocalPackagesPath="%HELIX_CORRELATION_PAYLOAD%\packages\"</HelixCommand>
<!-- The Helix correlation payload file -->
<TestArchiveRuntimeFile Condition="'$(BuildAllConfigurations)' != 'true'">$(TestArchiveRuntimeRoot)test-runtime-$(BuildSettings).zip</TestArchiveRuntimeFile>
Copy link
Member

Choose a reason for hiding this comment

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

Do we need these properties here and then passed down as global property? Or can they be moved to sendtohelixhelp.proj?

<Message Importance="High" Text="Using Queues: $(HelixTargetQueues)" />
</Target>

<Target Name="PrintBuildTargetFramework">
Copy link
Member

Choose a reason for hiding this comment

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

Aren’t these already printed in sendtohelix.proj?

</Target>

<Target Name="PrintHelixQueues">
<Message Importance="High" Text="Using Queues: $(HelixTargetQueues)" />
Copy link
Member

Choose a reason for hiding this comment

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

These are already printed in sendtohelix.proj right?

<Message Condition="'$(Scenario)' == ''" Importance="High" Text="Building Helix work items" />
<Message Condition="'$(Scenario)' != ''" Importance="High" Text="Building Helix work items for scenario $(Scenario)" />
<Message Importance="High" Text="Using TestRunNamePrefix: $(TestRunNamePrefix)" />
<Message Importance="High" Text="Using HelixCorrelationPayload: $(HelixCorrelationPayload)" />
Copy link
Member

Choose a reason for hiding this comment

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

All these are already printed in sendtohelix.proj

<HelixType Condition="'$(BuildAllConfigurations)' == 'true'">test/functional/packaging/</HelixType>
</PropertyGroup>

<ItemGroup Condition="'$(HelixCommand)' == '' and '$(BuildAllConfigurations)' == 'true'">
Copy link
Member

Choose a reason for hiding this comment

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

Should this condition probe for HelixPreCommand instead?

@BruceForstall
Copy link
Member Author

@safern Thanks for the careful review. I merged just before your review was posted, so I will try to follow up on this soon with an update PR if appropriate.

@safern
Copy link
Member

safern commented Jun 17, 2020

No worries, my review was a little bit late 😄

I will try to take a deeper look at how all is setup but I believe this is what jumped out.

Also, maybe sendtohelixhelp should be re-named to something more clarifying... something like sendtohelixinner? Or we could rename both?

@ghost ghost locked as resolved and limited conversation to collaborators Dec 9, 2020
@BruceForstall BruceForstall deleted the LibrariesTestsForCoreClr branch February 28, 2021 03:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants