Commit Graph
6 Commits
Author SHA1 Message Date
swaits 50501bb01e test(bench): disable callgrind cache simulation in compare_profile
The profiling campaign ranks functions on instruction count (Ir) only,
so callgrind's cache simulation is pure overhead — it roughly doubles
each run's wall time. Pass `--cache-sim=no` via the gungraun
`LibraryBenchmarkConfig` to halve the measure->optimize loop's latency.
2026-05-14 12:01:25 -06:00
swaitsandClaude Opus 4.7 1cecd44511 test(bench): profile the full compare workload with gungraun
Adds benches/compare_profile.rs: a gungraun library_benchmark that runs
the entire `compare` workload once at seed 0 under callgrind. It path-
includes the shared examples/_shared/compare_workload.rs module and calls
the new profile_workload() entry point, which invokes all 82 algorithm
runners and folds every result into a checksum so nothing is elided.

gungraun reports the whole-program instruction count and diffs it against
the previous run; the saved callgrind.out
(target/gungraun/heuropt/compare_profile/.../callgrind.full_compare_workload.out)
carries the per-function breakdown for callgrind_annotate. This is the
measurement harness for the function-level optimization campaign.

Round-0 baseline: 357,060,633,544 Ir. The shared module also carries the
example's presentation layer, so the bench gets a commented
`#![allow(dead_code)]` -- but the runner functions are deliberately not
allow-listed, so a runner missing from profile_workload still warns (that
check already caught one omission).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 11:24:19 -06:00
swaitsandClaude Opus 4.7 b1d339a869 test(bench): cover permutation operators, combinatorial problems, and remaining algorithms
Expand benches/hot_paths.rs so the instruction-count harness exercises the
whole library. Adds four groups — permutation_ops_group (all 10 permutation
operators at n=30/100), variation_ops_group (BitFlip, Levy, BoundedGaussian,
ClampToBounds, ProjectToSimplex), combinatorial_group (TSP/JSS/knapsack
end-to-end plus AntColonyTsp), and multi_fidelity_group (Hyperband) — and
folds tabu_search_short and umda_short into single_objective_group. All 33
algorithms and 20 operators are now on the benchmarking surface (69 benches).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 06:21:59 -06:00
swaits 4a59041d1a style: apply rustfmt drift across the crate 2026-05-05 11:40:14 -06:00
swaits aba9dbf469 build(bench): expand gungraun bench suite to cover every algorithm
Goes from 6 benchmarks to ~25:

Pareto utilities (existing):
- non_dominated_sort_2d (n=50, 200)
- crowding_distance_2d (n=50, 200)
- hypervolume_2d (n=30, 100)
- hypervolume_nd_3d (n=30, 100)

Single-objective algorithms (all measured at "one short run"):
- random_search, hill_climber, one_plus_one_es, simulated_annealing
- genetic_algorithm, particle_swarm, differential_evolution, tlbo
- cma_es, separable_nes, nelder_mead, bayesian_opt, tpe

Multi-objective algorithms (one short run each):
- nsga2, nsga3, spea2, moead, mopso, ibea, sms_emoa
- hype, pesa2, epsilon_moea, age_moea, grea, knea, rvea

Each uses a tiny problem with realistic-shape parameters (small pop,
few generations, tight bounds) so the benchmark exercises each
algorithm's *inner loop cost* rather than dominated by RNG init or
config parsing.
2026-05-05 11:03:00 -06:00
swaits 0b31b266ef build(deps): add gungraun (was iai-callgrind) instruction-count benches
Wire `gungraun` 0.18 as a dev-dependency and a `benches/` directory
with instruction-count benchmarks for the algorithmic hot paths.

Why gungraun and not criterion: heuropt's hot paths are deterministic
numerical loops where wall-clock noise dominates real differences.
gungraun runs each benchmark under valgrind/callgrind once and reports
exact instruction counts — stable across machines and CI runners,
detects sub-microsecond regressions cleanly.

Benchmarks added:
- pareto::non_dominated_sort  (the inner loop of every Pareto MOEA)
- pareto::crowding_distance   (NSGA-II survival selection)
- metrics::hypervolume_nd     (HSO recursion, used by SMS-EMOA)
- internal::cholesky          (BO's per-step posterior factorization)
- algorithms::nsga2 single generation (end-to-end smoke check)
- algorithms::cma_es single generation (eigendecomposition cost)

Tracked size only — these aren't part of the regular CI matrix because
they need valgrind installed. Run with `cargo bench` locally.

Wired via the standard `[[bench]]` Cargo entries with `harness = false`
so gungraun's main_macro does the dispatch.
2026-05-05 10:36:29 -06:00