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.Tests fails in Debug build #77836

Closed filipnavara closed 1 year ago

filipnavara commented 2 years ago
C:\Users\filip_pq4cffv\Documents\runtime\artifacts\bin\coreclr\windows.x64.Debug\ilc-published\ilc "@C:\Users\filip_pq4cffv\Documents\runtime\artifacts\obj\System.Numerics.Vectors.Tests\Debug\net7.0\native\System.Numerics.Vectors.Tests.ilc.rsp"
ILC: C:\Users\filip_pq4cffv\Documents\runtime\src\coreclr\jit\compiler.h:8788
ILC: Assertion failed '!"Unexpected size for SIMD type"' in 'System.Numerics.Vector`1[System.Half]:get_Item(int):System.Half:this' during 'Importation' (IL size 18; hash 0x11284064; MinOpts)

ILC: C:\Users\filip_pq4cffv\Documents\runtime\src\coreclr\jit\compiler.h:8788
ILC: Assertion failed '!"Unexpected size for SIMD type"' in 'System.Numerics.Vector`1[System.Int128]:get_Item(int):System.Int128:this' during 'Importation' (IL size 18; hash 0x165c7d84; MinOpts)
ghost commented 2 years ago

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

Issue Details
``` C:\Users\filip_pq4cffv\Documents\runtime\artifacts\bin\coreclr\windows.x64.Debug\ilc-published\ilc "@C:\Users\filip_pq4cffv\Documents\runtime\artifacts\obj\System.Numerics.Vectors.Tests\Debug\net7.0\native\System.Numerics.Vectors.Tests.ilc.rsp" ILC: C:\Users\filip_pq4cffv\Documents\runtime\src\coreclr\jit\compiler.h:8788 ILC: Assertion failed '!"Unexpected size for SIMD type"' in 'System.Numerics.Vector`1[System.Half]:get_Item(int):System.Half:this' during 'Importation' (IL size 18; hash 0x11284064; MinOpts) ILC: C:\Users\filip_pq4cffv\Documents\runtime\src\coreclr\jit\compiler.h:8788 ILC: Assertion failed '!"Unexpected size for SIMD type"' in 'System.Numerics.Vector`1[System.Int128]:get_Item(int):System.Int128:this' during 'Importation' (IL size 18; hash 0x165c7d84; MinOpts) ```
Author: filipnavara
Assignees: -
Labels: `area-CodeGen-coreclr`
Milestone: -
filipnavara commented 2 years ago

There are more targeted repro steps but I hit this with .\build.cmd clr+clr.aot+libs+libs.tests -test /p:TestNativeAot=true on Windows x64 machine.

jkotas commented 2 years ago

Repro steps without NativeAOT:

using System;
using System.Numerics;
using System.Reflection;
using System.Runtime.CompilerServices;

var m = typeof(Vector<Int128>).GetMethod("get_Item");
RuntimeHelpers.PrepareMethod(m.MethodHandle);
EgorBo commented 1 year ago

Fixed in https://github.com/dotnet/runtime/pull/78765