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

Test failure: JIT\\Regression\\JitBlue\\GitHub_23159\\GitHub_23159\\GitHub_23159.cmd #76880

Closed
BruceForstall opened this issue Oct 11, 2022 · 16 comments · Fixed by #77123
Closed
Assignees
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI blocking-clean-ci-optional Blocking optional rolling runs JitStress CLR JIT issues involving JIT internal stress modes
Milestone

Comments

@BruceForstall
Copy link
Member

win-arm64 random JitStress

https://dev.azure.com/dnceng-public/public/_build/results?buildId=47392&view=ms.vss-test-web.build-test-results-tab&runId=954268&resultId=102958&paneView=dotnet-dnceng.dnceng-build-release-tasks.helix-test-information-tab

set COMPlus_TieredCompilation=0
set COMPlus_JitStress=e7

    JIT\Regression\JitBlue\GitHub_23159\GitHub_23159\GitHub_23159.cmd [FAIL]
      
      Return code:      1
      Raw output file:      D:\h\w\9EF6090D\w\AEE409BF\uploads\Reports\JIT.Regression\JitBlue\GitHub_23159\GitHub_23159\GitHub_23159.output.txt
      Raw output:
      BEGIN EXECUTION
       "D:\h\w\9EF6090D\p\corerun.exe" -p "System.Reflection.Metadata.MetadataUpdater.IsSupported=false"  GitHub_23159.dll 
      Expected: 100
      Actual: -1
      END EXECUTION - FAILED

fwiw, this test has a lot of Vector<T> and Unsafe code

@dotnet/jit-contrib

@BruceForstall BruceForstall added JitStress CLR JIT issues involving JIT internal stress modes area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI blocking-clean-ci-optional Blocking optional rolling runs labels Oct 11, 2022
@BruceForstall BruceForstall added this to the 8.0.0 milestone Oct 11, 2022
@ghost
Copy link

ghost commented Oct 11, 2022

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

Issue Details

win-arm64 random JitStress

https://dev.azure.com/dnceng-public/public/_build/results?buildId=47392&view=ms.vss-test-web.build-test-results-tab&runId=954268&resultId=102958&paneView=dotnet-dnceng.dnceng-build-release-tasks.helix-test-information-tab

set COMPlus_TieredCompilation=0
set COMPlus_JitStress=e7

    JIT\Regression\JitBlue\GitHub_23159\GitHub_23159\GitHub_23159.cmd [FAIL]
      
      Return code:      1
      Raw output file:      D:\h\w\9EF6090D\w\AEE409BF\uploads\Reports\JIT.Regression\JitBlue\GitHub_23159\GitHub_23159\GitHub_23159.output.txt
      Raw output:
      BEGIN EXECUTION
       "D:\h\w\9EF6090D\p\corerun.exe" -p "System.Reflection.Metadata.MetadataUpdater.IsSupported=false"  GitHub_23159.dll 
      Expected: 100
      Actual: -1
      END EXECUTION - FAILED

fwiw, this test has a lot of Vector<T> and Unsafe code

@dotnet/jit-contrib

Author: BruceForstall
Assignees: -
Labels:

JitStress, area-CodeGen-coreclr, blocking-clean-ci-optional

Milestone: 8.0.0

@BruceForstall
Copy link
Member Author

@AndyAyersMS
Copy link
Member

I'll take a look.

@AndyAyersMS AndyAyersMS self-assigned this Oct 15, 2022
@AndyAyersMS
Copy link
Member

Repros with

set COMPlus_TieredCompilation=0
set COMPlus_JitMinOptsName=BytesOrdinalEqualsStringAndAscii

@AndyAyersMS
Copy link
Member

The AllTrue vector is not properly set up, and per element, contains FF00 instead of FFFF

var AllTrue = new Vector<ushort>(ushort.MaxValue);

AllTrue ==> <65280, 65280, 65280, 65280, 65280, 65280, 65280, 65280>

during codegen we have

Generating: N1014 (  1,  4) [000426] -c---------                  t426 =    CNS_INT   int    0xFFFF REG NA
                                                                        /--*  t426   int    
Generating: N1016 (  3,  2) [000427] -----------                  t427 = *  HWINTRINSIC simd16 ushort DuplicateToVector128 REG d0
IN0181:                           movi    v0.8h, #0xFF,  MSL #8

@AndyAyersMS
Copy link
Member

AndyAyersMS commented Oct 15, 2022

Seems like we may be encoding this immediate incorrectly. We believe we're emitting MSL but we actually emit LSL

;; jit
IN01ae: 0006F4  4F07A7E0          movi    v0.8h, #0xFF,  MSL #8

;; vs disassembler
00007FFDB79542EC 4F07A7E0             movi        v0.8h,#0xFF,lsl #8

cc @tannergooding @TIHan

@AndyAyersMS
Copy link
Member

Suspect IF_DV_1B needs to check for an MSL and do something different when it has EA_2BYTE elements, but don't know the encoding well enough to say for sure.

@AndyAyersMS
Copy link
Member

Or maybe the issue is upstream? Per C7.2.204 MOVI in the arm64 specs it looks like there is no 16 bit MSL variant.

@AndyAyersMS
Copy link
Member

FYI @tannergooding @TIHan -- suspect this may be an arm64 encoding issue.

@TIHan
Copy link
Contributor

TIHan commented Oct 17, 2022

I'll take a look.

@TIHan
Copy link
Contributor

TIHan commented Oct 17, 2022

I actually get an assert when trying to disasm this:

Assert failure(PID 32712 [0x00007fc8], Thread: 33816 [0x8418]): Assertion failed '!varTypeIsStruct(inlArgNode->gtType) && !varTypeIsStruct(sigType)' in 'GitHub_23159:BytesOrdinalEqualsStringAndAscii(System.String,System.Span`1[ubyte]):bool' during 'Morph - Inlining' (IL size 976; hash 0x1a3ab2eb; FullOpts)

    File: C:\work\runtime\src\coreclr\jit\importer.cpp Line: 13523
    Image: C:\work\runtime\artifacts\bin\coreclr\windows.x64.Checked\CoreRun.exe
ERROR:
Assert failure(PID 32712 [0x00007fc8], Thread: 33816 [0x8418]): Assertion failed '!varTypeIsStruct(inlArgNode->gtType) && !varTypeIsStruct(sigType)' in 'GitHub_23159:BytesOrdinalEqualsStringAndAscii(System.String,System.Span`1[ubyte]):bool' during 'Morph - Inlining' (IL size 976; hash 0x1a3ab2eb; FullOpts)

    File: C:\work\runtime\src\coreclr\jit\importer.cpp Line: 13523
    Image: C:\work\runtime\artifacts\bin\coreclr\windows.x64.Checked\CoreRun.exe

Probably unrelated and just a limitation of disasm since it is occurring in importer.cpp.

@BruceForstall
Copy link
Member Author

@TIHan Note that the failure is on win-arm64 and you're using win-x64. If you're using altjit, it might not work.

@TIHan
Copy link
Contributor

TIHan commented Oct 17, 2022

Yes, I was using altjit, but I did manage to isolate it:

    static int Main(string[] args)
    {
        var AllTrue = new Vector<ushort>(ushort.MaxValue);
        Console.Write(AllTrue);

        return 0;
    }

disasm shows:

movi    v16.8h, #0xFF,  MSL #8

@TIHan
Copy link
Contributor

TIHan commented Oct 17, 2022

My guess is that emitIns_valid_imm_for_movi is returning true in this case, which it should not, or, there is logic that is not calling this.