Skip to content

Enable jit optimization in crossgen testing #114464

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

Merged

Conversation

AndyAyersMS
Copy link
Member

Also mark filter test entry point as aggressiveinlining to create a cross-assembly wrapped exception throw test when crossgen2 runs in composite mode.

(see #113815 / #113849)

Also mark `filter` test entry point as `aggressiveinlining` to create a cross-assembly
wrapped exception throw test when crossgen2 runs in composite mode.

(see  dotnet#113815 / dotnet#113849)
@Copilot Copilot AI review requested due to automatic review settings April 10, 2025 00:55
Copy link
Contributor

@Copilot Copilot AI left a comment

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 any files in this pull request.

Files not reviewed (2)
  • src/tests/Common/CLRTest.CrossGen.targets: Language not supported
  • src/tests/JIT/Directed/throwbox/filter.il: Language not supported

@AndyAyersMS
Copy link
Member Author

Seems like we should generally run crossgen2 tests with jit optimizations enabled.

@steveisok @jkotas PTAL

@AndyAyersMS
Copy link
Member Author

/azp run runtime-coreclr crossgen2 outerloop

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jkotas
Copy link
Member

jkotas commented Apr 10, 2025

Also mark filter test entry point as aggressiveinlining

This makes the test fail due to the bug that you are fixing.

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

LGTM if the change does not introduce any new test failures.

@AndyAyersMS
Copy link
Member Author

Windows script change has > instead of >>.

There are a bunch of failures of the form

Running R2RDump:  dotnet /root/helix/work/correlation/R2RDump/R2RDump.dll --header --sc --in /root/helix/work/workitem/e/Regressions/coreclr/22021/consumer/composite-r2r.dll --out /root/helix/work/workitem/e/Regressions/coreclr/22021/consumer/composite-r2r.dll.r2rdump --val
Error: System.BadImageFormatException: Failed to convert invalid RVA to offset: 67168
   at ILCompiler.Reflection.ReadyToRun.PEReaderExtensions.GetOffset(PEReader reader, Int32 rva) in /_/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/PEReaderExtensions.cs:line 113
   at ILCompiler.Reflection.ReadyToRun.ReadyToRunReader.EnsureImportSections() in /_/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunReader.cs:line 1497
   at R2RDump.TextDumper.DumpSectionContents(ReadyToRunSection section) in /_/src/coreclr/tools/r2rdump/TextDumper.cs:line 435
   at R2RDump.TextDumper.DumpSection(ReadyToRunSection section) in /_/src/coreclr/tools/r2rdump/TextDumper.cs:line 120
   at R2RDump.TextDumper.DumpHeader(Boolean dumpSections) in /_/src/coreclr/tools/r2rdump/TextDumper.cs:line 81
   at R2RDump.Program.Dump(ReadyToRunReader r2r) in /_/src/coreclr/tools/r2rdump/Program.cs:line 166
   at R2RDump.Program.Run() in /_/src/coreclr/tools/r2rdump/Program.cs:line 460
02:52:41

Also this test is probably optimization sensitive

02:40:54.506 Running test: JIT/Directed/debugging/poisoning/poison/poison.dll
Xunit.Sdk.EqualException: Assert.Equal() Failure: Values differ
Expected: 100
Actual:   101
   at Xunit.Assert.Equal[T](T expected, T actual, IEqualityComparer`1 comparer) in /_/src/Microsoft.DotNet.XUnitAssert/src/EqualityAsserts.cs:line 174
   at Program.<<Main>$>g__TestExecutor113|0_114(StreamWriter tempLogSw, StreamWriter statsCsvSw, <>c__DisplayClass0_0&)

@AndyAyersMS
Copy link
Member Author

/azp run runtime-coreclr crossgen2 outerloop

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@AndyAyersMS
Copy link
Member Author

Also mark filter test entry point as aggressiveinlining

This makes the test fail due to the bug that you are fixing.

Yes, want to make sure it actually fails.

Looks like it does:

22:35:51.135 Running test: JIT/Directed/throwbox/filter/filter.dll
inside 1st try
entering filter
System.Runtime.CompilerServices.RuntimeWrappedException: An object that does not derive from System.Exception has been wrapped in a RuntimeWrappedException.
   at Program.<<Main>$>g__TestExecutor28|0_29(StreamWriter tempLogSw, StreamWriter statsCsvSw, <>c__DisplayClass0_0&)
22:35:51.139 Failed test: JIT/Directed/throwbox/filter/filter.dll

@AndyAyersMS
Copy link
Member Author

It looks like <CrossGenTest>false</CrossGenTest> is not actually excluding the test. And there are the invalid RVA failures.

So we can't yet enable optimization.

@AndyAyersMS
Copy link
Member Author

Going to try just enabling for windows, opened #114504 for the Linux R2R composite issue.

@AndyAyersMS
Copy link
Member Author

/azp run runtime-coreclr crossgen2 outerloop

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@AndyAyersMS
Copy link
Member Author

None of the failures seems related:

Crossgen2 OSX failure is #109395

17:34:55.631 Running test: JIT/opt/Devirtualization/Comparer_get_Default/Comparer_get_Default.dll
Type DoubleEnum: type is HFA but READYTORUN_LAYOUT_HFA flag is not set

Assert failure(PID 3608 [0x00000e18], Thread: 31661 [0x7bad]): Verify_TypeLayout 'DoubleEnum' failed to verify type layout
    File: /Users/runner/work/1/s/src/coreclr/vm/jitinterface.cpp:14041
    Image: /private/tmp/helix/working/B2270958/p/corerun

Wasm failure looks like low-memory / oom

##[warning]Free memory is lower than 5%; Currently used: 95.30%
##[warning]Free memory is lower than 5%; Currently used: 95.30%
##[warning]Free memory is lower than 5%; Currently used: 95.30%
...
  /__w/1/s/dotnet.sh: line 27: 52432 Killed                  ${dotnetPath} "$@"

x86 failure is in tracing/eventpipe/diagnosticport/diagnosticport/diagnosticport.cmd
Opened #114506

	  1.7s: Assert failure(PID 392 [0x00000188], Thread: 4844 [0x12ec]): g_flsIndex != FLS_OUT_OF_INDEXES
	  1.7s: CORECLR! OsDetachThread + 0x23 (0x7218ea20)
	  1.7s: CORECLR! SetThread + 0x64 (0x71d6cb92)
	  1.7s: CORECLR! Thread::DecExternalCount + 0x1E1 (0x71d63d96)
	  1.7s: CORECLR! Thread::OnThreadTerminate + 0x368 (0x71d6a09f)
	  1.7s: CORECLR! DestroyThread + 0xE2 (0x71d64232)
	  1.7s: CORECLR! ep_rt_thread_coreclr_start_func + 0x24 (0x72081164)
	  1.7s: KERNEL32! BaseThreadInitThunk + 0x24 (0x764662c4)
	  1.7s: NTDLL! RtlSubscribeWnfStateChangeNotification + 0x439 (0x76ee08b9)
	  1.7s: NTDLL! RtlSubscribeWnfStateChangeNotification + 0x404 (0x76ee0884)
	  1.7s:     File: D:\a\_work\1\s\src\coreclr\vm\ceemain.cpp:1794
	  1.7s:     Image: C:\h\w\A04C08E0\p\corerun.exe

@AndyAyersMS AndyAyersMS merged commit 05cd31b into dotnet:main Apr 10, 2025
112 of 118 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators May 11, 2025
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.

2 participants