Skip to main content

Crate cjc_runtime

Crate cjc_runtime 

Source
Expand description

CJC Runtime System

Provides the core runtime infrastructure for the CJC programming language:

  • Buffer<T>: Deterministic memory allocation with COW (Copy-On-Write) semantics
  • Tensor: N-dimensional tensor with element-wise ops, matmul, and stable reductions
  • ObjectSlab / GcRef: Deterministic RC-backed object slab (replaces mark-sweep GC)
  • FrameArena / ArenaStore: Bump-arena per function frame for non-escaping values
  • Value: Tagged union for the CJC interpreter
  • accumulator: BinnedAccumulator for order-invariant deterministic summation
  • dispatch: Hybrid summation strategy dispatch (Kahan vs Binned)

Re-exports§

pub use buffer::Buffer;
pub use tensor::Tensor;
pub use scratchpad::Scratchpad;
pub use aligned_pool::AlignedPool;
pub use aligned_pool::AlignedByteSlice;
pub use paged_kv::KvBlock;
pub use paged_kv::PagedKvCache;
pub use gc::GcRef;
pub use gc::GcHeap;
pub use binned_alloc::BinnedAllocator;
pub use frame_arena::FrameArena;
pub use frame_arena::ArenaStore;
pub use object_slab::ObjectSlab;
pub use object_slab::SlabRef;
pub use sparse::SparseCsr;
pub use sparse::SparseCoo;
pub use tensor_tiled::TiledMatmul;
pub use det_map::DetMap;
pub use det_map::murmurhash3;
pub use det_map::murmurhash3_finalize;
pub use det_map::value_hash;
pub use det_map::values_equal_static;
pub use value::Value;
pub use value::Bf16;
pub use value::FnValue;
pub use error::RuntimeError;
pub use tensor_dtype::DType;
pub use tensor_dtype::TypedStorage;

Modules§

accumulator
BinnedAccumulator — Deterministic, order-invariant floating-point summation.
aligned_pool
binned_alloc
Deterministic Binned Free Lists
buffer
builtins
Shared builtin function implementations for CJC eval and MIR-exec.
clustering
Clustering algorithms — K-Means, DBSCAN, Agglomerative.
complex
Complex BLAS — ComplexF64 with Fixed-Sequence Arithmetic.
datetime
DateTime support for CJC.
det_map
differentiate
Numerical Differentiation — deterministic finite-difference routines.
dispatch
Hybrid Summation Dispatch — Routes reductions to the appropriate accumulator.
distributions
Probability distributions — CDF, PDF, PPF for Normal, t, Chi-squared, F, Binomial, Poisson.
error
f16
Half Precision (f16) — IEEE 754 binary16 with promotion to f64.
fft
FFT — Cooley-Tukey radix-2 FFT, inverse FFT, real FFT, PSD.
frame_arena
Frame Arena — bump allocator for non-escaping values.
gc
GC compatibility layer — thin wrapper over ObjectSlab.
hypothesis
Statistical hypothesis tests — t-test (one-sample, two-sample, paired), chi-squared goodness-of-fit, ANOVA, F-test.
integrate
Numerical Integration — deterministic quadrature routines.
interpolate
Interpolation & Curve Fitting
json
Hand-rolled JSON parser and emitter for CJC.
kernel
Raw-pointer kernel functions that operate directly on f64 slices.
lib_registry
Library Registry — informational trait for CJC library self-description.
linalg
ml
ML Toolkit — loss functions, optimizers, activations, metrics.
object_slab
Object Slab — deterministic RC-backed replacement for mark-sweep GC.
ode
ODE / PDE Solver Infrastructure — Minimal Primitives
optimize
Optimization & Root Finding — deterministic numerical solvers.
paged_kv
quantized
Quantized BLAS — i8/i4 dequantization into BinnedAccumulator.
scratchpad
sparse
sparse_eigen
Sparse Eigenvalue Solvers — Lanczos and Arnoldi
sparse_solvers
Iterative solvers for sparse linear systems.
stationarity
Stationarity tests for time series analysis. ADF (Augmented Dickey-Fuller), KPSS, and Phillips-Perron tests. All use Kahan-compensated sums for numerical determinism.
stats
Descriptive statistics — population & sample variance, sd, se, median, quantile, IQR, skewness, kurtosis, z-score, standardize.
tensor
tensor_dtype
Typed tensor infrastructure: DType enum and TypedStorage.
tensor_pool
Thread-local tensor buffer pool for reusing allocations.
tensor_simd
SIMD acceleration for tensor operations (AVX2, 4-wide f64).
tensor_tiled
Tensor Tiling — L2-friendly tiled matrix multiplication.
timeseries
Time series analysis functions: ACF, PACF, EWMA, EMA, seasonal decomposition, differencing. All floating-point reductions use BinnedAccumulatorF64 for deterministic results.
value
window
Sliding-window functions for CJC.