Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

13. Benchmark Evaluation and Reproducibility

tools/bench (crate name nlopt4r-bench) is the in-repo benchmark driver, and tools/nlopt-reference provides comparison runs against the crates.io nlopt wrapper. This chapter records the protocol, metric definitions and published measurements.

13.1 Run protocol

  • suites: smoke (sphere, Rosenbrock, Booth, Rastrigin, linear fit, coupled QP), smooth (analytic, non-global, unconstrained catalog entries) and global (multimodal and nonsmooth groups);
  • dimension: 1–128, bounded by each formula’s minimum dimension; fixed-dimension problems keep their declared dimension;
  • budget: budget_per_dimension × actual dimension objective calls;
  • starting points: generated by a run-local SplitMix64 stream; population algorithms receive explicit seeds;
  • target value: reference value + \(10^{-6}(1+|\text{reference}|)\); a hit requires box feasibility and constraint violation \(\le10^{-8}\);
  • local solvers use exact chain-rule gradients for analytic entries and central differences for the rest, with each probe counted in the same budget;
  • recorded fields: seed, dimension, budget, derivative mode, termination or error, best point and value, improvement history and platform metadata.

13.2 Metrics

The expected running time (ERT) to first hit is

$$ \text{ERT}=\frac{\sum_{\text{success}}(\text{calls to first hit})+\sum_{\text{failure}}(\text{calls actually consumed})}{\text{success count}}. $$
  • failed runs enter the numerator with their actual consumption;
  • with zero successes the ERT is infinite (summary output null);
  • time ERT uses the corresponding hit times and full run times;
  • summaries group by budget, target, transform and noise configuration, and metadata is emitted with each group.

13.3 Affine-transform instances

Optional switches --shift, --rotate and --instance-seed generate paired comparison instances:

$$ z=r+Q\,\bigl(x-(r+s)\bigr),\qquad F(x)=f(z),\qquad \nabla F(x)=Q^\top\nabla f(z). $$
  • the shift \(s\) samples uniformly in the central 60% of each coordinate’s original interval;
  • the rotation \(Q\) comes from a Gaussian QR factorization with a sign correction and determinant +1;
  • reference and target values stay the same;
  • the JSON record carries generator version, seed, switches, shift vector and rotation matrix; with the switches off these fields record null.

The outer box and solver starting points stay in place; the transform acts on the objective landscape.

13.4 Observation noise

The main driver supports independent identically distributed additive noise

$$ Y(x)=F(x)+\sigma Z, $$

with a Gaussian (Box–Muller), Uniform (\(U[-\sqrt3,\sqrt3]\)) or Laplace (scale \(1/\sqrt2\)) distribution. Noise applies after the transform; reference values, constraints and targets stay the same.

Records separate three metric classes:

  • best_* and first-hit: noise-free feasible best visits;
  • observed_best: the smallest noisy observation and its true value;
  • recommendation: true-value score of the point the solver actually returns (or of the error-recovery point).

Noisy runs disable objective-value stopping, and the remaining stopping rules stay in force.

13.5 Measured baseline

The data below are historical measurements at the source revisions recorded in docs/BENCHMARK_RESULTS.md: seeds 0–29, Rust 1.99.1, Linux/x86_64, Intel Core i7-12700H, default algorithm parameters. Cell format is “hits/30; ERT (objective calls)”. They are not portable wall-time or current-revision claims.

smoke suite, dimension 2, budget 4000:

ProblemBFGSL-BFGSDEPSO
Sphere30/30; 3.0030/30; 3.0030/30; 1420.6730/30; 1343.23
Rosenbrock30/30; 62.8730/30; 39.3030/30; 2232.7324/30; 3879.67
Booth30/30; 13.0730/30; 10.5330/30; 1744.5330/30; 1773.03
Rastrigin0/300/3029/30; 3534.1030/30; 2513.23
Linear fit30/30; 9.0030/30; 10.2030/30; 1517.3730/30; 1448.27
Coupled QP30/30; 11.7030/30; 7.2730/30; 1320.6030/30; 1173.60

global suite, requested dimension 4 (fixed-dimension problems keep dimension 2):

ProblemDimension/budgetDEPSO
Ackley4 / 80002/3030/30; 5067.03
Alpine4 / 80000/3030/30; 4891.83
Easom2 / 400030/30; 1722.6030/30; 1499.43
Griewank4 / 80000/300/30
Himmelblau2 / 400030/30; 2977.2030/30; 1942.23
Levy4 / 800030/30; 4402.5730/30; 2351.37
Qing4 / 80000/3030/30; 3096.20
Rastrigin4 / 80000/307/30; 31449.29
Schwefel-2224 / 80001/3030/30; 5193.03

Native L-BFGS comparison (same ChaCha8 starting points, unbounded domain, history 10):

ProblemDimension/budgetNative NLoptnlopt4r
Sphere2 / 400030/30; 3.0030/30; 3.00
Rosenbrock2 / 400030/30; 37.8330/30; 43.30
Sphere20 / 4000030/30; 3.0030/30; 3.00
Rosenbrock20 / 4000025/30; 166.5225/30; 195.80

Five of the 20-dimensional Rosenbrock Rust runs report explicit errors from strong-Wolfe search exhaustion at seeds 1, 5, 9, 15 and 16; all records stay in the ERT.

The shift/rotate pairing experiment (instance seed 42, dimension 2, budget 4000, 2160 records) shows: the external pattern search on shifted sphere, coupled QP and Rastrigin moves from a single hit to 96, 85–93 calls or a miss; Rastrigin’s DE/PSO hit counts vary with orientation; sphere keeps its results under rotation. These records describe one instance seed’s observations.

The noise pairing experiment (instance seed 42, noise seed 17, 2520 records) shows: at \(\sigma=10^{-6}\), visit hits and recommendation hits stay close; at \(\sigma=0.01\), Gaussian gives 118 visit hits and 0 recommendation hits over 360 runs, Uniform gives 208 visit hits and 5 recommendation hits, and Laplace gives 80 visit hits and 0 recommendation hits.

13.6 Coverage and validation

Historical baseline at the recorded benchmark revision:

  • 118 workspace tests passed: 90 solver integration tests, 3 unit tests, 1 doctest, 10 native comparisons and 14 tool tests;
  • line coverage 90.05% (3331/3699), function coverage 93.91% (262/279), region coverage 88.34%;
  • 13 Criterion kernel smoke checks passed;
  • an allocation regression checks workspace scale at dimensions 512 and 2048.

Current 1.0.1 counts are 90 solver integration tests, 3 unit tests, 16 doctests, 10 native comparisons and 28 benchmark-tool tests; the extension example has no tests. Coverage figures come from cargo llvm-cov. Branch coverage was not instrumented, so no branch-coverage percentage is claimed.

Software interface

  • benchmark commands, options and summaries: see chapter 22.
  • transform and noise field definitions: see docs/BENCHMARKS.md in the repository.
  • full record files: tools/bench/results/*.jsonl.gz.
  • published API reference for the benchmarked entries: https://docs.rs/nlopt4r/1.0.1/nlopt4r/.

References

  • N. Hansen, A. Auger, R. Ros, O. Mersmann, T. Tušar, D. Brockhoff, “COCO: A Platform for Comparing Continuous Optimizers in a Black-Box Setting,” Optimization Methods and Software 36 (2021).
  • R. Storn, K. Price (1997); J. Kennedy, R. Eberhart (1995), see chapter 9.