Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Migrate JitOptimizationSensitive and GCStressIncompatible to SkipOnCoreClr attributes - #126108

#126108
Merged
jkoritzinsky merged 30 commits into
maindotnet/runtime:mainfrom
copilot/update-requirements-for-requiresprocessisolationdotnet/runtime:copilot/update-requirements-for-requiresprocessisolationCopy head branch name to clipboard
Jul 27, 2026
Merged

Migrate JitOptimizationSensitive and GCStressIncompatible to SkipOnCoreClr attributes#126108
jkoritzinsky merged 30 commits into
maindotnet/runtime:mainfrom
copilot/update-requirements-for-requiresprocessisolationdotnet/runtime:copilot/update-requirements-for-requiresprocessisolationCopy head branch name to clipboard

Conversation

Copilot AI commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

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 .il files, 4 .ilproj files)

  • Added SkipOnCoreClrAttribute with AnyJitOptimizationStress (0x11E) to each IL entry point
  • Added .assembly extern Microsoft.DotNet.XUnitExtensions where missing
  • Removed <JitOptimizationSensitive> and sole-cause <RequiresProcessIsolation> from project files
  • Added <ProjectReference Include="$(TestLibraryProjectPath)" /> to project files that were missing it

GCStressIncompatible — all project types (~310 files total)

C# (150 .cs + 150 .csproj):

  • Added [SkipOnCoreClr("This test is not compatible with GC stress.", RuntimeTestModes.AnyGCStress)] before each [Fact]/[Theory]/[ConditionalFact]/[ConditionalTheory]
  • Removed <GCStressIncompatible> and sole-cause <RequiresProcessIsolation> from project files
  • Added <ProjectReference Include="$(TestLibraryProjectPath)" /> to 65 csproj files that were missing it
  • Removed dangling <GCStressIncompatible> from project files where the compiled source already had a corresponding [SkipOnCoreClr(..., RuntimeTestModes.AnyGCStress)] attribute

IL (6 .ilproj, 3 .il):

  • 3 GenericContext tests: IL was pre-migrated; removed MSBuild properties from project files
  • 3 JIT regression tests: Added SkipOnCoreClrAttribute (0xC0 = AnyGCStress) to IL entry points; updated project files
  • Added <ProjectReference Include="$(TestLibraryProjectPath)" /> to 6 ilproj files that were missing it

F#:

  • Runtime_72845 was 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 builds

HeapVerifyIncompatible — migrated tests

  • Added <ProjectReference Include="$(TestLibraryProjectPath)" /> to project files that were missing it
  • For tests where <HeapVerifyIncompatible> was conditional on architecture, replaced the unconditional [SkipOnCoreClr(..., RuntimeTestModes.HeapVerify)] with [ConditionalFact] backed by a static bool property that combines the architecture check with TestLibrary.CoreClrConfigurationDetection.IsHeapVerify, preserving the original per-architecture skip semantics

Comment cleanup

  • Audited edited project files where <GCStressIncompatible> was removed and updated or removed stale RequiresProcessIsolation comments
  • Audited orphaned project comments that provided GC stress skip context, removed the orphaned comments, and moved important issue/context details into the corresponding [SkipOnCoreClr(...)] attribute messages
  • Kept remaining RequiresProcessIsolation rationale comments positioned above the <RequiresProcessIsolation> property they describe

Infrastructure and documentation

  • Doubled the browser-wasm (CoreCLR) runtime test work item timeout in helixpublishwitharcade.proj (123 → 246 minutes) to accommodate the larger merged test collections
  • Updated requiresprocessisolation.md to document two additional triggers for <RequiresProcessIsolation>: <IsLongRunningGCTest> and <CLRTestExecutionArguments>

CI failure fixes and process-isolation audit

  • Restored <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, or Process.Start
  • Added targeted [ActiveIssue] suppressions for CI failures on browser-wasm CoreCLR and Mono interpreter browser-wasm where appropriate
  • Resolved merge conflict in GetTotalAllocatedBytes.cs while preserving GC stress and HeapVerify skip behavior

Not migrated (MSBuild property retained)

  • Tests with ReferenceXUnitWrapperGenerator=false — no XUnit runner
  • Profiler tests — custom host runner with no XUnit
  • HW intrinsics wrapper projects — architecture-conditional property, no owned source
  • OutputType=Library projects — no entry point
  • Tests using top-level statements with no [Fact] method
  • Runtime_72845.fsproj — F# XUnit conversion did not compile in targeted test builds, so this test retains <GCStressIncompatible>true</GCStressIncompatible> and standalone process isolation
  • ReadyToRun tests with crossgen2 shell pre-commands (multifolder, determinism/crossgen2determinism) — [SkipOnCoreClr] only skips the XUnit test body, not pre-commands that run before the test executable
  • Tests that still match requiresprocessisolation.md rules retain <RequiresProcessIsolation>, including projects with CLRTestExecutionArguments, IsLongRunningGCTest, GC.WaitForPendingFinalizers, CLRTestTargetUnsupported, UnloadabilityIncompatible, NativeAotIncompatible, ProjectReference/content copying requirements, or Process.Start

Copilot AI and others added 7 commits March 24, 2026 21:57
…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>
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke, @dotnet/gc
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@MichalStrehovsky

Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Member

/azp run runtime-coreclr outerloop

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@jkoritzinsky

Copy link
Copy Markdown
Member

@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>

Copilot AI commented Apr 2, 2026

Copy link
Copy Markdown
Contributor Author

@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...

Done in 48bc184. Audited all 78 project files where GCStressIncompatible was removed but the <!-- Needed for GCStressIncompatible, ... --> comment on RequiresProcessIsolation still referenced it. Updated each comment to reflect only the remaining reasons (e.g. UnloadabilityIncompatible, GC.WaitForPendingFinalizers, CMakeProjectReference, etc.). When GCStressIncompatible was the sole reason, the entire comment line was removed.

Copilot AI review requested due to automatic review settings July 20, 2026 18:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Holistic Review

Motivation: Justified, unchanged. <GCStressIncompatible>, <JitOptimizationSensitive>, and <HeapVerifyIncompatible> only take effect when <RequiresProcessIsolation>true</RequiresProcessIsolation> forces an expensive per-test process. Moving eligible skips to XUnit [SkipOnCoreClr(...)]/[ConditionalFact] lets the merged in-process runner skip them without spawning a process, which is a real CI cost win.

Approach: Sound and idiomatic, unchanged. Managed entry points use [SkipOnCoreClr(msg, RuntimeTestModes.AnyGCStress|AnyJitOptimizationStress)] and IL entry points use equivalent .custom ... SkipOnCoreClrAttribute records with the correct Microsoft.DotNet.XUnitExtensions extern and public key token, mirroring the established src/tests pattern. Architecture-conditional HeapVerifyIncompatible is preserved via [ConditionalFact] gated on Utilities.IsArm/IsX86/... and CoreClrConfigurationDetection.IsHeapVerify. <RequiresProcessIsolation> is retained where genuinely required.

Summary: This is an incremental re-review. The 23 PR commits are byte-for-byte identical to the previously reviewed head (range-diff shows all 23 patches equal); the head SHA differs only because the PR was rebased onto a newer base. The sole semantic delta in the cumulative patch is in src/tests/Common/helixpublishwitharcade.proj: the doubled browser-wasm collection timeout (_TimeoutPerTestCollectionInMinutes = 246) was re-expressed during the rebase to match the reworked surrounding TargetsMobile condition, and now also applies to TargetsWasiOnCoreCLR. This is a benign, consistency-improving adaptation to upstream changes, not a behavioral regression, and it does not alter the motivation, approach, or risk of the PR. No new actionable findings. Overall verdict remains LGTM.

Assessment History

  • review 4730527139 reviewed commit 6d716aed9b8626ea8447a09af4dabd2017b787c1 with an LGTM verdict. Current verdict is also LGTM. Assessment unchanged: verdict, motivation, approach, and risk are all the same. The only intervening change is a rebase that preserved every PR patch and adjusted the browser-wasm timeout condition to also cover WASI, which does not affect the assessment.

Detailed Findings

None. The incremental change (WASI-inclusive browser-wasm timeout condition in helixpublishwitharcade.proj) is correct and consistent with the adjacent TargetsMobile logic.

Note

This review was generated by this repository's Holistic Review agentic workflow to complement the built-in Copilot review.

Generated by Holistic Review · 59.8 AIC · ⌖ 10.6 AIC · ⊞ 10K

@jkoritzinsky

Copy link
Copy Markdown
Member

/azp run runtime-coreclr outerloop

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@jkoritzinsky

Copy link
Copy Markdown
Member

@copilot please inspect the CI failures and mark the tests that failed due to multithreading as conditional on multithreading support.

Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 22, 2026 00:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because there is no eligible user to bill. To allow Copilot reviews on bot-authored pull requests, enable direct organization billing in your organization's Copilot settings.

Copilot AI commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please inspect the CI failures and mark the tests that failed due to multithreading as conditional on multithreading support.

Fixed in 711de57. I inspected the browser-wasm CoreCLR CI failures and marked the tests that depend on managed Thread.Start support with [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))]: 437044, 576463, MultipleException, RecursiveException, and Test12224.

@jkoritzinsky

Copy link
Copy Markdown
Member

/azp run runtime-coreclr outerloop

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Comment thread src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/MultipleException.cs Outdated
Comment thread src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/RecursiveException.cs Outdated
Comment thread src/tests/GC/API/GC/GetAllocatedBytesForCurrentThread.cs Outdated
Comment thread src/tests/GC/API/GC/GetGenerationWR2.csproj Outdated
Comment thread src/tests/GC/API/WeakReference/IsAlive.csproj Outdated
Comment thread src/tests/JIT/jit64/opt/cse/hugeexpr1.cs Outdated
Comment thread src/tests/JIT/jit64/opt/cse/HugeField2.cs Outdated
Comment thread src/tests/JIT/jit64/opt/cse/HugeField2.csproj Outdated
Comment thread src/tests/JIT/opt/Regressions/Regression2_Regressions.cs Outdated
Comment thread src/tests/JIT/Regression/JitBlue/DevDiv_255294/DevDiv_255294.csproj Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: dfcc4829-304a-4277-ac35-91ba6510eb70
Copilot AI review requested due to automatic review settings July 23, 2026 19:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@jkoritzinsky

Copy link
Copy Markdown
Member

/azp run runtime-coreclr outerloop

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@jkoritzinsky

Copy link
Copy Markdown
Member

/ba-g no unknown failures but BA still red

@jkoritzinsky
jkoritzinsky enabled auto-merge (squash) July 27, 2026 17:12
@jkoritzinsky
jkoritzinsky merged commit c35b7ab into main Jul 27, 2026
144 of 150 checks passed
@jkoritzinsky
jkoritzinsky deleted the copilot/update-requirements-for-requiresprocessisolation branch July 27, 2026 17:12
@github-project-automation github-project-automation Bot moved this to Done in AppModel Jul 27, 2026
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-rc1 milestone Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.