wickra_benchmark_core/lib.rs
1//! # wickra-benchmark-core
2//!
3//! The deterministic core of `wickra-benchmark`: a curated suite of
4//! `(strategy, dataset, expected report, hash)` cases you recompute and confirm
5//! byte-for-byte. Given a [`BenchmarkCase`], [`run_case`] recomputes the report
6//! from the embedded strategy and candle data with the pinned `wickra-backtest`
7//! engine, hashes it with the same canonicalization `wickra-proof` uses, and
8//! reports two independent booleans: `passed` (the recomputed report is
9//! byte-exact equal to the frozen `expected`) and `hash_match` (its canonical
10//! hash equals `expected_hash`).
11//!
12//! [`run_suite`] (path-based, for the CLI) and [`run_suite_inline`] (data
13//! supplied inline, for the FFI boundary) fan out over a [`Suite`] and re-sort
14//! the results by `id`, so a [`SuiteReport`] is byte-identical across all ten
15//! language bindings and between the parallel (rayon) and sequential (WASM)
16//! runners. [`Benchmark`] exposes the `command_json` boundary the bindings
17//! forward verbatim; [`canonicalize`]/[`hash`] are the single source of hash
18//! stability.
19
20mod benchmark;
21mod case;
22mod config;
23mod error;
24mod hash;
25mod runner;
26mod suite;
27
28pub use benchmark::Benchmark;
29pub use case::{BacktestReport, BenchmarkCase, Candle, StrategySpec};
30pub use config::Config;
31pub use error::{Error, Result};
32pub use hash::{canonicalize, hash, hash_report};
33pub use runner::{load_candles, run_case, run_suite, run_suite_inline};
34pub use suite::{CaseResult, Suite, SuiteReport};
35
36/// The wickra-benchmark-core crate version.
37#[must_use]
38pub fn version() -> &'static str {
39 env!("CARGO_PKG_VERSION")
40}
41
42#[cfg(test)]
43mod tests;