dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.37k stars 4.75k forks source link

[NativeAOT] System.Numerics.Vectors test fails to compile with an assert. #78717

Closed VSadov closed 1 year ago

VSadov commented 1 year ago

To repro - just build tests with chk runtime config (like build.cmd clr+libs+libs.tests -rc Checked -lc Release /p:TestNativeAot=true)

A more direct repro is to just compile one test: "C:\naot02\runtime\artifacts\bin\coreclr\windows.x64.Checked\ilc-published\\ilc" @"C:\naot02\runtime\artifacts\obj\System.Numerics.Vectors.Tests\Release\net7.0\native\System.Numerics.Vectors.Tests.ilc.rsp

The command fails with:

ILC: C:\naot02\runtime\src\coreclr\jit\hwintrinsic.cpp:564
ILC: Assertion failed 'genActualType(arg->gtType) == genActualType(argType)' in 'System.Numerics.Vector:Load[ulong](ulong):System.Numerics.Vector`1[ulong]' during 'Importation' (IL size 7; hash 0xfe953b2c; FullOpts)
ghost commented 1 year ago

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

Issue Details
To repro - just build tests with chk runtime (like `build.cmd clr+libs+libs.tests -rc Checked -lc Release /p:TestNativeAot=true`) A more direct repro is to just compile one test: `"C:\naot02\runtime\artifacts\bin\coreclr\windows.x64.Checked\ilc-published\\ilc" @"C:\naot02\runtime\artifacts\obj\System.Numerics.Vectors.Tests\Release\net7.0\native\System.Numerics.Vectors.Tests.ilc.rsp` The command fails with: ``` ILC: C:\naot02\runtime\src\coreclr\jit\hwintrinsic.cpp:564 ILC: Assertion failed 'genActualType(arg->gtType) == genActualType(argType)' in 'System.Numerics.Vector:Load[ulong](ulong):System.Numerics.Vector`1[ulong]' during 'Importation' (IL size 7; hash 0xfe953b2c; FullOpts) ```
Author: VSadov
Assignees: -
Labels: `area-NativeAOT-coreclr`
Milestone: -
ghost commented 1 year ago

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

Issue Details
To repro - just build tests with chk runtime config (like `build.cmd clr+libs+libs.tests -rc Checked -lc Release /p:TestNativeAot=true`) A more direct repro is to just compile one test: `"C:\naot02\runtime\artifacts\bin\coreclr\windows.x64.Checked\ilc-published\\ilc" @"C:\naot02\runtime\artifacts\obj\System.Numerics.Vectors.Tests\Release\net7.0\native\System.Numerics.Vectors.Tests.ilc.rsp` The command fails with: ``` ILC: C:\naot02\runtime\src\coreclr\jit\hwintrinsic.cpp:564 ILC: Assertion failed 'genActualType(arg->gtType) == genActualType(argType)' in 'System.Numerics.Vector:Load[ulong](ulong):System.Numerics.Vector`1[ulong]' during 'Importation' (IL size 7; hash 0xfe953b2c; FullOpts) ```
Author: VSadov
Assignees: -
Labels: `area-CodeGen-coreclr`, `untriaged`, `area-NativeAOT-coreclr`
Milestone: -
EgorBo commented 1 year ago

I'll take a look, I think jit-diff currently hit the same assert

sodiqjonovich commented 1 year ago

Why is this bug?

EgorBo commented 1 year ago

build.cmd clr+libs+libs.tests -rc Checked -lc Release /p:TestNativeAot=true

This command seems to take a lot of time, still building for me.. (and consumes a lot of space). Is it possible to generate rsp for a specific libs tests without it?

jkotas commented 1 year ago

You can omit +libs.tests and instead go to the specific libraries/.../test directory and run dotnet build /t:Test -c Release /p:TestNativeAot=true there. Most of the workflows from https://github.com/dotnet/runtime/blob/main/docs/workflow/testing/libraries/testing.md work for native AOT - just need to add /p:TestNativeAot=true to all command lines.