dotnet / runtime

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

Matrix4x4IndexerGetTest and Matrix4x4IndexerSetTest failing on native AOT arm64 #104232

Closed MichalStrehovsky closed 3 months ago

MichalStrehovsky commented 3 months ago

Failing on native AOT outerloop testing in arm64 legs only.

E.g. here https://dev.azure.com/dnceng-public/public/_build/results?buildId=725747&view=logs&jobId=2f6a7d26-0d60-5ade-d191-981fe0847989

Going to block the tests on this bug to get the CI clean.

[FAIL] System.Numerics.Tests.Matrix4x4Tests.Matrix4x4IndexerSetTest(m11: 3.14343429, m12: 1.12341225, m13: 0.123412304, m14: -0.123412304, m21: 3.14343429, m22: 1.12341225, m23: 3.14343429, m24: 1.12341225, m31: 0.123412304, m32: -0.123412304, m33: 3.14343429, m34: 1.12341225, m41: 3.14343429, m42: 1.12341225, m43: 0.123412304, m44: -0.123412304)
Assert.Equal() Failure: Values differ
Expected: 3.14343429
Actual:   0.123412304
   at System.Numerics.Tests.Matrix4x4Tests.Matrix4x4IndexerSetTest(Single m11, Single m12, Single m13, Single m14, Single m21, Single m22, Single m23, Single m24, Single m31, Single m32, Single m33, Single m34, Single m41, Single m42, Single m43, Single m44) + 0x29c
   at System.Numerics.Vectors!<BaseAddress>+0x13c6cf4
   at System.Reflection.DynamicInvokeInfo.InvokeWithManyArguments(IntPtr methodToCall, Byte& thisArg, Byte& ret, Object[] parameters, BinderBundle binderBundle, Boolean wrapInTargetInvocationException) + 0x144
[FAIL] System.Numerics.Tests.Matrix4x4Tests.Matrix4x4IndexerSetTest(m11: 1.00000012, m12: 1.00000001E-07, m13: 2, m14: 2.00000002E-07, m21: 1.00000012, m22: 1.00000001E-07, m23: 1.00000012, m24: 1.00000001E-07, m31: 2, m32: 2.00000002E-07, m33: 1.00000012, m34: 1.00000001E-07, m41: 1.00000012, m42: 1.00000001E-07, m43: 2, m44: 2.00000002E-07)
Assert.Equal() Failure: Values differ
Expected: 1.00000012
Actual:   2
   at System.Numerics.Tests.Matrix4x4Tests.Matrix4x4IndexerSetTest(Single m11, Single m12, Single m13, Single m14, Single m21, Single m22, Single m23, Single m24, Single m31, Single m32, Single m33, Single m34, Single m41, Single m42, Single m43, Single m44) + 0x29c
   at System.Numerics.Vectors!<BaseAddress>+0x13c6cf4
   at System.Reflection.DynamicInvokeInfo.InvokeWithManyArguments(IntPtr methodToCall, Byte& thisArg, Byte& ret, Object[] parameters, BinderBundle binderBundle, Boolean wrapInTargetInvocationException) + 0x144
[FAIL] System.Numerics.Tests.Matrix4x4Tests.Matrix4x4IndexerGetTest(m11: 3.14343429, m12: 1.12341225, m13: 0.123412304, m14: -0.123412304, m21: 3.14343429, m22: 1.12341225, m23: 3.14343429, m24: 1.12341225, m31: 0.123412304, m32: -0.123412304, m33: 3.14343429, m34: 1.12341225, m41: 3.14343429, m42: 1.12341225, m43: 0.123412304, m44: -0.123412304)
Assert.Equal() Failure: Values differ
Expected: 3.14343429
Actual:   0.123412304
   at System.Numerics.Tests.Matrix4x4Tests.Matrix4x4IndexerGetTest(Single m11, Single m12, Single m13, Single m14, Single m21, Single m22, Single m23, Single m24, Single m31, Single m32, Single m33, Single m34, Single m41, Single m42, Single m43, Single m44) + 0x1bc
   at System.Numerics.Vectors!<BaseAddress>+0x13c6cf4
   at System.Reflection.DynamicInvokeInfo.InvokeWithManyArguments(IntPtr methodToCall, Byte& thisArg, Byte& ret, Object[] parameters, BinderBundle binderBundle, Boolean wrapInTargetInvocationException) + 0x144
[FAIL] System.Numerics.Tests.Matrix4x4Tests.Matrix4x4IndexerGetTest(m11: 1.00000012, m12: 1.00000001E-07, m13: 2, m14: 2.00000002E-07, m21: 1.00000012, m22: 1.00000001E-07, m23: 1.00000012, m24: 1.00000001E-07, m31: 2, m32: 2.00000002E-07, m33: 1.00000012, m34: 1.00000001E-07, m41: 1.00000012, m42: 1.00000001E-07, m43: 2, m44: 2.00000002E-07)
Assert.Equal() Failure: Values differ
Expected: 1.00000012
Actual:   2
   at System.Numerics.Tests.Matrix4x4Tests.Matrix4x4IndexerGetTest(Single m11, Single m12, Single m13, Single m14, Single m21, Single m22, Single m23, Single m24, Single m31, Single m32, Single m33, Single m34, Single m41, Single m42, Single m43, Single m44) + 0x1bc
   at System.Numerics.Vectors!<BaseAddress>+0x13c6cf4
   at System.Reflection.DynamicInvokeInfo.InvokeWithManyArguments(IntPtr methodToCall, Byte& thisArg, Byte& ret, Object[] parameters, BinderBundle binderBundle, Boolean wrapInTargetInvocationException) + 0x144
Finished System.Numerics.Vectors.Tests, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51

Tests run: 2227, Errors: 0, Failures: 4, Skipped: 0. Time: 1.06985s
dotnet-policy-service[bot] commented 3 months ago

Tagging subscribers to this area: @dotnet/area-system-numerics See info in area-owners.md if you want to be subscribed.

tannergooding commented 3 months ago

I wonder if this is related to https://github.com/dotnet/runtime/pull/104204, but it's surprising that its only failing in NAOT and only for these tests.

tannergooding commented 3 months ago

In all cases here, it looks to be retrieving index 2 (m13) instead of index 0 (m11).

JulieLeeMSFT commented 3 months ago

It is failing in runtime-coreclr superpmi-collect as well for arm64.