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

[tvOS][arm64] Vector128Tests.Vector128NIntSumTest/Vector128NUIntSumTest failed on the rolling build #63746

Open
MaximLipnin opened this issue Jan 13, 2022 · 9 comments
Assignees
Milestone

Comments

@MaximLipnin
Copy link
Contributor

<test name="System.Runtime.Intrinsics.Tests.Vectors.Vector128Tests.Vector128NIntSumTest" type="System.Runtime.Intrinsics.Tests.Vectors.Vector128Tests" method="Vector128NIntSumTest" time="0.0060218" result="Fail">
    <failure exception-type="Xunit.Sdk.EqualException">
        <message><![CDATA[Assert.Equal() Failure\nExpected: 2\nActual:   40452]]></message>
        <stack-trace><![CDATA[   at System.Runtime.Intrinsics.Tests.Vectors.Vector128Tests.Vector128NIntSumTest()
    at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)]]></stack-trace>
    </failure>
</test>
<test name="System.Runtime.Intrinsics.Tests.Vectors.Vector128Tests.Vector128NUIntSumTest" type="System.Runtime.Intrinsics.Tests.Vectors.Vector128Tests" method="Vector128NUIntSumTest" time="0.0017315" result="Fail">
    <failure exception-type="Xunit.Sdk.EqualException">
        <message><![CDATA[Assert.Equal() Failure\nExpected: 2\nActual:   40452]]></message>
        <stack-trace><![CDATA[   at System.Runtime.Intrinsics.Tests.Vectors.Vector128Tests.Vector128NUIntSumTest()
    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=1550469&view=ms.vss-test-web.build-test-results-tab&runId=43767104&resultId=112398&paneView=dotnet-dnceng.dnceng-anon-build-release-tasks.helix-anon-test-information-tab

@steveisok @akoeplinger

@dotnet-issue-labeler dotnet-issue-labeler bot added area-System.Runtime.Intrinsics untriaged New issue has not been triaged by the area owner labels Jan 13, 2022
@ghost
Copy link

ghost commented Jan 13, 2022

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

Issue Details
<test name="System.Runtime.Intrinsics.Tests.Vectors.Vector128Tests.Vector128NIntSumTest" type="System.Runtime.Intrinsics.Tests.Vectors.Vector128Tests" method="Vector128NIntSumTest" time="0.0060218" result="Fail">
    <failure exception-type="Xunit.Sdk.EqualException">
        <message><![CDATA[Assert.Equal() Failure\nExpected: 2\nActual:   40452]]></message>
        <stack-trace><![CDATA[   at System.Runtime.Intrinsics.Tests.Vectors.Vector128Tests.Vector128NIntSumTest()
    at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)]]></stack-trace>
    </failure>
</test>
<test name="System.Runtime.Intrinsics.Tests.Vectors.Vector128Tests.Vector128NUIntSumTest" type="System.Runtime.Intrinsics.Tests.Vectors.Vector128Tests" method="Vector128NUIntSumTest" time="0.0017315" result="Fail">
    <failure exception-type="Xunit.Sdk.EqualException">
        <message><![CDATA[Assert.Equal() Failure\nExpected: 2\nActual:   40452]]></message>
        <stack-trace><![CDATA[   at System.Runtime.Intrinsics.Tests.Vectors.Vector128Tests.Vector128NUIntSumTest()
    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=1550469&view=ms.vss-test-web.build-test-results-tab&runId=43767104&resultId=112398&paneView=dotnet-dnceng.dnceng-anon-build-release-tasks.helix-anon-test-information-tab

@steveisok @akoeplinger

Author: MaximLipnin
Assignees: -
Labels:

area-System.Runtime.Intrinsics, untriaged

Milestone: -

@MaximLipnin MaximLipnin added the os-tvos Apple tvOS label Jan 13, 2022
@ghost
Copy link

ghost commented Jan 13, 2022

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

Issue Details
<test name="System.Runtime.Intrinsics.Tests.Vectors.Vector128Tests.Vector128NIntSumTest" type="System.Runtime.Intrinsics.Tests.Vectors.Vector128Tests" method="Vector128NIntSumTest" time="0.0060218" result="Fail">
    <failure exception-type="Xunit.Sdk.EqualException">
        <message><![CDATA[Assert.Equal() Failure\nExpected: 2\nActual:   40452]]></message>
        <stack-trace><![CDATA[   at System.Runtime.Intrinsics.Tests.Vectors.Vector128Tests.Vector128NIntSumTest()
    at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)]]></stack-trace>
    </failure>
</test>
<test name="System.Runtime.Intrinsics.Tests.Vectors.Vector128Tests.Vector128NUIntSumTest" type="System.Runtime.Intrinsics.Tests.Vectors.Vector128Tests" method="Vector128NUIntSumTest" time="0.0017315" result="Fail">
    <failure exception-type="Xunit.Sdk.EqualException">
        <message><![CDATA[Assert.Equal() Failure\nExpected: 2\nActual:   40452]]></message>
        <stack-trace><![CDATA[   at System.Runtime.Intrinsics.Tests.Vectors.Vector128Tests.Vector128NUIntSumTest()
    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=1550469&view=ms.vss-test-web.build-test-results-tab&runId=43767104&resultId=112398&paneView=dotnet-dnceng.dnceng-anon-build-release-tasks.helix-anon-test-information-tab

@steveisok @akoeplinger

Author: MaximLipnin
Assignees: -
Labels:

area-System.Runtime.Intrinsics, untriaged, os-tvos

Milestone: -

@danmoseley
Copy link
Member

@tannergooding

@steveisok
Copy link
Member

fyi - tvOS arm64 is our device run.

@steveisok
Copy link
Member

@vargaz do you think this is going to work as expected at all on the device?

@danmoseley
Copy link
Member

I'm curious about the expected VectorNN story on devices and WASM as well.

@imhameed
Copy link
Contributor

imhameed commented Jan 13, 2022

@vargaz do you think this is going to work as expected at all on the device?

I'm curious about the expected VectorNN story on devices

NEON is a part of ARMv8-A so Vector64/Vector128 should be fully supported on arm64 tvOS devices. These tests all passed on arm64 Linux hardware on CI, when the LLVM AOT and LLVM FullAOT lanes were still enabled per-PR. Additionally they passed when I ran them by hand last year on an arm64 Linux machine and on an arm64 Linux VM running on an M1 mac. I have an Apple TV device on hand so I can look into this.

No idea about Wasm though.

@imhameed imhameed self-assigned this Jan 13, 2022
@tannergooding
Copy link
Member

NEON is a part of ARMv8-A so Vector64/Vector128 should be fully supported on arm64 tvOS devices

Just noting that these APIs in particular are new and have software fallbacks. They won't be accelerated on Mono yet and so the software fallback is what's likely failing here.

The software fallback is: https://source.dot.net/#System.Private.CoreLib/Vector128.cs,f8444b31977d1b83:

[Intrinsic]
public static T Sum<T>(Vector128<T> vector)
    where T : struct
{
    T sum = default;

    for (int index = 0; index < Vector128<T>.Count; index++)
    {
        sum = Scalar<T>.Add(sum, vector.GetElementUnsafe(index));
    }

    return sum;
}

The Scalar<T>.Add method is ultimately going to be doing:

// ...
else if (typeof(T) == typeof(nint))
{
    return (T)(object)((nint)(object)left + (nint)(object)right);
}
else if (typeof(T) == typeof(nuint))
{
    return (T)(object)((nuint)(object)left + (nuint)(object)right);
}
// ...

And GetElementUnsafe is doing:

[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static T GetElementUnsafe<T>(in this Vector128<T> vector, int index)
    where T : struct
{
    Debug.Assert((index >= 0) && (index < Vector128<T>.Count));
    return Unsafe.Add(ref Unsafe.As<Vector128<T>, T>(ref Unsafe.AsRef(in vector)), index);
}

Also noting however that this is the "safe" fallback implementation used by Vector<T> which has been running and passing for several months now.

@vargaz
Copy link
Contributor

vargaz commented Jan 16, 2022

There is another set of test failures on tvos which appears related:
#61920

@SamMonoRT SamMonoRT added area-Codegen-meta-mono and removed untriaged New issue has not been triaged by the area owner area-System.Runtime.Intrinsics labels Mar 1, 2022
@SamMonoRT SamMonoRT assigned vargaz and unassigned imhameed Mar 1, 2022
vargaz added a commit to vargaz/runtime that referenced this issue May 22, 2022
@steveisok steveisok added this to the 8.0.0 milestone Aug 1, 2022
@steveisok steveisok modified the milestones: 8.0.0, Future Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants