You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ARM64 Vector2 multiplication breaks in .NET 8 #98137
This does not occur in Debug Mode. If I don't wrap the code in a function (Step) it doesn't seem to happen. If I hard code the floating value (Vector2.One * 4.0f) it doesn't seem to happen.
Reproduction Steps
Simply create a new console project in .NET 8 and run the above code in Program.cs with dotnet run -c Release. After running for a few hundred milliseconds the application will throw an exception.
Expected behavior
Multiplication should always result in <4,4>
Actual behavior
Multiplication results in <4,0> after several hundred milliseconds
Regression?
Does not occur in .NET 7, only .NET 8
Known Workarounds
No response
Configuration
.NET 8, ARM64, MacOS (have had reports of this same problem on ARM64 Linux)
Other information
This has been an issue found in our open source game Celeste 64 for users running the game on ARM64 for both MacOS and Linux. I personally have only tested on MacOS.
Activity
ghost added
untriagedNew issue has not been triaged by the area owner
This was fixed by @jakobbotsch in .NET 9 via #94413, which was fixing a different issue caused by the types of op1/op2 mismatching for MultiplyByScalar (one is a TYP_SIMD16, the other a TYP_SIMD8).
The simple fix should be backporting this PR to .NET 8.
Independently, we should ensure an issue exists to ensure constant folding does work for this scenario and that the correctly typed operand is selected.
This was fixed by @jakobbotsch in .NET 9 via #94413, which was fixing a different issue caused by the types of op1/op2 mismatching for MultiplyByScalar (one is a TYP_SIMD16, the other a TYP_SIMD8).
That PR fixed the type mismatch but also deliberately this particular issue, which I noticed while working on the other one (#94413 (comment)).
Activity
isadorasophia commentedon Feb 7, 2024
@tannergooding could you help triaging this?
tannergooding commentedon Feb 8, 2024
This was fixed by @jakobbotsch in .NET 9 via #94413, which was fixing a different issue caused by the types of op1/op2 mismatching for MultiplyByScalar (one is a
TYP_SIMD16, the other aTYP_SIMD8).The simple fix should be backporting this PR to .NET 8.
Independently, we should ensure an issue exists to ensure constant folding does work for this scenario and that the correctly typed operand is selected.
jakobbotsch commentedon Feb 8, 2024
That PR fixed the type mismatch but also deliberately this particular issue, which I noticed while working on the other one (#94413 (comment)).
theofficialgman commentedon Feb 9, 2024
can confirm running the testcase results in an exception after 77 iterations on arm64 linux
jakobbotsch commentedon Jun 5, 2024
The fix is available in the current .NET 8 release.