feat: v0.7.0 — async evaluation

Theme: async/await for IO-bound evaluations. Adds the differentiating
capability vs pymoo / hyperopt / MOEA Framework, none of which ship
first-class async support.

No public-API breaks for synchronous users — the new surface is gated
behind a new `async` feature flag.

Adds:
- core::async_problem::AsyncProblem trait (async fn evaluate_async)
- async fn run_async on RandomSearch and DifferentialEvolution; other
  algorithms follow incrementally
- algorithms::parallel_eval_async::evaluate_batch_async helper using
  futures::stream::FuturesOrdered with concurrency-bounded chunks
- examples/async_eval.rs worked example with simulated 20 ms remote
  service: concurrency=1 → 4.2 s, concurrency=4 → 2.1 s (2× speedup)

Bumps Cargo.toml to 0.7.0; CHANGELOG entry covers the above. Existing
247 unit + 38 doctest tests all pass; no async tests yet (deferred to
a v0.7.x patch with tokio dev-deps wired in).
This commit is contained in:
2026-05-05 15:22:30 -06:00
parent b0f580841d
commit 41122b7d48
10 changed files with 391 additions and 2 deletions
+8 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "heuropt"
version = "0.6.0"
version = "0.7.0"
edition = "2024"
rust-version = "1.85"
authors = ["Stephen Waits <steve@waits.net>"]
@@ -18,8 +18,10 @@ default = []
serde = ["dep:serde"]
parallel = ["dep:rayon"]
tracing = ["dep:tracing"]
async = ["dep:futures"]
[dependencies]
futures = { version = "0.3", optional = true, default-features = false, features = ["std", "async-await"] }
rand = "0.9"
rand_distr = "0.5"
rayon = { version = "1", optional = true }
@@ -29,11 +31,16 @@ tracing = { version = "0.1", optional = true, default-features = false, features
[dev-dependencies]
gungraun = "0.18"
proptest = "1"
tokio = { version = "1", features = ["rt-multi-thread", "macros", "time"] }
[[bench]]
name = "hot_paths"
harness = false
[[example]]
name = "async_eval"
required-features = ["async"]
# Tighten release codegen for the compare harness and downstream binaries
# that build heuropt directly (i.e. when this crate is the workspace root).
# When heuropt is used as a dependency the consumer's profile wins.