ARM-SVE: Fix validation logic for GatherVectorByteOffsetFirstFaulting tests#107165
Merged
amanasifkhalid merged 1 commit intodotnet:mainfrom Aug 30, 2024
Merged
Conversation
3 tasks
Contributor
Author
|
@dotnet/jit-contrib could you PTAL? Thanks! |
TIHan
approved these changes
Aug 30, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #106621. Fixes #106815.
ValidateFirstFaultingResult, we pass theBoundedMemoryobject's underlying byte array directly toCheckGatherVectorWithByteOffsetFirstFaultingBehaviorinstead 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 theBoundedMemoryobject is 5 bytes long, the naive calculationinBounded.Length / Unsafe.SizeOf<Int32>()will drop the last byte).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
GatherVectorFirstFaultingtests pass under stress modes. Thanks!