Skip to content

v0.3.0

Choose a tag to compare

@basnijholt basnijholt released this 10 Jun 22:01
· 2 commits to main since this release
a8a02a4

Minor release: two batched APIs that move LearnerND's remaining Python hot loops into Rust (#13).

Profiling LearnerND with the Rust backend (adaptive ≥ 1.5) showed only 14-25% of runtime left inside this extension; these APIs target the two largest remaining Python-side costs:

  • Triangulation.simplices_containing(point, simplex=None, candidates=None, eps=1e-8) — all simplices containing a point, in one call instead of a point_in_simplex loop. Solves once for a simplex known to contain the point (the simplex hint, or locate_point), reduces it to the face the point lies on, and looks the containing simplices up in the facet index. A stale hint falls back to locating; candidates filters explicitly instead.
  • default_loss(simplex, values, value_scale=None) — LearnerND's default loss (embedded simplex volume) taking the scaled vertex/value arrays directly, signature-compatible with adaptive's loss_per_simplex functions.

Wired into LearnerND the way a future adaptive release would use them (examples/learnernd_batched_apis.py), they add 1.17× (2D) to 1.40× (3D) on top of the Rust backend, while sampling identical points.

Also refreshes the README benchmarks against adaptive 1.5.0, which now selects this backend automatically (pip install "adaptive[rust]").

Full changelog: v0.2.1...v0.3.0