You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That PR also made change in the jit directory (src/coreclr/jit/CMakeLists.txt), so that's also not too surprising to me. 🤷♂️
The surprise is not that superpmi-diffs is running, the surprise is that smoke_tests.nativeaot is showing up as having diffs when the PRs do not change anything about what is being emitted.
That's an AVX10.2 instruction and the bytes look correct.
But I'm confused as to why NAOT is emitting it in the first place as AVX10.2 is off by default for the JIT and we presumably shouldn't have NAOT tests targeting "all possible ISAs"
But I'm confused as to why NAOT is emitting it in the first place as AVX10.2 is off by default for the JIT and we presumably shouldn't have NAOT tests targeting "all possible ISAs"
We have a couple tests that enable extra ISAs under src\tests\nativeaot\SmokeTests\HardwareIntrinsics. This one looks to be:
; Emitting BLENDED_CODE for X64 with AVX10.2/512 - Windows
So maybe it's the test that enables --instruction-set:avx512f,avx512f_vl,avx512bw,avx512bw_vl,avx512cd,avx512cd_vl,avx512dq,avx512dq_vl?
compExactlyDependsOn and compOpportunisticallyDependsOn then do roughly the same thing: https://github.com/dotnet/runtime/blob/main/src/coreclr/jit/compiler.h#L9843-L9874. The difference is that compExactlyDependsOn always reports the usage while compOpportunisticallyDependsOn does not. These are the two meant to be used by the JIT for its own internal usages. We then have a third compHWIntrinsicDependsOn which is used by the JIT for user hardware intrinsic usage (as in from normal C# code).
We have this split because the optimistic set is meant to be allowed under NAOT under the premise the user has correctly emitted a containing if (Isa.IsSupported) { } guard check (hence we report usage, but then simply return whether its in the list of ISAs). While for the JIT we can emit no such guard and so want exactlyDependsOn to report true but opportunisticallyDependsOn to report false. This difference is meant to be surfaced by the notifyInstructionSetUsage(isa, (opts.compSupportsISA.HasInstructionSet(isa))) call: https://github.com/dotnet/runtime/blob/main/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs#L4460
Activity
dotnet-policy-service commentedon Feb 20, 2025
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.
filipnavara commentedon Feb 20, 2025
That PR has change in RISC-V JIT for emitting unwinding codes. I'm not surprised that it triggered the pipelines that generate those diffs.
jakobbotsch commentedon Feb 20, 2025
It was just an example. The point is that we see spurious diffs in smoke_tests.nativeaot. Here is another example: https://dev.azure.com/dnceng-public/public/_build/results?buildId=957764&view=ms.vss-build-web.run-extensions-tab
filipnavara commentedon Feb 20, 2025
That PR also made change in the jit directory (src/coreclr/jit/CMakeLists.txt), so that's also not too surprising to me. 🤷♂️
jakobbotsch commentedon Feb 20, 2025
The surprise is not that superpmi-diffs is running, the surprise is that smoke_tests.nativeaot is showing up as having diffs when the PRs do not change anything about what is being emitted.
jakobbotsch commentedon Feb 20, 2025
Output
The problem looks to be that coredistools fails to disassemble
@tannergooding is this a newly emitted instruction, and are we emitting the right bytes here? If so we probably need to update coredistools.
tannergooding commentedon Feb 20, 2025
That's an AVX10.2 instruction and the bytes look correct.
But I'm confused as to why NAOT is emitting it in the first place as AVX10.2 is off by default for the JIT and we presumably shouldn't have NAOT tests targeting "all possible ISAs"
MichalStrehovsky commentedon Feb 20, 2025
We have a couple tests that enable extra ISAs under src\tests\nativeaot\SmokeTests\HardwareIntrinsics. This one looks to be:
So maybe it's the test that enables
--instruction-set:avx512f,avx512f_vl,avx512bw,avx512bw_vl,avx512cd,avx512cd_vl,avx512dq,avx512dq_vl?jakobbotsch commentedon Feb 20, 2025
The problem is that avx10v2 is optimistically enabled any time avx512f is enabled:
runtime/src/coreclr/tools/Common/InstructionSetHelpers.cs
Lines 230 to 234 in 306ced2
Not sure if that's the right behavior or not.
tannergooding commentedon Feb 20, 2025
It could be if there's a bug. However, that shouldn't be causing
AVX10.2/512as "supported" under the intended design.That is given the
--instruction-setspecified there, the NAOT VM should say thatAVX512Fissupportedand thatAVX10.2isoptimisticallySupported(https://github.com/dotnet/runtime/blob/main/src/coreclr/tools/Common/InstructionSetHelpers.cs#L233).The VM should then pass both the
supportedandoptimisticset down to the JIT: https://github.com/dotnet/runtime/blob/main/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs#L4203, for which the JIT should track as the "supported" set: https://github.com/dotnet/runtime/blob/main/src/coreclr/jit/compiler.cpp#L2282compExactlyDependsOnandcompOpportunisticallyDependsOnthen do roughly the same thing: https://github.com/dotnet/runtime/blob/main/src/coreclr/jit/compiler.h#L9843-L9874. The difference is thatcompExactlyDependsOnalways reports the usage whilecompOpportunisticallyDependsOndoes not. These are the two meant to be used by the JIT for its own internal usages. We then have a thirdcompHWIntrinsicDependsOnwhich is used by the JIT for user hardware intrinsic usage (as in from normal C# code).We have this split because the
optimisticset is meant to be allowed under NAOT under the premise the user has correctly emitted a containingif (Isa.IsSupported) { }guard check (hence we report usage, but then simply return whether its in the list of ISAs). While for the JIT we can emit no such guard and so wantexactlyDependsOnto reporttruebutopportunisticallyDependsOnto report false. This difference is meant to be surfaced by thenotifyInstructionSetUsage(isa, (opts.compSupportsISA.HasInstructionSet(isa)))call: https://github.com/dotnet/runtime/blob/main/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs#L4460For NAOT this should simply be querying
IsInstructionSetSupportedwhich should only include the actual baseline ISAs and not any optimistic ISAs: https://github.com/dotnet/runtime/blob/main/src/coreclr/tools/Common/Compiler/InstructionSetSupport.cs#L44-L52jakobbotsch commentedon Feb 20, 2025
Then this just looks like a bug in SPMI's implementation of
notifyInstructionSetUsagehere:runtime/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp
Lines 1529 to 1533 in 306ced2