Skip to content

Introduce a fast masked key for sorting#135

Merged
aneubeck merged 3 commits into
mainfrom
aneubeck/fastmask
Jul 6, 2026
Merged

Introduce a fast masked key for sorting#135
aneubeck merged 3 commits into
mainfrom
aneubeck/fastmask

Conversation

@aneubeck

@aneubeck aneubeck commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

see readme for more information.
This should speed up MST construction significantly

Copilot AI review requested due to automatic review settings July 6, 2026 09:39
@aneubeck aneubeck requested a review from a team as a code owner July 6, 2026 09:39

Copilot AI 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.

Pull request overview

This PR introduces a fast u64 sort key for masked similarity ordering of GeoDiffCount filters, intended to reduce the cost of sorting/bucketing large filter sets (and thereby speed up MST construction workflows that rely on masked ordering).

Changes:

  • Adds GeoDiffCount::masked_sort_key(mask, mask_size) -> u64 to accelerate masked sorting with tie-break fallback to cmp_masked.
  • Documents the masked-sort approach and reports benchmark results in crates/geo_filters/README.md.
  • Adds a Criterion benchmark (masked_sort) to measure keyed sorting vs direct cmp_masked sorting.
Show a summary per file
File Description
crates/geo_filters/src/diff_count.rs Adds masked_sort_key implementation and unit test validating key ordering against cmp_masked.
crates/geo_filters/README.md Documents masked sorting strategy, example usage, and benchmark results.
crates/geo_filters/evaluation/masked_sort.rs Adds Criterion benchmark comparing cmp_masked sorting vs key-based sorting and key construction cost.
crates/geo_filters/Cargo.toml Registers the new masked_sort benchmark target.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 4/4 changed files
  • Comments generated: 2
  • Review effort level: Low

Comment thread crates/geo_filters/src/diff_count.rs
Comment on lines +52 to +55
[[bench]]
name = "masked_sort"
path = "evaluation/masked_sort.rs"
harness = false

@itsibitzi itsibitzi 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.

Very neat.

Comment thread crates/geo_filters/README.md
Comment thread crates/geo_filters/README.md
Comment thread crates/geo_filters/src/diff_count.rs
aneubeck and others added 2 commits July 6, 2026 14:12
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Resolve conflicts in Cargo.toml (keep both nearest_neighbor and masked_sort bench targets) and README.md (keep both the nearest-neighbor metric and masked-similarity sorting sections). diff_count.rs auto-merged; fixed pre-existing indentation of masked_sort_key.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@aneubeck aneubeck enabled auto-merge July 6, 2026 12:26
@aneubeck aneubeck merged commit f747de0 into main Jul 6, 2026
8 checks passed
@aneubeck aneubeck deleted the aneubeck/fastmask branch July 6, 2026 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants