Pack richer compact masked sort keys - #147
Open
aneubeck wants to merge 4 commits into
Open
Conversation
Use configuration-derived bucket widths to fit more complete masked positions and an order-preserving prefix of the next position into each u64 key. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Compacts masked sort keys using configuration-specific bucket bounds, improving sort efficiency.
Changes:
- Adds maximum bucket-position bounds and denser key packing.
- Expands ordering tests and benchmarks GeoDiffConfig10.
- Corrects the maximum geometric bucket calculation.
Show a summary per file
| File | Description |
|---|---|
crates/geo_filters/src/diff_count.rs |
Implements compact key packing and tests. |
crates/geo_filters/src/config/buckets.rs |
Corrects the inclusive maximum bucket. |
crates/geo_filters/src/config.rs |
Exposes configuration bucket bounds. |
crates/geo_filters/evaluation/masked_sort.rs |
Adds GeoDiffConfig10 benchmarks. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Balanced
| for _ in 0..complete_positions { | ||
| let position = positions.next().unwrap_or(0); | ||
| debug_assert!(position <= max_position); | ||
| key = (key << position_bits) | position; |
Let configurations provide the required bucket-position bit width directly so masked key packing does not derive it from an intermediate maximum. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f922e63e-969b-47b1-86a0-3a54220589f2
Make the shared configuration helper expose the required bit count directly and reuse it for bucket-type validation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f922e63e-969b-47b1-86a0-3a54220589f2
Use the exact b + 7 bit-width identity for the maximum geometric bucket position. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f922e63e-969b-47b1-86a0-3a54220589f2
tclem
approved these changes
Aug 25, 2026
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.
Summary
Packing
The trailing prefix is monotonic: if it differs, its ordering is the ordering of the full next position; if it does not differ, callers retain the existing
cmp_maskedfallback.Validation
cargo test -p geo_filters --all-featurescargo test -p geo_filters --doc --all-featurescargo bench -p geo_filters --bench masked_sort --no-runcargo bench -p geo_filters --bench masked_sort -- --noplotMeasured absolute Criterion medians on this machine (not a before/after speedup claim):