bench: capture T0 baseline; expose pi/tau accessors; fix div panic
- Promotes Gaussian::pi and Gaussian::tau to public so benches/gaussian.rs compiles, then captures baseline numbers for the T0 acceptance gate. - Fixes the divide bench: g1/g2 panicked (g1 has lower precision than g2; cavity requires pi_num >= pi_den). Swapped to g2/g1 (well-defined). Baseline on Apple M5 Pro: Batch::iteration 29.840 µs Gaussian::mul 1.568 ns (vs ~220 ps for add/sub — hot path) Gaussian::div 1.572 ns
This commit is contained in:
@@ -23,8 +23,11 @@ fn benchmark_gaussian_arithmetic(criterion: &mut Criterion) {
|
||||
});
|
||||
|
||||
// Benchmark division
|
||||
// NOTE: numerator must have higher precision (smaller sigma) than the
|
||||
// denominator in this representation; g2 (sigma=1) / g1 (sigma=8.33) is
|
||||
// well-defined, whereas g1 / g2 underflows and panics in mu_sigma.
|
||||
criterion.bench_function("Gaussian::div", |bencher| {
|
||||
bencher.iter(|| g1 / g2);
|
||||
bencher.iter(|| g2 / g1);
|
||||
});
|
||||
|
||||
// Benchmark natural parameter conversions
|
||||
|
||||
Reference in New Issue
Block a user