Uh oh!
There was an error while loading. Please reload this page.
Migrate JitOptimizationSensitive and GCStressIncompatible to SkipOnCoreClr attributes - #126108
Conversation
…odes.HeapVerify) Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com> Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/b9ff7f11-db85-474b-bed1-1e4bd364f234
…ource files
Replace MSBuild property JitOptimizationSensitive with
[SkipOnCoreClr("This test is sensitive to JIT optimizations.", RuntimeTestModes.AnyJitOptimizationStress)]
attribute directly on [Fact]/[Theory] methods across 48 test source files.
Corresponding .csproj files have the <JitOptimizationSensitive> property removed.
RequiresProcessIsolation is also removed from project files where
JitOptimizationSensitive was the sole reason for it.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>…e migration Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com> Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/291e5882-a072-4964-8394-d20db497e472
…IL source files Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com> Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/e0266c53-b95c-4538-80c9-b7d881f45840
… ilproj, fsproj Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com> Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/66a86949-b520-4439-8d71-659f2b4391fc
…projects - Remove GCStressIncompatible from 7 OutputType=Library projects where the property is a no-op. - Remove redundant conditional GCStressIncompatible from 10 X86 HWIntrinsics projects (both arm64+osx and arm conditions already covered by CLRTestTargetUnsupported). - Remove redundant arm-only GCStressIncompatible from 2 Arm HWIntrinsics projects (arm condition already covered by CLRTestTargetUnsupported). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add runtime HeapVerify check to ServerModel test using CoreClrConfigurationDetection.IsHeapVerify (the last project using it). - Remove HeapVerify skip logic from Batch and Bash execution script targets. - Remove auto-setting of HeapVerifyIncompatible for disasm-check tests in CLRTest.Jit.targets. - Remove all documentation references to HeapVerifyIncompatible. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Tagging subscribers to this area: @agocke, @dotnet/gc |
MichalStrehovsky
commented
Mar 25, 2026
Before we make more changes to the test tree, it would be nice to make the test tree buildable again. https://github.com/dotnet/runtime/runs/68503855882 I assume this is from #125460, I've seen similar failures when I worked on the Loader tree. It would be nice to re-validate we're still running the same number of tests after #125460, the validation at #125460 (comment) must have missed this. |
jkoritzinsky
commented
Mar 26, 2026
I must have fat fingered the build command and missed the pri1 tests somehow. I'll fix that up before coming back to this. |
jkoritzinsky
commented
Mar 31, 2026
/azp run runtime-coreclr outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
jkoritzinsky
commented
Apr 2, 2026
@copilot some of the projects you've edited still mention that they have RequiresProcessIsolation due to GCStressIncompatible. Please audit the projects you've edited to make sure that the reasons for a project being marked RPI are accurate. |
… comments Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/c882c5b1-c293-4d09-8e31-17947a0bdd1e Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com>
Done in 48bc184. Audited all 78 project files where |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: dfcc4829-304a-4277-ac35-91ba6510eb70
jkoritzinsky
commented
Jul 25, 2026
/azp run runtime-coreclr outerloop |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
jkoritzinsky
commented
Jul 27, 2026
/ba-g no unknown failures but BA still red |
Uh oh!
There was an error while loading. Please reload this page.
EgorBo
commented
Aug 3, 2026
@jkoritzinsky this seems like badly impacted outerloop CI PR #126108 (c35b7ab, 2026-07-27 — matches the exact failure onset) migrated Example: #131447 |
EgorBo
commented
Aug 3, 2026
Ah, or was it fixed by #131670? |
jkoritzinsky
commented
Aug 3, 2026
I fixed a particular test there where the rules for RPI were insufficient. The case you linked that's still open may be due to the test being in il and the Main not being updated. For IL tests, either reverting to the MSBuild properties or updating the Main method to call the methods on CoreClrConfigurationDetection would fix the issue. |
Fixes#131447. ## Root cause Not a JIT bug. #126108 replaced the `<JitOptimizationSensitive>` and `<GCStressIncompatible>` MSBuild properties with `[SkipOnCoreClr(...)]` attributes on test entry points. That works for C# tests and for in-process IL tests, but silently drops the guard for **IL tests that also set `<RequiresProcessIsolation>`**: | Test kind | What evaluates the skip | Result | | --- | --- | --- | | C#, any isolation | `GenerateStandaloneSimpleTestRunner` compiles the check into `__GeneratedMainWrapper.Main` | ✅ honored | | IL, in-process | merged runner reads the attribute from metadata via `ExternallyReferencedTestMethodsVisitor` | ✅ honored | | **IL + process isolation** | merged runner emits an `OutOfProcessTest` that only calls `RunOutOfProcessTest(...)` on the generated run script, and `ReferenceXUnitWrapperGenerator` is gated on `'$(Language)' == 'C#'` so the IL assembly's hand-written `.entrypoint` never gets a wrapper either | ❌ **nothing reads the attribute** | In that last case only the MSBuild property puts the guard into the generated `.cmd`/`.sh`. `arrres_il_r` keeps its whole body in a single `Main`, so unoptimized codegen (tier-0, minopts, JIT stress) keeps the `Test` objects alive in untracked stack slots for the duration of `Main`. They are then never finalized and never resurrected, and the test throws. It fails on every default (tiered) run, which is why it lit up across outerloop, jitstress and pgo on all platforms at once. ## Fix Restore the MSBuild property on the two affected tests (option 1 from #126108 (comment)): - `arrres_il_r.ilproj` → `<JitOptimizationSensitive>` - `b143840.ilproj` → `<GCStressIncompatible>` (same bug, unguarded on gcstress legs; it kept `<RequiresProcessIsolation>` for `<UnloadabilityIncompatible>`) The `[SkipOnCoreClr]` attributes are intentionally left in place, so the guard keeps working if either test ever stops requiring process isolation. Each project gets a comment explaining why the property cannot be dropped in favour of the attribute. ## Fallout audit I enumerated all 16 IL tests carrying `[SkipOnCoreClr]` and evaluated each owning project's *effective* `RequiresProcessIsolation` with `msbuild -getProperty` (so inherited `Directory.Build.props`/`.targets` values are accounted for). These two are the only process-isolated ones — the other 14 are in-process and unaffected. I also confirmed empirically, rather than by inspection alone, that both of the "honored" rows above really do emit the guard, by disassembling the built assemblies: - `Directed_3.dll` (merged runner, in-process IL) contains `IsJitStress` / `IsJitStressRegs` / `IsJitMinOpts` / `IsTailCallStress` / `IsTieredCompilation` checks guarding the call to `[AttributeConflict]P::Main()`. - `ObjectStackAllocationTests.dll` (process-isolated C#) contains the same checks inside `__GeneratedMainWrapper`. No C# test is affected by this class of bug. ## Validation Built and ran the generated run scripts on windows-x64 checked: ``` arrres_il_r default (tiered) SKIP TieredCompilation=0 PASS (Test passed., 100) TC=0 + JITMinOpts=1 SKIP TC=0 + JitStress=2 SKIP b143840 default PASS GCStress=0xC SKIP ``` Before the change, `arrres_il_r` reproduced the exact CI signature under the default environment: unhandled `System.Exception` in `GCTest_arrres_il.Test.Main`, exit `-532462766`. cc @jkoritzinsky@jakobbotsch@JulieLeeMSFT Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a984328a-8b6c-4221-b2c9-d668eae5b505
Replaces eligible MSBuild
<JitOptimizationSensitive>and<GCStressIncompatible>properties with[SkipOnCoreClr(...)]applied directly to test entry points, moving skip logic from build-time property injection into the XUnit test runner where the test can safely run without process isolation.Description
Why
MSBuild properties like
<GCStressIncompatible>and<JitOptimizationSensitive>require<RequiresProcessIsolation>true</RequiresProcessIsolation>to take effect — process isolation is expensive. Moving eligible skips to XUnit attributes allows tests to be skipped in-process without spawning a new process per test. Tests that still require process isolation for other reasons retain<RequiresProcessIsolation>true</RequiresProcessIsolation>.Changes
JitOptimizationSensitive — ilproj tests (4
.ilfiles, 4.ilprojfiles)SkipOnCoreClrAttributewithAnyJitOptimizationStress(0x11E) to each IL entry point.assembly extern Microsoft.DotNet.XUnitExtensionswhere missing<JitOptimizationSensitive>and sole-cause<RequiresProcessIsolation>from project files<ProjectReference Include="$(TestLibraryProjectPath)" />to project files that were missing itGCStressIncompatible — all project types (~310 files total)
C# (150
.cs+ 150.csproj):[SkipOnCoreClr("This test is not compatible with GC stress.", RuntimeTestModes.AnyGCStress)]before each[Fact]/[Theory]/[ConditionalFact]/[ConditionalTheory]<GCStressIncompatible>and sole-cause<RequiresProcessIsolation>from project files<ProjectReference Include="$(TestLibraryProjectPath)" />to 65 csproj files that were missing it<GCStressIncompatible>from project files where the compiled source already had a corresponding[SkipOnCoreClr(..., RuntimeTestModes.AnyGCStress)]attributeIL (6
.ilproj, 3.il):SkipOnCoreClrAttribute(0xC0 =AnyGCStress) to IL entry points; updated project files<ProjectReference Include="$(TestLibraryProjectPath)" />to 6 ilproj files that were missing itF#:
Runtime_72845was left on the standalone[<EntryPoint>]/exit-code pattern with<GCStressIncompatible>true</GCStressIncompatible>and<RequiresProcessIsolation>true</RequiresProcessIsolation>retained, because the attempted XUnit conversion did not compile in targeted test buildsHeapVerifyIncompatible — migrated tests
<ProjectReference Include="$(TestLibraryProjectPath)" />to project files that were missing it<HeapVerifyIncompatible>was conditional on architecture, replaced the unconditional[SkipOnCoreClr(..., RuntimeTestModes.HeapVerify)]with[ConditionalFact]backed by a static bool property that combines the architecture check withTestLibrary.CoreClrConfigurationDetection.IsHeapVerify, preserving the original per-architecture skip semanticsComment cleanup
<GCStressIncompatible>was removed and updated or removed staleRequiresProcessIsolationcomments[SkipOnCoreClr(...)]attribute messagesRequiresProcessIsolationrationale comments positioned above the<RequiresProcessIsolation>property they describeInfrastructure and documentation
helixpublishwitharcade.proj(123 → 246 minutes) to accommodate the larger merged test collectionsrequiresprocessisolation.mdto document two additional triggers for<RequiresProcessIsolation>:<IsLongRunningGCTest>and<CLRTestExecutionArguments>CI failure fixes and process-isolation audit
<RequiresProcessIsolation>true</RequiresProcessIsolation>to tests that still require isolation for GC measurement accuracy, long-running GC pre-commands, custom CLR test execution arguments,GC.WaitForPendingFinalizers, unsupported target handling, unloadability, NativeAOT incompatibility, output-copying project references, orProcess.Start[ActiveIssue]suppressions for CI failures on browser-wasm CoreCLR and Mono interpreter browser-wasm where appropriateGetTotalAllocatedBytes.cswhile preserving GC stress and HeapVerify skip behaviorNot migrated (MSBuild property retained)
ReferenceXUnitWrapperGenerator=false— no XUnit runnerOutputType=Libraryprojects — no entry point[Fact]methodRuntime_72845.fsproj— F# XUnit conversion did not compile in targeted test builds, so this test retains<GCStressIncompatible>true</GCStressIncompatible>and standalone process isolationmultifolder,determinism/crossgen2determinism) —[SkipOnCoreClr]only skips the XUnit test body, not pre-commands that run before the test executablerequiresprocessisolation.mdrules retain<RequiresProcessIsolation>, including projects withCLRTestExecutionArguments,IsLongRunningGCTest,GC.WaitForPendingFinalizers,CLRTestTargetUnsupported,UnloadabilityIncompatible,NativeAotIncompatible,ProjectReference/content copying requirements, orProcess.Start