GH-40870: [C#] Update CompareValidityBuffer() to pass when unspecified final bits are not identical#40873
Merged
paleolimbot merged 4 commits intoapache:mainfrom Mar 28, 2024
Merged
Conversation
|
|
| else if (nullCount != 0 && arrayLength > 0) | ||
| { | ||
| int validityBitmapByteCount = BitUtility.ByteCount(arrayLength); | ||
| ReadOnlySpan<byte> expectedSpan = expectedValidityBuffer.Span.Slice(0, validityBitmapByteCount); |
Contributor
There was a problem hiding this comment.
Should this be validityBitmapByteCount - 1?
Member
Author
There was a problem hiding this comment.
😬 (this is the first C# I've ever attempted!)
CurtHagenlocher
approved these changes
Mar 28, 2024
CurtHagenlocher
approved these changes
Mar 28, 2024
|
After merging your PR, Conbench analyzed the 5 benchmarking runs that have been run so far on merge-commit 683a78b. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. |
vibhatha
pushed a commit
to vibhatha/arrow
that referenced
this pull request
May 25, 2024
…ecified final bits are not identical (apache#40873) ### Rationale for this change Before fixing nanoarrow's testing JSON reader to align with other implementations and properly zero out the last few bits, integration tests failed because C#'s `CompareValidityBuffer()` was comparing the bytes of the validity buffer (including undefined final bits that are maybe not identical due to uninitialized memory or because the arrays are slices). ### What changes are included in this PR? `CompareValidityBuffer()` now compares the memory for all except the last byte and compares the last byte bitwise. ### Are these changes tested? They should be but I am not sure exactly where to add the test! ### Are there any user-facing changes? No * GitHub Issue: apache#40870 Authored-by: Dewey Dunnington <dewey@fishandwhistle.net> Signed-off-by: Dewey Dunnington <dewey@voltrondata.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Rationale for this change
Before fixing nanoarrow's testing JSON reader to align with other implementations and properly zero out the last few bits, integration tests failed because C#'s
CompareValidityBuffer()was comparing the bytes of the validity buffer (including undefined final bits that are maybe not identical due to uninitialized memory or because the arrays are slices).What changes are included in this PR?
CompareValidityBuffer()now compares the memory for all except the last byte and compares the last byte bitwise.Are these changes tested?
They should be but I am not sure exactly where to add the test!
Are there any user-facing changes?
No