Skip to content

ARM-SVE: Fix validation logic for GatherVectorByteOffsetFirstFaulting tests#107165

Merged
amanasifkhalid merged 1 commit intodotnet:mainfrom
amanasifkhalid:fix-firstfaulting-tests
Aug 30, 2024
Merged

ARM-SVE: Fix validation logic for GatherVectorByteOffsetFirstFaulting tests#107165
amanasifkhalid merged 1 commit intodotnet:mainfrom
amanasifkhalid:fix-firstfaulting-tests

Conversation

@amanasifkhalid
Copy link
Contributor

Fixes #106621. Fixes #106815.

  • In ValidateFirstFaultingResult, we pass the BoundedMemory object's underlying byte array directly to CheckGatherVectorWithByteOffsetFirstFaultingBehavior instead of first converting it to an array of the user-facing type. This way, we don't risk dropping any bytes via imprecise length conversions for byte amounts that aren't multiples of the base type's size (i.e. if the BoundedMemory object is 5 bytes long, the naive calculation inBounded.Length / Unsafe.SizeOf<Int32>() will drop the last byte).
  • In CheckGatherVectorWithByteOffsetFirstFaultingBehavior, when we're determining the expected fault result, it is not enough to check if the starting offset is out-of-bounds; we also have to factor in the size of the load to ensure the remaining bytes of the load operation fault if they walk off the end of the byte array.

@dotnet/arm64-contrib PTAL. All GatherVectorFirstFaulting tests pass under stress modes. Thanks!

@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Aug 29, 2024
Copy link
Contributor

@SwapnilGaikwad SwapnilGaikwad left a comment

Choose a reason for hiding this comment

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

LGTM!

@amanasifkhalid
Copy link
Contributor Author

@dotnet/jit-contrib could you PTAL? Thanks!

@amanasifkhalid amanasifkhalid merged commit 4df1b9a into dotnet:main Aug 30, 2024
@amanasifkhalid amanasifkhalid deleted the fix-firstfaulting-tests branch August 30, 2024 19:42
jtschuster pushed a commit to jtschuster/runtime that referenced this pull request Sep 17, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Oct 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

3 participants