cartan

Stochastic Benchmarks

Native Rust timing for L1 operations — the orthonormal-frame-bundle primitives that drive Brownian motion on manifolds, plus the Wishart SPD diffusion. All times are median over 200 repetitions with 5 warmup calls, measured on the same hardware as the geometry benchmarks.

Primitives

horizontal_velocity:

Constant-time lift of a driving noise vector into the tangent space via a precomputed frame. Sphere dimensions:

median
220 ns
320 ns
520 ns
1020 ns
2560 ns
50250 ns

The inner loop is a dot product of a frame row against the noise vector. Performance is memory-bandwidth-bound above and essentially free below.

stratonovich_step: one Stratonovich-Euler step on

Includes horizontal lift, retraction of the base point, vector transport of each frame basis vector, and modified Gram-Schmidt re-orthonormalisation against the Riemannian metric.

Manifolddimmedian
Sphere 2190 ns
Sphere 3270 ns
Sphere 5501 ns
Sphere 101.66 µs
Sphere 259.45 µs
Sphere 5041.2 µs
SPD(2)24.11 µs
SPD(3)324.9 µs
SPD(5)5202 µs

Cost scales roughly cubically with manifold dimension for SPD (dominated by the matrix square-root at each sub-step) and roughly linearly for the sphere.

stochastic_development: 32-step end-to-end Brownian path

Full Eells-Elworthy-Malliavin integration: frame initialisation, then 32 Stratonovich-Euler steps driven by i.i.d. Gaussian increments.

Manifolddimmedian
Sphere 25.89 µs
Sphere 39.08 µs
Sphere 517.9 µs
Sphere 1055.9 µs
Sphere 25313 µs
Sphere 501.39 ms

wishart_step: SPD-valued Itô step

Matrix-Brownian increment, symmetric square root of the current state, combined into the Wishart diffusion.

median
2170 ns
3451 ns
51.06 µs

Order of magnitude faster per step than stratonovich_step on SPD because it bypasses the full frame-bundle bookkeeping — appropriate when metric-consistency is not required and the caller just wants a matrix-valued diffusion.

Reproducing

cd cartan
cargo run --release -p cartan-bench -- --all > benchmarks/results.jsonl

Results are emitted as JSON lines with {manifold, op, dim, median_ns, q1_ns, q3_ns}.

Methodology

  • 200 repetitions after 5 warmup calls per configuration
  • Median + interquartile range reported; medians listed in tables above
  • Fixed seed (42) across all runs for reproducibility
  • Single-threaded, f64, LTO-thin release profile