Skip to content

Fix #29: re-build the KdTree when doing consecutive insert_bulk operations#30

Merged
habedi merged 3 commits into
habedi:mainfrom
timbeurskens:bug/consecutive-kdtree-bulk-insert
Feb 20, 2026
Merged

Fix #29: re-build the KdTree when doing consecutive insert_bulk operations#30
habedi merged 3 commits into
habedi:mainfrom
timbeurskens:bug/consecutive-kdtree-bulk-insert

Conversation

@timbeurskens

@timbeurskens timbeurskens commented Feb 20, 2026

Copy link
Copy Markdown
Contributor

This PR should fix issue #29

@timbeurskens timbeurskens force-pushed the bug/consecutive-kdtree-bulk-insert branch from efd70c9 to d34cd9c Compare February 20, 2026 12:24
@codecov

codecov Bot commented Feb 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.57%. Comparing base (56d4487) to head (0aad6fe).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #30      +/-   ##
==========================================
+ Coverage   72.52%   73.57%   +1.04%     
==========================================
  Files          10       10              
  Lines        2038     2100      +62     
==========================================
+ Hits         1478     1545      +67     
+ Misses        560      555       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@habedi habedi self-assigned this Feb 20, 2026
@habedi habedi added bug Something isn't working labels Feb 20, 2026
Comment thread tests/test_kdtree.rs
let target = target_point_2d();
let knn_results = tree.knn_search::<EuclideanDistance>(&target, len_a + len_b);

assert_eq!(

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Hi, can the test be more strict? Right now, it only check the tree includes the expected number of points. It doesn't check if the inserted points actually exists in the tree, for example points "L" to "V" should be in the tree.

For example:

for point in points_first.iter().chain(points_second.iter()) {
        assert!(
            tree.contains(point),
            "Expected tree to contain point after consecutive insert_bulk calls: {:?}",
            point
        );

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestion. I've updated the test accordingly.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks.

@habedi habedi merged commit 1440b2b into habedi:main Feb 20, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants