Repository navigation
docs(encoding): document dictionary gather buffer safety - #10980
Merged
Xuanwo merged 1 commit intoNov 12, 2026
Merged
Conversation
The `ci` profile lint on main fails with `clippy::undocumented_unsafe_blocks` at `DictionaryDataBlock::gather_variable_width_typed`: the existing `SAFETY:` note sits inside the outer unsafe block and only justifies the unchecked offset reads, leaving the block itself undocumented. Move that justification above the block and extend it to cover the raw pointer arithmetic, the disjoint fresh output allocations, and the `set_len` calls. Comment-only change; no runtime behavior differs.
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
Contributor
There was a problem hiding this comment.
✅ Gate recommendation: approve.
The expanded safety argument matches the surrounding bounds validation and initialization order. A focused Clippy reproduction fails with the old comment placement and passes with this change; executable code is unchanged.
wombatu-kun
approved these changes
Nov 12, 2026
LuciferYang
approved these changes
Nov 12, 2026
LuciferYang
left a comment
Contributor
There was a problem hiding this comment.
+1, LGTM
Thanks @Xuanwo
Xuanwo
deleted the
xuanwo/dictionary-gather-safety-comment-nier-20261112
branch
November 12, 2026 07:25
This was referenced Nov 12, 2026
Xuanwo
added a commit
that referenced
this pull request
Nov 12, 2026
Controlled services need to reject stored External Blob references outside registered storage bases before URI resolution or size probing, while immutable payload caches must not return stale External data. Add an opt-in Session policy for unregistered External reads and logical reference writes. Embedded sessions retain the existing Allow default. Provider filtering removes selected schemes and clears cached bindings; it does not revoke previously issued handles. Policy-aware writes report that remote tables require registered storage bases. Explicit Ingest and low-level file APIs retain their existing contracts. Add an External-store wrapper hook that derives a view from the resolved store, preserving credentials, endpoints, connection pools and provider state. Immutable cache wrappers can bypass their cache for External reads while retaining ordinary Managed behavior. A weak cache reuses live External views without a reference cycle, and source/scheduler identity prevents stores or wrapper views with matching prefixes from being combined. Behavioral validation covers rejection before source access, filtered local providers, registered-base matching, repeated locator batches sharing one executor, fresh External reads after overwrite, and zero origin reads for warm Managed payloads. The final reviewed delta passed 483 IO and 227 Blob tests; earlier 189 Dataset IO cases and two doctests remain applicable. The integrated tree adds only the upstream SAFETY-comment fix from #10980; full root Clippy passed on the integrated PR head (`cargo clippy --all --tests --benches --profile ci -j 4 -- -D warnings`, exit 0). Hosted CI and formal approval remain pending. Service adoption must propagate the policy when rebuilding Sessions and implement the External hook in its immutable cache wrapper. Production RAM/NVMe, cloud credentials and REST/SQL integration are separate downstream work. This PR does not establish that those service boundaries are already enforced. It overlaps the internal read keys in #10171; a separately reviewed integration candidate with that PR retained Arc-instance-plus-path scheduler identity and row-independent entries and passed 605 Blob tests (0 failures). This does not claim downstream Sophon adoption or a merged prerequisite.
Xuanwo
added a commit
that referenced
this pull request
Nov 12, 2026
Complete the descriptor-transition contract from #9458 and #9459 with regression assertions for exact historical descriptors, an unchanged default storage version, and implicit-version compaction failing without committing a new snapshot. Remove the obsolete schema-transition discussion link while retaining the requirement to explicitly select `data_storage_version >= 2.2` for mixed-column Blob v2 compaction. Validation evidence for this unchanged patch contains five passing Rust behavior cases: all four mixed-version cases and the released legacy-fragment regression. Formatting and diff checks pass. Workspace Clippy and the targeted lance Clippy run are blocked by the existing `clippy::undocumented_unsafe_blocks` error at `rust/lance-encoding/src/data.rs:1200`; the separate fix is tracked in #10980 and is not duplicated here. Full workspace tests and Python bindings were not run. Closes #9458.
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.
Main's
ciprofile lint fails withclippy::undocumented_unsafe_blocksatDictionaryDataBlock::gather_variable_width_typed(data.rs:1200), which blocks the full Rustlint for every PR in the workspace, #10750 included.
The existing
SAFETY:note sits inside the outer unsafe block, so it justifies the uncheckedoffset reads but leaves the block itself undocumented. This moves the justification above the
block and extends it to cover the rest of it: the index/offset bounds proven by
validate_offsets_for_appendand the first pass,total_bytesfitting bothusizeandT, thetwo output allocations being disjoint from the dictionary data, and every rebased offset and
payload byte being written before the
set_lencalls. Comment-only; no runtime change.Context: the block came in with #10911. Validation on this branch:
cargo fmt --all -- --checkand
cargo clippy --profile ci --all --tests --benches -- -D warningsboth pass.