Skip to content

Support KDE in no_std - #443

Draft
day01 wants to merge 2 commits into
statrs-dev:mainfrom
day01:feat/no-std-kde
Draft

Support KDE in no_std#443
day01 wants to merge 2 commits into
statrs-dev:mainfrom
day01:feat/no-std-kde

Conversation

@day01

@day01 day01 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Motivation

KDE is currently gated by std because kdtree does not expose its allocation-backed API in no_std builds. This continues the no_std work tracked in #400 and integrates the upstream support from mrhooray/kdtree-rs#92.

Changes

  • enable kde with no_std + alloc through the upstream kdtree libm feature
  • import num_traits::Float where density calculations need floating-point methods without std
  • compute the neighborhood radius from the farthest returned distance instead of assuming kdtree::within result ordering
  • add a bare-metal KDE check and execute kde_pdf and knn_pdf in the existing no_std Wasm runtime test
  • document the supported no_std feature combination

Blocked by

  • merge and release mrhooray/kdtree-rs#92
  • replace the temporary Git revision with the released crates.io version before merge

@day01 day01 mentioned this pull request Aug 12, 2026
11 tasks
@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.07%. Comparing base (92819b6) to head (e9d0baa).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #443   +/-   ##
=======================================
  Coverage   95.07%   95.07%           
=======================================
  Files          62       62           
  Lines       14191    14191           
=======================================
  Hits        13492    13492           
  Misses        699      699           

☔ View full report in Codecov by Harness.
📢 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.

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.

1 participant