Workspace layout
How the stochastic-rs Cargo workspace is organised — sub-crates, dependency topology, and how the umbrella re-exports preserve v1.x import paths.
Workspace layout
stochastic-rs is a Cargo workspace with 9 sub-crates as siblings
under the workspace root. The stochastic-rs umbrella crate keeps the
v1.x public API by re-exporting everything via pub use.
stochastic-rs/ (workspace root + umbrella crate)
├── stochastic-rs-core/ simd_rng (foundation)
├── stochastic-rs-distributions/ FloatExt, SimdFloatExt, 19 distributions
├── stochastic-rs-stochastic/ ProcessExt, 120+ processes
├── stochastic-rs-copulas/ BivariateExt, MultivariateExt, 10 copulas
├── stochastic-rs-stats/ MLE, Hurst, realised, stationarity, …
├── stochastic-rs-quant/ PricerExt, ModelPricer, calibration, vol surface
├── stochastic-rs-ai/ Neural surrogates (feature-gated)
├── stochastic-rs-viz/ Plotly grid plotter
└── stochastic-rs-py/ PyO3 cdylib (210 entries)Dependency topology
stochastic-rs-core (simd_rng)
│
▼
stochastic-rs-distributions (FloatExt, SimdFloatExt)
┌─────────┬─────────┐
▼ ▼ ▼
stochastic copulas stats
│ │
└────────┬──────────┘
▼
stochastic-rs-quant
┌───┴───┐
▼ ▼
ai vizThe PyO3 crate (stochastic-rs-py) sits on the side: it depends on the
producer crates and re-exports #[pyclass]-wrapped types via the
py_distribution! / py_process_*! macros plus hand-written
#[pyclass] blocks for pricers and estimators.
Why the workspace split
- Compile time. Pulling only
stochastic-rs-distributionsfor a distribution-sampling job avoids compiling the quant + AI surface. - Feature gating.
ai,openblas,cuda,metal,vizlive on the crates that own the optional dependency, so a defaultcargo buildnever tries to link CUDA on a laptop with no GPU. - Versioning. Sub-crates can ship patch releases independently when needed — the umbrella tracks the highest sub-crate version.
Path preservation across the workspace split
If your code imports via stochastic_rs::stochastic::diffusion::* or
stochastic_rs::quant::pricing::*, no change is required when
upgrading across the workspace split. The umbrella pub uses every
sub-crate's public surface under the historical paths.
Quickstart
A 5-minute end-to-end tour — simulate an OU path, price a Heston call, and run a Hurst estimator. Same code shown in Rust and Python side by side.
Traits overview
The trait surface that organises the library — FloatExt, ProcessExt, DistributionExt, PricerExt, ModelPricer, Calibrator, GreeksExt, and friends.