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 | |
|---|---|
| 2 | 20 ns |
| 3 | 20 ns |
| 5 | 20 ns |
| 10 | 20 ns |
| 25 | 60 ns |
| 50 | 250 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.
| Manifold | dim | median |
|---|---|---|
| Sphere | 2 | 190 ns |
| Sphere | 3 | 270 ns |
| Sphere | 5 | 501 ns |
| Sphere | 10 | 1.66 µs |
| Sphere | 25 | 9.45 µs |
| Sphere | 50 | 41.2 µs |
| SPD(2) | 2 | 4.11 µs |
| SPD(3) | 3 | 24.9 µs |
| SPD(5) | 5 | 202 µ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.
| Manifold | dim | median |
|---|---|---|
| Sphere | 2 | 5.89 µs |
| Sphere | 3 | 9.08 µs |
| Sphere | 5 | 17.9 µs |
| Sphere | 10 | 55.9 µs |
| Sphere | 25 | 313 µs |
| Sphere | 50 | 1.39 ms |
wishart_step: SPD-valued Itô step
Matrix-Brownian increment, symmetric square root of the current state, combined into the Wishart diffusion.
| median | |
|---|---|
| 2 | 170 ns |
| 3 | 451 ns |
| 5 | 1.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.jsonlResults 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