Expand description
covstream is a fixed-dimension streaming covariance library with Lean-backed
specifications.
The crate is built around two public entry points:
CovstreamStateis the default user-facing API. It stores a chosenMatrixLayoutand returns buffers in that layout.CovstreamCoreis the lower-level engine. It gives direct access to the underlying state and explicit extraction methods for each layout.
Safe ingest paths reject:
- wrong sample dimensions
- malformed flat batch buffers
- non-finite inputs such as
NaNandInf
Covariance and shrinkage extraction require at least two observed samples.
Until then the library returns CovstreamError::InsufficientSamples.
For higher-throughput pipelines that already validate inputs upstream, the
trusted_finite ingest methods skip finite-value checks while preserving
shape checks.
Security and safety notes:
- The crate does not perform network I/O, file I/O, subprocess execution, or environment-based configuration in its library API.
- The checked ingest paths validate dimensions and reject non-finite values.
- The only
unsafecode is isolated to optional AArch64 SIMD leaf kernels insrc/kernels.rs.
Re-exports§
pub use shrinkage::diagonal_mean_row_major;pub use shrinkage::scaled_identity_row_major;pub use shrinkage::shrink_row_major;pub use shrinkage::shrink_with_mode_row_major;pub use shrinkage::ShrinkageMode;
Modules§
Structs§
- Covstream
Core - Low-level fixed-dimension streaming covariance engine.
- Covstream
State - User-facing wrapper around
CovstreamCorethat remembers an output layout.
Enums§
- Covstream
Error - Runtime errors returned by the checked Covstream APIs.
- Matrix
Layout - Output layout used when extracting covariance or shrinkage matrices.