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

[Android][x86] System.Runtime.InteropServices.Tests.NFloatTests failed #65557

Closed
MaximLipnin opened this issue Feb 18, 2022 · 8 comments · Fixed by #65723
Closed

[Android][x86] System.Runtime.InteropServices.Tests.NFloatTests failed #65557

MaximLipnin opened this issue Feb 18, 2022 · 8 comments · Fixed by #65723

Comments

@MaximLipnin
Copy link
Contributor

There are the following failures in the System.Runtime.InteropServices.Tests.NFloatTests library test suite which are being hit on Android x86 leg in #65551:

<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(left: -4567, right: 3.1400001)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Subtraction" time="0.0140883" result="Fail">
<failure exception-type="Xunit.Sdk.EqualException">
    <message><![CDATA[Assert.Equal() Failure\nExpected: -4570.1400001049042\nActual:   -4570.14013671875]]></message>
    <stack-trace><![CDATA[   at System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(Single left, Single right) in /_/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/NFloatTests.cs:line 244
at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)]]></stack-trace>
</failure>
</test>
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(left: -4567.89111, right: 3.14568996)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Subtraction" time="0.0003036" result="Fail">
<failure exception-type="Xunit.Sdk.EqualException">
    <message><![CDATA[Assert.Equal() Failure\nExpected: -4571.0368032455444\nActual:   -4571.03662109375]]></message>
    <stack-trace><![CDATA[   at System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(Single left, Single right) in /_/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/NFloatTests.cs:line 244
at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)]]></stack-trace>
</failure>
</test>
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(left: 0, right: 3.1400001)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Subtraction" time="0.0000064" result="Pass" />
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(left: 4567, right: -3.1400001)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Subtraction" time="0.0002445" result="Fail">
<failure exception-type="Xunit.Sdk.EqualException">
    <message><![CDATA[Assert.Equal() Failure\nExpected: 4570.1400001049042\nActual:   4570.14013671875]]></message>
    <stack-trace><![CDATA[   at System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(Single left, Single right) in /_/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/NFloatTests.cs:line 244
at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)]]></stack-trace>
</failure>
</test>
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(left: 4567.89111, right: -3.14568996)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Subtraction" time="0.000254" result="Fail">
<failure exception-type="Xunit.Sdk.EqualException">
    <message><![CDATA[Assert.Equal() Failure\nExpected: 4571.0368032455444\nActual:   4571.03662109375]]></message>
    <stack-trace><![CDATA[   at System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(Single left, Single right) in /_/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/NFloatTests.cs:line 244
at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)]]></stack-trace>
</failure>
</test>
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Division(left: -4567, right: 3.1400001)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Division" time="0.0005455" result="Fail">
<failure exception-type="Xunit.Sdk.EqualException">
    <message><![CDATA[Assert.Equal() Failure\nExpected: -1454.4585501341485\nActual:   -1454.45849609375]]></message>
    <stack-trace><![CDATA[   at System.Runtime.InteropServices.Tests.NFloatTests.op_Division(Single left, Single right) in /_/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/NFloatTests.cs:line 284
at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)]]></stack-trace>
</failure>
</test>
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Division(left: -4567.89111, right: 3.14568996)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Division" time="0.000232" result="Fail">
<failure exception-type="Xunit.Sdk.EqualException">
    <message><![CDATA[Assert.Equal() Failure\nExpected: -1452.1110360937337\nActual:   -1452.111083984375]]></message>
    <stack-trace><![CDATA[   at System.Runtime.InteropServices.Tests.NFloatTests.op_Division(Single left, Single right) in /_/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/NFloatTests.cs:line 284
at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)]]></stack-trace>
</failure>
</test>
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Division(left: 0, right: 3.1400001)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Division" time="0.0000054" result="Pass" />
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Division(left: 4567, right: -3.1400001)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Division" time="0.0002909" result="Fail">
<failure exception-type="Xunit.Sdk.EqualException">
    <message><![CDATA[Assert.Equal() Failure\nExpected: -1454.4585501341485\nActual:   -1454.45849609375]]></message>
    <stack-trace><![CDATA[   at System.Runtime.InteropServices.Tests.NFloatTests.op_Division(Single left, Single right) in /_/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/NFloatTests.cs:line 284
at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)]]></stack-trace>
</failure>
</test>
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Division(left: 4567.89111, right: -3.14568996)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Division" time="0.0002319" result="Fail">
<failure exception-type="Xunit.Sdk.EqualException">
    <message><![CDATA[Assert.Equal() Failure\nExpected: -1452.1110360937337\nActual:   -1452.111083984375]]></message>
    <stack-trace><![CDATA[   at System.Runtime.InteropServices.Tests.NFloatTests.op_Division(Single left, Single right) in /_/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/NFloatTests.cs:line 284
at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)]]></stack-trace>
</failure>
</test>
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(left: -4567, right: 3.1400001)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Addition" time="0.0005737" result="Fail">
<failure exception-type="Xunit.Sdk.EqualException">
    <message><![CDATA[Assert.Equal() Failure\nExpected: -4563.8599998950958\nActual:   -4563.85986328125]]></message>
    <stack-trace><![CDATA[   at System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(Single left, Single right) in /_/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/NFloatTests.cs:line 224
at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)]]></stack-trace>
</failure>
</test>
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(left: -4567.89111, right: 3.14568996)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Addition" time="0.0002292" result="Fail">
<failure exception-type="Xunit.Sdk.EqualException">
    <message><![CDATA[Assert.Equal() Failure\nExpected: -4564.7454233169556\nActual:   -4564.74560546875]]></message>
    <stack-trace><![CDATA[   at System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(Single left, Single right) in /_/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/NFloatTests.cs:line 224
at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)]]></stack-trace>
</failure>
</test>
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(left: 0, right: 3.1400001)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Addition" time="0.0000053" result="Pass" />
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(left: 4567, right: -3.1400001)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Addition" time="0.0029769" result="Fail">
<failure exception-type="Xunit.Sdk.EqualException">
    <message><![CDATA[Assert.Equal() Failure\nExpected: 4563.8599998950958\nActual:   4563.85986328125]]></message>
    <stack-trace><![CDATA[   at System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(Single left, Single right) in /_/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/NFloatTests.cs:line 224
at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)]]></stack-trace>
</failure>
</test>
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(left: 4567.89111, right: -3.14568996)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Addition" time="0.0002373" result="Fail">
<failure exception-type="Xunit.Sdk.EqualException">
    <message><![CDATA[Assert.Equal() Failure\nExpected: 4564.7454233169556\nActual:   4564.74560546875]]></message>
    <stack-trace><![CDATA[   at System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(Single left, Single right) in /_/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/NFloatTests.cs:line 224
at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)]]></stack-trace>
</failure>
</test>
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(left: -4567, right: 3.1400001)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Multiply" time="0.0005585" result="Fail">
<failure exception-type="Xunit.Sdk.EqualException">
    <message><![CDATA[Assert.Equal() Failure\nExpected: -14340.380479097366\nActual:   -14340.380859375]]></message>
    <stack-trace><![CDATA[   at System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(Single left, Single right) in /_/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/NFloatTests.cs:line 264
at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)]]></stack-trace>
</failure>
</test>
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(left: -4567.89111, right: 3.14568996)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Multiply" time="0.0002354" result="Fail">
<failure exception-type="Xunit.Sdk.EqualException">
    <message><![CDATA[Assert.Equal() Failure\nExpected: -14369.169233038556\nActual:   -14369.1689453125]]></message>
    <stack-trace><![CDATA[   at System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(Single left, Single right) in /_/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/NFloatTests.cs:line 264
at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)]]></stack-trace>
</failure>
</test>
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(left: 0, right: 3.1400001)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Multiply" time="0.0000054" result="Pass" />
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(left: 4567, right: -3.1400001)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Multiply" time="0.0020525" result="Fail">
<failure exception-type="Xunit.Sdk.EqualException">
    <message><![CDATA[Assert.Equal() Failure\nExpected: -14340.380479097366\nActual:   -14340.380859375]]></message>
    <stack-trace><![CDATA[   at System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(Single left, Single right) in /_/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/NFloatTests.cs:line 264
at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)]]></stack-trace>
</failure>
</test>
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(left: 4567.89111, right: -3.14568996)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Multiply" time="0.0002333" result="Fail">
<failure exception-type="Xunit.Sdk.EqualException">
    <message><![CDATA[Assert.Equal() Failure\nExpected: -14369.169233038556\nActual:   -14369.1689453125]]></message>
    <stack-trace><![CDATA[   at System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(Single left, Single right) in /_/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/NFloatTests.cs:line 264
at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)]]></stack-trace>
</failure>
</test>

https://dev.azure.com/dnceng/public/_build/results?buildId=1620509&view=ms.vss-test-web.build-test-results-tab&runId=45058618&paneView=debug&resultId=166936

cc @steveisok @akoeplinger @tannergooding @vargaz

@ghost
Copy link

ghost commented Feb 18, 2022

Tagging subscribers to 'arch-android': @steveisok, @akoeplinger
See info in area-owners.md if you want to be subscribed.

Issue Details

There are the following failures in the System.Runtime.InteropServices.Tests.NFloatTests library test suite which are being hit on Android x86 leg in #65551:

<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(left: -4567, right: 3.1400001)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Subtraction" time="0.0140883" result="Fail">
<failure exception-type="Xunit.Sdk.EqualException">
    <message><![CDATA[Assert.Equal() Failure\nExpected: -4570.1400001049042\nActual:   -4570.14013671875]]></message>
    <stack-trace><![CDATA[   at System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(Single left, Single right) in /_/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/NFloatTests.cs:line 244
at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)]]></stack-trace>
</failure>
</test>
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(left: -4567.89111, right: 3.14568996)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Subtraction" time="0.0003036" result="Fail">
<failure exception-type="Xunit.Sdk.EqualException">
    <message><![CDATA[Assert.Equal() Failure\nExpected: -4571.0368032455444\nActual:   -4571.03662109375]]></message>
    <stack-trace><![CDATA[   at System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(Single left, Single right) in /_/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/NFloatTests.cs:line 244
at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)]]></stack-trace>
</failure>
</test>
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(left: 0, right: 3.1400001)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Subtraction" time="0.0000064" result="Pass" />
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(left: 4567, right: -3.1400001)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Subtraction" time="0.0002445" result="Fail">
<failure exception-type="Xunit.Sdk.EqualException">
    <message><![CDATA[Assert.Equal() Failure\nExpected: 4570.1400001049042\nActual:   4570.14013671875]]></message>
    <stack-trace><![CDATA[   at System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(Single left, Single right) in /_/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/NFloatTests.cs:line 244
at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)]]></stack-trace>
</failure>
</test>
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(left: 4567.89111, right: -3.14568996)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Subtraction" time="0.000254" result="Fail">
<failure exception-type="Xunit.Sdk.EqualException">
    <message><![CDATA[Assert.Equal() Failure\nExpected: 4571.0368032455444\nActual:   4571.03662109375]]></message>
    <stack-trace><![CDATA[   at System.Runtime.InteropServices.Tests.NFloatTests.op_Subtraction(Single left, Single right) in /_/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/NFloatTests.cs:line 244
at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)]]></stack-trace>
</failure>
</test>
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Division(left: -4567, right: 3.1400001)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Division" time="0.0005455" result="Fail">
<failure exception-type="Xunit.Sdk.EqualException">
    <message><![CDATA[Assert.Equal() Failure\nExpected: -1454.4585501341485\nActual:   -1454.45849609375]]></message>
    <stack-trace><![CDATA[   at System.Runtime.InteropServices.Tests.NFloatTests.op_Division(Single left, Single right) in /_/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/NFloatTests.cs:line 284
at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)]]></stack-trace>
</failure>
</test>
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Division(left: -4567.89111, right: 3.14568996)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Division" time="0.000232" result="Fail">
<failure exception-type="Xunit.Sdk.EqualException">
    <message><![CDATA[Assert.Equal() Failure\nExpected: -1452.1110360937337\nActual:   -1452.111083984375]]></message>
    <stack-trace><![CDATA[   at System.Runtime.InteropServices.Tests.NFloatTests.op_Division(Single left, Single right) in /_/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/NFloatTests.cs:line 284
at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)]]></stack-trace>
</failure>
</test>
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Division(left: 0, right: 3.1400001)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Division" time="0.0000054" result="Pass" />
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Division(left: 4567, right: -3.1400001)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Division" time="0.0002909" result="Fail">
<failure exception-type="Xunit.Sdk.EqualException">
    <message><![CDATA[Assert.Equal() Failure\nExpected: -1454.4585501341485\nActual:   -1454.45849609375]]></message>
    <stack-trace><![CDATA[   at System.Runtime.InteropServices.Tests.NFloatTests.op_Division(Single left, Single right) in /_/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/NFloatTests.cs:line 284
at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)]]></stack-trace>
</failure>
</test>
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Division(left: 4567.89111, right: -3.14568996)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Division" time="0.0002319" result="Fail">
<failure exception-type="Xunit.Sdk.EqualException">
    <message><![CDATA[Assert.Equal() Failure\nExpected: -1452.1110360937337\nActual:   -1452.111083984375]]></message>
    <stack-trace><![CDATA[   at System.Runtime.InteropServices.Tests.NFloatTests.op_Division(Single left, Single right) in /_/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/NFloatTests.cs:line 284
at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)]]></stack-trace>
</failure>
</test>
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(left: -4567, right: 3.1400001)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Addition" time="0.0005737" result="Fail">
<failure exception-type="Xunit.Sdk.EqualException">
    <message><![CDATA[Assert.Equal() Failure\nExpected: -4563.8599998950958\nActual:   -4563.85986328125]]></message>
    <stack-trace><![CDATA[   at System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(Single left, Single right) in /_/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/NFloatTests.cs:line 224
at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)]]></stack-trace>
</failure>
</test>
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(left: -4567.89111, right: 3.14568996)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Addition" time="0.0002292" result="Fail">
<failure exception-type="Xunit.Sdk.EqualException">
    <message><![CDATA[Assert.Equal() Failure\nExpected: -4564.7454233169556\nActual:   -4564.74560546875]]></message>
    <stack-trace><![CDATA[   at System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(Single left, Single right) in /_/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/NFloatTests.cs:line 224
at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)]]></stack-trace>
</failure>
</test>
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(left: 0, right: 3.1400001)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Addition" time="0.0000053" result="Pass" />
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(left: 4567, right: -3.1400001)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Addition" time="0.0029769" result="Fail">
<failure exception-type="Xunit.Sdk.EqualException">
    <message><![CDATA[Assert.Equal() Failure\nExpected: 4563.8599998950958\nActual:   4563.85986328125]]></message>
    <stack-trace><![CDATA[   at System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(Single left, Single right) in /_/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/NFloatTests.cs:line 224
at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)]]></stack-trace>
</failure>
</test>
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(left: 4567.89111, right: -3.14568996)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Addition" time="0.0002373" result="Fail">
<failure exception-type="Xunit.Sdk.EqualException">
    <message><![CDATA[Assert.Equal() Failure\nExpected: 4564.7454233169556\nActual:   4564.74560546875]]></message>
    <stack-trace><![CDATA[   at System.Runtime.InteropServices.Tests.NFloatTests.op_Addition(Single left, Single right) in /_/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/NFloatTests.cs:line 224
at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)]]></stack-trace>
</failure>
</test>
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(left: -4567, right: 3.1400001)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Multiply" time="0.0005585" result="Fail">
<failure exception-type="Xunit.Sdk.EqualException">
    <message><![CDATA[Assert.Equal() Failure\nExpected: -14340.380479097366\nActual:   -14340.380859375]]></message>
    <stack-trace><![CDATA[   at System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(Single left, Single right) in /_/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/NFloatTests.cs:line 264
at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)]]></stack-trace>
</failure>
</test>
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(left: -4567.89111, right: 3.14568996)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Multiply" time="0.0002354" result="Fail">
<failure exception-type="Xunit.Sdk.EqualException">
    <message><![CDATA[Assert.Equal() Failure\nExpected: -14369.169233038556\nActual:   -14369.1689453125]]></message>
    <stack-trace><![CDATA[   at System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(Single left, Single right) in /_/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/NFloatTests.cs:line 264
at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)]]></stack-trace>
</failure>
</test>
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(left: 0, right: 3.1400001)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Multiply" time="0.0000054" result="Pass" />
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(left: 4567, right: -3.1400001)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Multiply" time="0.0020525" result="Fail">
<failure exception-type="Xunit.Sdk.EqualException">
    <message><![CDATA[Assert.Equal() Failure\nExpected: -14340.380479097366\nActual:   -14340.380859375]]></message>
    <stack-trace><![CDATA[   at System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(Single left, Single right) in /_/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/NFloatTests.cs:line 264
at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)]]></stack-trace>
</failure>
</test>
<test name="System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(left: 4567.89111, right: -3.14568996)" type="System.Runtime.InteropServices.Tests.NFloatTests" method="op_Multiply" time="0.0002333" result="Fail">
<failure exception-type="Xunit.Sdk.EqualException">
    <message><![CDATA[Assert.Equal() Failure\nExpected: -14369.169233038556\nActual:   -14369.1689453125]]></message>
    <stack-trace><![CDATA[   at System.Runtime.InteropServices.Tests.NFloatTests.op_Multiply(Single left, Single right) in /_/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/NFloatTests.cs:line 264
at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)]]></stack-trace>
</failure>
</test>

https://dev.azure.com/dnceng/public/_build/results?buildId=1620509&view=ms.vss-test-web.build-test-results-tab&runId=45058618&paneView=debug&resultId=166936

cc @steveisok @akoeplinger @tannergooding @vargaz

Author: MaximLipnin
Assignees: -
Labels:

arch-x86, os-android

Milestone: -

@dotnet-issue-labeler dotnet-issue-labeler bot added area-System.Runtime.InteropServices untriaged New issue has not been triaged by the area owner labels Feb 18, 2022
@vargaz
Copy link
Contributor

vargaz commented Feb 18, 2022

Float tests should not compare using exact equality, they should use the
Assert.Equal(expected,actual,precision) variant.

@tannergooding
Copy link
Member

@vargaz, no.

IEEE 754 floating-point is deterministic and there are plenty of cases where using exact equality is warranted and correct.

In this case, these are all testing single simple operations and that nfloat op nfloat produces the bitwise identical result to double op double on 64-bit and float op float on 32-bit.

These represent concrete and real bugs in mono and need to be fixed.

@tannergooding
Copy link
Member

tannergooding commented Feb 18, 2022

That is, these represent issues where the code executing for the given architecture is not IEEE 754 compliant and is likely due to the JIT/AOT performing invalid optimizations or other changes to the code.

@vargaz
Copy link
Contributor

vargaz commented Feb 18, 2022

mono on x86 is still using the old fp stack based fp instructions which operate with a different precision, that might be the cause of these problems.

@tannergooding
Copy link
Member

tannergooding commented Feb 18, 2022

In particular, the test is doing:

[Theory]
[InlineData(-4567.0f, 3.14f)]
[InlineData(-4567.89101f, 3.14569f)]
[InlineData(0.0f, 3.14f)]
[InlineData(4567.0f, -3.14f)]
[InlineData(4567.89101f, -3.14569f)]
public static void op_Subtraction(float left, float right)
{
    NFloat result = new NFloat(left) - new NFloat(right);

    if (Environment.Is64BitProcess)
    {
        Assert.Equal((double)left - right, result.Value);
    }
    else
    {
        Assert.Equal(left - right, result.Value);
    }
}

where

[NonVersionable]
public static NFloat operator -(NFloat left, NFloat right) => new NFloat(left._value - right._value);

and where:

#if TARGET_32BIT
using NativeType = System.Single;
#else
using NativeType = System.Double;
#endif

// ...

private readonly NativeType _value;

The inputs in question here are -4567 (which is exactly representable) and 3.14 (whose exact represented value is 3.1400001049041748046875). The exact computed result here is -4570.1400001049041748046875 which then must be rounded to the nearest representable float: -4570.14013671875

Assert.Equal is the double overload and so it looks like Mono is treating the left - right as (double)left - (double)right, rather than as (double)(left - right) .

We could "fix" this in the tests by inserting an explicit cast to float; e.g. (float)(left - right). But this also represents a determinism bug in Mono as compared to what RyuJIT does, with what most hardware/other languages do, and with regards to what the user likely intended. It also represents a case where Mono is not IEEE 754 compliant, which while "allowed" by the original ECMA-335 spec (due to only having the F stack type) is likely very undesirable and ultimately makes the code less readable, more error prone, and was designed around the x87 FPU unit existing at the time (which doesn't match what hardware from ~2004 onwards as used as the standard and what other architectures like Arm32, Arm64, etc follow).

@vargaz vargaz self-assigned this Feb 18, 2022
@vargaz
Copy link
Contributor

vargaz commented Feb 18, 2022

Will try to transition the x86 backend to SSE, will take some time. In the meantime, these tests should be disabled on mono+x86.

@MaximLipnin
Copy link
Contributor Author

In the meantime, these tests should be disabled on mono+x86.

Yeah, they are going to be disabled in #65551

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Mar 23, 2022
@AaronRobinsonMSFT AaronRobinsonMSFT removed the untriaged New issue has not been triaged by the area owner label May 11, 2022
@steveisok steveisok added this to the Future milestone Jul 18, 2022
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Aug 8, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Sep 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants