Repository navigation
fix(datagen): enable undocumented_unsafe_blocks and preserve sliced validity - #11400
Open
wombatu-kun wants to merge 1 commit into
Open
wombatu-kun wants to merge 1 commit into
wombatu-kun wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
✅ Gate recommendation: approve.
The validity window respects sliced-array offsets and Arrow’s backing-buffer contract. The regression fails on the base implementation and passes here; datagen unit tests, additional offset-boundary checks, and Clippy passed.
This branch has not been deployed
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.
Part of #8678.
This enables
clippy::undocumented_unsafe_blocksforlance-datagenand documents its six previously undocumented unsafe blocks. Two of them needed a soundness fix rather than a comment alone:CycleNullGeneratorandNullGeneratorapplied the sourceArrayData::offsetto a fresh validity allocation, shifting nulls for offset-preserving arrays and potentially leaving the backing buffer too short. They now build aNullBufferwhose backing allocation includes the source offset while its visible window contains exactly the generated validity bits.The regression coverage uses an offset-preserving test array to check both the cyclic validity sequence and Arrow's
len + offsetbacking-buffer requirement. The fourRandomBinaryGeneratorconstructors are unchanged apart from their SAFETY comments: their offsets cover the generated value buffers, and the UTF-8 variants contain only printable ASCII.missing_safety_docis already denied through the workspace's Clippy configuration. The new attribute covers the library and its unit tests; separate integration and bench crates remain outside it, matching the earlier crate-by-crate changes. No dependencies or public signatures change.