Skip to content

fix(datagen): enable undocumented_unsafe_blocks and preserve sliced validity - #11400

Open
wombatu-kun wants to merge 1 commit into
lance-format:mainfrom
wombatu-kun:docs/datagen-safety-comments
Open

wombatu-kun wants to merge 1 commit into
lance-format:mainfrom
wombatu-kun:docs/datagen-safety-comments

Conversation

@wombatu-kun

Copy link
Copy Markdown
Contributor

Part of #8678.

This enables clippy::undocumented_unsafe_blocks for lance-datagen and documents its six previously undocumented unsafe blocks. Two of them needed a soundness fix rather than a comment alone: CycleNullGenerator and NullGenerator applied the source ArrayData::offset to a fresh validity allocation, shifting nulls for offset-preserving arrays and potentially leaving the backing buffer too short. They now build a NullBuffer whose 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 + offset backing-buffer requirement. The four RandomBinaryGenerator constructors 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_doc is 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.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@github-actions github-actions Bot added the bug Something isn't working label Nov 23, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ 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.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 23, 2026
@wombatu-kun wombatu-kun reopened this Nov 23, 2026
@lance-gatekeeper lance-gatekeeper Bot added K-approved Latest Gatekeeper recommendation permits acceptance. and removed K-approved Latest Gatekeeper recommendation permits acceptance. labels Nov 23, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant