Skip to content

Conversation

SwapnilGaikwad
Copy link
Contributor

@SwapnilGaikwad SwapnilGaikwad commented Sep 15, 2025

Currently, offsets are incorrectly treated as indices which is leading to incorrect code being emitted.

e.g., ScatterWithByteOffsets<long> emits
ST1D Zdata.D, Pg, [Xbase, Zoffsets.D, lsl #3]
instead of,
ST1D Zdata.D, Pg, [Xbase, Zoffsets.D]

@dotnet/arm64-contrib @a74nh

Currently, offsets are incorrectly treated as indices which is
leading to incorrect code being emitted.

e.g., `ScatterWithByteOffsets<long>` emits
`ST1D Zdata.D, Pg, [Xbase, Zoffsets.D, lsl #3]`
instead of,
`ST1D Zdata.D, Pg, [Xbase, Zoffsets.D]`
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Sep 15, 2025
Copy link
Contributor

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

@a74nh a74nh added this to the 10.0.0 milestone Sep 15, 2025
@a74nh a74nh added the Priority:1 Work that is critical for the release, but we could probably ship without label Sep 15, 2025
@a74nh
Copy link
Contributor

a74nh commented Sep 15, 2025

This is an error in our implementation for .NET9. As such, I'm marking this as .NET10 and high priority.
@jeffhandley @tannergooding

Comment on lines +2324 to +2327
case NI_Sve_Scatter16BitWithByteOffsetsNarrowing:
case NI_Sve_Scatter32BitWithByteOffsetsNarrowing:
case NI_Sve_Scatter8BitWithByteOffsetsNarrowing:
case NI_Sve_ScatterWithByteOffsets:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were there any other instructions (such as gather) which differed between indices vs offsets like these ones?

I know we've reviewed/approved a few groups, but I don't know which are actually implemented today.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found the following APIs that are incorrectly treating offsets as indices and would need a similar fix.

GatherVectorInt16WithByteOffsetsSignExtend (long/ulong combinations)
GatherVectorInt32WithByteOffsetsSignExtend (long/ulong)
GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting (long/ulong)
GatherVectorInt32WithByteOffsetsSignExtendFirstFaulting (long/ulong)
GatherVectorUInt16WithByteOffsetsZeroExtend (long/ulong)
GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting (long/ulong)
GatherVectorUInt32WithByteOffsetsZeroExtend(long/ulong)

Do you recommend a separate PR for the above or should put in the current one?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since its the same general issue and we're looking at backporting, I'd put them in the same PR

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should make sure these ones still get a fix done and also included in the backport

@JulieLeeMSFT
Copy link
Member

@tannergooding, we will backport this to .NET 10. Do we need to backport to .NET 9?

@JulieLeeMSFT
Copy link
Member

@SwapnilGaikwad, please check test failures.
@EgorBo, please review and backport when ready.

@tannergooding
Copy link
Member

The feature remains experimental (and requires explicit user opt-in) in both .NET 9 and .NET 10

I think it would be fine to go into .NET 10, being an LTS and a known issue prior to RTM. I don't think we need to also backport to .NET 9 without some explicit customer report, particularly given .NET 9 is EoL in May of next year.

@JulieLeeMSFT
Copy link
Member

Agreed. @EgorBo, let's backport to .NET 10 only.

@SwapnilGaikwad
Copy link
Contributor Author

@SwapnilGaikwad, please check test failures.

Failures seem unrelated to the PR. The changes are SVE only and the failures are for x64.

@EgorBo
Copy link
Member

EgorBo commented Sep 16, 2025

/backport to release/10.0

Copy link
Contributor

Started backporting to release/10.0: https://github.com/dotnet/runtime/actions/runs/17771937971

@EgorBo
Copy link
Member

EgorBo commented Sep 16, 2025

Agreed. @EgorBo, let's backport to .NET 10 only.

I presume we won't merge this PR into main, right?

@EgorBo
Copy link
Member

EgorBo commented Sep 16, 2025

Ah, you meant no .NET 9.0, got it

@EgorBo
Copy link
Member

EgorBo commented Sep 16, 2025

/azp list

This comment was marked as resolved.

@EgorBo
Copy link
Member

EgorBo commented Sep 16, 2025

/azp run Fuzzlyn

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@a74nh
Copy link
Contributor

a74nh commented Sep 17, 2025

@EgorBo Are these Fuzzlyn error results expected?
I don't see anything in this PR that could have caused the errors in the CI

When running latest HEAD,
vectort,vector64,vector128,armadvsimd,armadvsimdarm64,armaes,armarmbase,armarmbasearm64,armsve,armsve2 gives me 1 error after 15mins, which I can raise if it's not new:
505.cs

Meanwhile async,runtimeasync,vectort,vector64,vector128,armadvsimd,armadvsimdarm64,armaes,armarmbase,armarmbasearm64,armcrc32,armcrc32arm64,armdp,armrdm,armrdmarm64,armsha1,armsha256,armsve,armsve2 gives constant errors immediately with

Unhandled exception. System.TypeLoadException: Could not load type 'Program' from assembly 'FuzzlynProgram1697, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' because the format is invalid.

@EgorBo
Copy link
Member

EgorBo commented Sep 17, 2025

@a74nh it looks like these failures reproduce on Main too on that pipeline, although, they're SVE related it seems. I guess we can merge the PR

@EgorBo EgorBo enabled auto-merge (squash) September 17, 2025 17:00
@EgorBo
Copy link
Member

EgorBo commented Sep 17, 2025

/ba-g "timeouts"

@EgorBo EgorBo merged commit 2cd78d3 into dotnet:main Sep 17, 2025
158 of 173 checks passed
@EgorBo
Copy link
Member

EgorBo commented Sep 17, 2025

Oops, didn't realize there is a pending work on this one given @tannergooding comments. let's address that and file a backport with those?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Runtime.Intrinsics community-contribution Indicates that the PR has been added by a community member Priority:1 Work that is critical for the release, but we could probably ship without
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants