Skip to main content

Module compute

Module compute 

Source
Expand description

§Chronix Compute Engine

CPU compute engine for Chronix analytics operations — dot products, matrix solving, exponential smoothing, differencing, autocorrelation, and batch statistics. Built on multi-tier SIMD acceleration and rayon parallelism.

§Architecture

┌──────────────────────────────────┐
│        ComputeEngine trait       │
├──────────────────────────────────┤
│  batch_dot_product()             │
│  batch_matrix_solve()            │
│  batch_exponential_smooth()      │
│  batch_difference()              │
│  batch_autocorrelation()         │
└──────────────┬───────────────────┘
               │
         ┌─────┴────┐
         │ CpuEngine │
         │ rayon+SIMD│
         └───────────┘

§SIMD Operations

Multi-tier SIMD for common statistical operations:

  • simd_sum, simd_mean, simd_variance, simd_min_max, simd_dot_product, simd_std_dev
  • x86_64: runtime-detected AVX-512F (8×f64) → AVX2+FMA (4×f64) → SSE2 (2×f64, baseline)
  • aarch64: NEON (2×f64, baseline)
  • Scalar 4-wide ILP fallback on other architectures
  • simd_tier() returns the active tier for diagnostics

§Buffer Pool

BufferPool<T> provides reusable Vec<T> to minimize allocation overhead in hot compute paths.

Structs§

BufferPool
A pool of reusable Vec<T> buffers that avoids repeated allocation on hot compute paths: get() hands out a cleared buffer, put() returns it.
ComputeConfig
Configuration for the compute engine.
CpuEngine
CPU compute engine using SIMD and rayon parallelism.

Enums§

ComputeError
Errors from compute operations.

Traits§

ComputeEngine
Compute engine trait — defines batch numerical operations used by forecast, anomaly detection, and multivariate engines.

Functions§

simd_dot_product
Computes the dot product of two equal-length slices using SIMD.
simd_mean
Computes the arithmetic mean of a slice.
simd_mean_variance
Two-pass mean + sample variance using SIMD kernels.
simd_min_max
Computes the minimum and maximum of a slice simultaneously using SIMD.
simd_population_variance
Computes the population variance of the slice using SIMD (divides by n).
simd_range_filter_i64
SIMD-accelerated timestamp range filter.
simd_std_dev
Computes the sample standard deviation.
simd_sum
Computes the sum of a slice with multi-tier SIMD acceleration and Kahan (compensated) summation for numerical stability.
simd_tier
Returns a human-readable string describing the active SIMD tier.
simd_variance
Computes the population variance given a precomputed mean.