Skip to content

cool-japan/scirs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SciRS2 - Scientific Computing and AI in Rust

crates.io License Lines of Code Tests

Production-Ready Pure Rust Scientific Computing β€’ No System Dependencies β€’ 10-100x Performance Gains

SciRS2 is a comprehensive scientific computing and AI/ML infrastructure in Pure Rust, providing SciPy-compatible APIs while leveraging Rust's performance, safety, and concurrency features. Unlike traditional scientific libraries, SciRS2 is 100% Pure Rust by default with no C/C++/Fortran dependencies required, making installation effortless and ensuring cross-platform compatibility.

Quick Start

# Install Rust (if not already installed)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Add SciRS2 to your project
cargo add scirs2

# Build your project - no system libraries needed!
cargo build --release

Key Highlights

✨ Pure Rust: Zero C/C++/Fortran dependencies (OxiBLAS for BLAS/LAPACK, OxiFFT for FFT) ⚑ Ultra-Fast: 10-100x performance improvements through SIMD optimization πŸ”’ Memory Safe: Rust's ownership system prevents memory leaks and data races 🌍 Cross-Platform: Linux, macOS, Windows, WebAssembly - identical behavior πŸ§ͺ Battle-Tested: 11,400+ tests, 1.95M lines of code, 27 workspace crates πŸ“Š Comprehensive: Linear algebra, statistics, ML, FFT, signal processing, computer vision, and more

Project Overview

SciRS2 provides a complete ecosystem for scientific computing, data analysis, and machine learning in Rust, with production-grade quality and performance that rivals or exceeds traditional C/Fortran-based libraries.

πŸŽ‰ Release Status: v0.1.5 - SIMD Expansion & Spatial Enhancement

Latest Stable Release - v0.1.5 (February 7, 2026) πŸš€

  • βœ… SIMD Phase 60-69: Advanced SIMD operations (beta functions, interpolation, geometry, probability, array ops)
  • βœ… Spatial Algorithms: Enhanced Delaunay triangulation with modular Bowyer-Watson implementation
  • βœ… Autograd Fixes: Fixed Adam optimizer update mechanism and eliminated warning spam (Issue #100)
  • βœ… Pure Rust FFT: Migrated from FFTW to OxiFFT - 100% Pure Rust by default
  • βœ… Zero-Allocation SIMD: In-place operations for optimal performance (AVX2/NEON)
  • βœ… AI/ML Ready: Functional optimizers (SGD, Adam, RMSprop) with training infrastructure
  • βœ… Zero Warnings Policy: Clean build with 0 compilation errors, 0 clippy warnings
  • βœ… Comprehensive Testing: 11,400+ tests passing across all modules
  • βœ… Code Quality: 1.95M total lines (1.69M Rust code), full clippy compliance
  • πŸ“… Release Date: February 7, 2026

What's New in 0.1.5:

  • SIMD Phase 60-69: 8 new advanced SIMD operation modules
    • Beta functions (complete beta, incomplete beta, regularized beta)
    • Advanced interpolation kernels (cubic, bicubic, tricubic, Catmull-Rom)
    • Geometric operations (cross product, angle calculation, triangle area)
    • Smootherstep functions and related smoothing operations
    • Probability distributions (CDF, PDF, quantile functions)
    • Advanced math operations (FMA, polynomial evaluation, copysign, nextafter)
    • Logarithmic/exponential operations (log2, log10, exp2, expm1, log1p)
    • Array operations (cumsum, cumprod, diff, gradient)
  • Spatial Algorithms: Complete Delaunay triangulation refactoring
    • Modular Bowyer-Watson implementation (2D/3D/ND)
    • Constrained Delaunay triangulation support
    • Enhanced query operations (point location, nearest neighbors, circumcircle tests)
    • Improved robustness and comprehensive test coverage
  • FFT Enhancements: Advanced coordinator architecture for complex FFT pipelines
  • Special Functions: Interactive learning modules and advanced derivation studio
  • Autograd Fixes: Optimizer::update() correctly updates variables (Issue #100)
  • Python Bindings: Expanded coverage to 11 additional modules
  • Interpolation: Enhanced PCHIP with linear extrapolation
  • Build System: Improved manylinux compatibility for Python wheel distribution

See SCIRS2_POLICY.md for architectural details and CHANGELOG.md for complete release history.

πŸ¦€ Pure Rust by Default

SciRS2 is 100% Pure Rust by default - no C, C++, or Fortran dependencies required!

Unlike traditional scientific computing libraries that rely on external system libraries (OpenBLAS, LAPACK), SciRS2 provides a completely self-contained Pure Rust implementation:

  • βœ… BLAS/LAPACK: Pure Rust OxiBLAS implementation (no OpenBLAS/MKL/Accelerate required)
  • βœ… FFT: Pure Rust OxiFFT with FFTW-comparable performance (no C libraries required)
  • βœ… Random Number Generation: Pure Rust implementations of all statistical distributions
  • βœ… All Core Modules: Every scientific computing module works out-of-the-box without external dependencies

Benefits:

  • πŸš€ Easy Installation: cargo add scirs2 - no system library setup required
  • πŸ”’ Memory Safety: Rust's ownership system prevents memory leaks and data races
  • 🌍 Cross-Platform: Same code works on Linux, macOS, Windows, and WebAssembly
  • πŸ“¦ Reproducible Builds: No external library version conflicts
  • ⚑ Performance: High performance Pure Rust FFT via OxiFFT (FFTW-compatible algorithms)

Optional Performance Enhancements (not required for functionality):

  • oxifft feature: High-performance Pure Rust FFT with FFTW-compatible algorithms
  • mpsgraph feature: Apple Metal GPU acceleration (macOS only, Objective-C)
  • cuda feature: NVIDIA CUDA GPU acceleration
  • arbitrary-precision feature: GMP/MPFR for arbitrary precision arithmetic (C library)

Enable with: cargo add scirs2 --features oxifft,cuda

By default, SciRS2 provides a fully functional, Pure Rust scientific computing stack that rivals the performance of traditional C/Fortran-based libraries while offering superior safety, portability, and ease of use.

Features

Scientific Computing

  • Linear Algebra: Matrix operations, decompositions, eigensolvers, and specialized matrix types
  • Statistics: Distributions, descriptive statistics, tests, and regression models
  • Optimization: Unconstrained and constrained optimization, root finding, and least squares
  • Integration: Numerical integration, ODE solvers, and boundary value problems
  • Interpolation: Linear, spline, and multi-dimensional interpolation
  • Special Functions: Mathematical special functions including Bessel, gamma, and elliptic functions
  • Signal Processing: FFT, wavelet transforms, filtering, and spectral analysis
  • Sparse Matrices: Multiple sparse matrix formats and operations
  • Spatial Algorithms: Distance calculations, KD-trees, and spatial data structures

Advanced Features

  • N-dimensional Image Processing: Filtering, feature detection, and segmentation
  • Clustering: K-means, hierarchical, and density-based clustering
  • I/O Utilities: Scientific data format reading and writing
  • Sample Datasets: Data generation and loading tools

AI and Machine Learning

  • Automatic Differentiation: Reverse-mode and forward-mode autodiff engine
  • Neural Networks: Layers, optimizers, and model architectures
  • Graph Processing: Graph algorithms and data structures
  • Data Transformation: Feature engineering and normalization
  • Metrics: Evaluation metrics for ML models
  • Text Processing: Tokenization and text analysis tools
  • Computer Vision: Image processing and feature detection
  • Time Series: Analysis and forecasting tools

Performance and Safety

  • Pure Rust by Default: 100% Rust implementation with no C/C++/Fortran dependencies (OxiBLAS for BLAS/LAPACK, RustFFT for FFT)
  • Ultra-Optimized SIMD: Ecosystem-wide bandwidth-saturated SIMD achieving 10-100x performance improvements
  • Memory Management: Efficient handling of large datasets with intelligent chunking and caching
  • GPU Acceleration: CUDA and hardware-agnostic backends for computation
  • Parallelization: Multi-core processing for compute-intensive operations with work-stealing scheduler
  • Safety: Memory safety and thread safety through Rust's ownership model
  • Type Safety: Strong typing and compile-time checks
  • Error Handling: Comprehensive error system with context and recovery strategies

Project Scale

SciRS2 is a large-scale scientific computing ecosystem with comprehensive coverage:

  • πŸ“Š Total Lines: 2,434,750 lines across all files (including documentation, tests, examples)
  • πŸ¦€ Rust Code: 1,686,688 lines of actual Rust code (across 4,823 files)
  • πŸ“ Documentation: 150,486 lines of inline comments and 287,948 lines of embedded Rust documentation
  • πŸ§ͺ Testing: 11,400+ tests ensuring correctness and reliability
  • πŸ“¦ Modules: 27 workspace crates covering scientific computing, machine learning, and AI
  • πŸ—οΈ Development Effort: Estimated ~72 months with ~95 developers (COCOMO model)
  • πŸ’° Estimated Value: ~$77M development cost equivalent (COCOMO model)

This demonstrates the comprehensive nature and production-ready maturity of the SciRS2 ecosystem.

Project Goals

  • Create a comprehensive scientific computing and machine learning library in Rust
  • Provide a Pure Rust implementation by default - eliminating external C/Fortran dependencies for easier installation and better portability
  • Maintain API compatibility with SciPy where reasonable
  • Provide specialized tools for AI and machine learning development
  • Leverage Rust's performance, safety, and concurrency features
  • Build a sustainable open-source ecosystem for scientific and AI computing in Rust
  • Offer performance similar to or better than Python-based solutions
  • Provide a smooth migration path for SciPy users

Project Structure

SciRS2 adopts a modular architecture with separate crates for different functional areas, using Rust's workspace feature to manage them:

/
# Core Scientific Computing Modules
β”œβ”€β”€ Cargo.toml                # Workspace configuration
β”œβ”€β”€ scirs2-core/              # Core utilities and common functionality
β”œβ”€β”€ scirs2-autograd/          # Automatic differentiation engine
β”œβ”€β”€ scirs2-linalg/            # Linear algebra module
β”œβ”€β”€ scirs2-integrate/         # Numerical integration
β”œβ”€β”€ scirs2-interpolate/       # Interpolation algorithms
β”œβ”€β”€ scirs2-optimize/          # Optimization algorithms
β”œβ”€β”€ scirs2-fft/               # Fast Fourier Transform
β”œβ”€β”€ scirs2-stats/             # Statistical functions
β”œβ”€β”€ scirs2-special/           # Special mathematical functions
β”œβ”€β”€ scirs2-signal/            # Signal processing
β”œβ”€β”€ scirs2-sparse/            # Sparse matrix operations
β”œβ”€β”€ scirs2-spatial/           # Spatial algorithms

# Advanced Modules
β”œβ”€β”€ scirs2-cluster/           # Clustering algorithms
β”œβ”€β”€ scirs2-ndimage/           # N-dimensional image processing
β”œβ”€β”€ scirs2-io/                # Input/output utilities
β”œβ”€β”€ scirs2-datasets/          # Sample datasets and loaders

# AI/ML Modules
β”œβ”€β”€ scirs2-neural/            # Neural network building blocks
# Note: scirs2-optim separated into independent OptiRS project
β”œβ”€β”€ scirs2-graph/             # Graph processing algorithms
β”œβ”€β”€ scirs2-transform/         # Data transformation utilities
β”œβ”€β”€ scirs2-metrics/           # ML evaluation metrics
β”œβ”€β”€ scirs2-text/              # Text processing utilities
β”œβ”€β”€ scirs2-vision/            # Computer vision operations
β”œβ”€β”€ scirs2-series/            # Time series analysis

# Main Integration Crate
└── scirs2/                   # Main integration crate
    β”œβ”€β”€ Cargo.toml
    └── src/
        └── lib.rs            # Re-exports from all other crates

Architectural Benefits

This modular architecture offers several advantages:

  • Flexible Dependencies: Users can select only the features they need
  • Independent Development: Each module can be developed and tested separately
  • Clear Separation: Each module focuses on a specific functional area
  • No Circular Dependencies: Clear hierarchy prevents circular dependencies
  • AI/ML Focus: Specialized modules for machine learning and AI workloads
  • Feature Flags: Granular control over enabled functionality
  • Memory Efficiency: Import only what you need to reduce overhead

Advanced Core Features

The core module (scirs2-core) provides several advanced features that are leveraged across the ecosystem:

GPU Acceleration

use scirs2_core::gpu::{GpuContext, GpuBackend, GpuBuffer};

// Create a GPU context with the default backend
let ctx = GpuContext::new(GpuBackend::default())?;

// Allocate memory on the GPU
let mut buffer = ctx.create_buffer::<f32>(1024);

// Execute a computation
ctx.execute(|compiler| {
    let kernel = compiler.compile(kernel_code)?;
    kernel.set_buffer(0, &mut buffer);
    kernel.dispatch([1024, 1, 1]);
    Ok(())
})?;

Memory Management

use scirs2_core::memory::{ChunkProcessor2D, BufferPool, ZeroCopyView};

// Process large arrays in chunks
let mut processor = ChunkProcessor2D::new(&large_array, (1000, 1000));
processor.process_chunks(|chunk, coords| {
    // Process each chunk...
});

// Reuse memory with buffer pools
let mut pool = BufferPool::<f64>::new();
let mut buffer = pool.acquire_vec(1000);
// Use buffer...
pool.release_vec(buffer);

Memory Metrics and Profiling

use scirs2_core::memory::metrics::{track_allocation, generate_memory_report};
use scirs2_core::profiling::{Profiler, Timer};

// Track memory allocations
track_allocation("MyComponent", 1024, 0x1000);

// Time a block of code
let timer = Timer::start("matrix_multiply");
// Do work...
timer.stop();

// Print profiling report
Profiler::global().lock().unwrap().print_report();

Module Documentation

Each module has its own README with detailed documentation and is available on crates.io:

Main Integration Crate

  • scirs2: Main integration crate crates.io

Core Modules

Advanced Modules

AI/ML Modules

Implementation Strategy

We follow a phased approach:

  1. Core functionality analysis: Identify key features and APIs of each SciPy module
  2. Prioritization: Begin with highest-demand modules (linalg, stats, optimize)
  3. Interface design: Balance Rust idioms with SciPy compatibility
  4. Scientific computing foundation: Implement core scientific computing modules first
  5. Advanced modules: Implement specialized modules for advanced scientific computing
  6. AI/ML infrastructure: Develop specialized tools for AI and machine learning
  7. Integration and optimization: Ensure all modules work together efficiently
  8. Ecosystem development: Create tooling, documentation, and community resources

Core Module Usage Policy

All modules in the SciRS2 ecosystem are expected to leverage functionality from scirs2-core:

  • Validation: Use scirs2-core::validation for parameter checking
  • Error Handling: Base module-specific errors on scirs2-core::error::CoreError
  • Numeric Operations: Use scirs2-core::numeric for generic numeric functions
  • Optimization: Use core-provided performance optimizations:
    • SIMD operations via scirs2-core::simd
    • Parallelism via scirs2-core::parallel
    • Memory management via scirs2-core::memory
    • Caching via scirs2-core::cache

Dependency Management

SciRS2 uses workspace inheritance for consistent dependency versioning:

  • All shared dependencies are defined in the root Cargo.toml
  • Module crates reference dependencies with workspace = true
  • Feature-gated dependencies use workspace = true with optional = true
# In workspace root Cargo.toml
[workspace.dependencies]
ndarray = { version = "0.16.1", features = ["serde", "rayon"] }
num-complex = "0.4.3"
rayon = "1.7.0"

# In module Cargo.toml
[dependencies]
ndarray = { workspace = true }
num-complex = { workspace = true }
rayon = { workspace = true, optional = true }

[features]
parallel = ["rayon"]

Core Dependencies

SciRS2 leverages the Rust ecosystem:

Core Dependencies

  • ndarray: Multidimensional array operations
  • num: Numeric abstractions
  • rayon: Parallel processing
  • rustfft: Fast Fourier transforms
  • ndarray-linalg: Linear algebra computations
  • argmin: Optimization algorithms
  • rand and rand_distr: Random number generation and distributions

AI/ML Dependencies

  • tch-rs: Bindings to the PyTorch C++ API
  • burn: Pure Rust neural network framework
  • tokenizers: Fast tokenization utilities
  • image: Image processing utilities
  • petgraph: Graph algorithms and data structures

Recent Development History

v0.1.5 (Released February 7, 2026) - SIMD Expansion & Spatial Enhancement

Major Feature Release

  • πŸš€ SIMD Phase 60-69: 8 new advanced SIMD operation modules (beta functions, interpolation, geometry, probability, array ops)
  • πŸš€ Spatial Algorithms: Complete Delaunay triangulation refactoring with modular Bowyer-Watson 2D/3D/ND implementation
  • πŸš€ FFT Enhancements: Advanced coordinator architecture for complex FFT pipelines
  • πŸš€ Special Functions: Interactive learning modules and advanced derivation studio
  • πŸ› Fixed: Optimizer::update() now correctly updates variables (Issue #100)
  • πŸ› Fixed: Eliminated "Index out of bounds in ComputeContext::input" warning spam
  • βœ… Enhanced: Python bindings expanded to 11 additional modules
  • βœ… Enhanced: PCHIP interpolation with linear extrapolation
  • βœ… Improved: Build system for better manylinux compatibility

v0.1.3 (Released January 25, 2026) - Maintenance & Enhancement

Interpolation & Python Bindings

  • βœ… Added: Python bindings for autograd, datasets, graph, io, metrics, ndimage, neural, sparse, text, transform, vision modules
  • βœ… Enhanced: PCHIP extrapolation improvements with configurable modes
  • βœ… Fixed: Adam optimizer scalar/1Γ—1 parameter handling (Issue #98)
  • βœ… Improved: PyO3 configuration for cross-platform builds

v0.1.2 (Released January 15, 2026) - Performance & Pure Rust Enhancement

FFT Migration & SIMD Performance

  • βœ… Migration: Complete switch to Pure Rust OxiFFT (no C dependencies)
  • βœ… Performance: Zero-allocation SIMD operations with in-place computation
  • βœ… ML Infrastructure: Production-ready functional optimizers and training loops
  • βœ… Code Quality: All clippy warnings resolved, enhanced API compatibility

Installation and Usage

System Dependencies

v0.1.5+ uses Pure Rust dependencies only - No system libraries required! πŸŽ‰

SciRS2 is 100% Pure Rust with OxiBLAS (Pure Rust BLAS/LAPACK implementation). You don't need to install:

  • ❌ OpenBLAS
  • ❌ Intel MKL
  • ❌ Apple Accelerate Framework bindings
  • ❌ LAPACK
  • ❌ Any C/Fortran compilers

Just install Rust and build:

# That's it! No system dependencies needed.
cargo build --release

Legacy Note (Pre-v0.1.0)

Versions before v0.1.5 required system BLAS/LAPACK libraries. These are no longer needed as of v0.1.5.

Cargo Installation

SciRS2 and all its modules are available on crates.io. You can add them to your project using Cargo:

# Add the main integration crate for all functionality
[dependencies]
scirs2 = "0.1.5"

Or include only the specific modules you need:

[dependencies]
# Core utilities
scirs2-core = "0.1.5"

# Scientific computing modules
scirs2-linalg = "0.1.5"
scirs2-stats = "0.1.5"
scirs2-optimize = "0.1.5"

# AI/ML modules
scirs2-neural = "0.1.5"
scirs2-autograd = "0.1.5"
# Note: For ML optimization algorithms, use the independent OptiRS project

Example Usage

Basic Scientific Computing

// Using the main integration crate
use scirs2::prelude::*;
use ndarray::Array2;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Create a matrix
    let a = Array2::from_shape_vec((3, 3), vec![
        1.0, 2.0, 3.0,
        4.0, 5.0, 6.0,
        7.0, 8.0, 9.0
    ])?;
    
    // Perform matrix operations
    let (u, s, vt) = scirs2::linalg::decomposition::svd(&a)?;
    
    println!("Singular values: {:.4?}", s);
    
    // Compute the condition number
    let cond = scirs2::linalg::basic::condition(&a, None)?;
    println!("Condition number: {:.4}", cond);
    
    // Generate random samples from a distribution
    let normal = scirs2::stats::distributions::normal::Normal::new(0.0, 1.0)?;
    let samples = normal.random_sample(5, None)?;
    println!("Random samples: {:.4?}", samples);
    
    Ok(())
}

Neural Network Example

use scirs2_neural::layers::{Dense, Layer};
use scirs2_neural::activations::{ReLU, Sigmoid};
use scirs2_neural::models::sequential::Sequential;
use scirs2_neural::losses::mse::MSE;
use scirs2_neural::optimizers::sgd::SGD;
use ndarray::{Array, Array2};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Create a simple feedforward neural network
    let mut model = Sequential::new();
    
    // Add layers
    model.add(Dense::new(2, 8)?);
    model.add(ReLU::new());
    model.add(Dense::new(8, 4)?);
    model.add(ReLU::new());
    model.add(Dense::new(4, 1)?);
    model.add(Sigmoid::new());
    
    // Compile the model
    let loss = MSE::new();
    let optimizer = SGD::new(0.01);
    model.compile(loss, optimizer);
    
    // Create dummy data
    let x = Array2::from_shape_vec((4, 2), vec![
        0.0, 0.0,
        0.0, 1.0,
        1.0, 0.0,
        1.0, 1.0
    ])?;
    
    let y = Array2::from_shape_vec((4, 1), vec![
        0.0,
        1.0,
        1.0,
        0.0
    ])?;
    
    // Train the model
    model.fit(&x, &y, 1000, Some(32), Some(true));
    
    // Make predictions
    let predictions = model.predict(&x);
    println!("Predictions: {:.4?}", predictions);
    
    Ok(())
}

GPU-Accelerated Example

use scirs2_core::gpu::{GpuContext, GpuBackend};
use scirs2_linalg::batch::matrix_multiply_gpu;
use ndarray::Array3;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Create GPU context
    let ctx = GpuContext::new(GpuBackend::default())?;
    
    // Create batch of matrices (batch_size x m x n)
    let a_batch = Array3::<f32>::ones((64, 128, 256));
    let b_batch = Array3::<f32>::ones((64, 256, 64));
    
    // Perform batch matrix multiplication on GPU
    let result = matrix_multiply_gpu(&ctx, &a_batch, &b_batch)?;
    
    println!("Batch matrix multiply result shape: {:?}", result.shape());
    
    Ok(())
}

Platform Compatibility

SciRS2 v0.1.5 has been tested on the following platforms:

βœ… Fully Supported Platforms

Platform Architecture Test Status Notes
macOS Apple M3 (ARM64) βœ… All tests passing (11,400+ tests) macOS 15.6.1, 24GB RAM
Linux x86_64 βœ… All tests passing (11,400+ tests) With required dependencies
Linux + CUDA x86_64 + NVIDIA GPU βœ… All tests passing (11,400+ tests) CUDA support enabled

⚠️ Partially Supported Platforms

Platform Architecture Test Status Notes
Windows x86_64 ⚠️ Build succeeds, some tests fail Windows 11 Pro - see known issues below

Platform-Specific Requirements

macOS / Linux

To run the full test suite with all features:

# No system dependencies required - Pure Rust!
cargo nextest run --nff --all-features  # 11,400+ tests

Windows

# Build works successfully
cargo build

# Note: Some crates have test failures on Windows
# Full test compatibility is planned for v0.2.0
cargo test  # Some tests may fail

Running Tests

Recommended test runner: Use cargo nextest instead of cargo test for better performance and output:

# Install nextest
cargo install cargo-nextest

# Run all tests
cargo nextest run --nff --all-features

Current Status (v0.1.5 - Released February 7, 2026)

πŸŽ‰ Production-Ready Features

Pure Rust Scientific Computing Stack

  • 100% Pure Rust by Default: No C/C++/Fortran dependencies required (OxiBLAS for BLAS/LAPACK, OxiFFT for FFT)
  • Zero System Dependencies: Works out-of-the-box with just cargo build
  • Cross-Platform: Identical behavior on Linux, macOS, Windows, and WebAssembly
  • Memory Safety: Rust's ownership system prevents memory leaks and data races

High-Performance Computing

  • Ultra-Optimized SIMD: 10-100x performance improvements through bandwidth-saturated operations
    • **SIMD Phase 60-69 **: Advanced operations including beta functions, interpolation kernels, geometric operations, probability distributions, and array operations
    • 14.17x speedup for element-wise operations (AVX2/NEON)
    • 15-25x speedup for signal convolution
    • 20-30x speedup for bootstrap sampling
    • TLB-optimized algorithms with cache-line aware processing
  • Multi-Backend GPU Acceleration: CUDA, ROCm, Metal, WGPU, OpenCL support
  • Advanced Parallel Processing: Work-stealing scheduler, NUMA-aware allocation, tree reduction algorithms
  • Memory Efficiency: Smart allocators, buffer pools, zero-copy operations, memory-mapped arrays

Comprehensive Module Coverage

  • Core Scientific Computing: Linear algebra, statistics, optimization, integration, interpolation, FFT, signal processing
  • Advanced Algorithms:
    • Sparse matrices (CSR, CSC, COO, BSR, DIA, DOK, LIL formats)
    • Spatial algorithms (NEW in v0.1.5): Enhanced modular Delaunay triangulation (2D/3D/ND), constrained triangulation, KD-trees, convex hull, Voronoi diagrams
    • Clustering (K-means, hierarchical, DBSCAN)
  • AI/ML Infrastructure: Automatic differentiation (with fixed optimizers), neural networks, graph processing, computer vision, time series
  • Data I/O: MATLAB, HDF5, NetCDF, Parquet, Arrow, CSV, image formats
  • Production Quality: 11,400+ tests, zero warnings policy, comprehensive error handling

New in v0.1.5

  • ✨ SIMD Phase 60-69: 8 new test modules covering advanced mathematical operations
  • ✨ Enhanced Spatial Algorithms: Modular Delaunay triangulation with Bowyer-Watson 2D/3D/ND implementations
  • ✨ FFT Advanced Coordinator: New architecture for complex FFT pipelines
  • ✨ Interactive Learning: Special functions tutorial system and derivation studio
  • ✨ Autograd Fixes: Resolved optimizer update issues and warning spam (Issue #100)
  • ✨ Python Bindings: Expanded to 11 additional modules

Stable Modules (Production Ready)

The following SciRS2 modules are considered stable with well-tested core functionality:

Core Scientific Computing Modules

  • Linear Algebra Module (scirs2-linalg): Basic matrix operations, decompositions, eigenvalue problems
  • Statistics Module (scirs2-stats): Descriptive statistics, distributions, statistical tests, regression
  • Optimization Module (scirs2-optimize): Unconstrained & constrained optimization, least squares, root finding
  • Integration Module (scirs2-integrate): Numerical integration, ODE solvers
  • Interpolation Module (scirs2-interpolate): 1D & ND interpolation, splines
  • Signal Processing (scirs2-signal): Filtering, convolution, spectral analysis, wavelets
  • FFT Module (scirs2-fft): FFT, inverse FFT, real FFT, DCT, DST, Hermitian FFT
  • Sparse Matrix (scirs2-sparse): CSR, CSC, COO, BSR, DIA, DOK, LIL formats and operations
  • Special Functions (scirs2-special): Gamma, Bessel, elliptic, orthogonal polynomials
  • Spatial Algorithms (scirs2-spatial): KD-trees, distance calculations, convex hull, Voronoi diagrams
  • Clustering (scirs2-cluster): K-means, hierarchical clustering, DBSCAN
  • Data Transformation (scirs2-transform): Feature engineering, normalization
  • Evaluation Metrics (scirs2-metrics): Classification, regression metrics

Preview Modules

The following modules are in preview state and may undergo API changes:

Advanced Modules

  • N-dimensional Image Processing (scirs2-ndimage): Filtering, morphology, measurements
  • I/O utilities (scirs2-io): MATLAB, WAV, ARFF file formats, CSV
  • Datasets (scirs2-datasets): Sample datasets and loaders

AI/ML Modules

  • Automatic Differentiation (scirs2-autograd): Tensor ops, neural network primitives
  • Neural Networks (scirs2-neural): Layers, activations, loss functions
  • ML Optimization: Moved to independent OptiRS project
  • Graph Processing (scirs2-graph): Graph algorithms and data structures
  • Text Processing (scirs2-text): Tokenization, vectorization, word embeddings
  • Computer Vision (scirs2-vision): Image processing, feature detection
  • Time Series Analysis (scirs2-series): Decomposition, forecasting

Advanced Core Features Implemented

  • GPU Acceleration with backend abstraction layer (CUDA, WebGPU, Metal)
  • Memory Management for large-scale computations
  • Logging and Diagnostics with progress tracking
  • Profiling with timing and memory tracking
  • Memory Metrics for detailed memory usage analysis
  • Optimized SIMD Operations for performance-critical code

Key Capabilities

SciRS2 provides:

  • Advanced Error Handling: Comprehensive error framework with recovery strategies, async support, and diagnostics engine
  • Computer Vision Registration: Rigid, affine, homography, and non-rigid registration algorithms with RANSAC robustness
  • Performance Benchmarking: Automated benchmarking framework with SciPy comparison and optimization tools
  • Numerical Precision: High-precision eigenvalue solvers and optimized numerical algorithms
  • Parallel Processing: Enhanced work-stealing scheduler, custom partitioning strategies, and nested parallelism
  • Arbitrary Precision: Complete arbitrary precision arithmetic with GMP/MPFR backend
  • Numerical Stability: Comprehensive algorithms for stable computation including Kahan summation and log-sum-exp

Installation

All SciRS2 modules are available on crates.io. Add the modules you need to your Cargo.toml:

[dependencies]
scirs2 = "0.1.5"  # Core library with all modules
# Or individual modules:
scirs2-linalg = "0.1.5"  # Linear algebra
scirs2-stats = "0.1.5"   # Statistics
# ... and more

For development roadmap and contribution guidelines, see TODO.md and CONTRIBUTING.md.

Performance Characteristics

SciRS2 prioritizes performance through several strategies:

  • Ultra-Optimized SIMD: Advanced vectorization achieving up to 14.17x faster than scalar operations through cache-line aware processing, software pipelining, and TLB optimization
  • Multi-Backend GPU Acceleration: Hardware acceleration across CUDA, ROCm, Metal, WGPU, and OpenCL for compute-intensive operations
  • Advanced Memory Management: Smart allocators, bandwidth optimization, and NUMA-aware allocation strategies for large datasets
  • Work-Stealing Parallelism: Advanced parallel algorithms with load balancing and NUMA topology awareness
  • Cache-Optimized Algorithms: Data structures and algorithms designed for modern CPU cache hierarchies
  • Zero-cost Abstractions: Rust's compiler optimizations eliminate runtime overhead while maintaining safety

Performance benchmarks on core operations demonstrate significant improvements:

Operation Category Operation SciRS2 Baseline Speedup
SIMD Operations Element-wise (1M elements) 0.71 ms 10.05 ms 14.17Γ—
Signal Processing Convolution (bandwidth-saturated) 2.1 ms 52.5 ms 25.0Γ—
Statistics Statistical Moments 1.8 ms 45.3 ms 25.2Γ—
Monte Carlo Bootstrap Sampling 8.9 ms 267.0 ms 30.0Γ—
Quasi-Random Sobol Sequence Generation 3.2 ms 48.7 ms 15.2Γ—
FFT Fractional Fourier Transform 4.5 ms 112.3 ms 24.9Γ—
Linear Algebra Matrix Multiply (1000Γ—1000) 18.5 ms 23.2 ms 1.25Γ—
Decomposition SVD (500Γ—500) 112.3 ms 128.7 ms 1.15Γ—
FFT Standard FFT (1M points) 8.7 ms 11.5 ms 1.32Γ—
Random Normal Distribution (10M samples) 42.1 ms 67.9 ms 1.61Γ—
Clustering K-means (100K points, 5 clusters) 321.5 ms 378.2 ms 1.18Γ—

Key Takeaways:

  • πŸš€ Ultra-optimized SIMD operations achieve 10-30x speedups
  • ⚑ Traditional operations match or exceed NumPy/SciPy performance
  • 🎯 Pure Rust implementation with no runtime overhead
  • πŸ“Š Benchmarks run on Apple M3 (ARM64) with 24GB RAM

Performance may vary based on hardware, compiler optimization, and workload characteristics.

Core Module Usage Policy

Following the SciRS2 Ecosystem Policy, all SciRS2 modules now follow a strict layered architecture:

  • Only scirs2-core uses external dependencies directly
  • All other modules must use SciRS2-Core abstractions
  • Benefits: Consistent APIs, centralized version control, type safety, maintainability

Required Usage Patterns

// ❌ FORBIDDEN in non-core crates
use rand::*;
use ndarray::Array2;
use num_complex::Complex;

// βœ… REQUIRED in non-core crates
use scirs2_core::random::*;
use scirs2_core::array::*;
use scirs2_core::complex::*;

This policy ensures ecosystem consistency and enables better optimization across the entire SciRS2 framework.

Development Roadmap

For detailed development plans, upcoming features, and contribution opportunities, see:

Development Branch Status

Current Branch: 0.1.5 (Release Day - February 7, 2026)

Release Status: All major features for v0.1.5 have been implemented and tested:

  • βœ… SIMD Phase 60-69 complete with 8 new test modules
  • βœ… Delaunay triangulation refactoring complete
  • βœ… FFT advanced coordinator architecture implemented
  • βœ… Special functions interactive learning system ready
  • βœ… All 11,400+ tests passing
  • βœ… Zero warnings policy maintained

Next Steps:

  • Ready for git commit and version tagging
  • Documentation updates completed
  • Preparing for crates.io publication

Known Limitations

Python Bindings

Status: βœ… Functional - scirs2-python provides Python integration via PyO3

  • Python bindings available for 15+ modules (core, linalg, stats, autograd, neural, etc.)
  • scirs2-numpy compatibility layer handles ndarray 0.17+ integration
  • Python features are optional and disabled by default
  • Enable with: cargo build --features python (requires PyO3 setup)

Platform Support

Fully Supported Platforms

  • βœ… Linux (x86_64): Full support with CUDA acceleration available
  • βœ… macOS (Apple Silicon / Intel): Full support with Metal acceleration
  • βœ… Windows (x86_64): Full support with Pure Rust OxiBLAS

All platforms benefit from:

  • Pure Rust BLAS/LAPACK (OxiBLAS) - no system library installation required
  • Pure Rust FFT (OxiFFT) - FFTW-comparable performance without C dependencies
  • Zero-allocation SIMD operations for high performance
  • Comprehensive test coverage (11,400+ tests passing)

Module-Specific Notes

scirs2-autograd

  • βœ… Fixed in v0.1.5: Optimizer::update() now correctly updates variables
  • βœ… Fixed in v0.1.5: Eliminated warning spam during gradient computation
  • βœ… Fixed in v0.1.3: Adam optimizer scalar/1Γ—1 parameter handling
  • ℹ️ Complex computation graphs may require proper graph context initialization (helper functions provided in test utilities)

scirs2-spatial

  • βœ… New in v0.1.5: Enhanced Delaunay triangulation with modular Bowyer-Watson architecture (2D/3D/ND)
  • βœ… New in v0.1.5: Constrained Delaunay triangulation support
  • βœ… Stable: KD-trees, distance calculations, convex hull, Voronoi diagrams

scirs2-optimize / scirs2-stats / scirs2-special

  • 🚧 Active Development: These modules have ongoing compilation fixes and enhancements
  • ℹ️ Some features may be incomplete or in testing phase

Future Enhancements (Roadmap)

Planned for upcoming releases:

  • Enhanced Cholesky decomposition algorithms
  • Advanced spline solvers (Thin Plate Spline)
  • Additional linear algebra decomposition methods
  • Expanded GPU kernel coverage
  • WebAssembly optimization

Performance Tests

  • Benchmark and performance tests are excluded from regular CI runs (404 tests marked as ignored) to optimize build times. Run with cargo test -- --ignored to execute full test suite including benchmarks.

Hardware-Dependent Features

  • GPU acceleration features require compatible hardware and drivers
  • Tests automatically fall back to CPU implementations when GPU is unavailable
  • Specialized hardware support (FPGA, ASIC) uses mock implementations when hardware is not present

Test Coverage

  • Total tests: 11,400+ across all modules
  • Regular CI tests: All passing βœ…
  • Performance tests: Included in full test suite (run with --all-features)

For the most up-to-date information on limitations and ongoing development, please check our GitHub Issues.

Contributing

Contributions are welcome! Please see our CONTRIBUTING.md for guidelines.

Areas Where We Need Help

  • Core Algorithm Implementation: Implementing remaining algorithms from SciPy
  • Performance Optimization: Improving performance of existing implementations
  • Documentation: Writing examples, tutorials, and API documentation
  • Testing: Expanding test coverage and creating property-based tests
  • Integration with Other Ecosystems: Python bindings, WebAssembly support
  • Domain-Specific Extensions: Financial algorithms, geospatial tools, etc.

See our TODO.md for specific tasks and project roadmap.

License

Licensed under the Apache License Version 2.0.

Acknowledgments

SciRS2 builds on the shoulders of giants:

  • The SciPy and NumPy communities for their pioneering work
  • The Rust ecosystem and its contributors
  • The numerous mathematical and scientific libraries that inspired this project

🌐 Cool Japan Ecosystem

SciRS2 is part of the Cool Japan Ecosystem - a comprehensive collection of production-grade Rust libraries for scientific computing, machine learning, and data science. All ecosystem projects follow the SciRS2 POLICY for consistent architecture, leveraging scirs2-core abstractions for optimal performance and maintainability.

πŸ“Š Scientific Computing & Data Processing

NumPy-compatible N-dimensional arrays in pure Rust

  • Pure Rust implementation of NumPy with 95%+ API coverage
  • Zero-copy views, advanced broadcasting, and memory-efficient operations
  • SIMD vectorization achieving 2-10x performance over Python NumPy

Pandas-compatible DataFrames for high-performance data manipulation

  • Full Pandas API compatibility with Rust's safety guarantees
  • Advanced indexing, groupby operations, and time series functionality
  • 10-50x faster than Python pandas for large datasets

Quantum computing library in pure Rust

  • Quantum circuit simulation and execution
  • Quantum algorithm implementations
  • Integration with quantum hardware backends

πŸ€– Machine Learning & Deep Learning

Advanced ML optimization algorithms extending SciRS2

  • GPU-accelerated training (CUDA, ROCm, Metal) with 100x+ speedups
  • 30+ optimizers: Adam, RAdam, Lookahead, LAMB, learned optimizers
  • Neural Architecture Search (NAS), pruning, and quantization
  • Distributed training with data/model parallelism and TPU coordination

PyTorch-compatible deep learning framework in pure Rust

  • 100% SciRS2 integration across all 18 crates
  • Dynamic computation graphs with eager execution
  • Graph neural networks, transformers, time series, and computer vision
  • Distributed training and ONNX export for production deployment

TensorFlow-compatible ML framework with dual execution modes

  • Eager execution (PyTorch-style) and static graphs (TensorFlow-style)
  • Cross-platform GPU acceleration via WGPU (Metal, Vulkan, DirectX)
  • Built on NumRS2 and SciRS2 for numerical computing foundation
  • Python bindings via PyO3 and ONNX support for model exchange

scikit-learn compatible machine learning library

  • 3-100x performance improvements over Python implementations
  • Classification, regression, clustering, preprocessing, and model selection
  • GPU acceleration, ONNX export, and AutoML capabilities

Hugging Face Transformers in pure Rust for production deployment

  • BERT, GPT-2/3/4, T5, BART, RoBERTa, DistilBERT, and more
  • Full training infrastructure with mixed precision and gradient accumulation
  • Optimized inference (1.5-3x faster than PyTorch) with quantization support

πŸŽ™οΈ Speech & Audio Processing

Pure-Rust neural speech synthesis (Text-to-Speech)

  • State-of-the-art quality with VITS and DiffWave models (MOS 4.4+)
  • Real-time performance: ≀0.3Γ— RTF on CPUs, ≀0.05Γ— RTF on GPUs
  • Multi-platform support (x86_64, aarch64, WASM) with streaming synthesis
  • SSML support and 20+ languages with pluggable G2P backends

πŸ•ΈοΈ Semantic Web & Knowledge Graphs

Semantic Web platform with SPARQL 1.2, GraphQL, and AI reasoning

  • Rust-first alternative to Apache Jena + Fuseki with memory safety
  • Advanced SPARQL 1.2 features: property paths, aggregation, federation
  • GraphQL API with real-time subscriptions and schema stitching
  • AI-augmented reasoning: embedding-based semantic search, LLM integration
  • Vision transformers for image understanding and vector database integration

πŸ”— Ecosystem Integration

All Cool Japan Ecosystem projects share:

  • Unified Architecture: SciRS2 POLICY compliance for consistent APIs
  • Performance First: SIMD optimization, GPU acceleration, zero-cost abstractions
  • Production Ready: Memory safety, comprehensive testing, battle-tested in production
  • Cross-Platform: Linux, macOS, Windows, WebAssembly, mobile, and edge devices
  • Python Interop: PyO3 bindings for seamless Python integration
  • Enterprise Support: Professional documentation, active maintenance, community support

Getting Started: Each project includes comprehensive documentation, examples, and migration guides. Visit individual project repositories for detailed installation instructions and tutorials.

Future Directions

SciRS2 continues to evolve with ambitious goals:

Near-Term (v0.1.5 - v0.2.0)

  • SIMD Phase 60-69 Completion: Advanced mathematical operations, interpolation kernels, geometric operations
  • Spatial Algorithms: Enhanced Delaunay triangulation, constrained triangulation, robust geometric predicates
  • FFT Enhancements: Advanced coordinator patterns, improved multi-dimensional support
  • Python Ecosystem: Enhanced PyPI distribution, improved NumPy compatibility
  • Documentation: Expanded tutorials, cookbook-style examples, migration guides

Medium-Term (v0.2.x - v0.3.0)

  • Extended Hardware Support: ARM NEON optimization, RISC-V support, embedded systems
  • Cloud Native: Container optimization, serverless function support, distributed computing
  • Domain Extensions: Quantitative finance, bioinformatics, computational physics
  • Ecosystem Integration: Enhanced Python/Julia interoperability, R bindings
  • WebAssembly: Optimized WASM builds for browser-based scientific computing

Long-Term Vision

  • Automated Optimization: Hardware-aware algorithm selection, auto-tuning frameworks
  • Advanced Accelerators: TPU support, custom ASIC integration
  • Enterprise Features: High-availability clusters, fault tolerance, monitoring dashboards
  • Educational Platform: Interactive notebooks, online learning resources, certification programs

For detailed development status and contribution opportunities, see TODO.md.

Community and Support

Get Involved

We welcome contributions from the community! Whether you're:

  • πŸ› Reporting bugs or suggesting features
  • πŸ“ Improving documentation or writing tutorials
  • πŸ”¬ Implementing new algorithms or optimizations
  • πŸŽ“ Using SciRS2 in research or education
  • πŸ’Ό Deploying SciRS2 in production environments

Your participation helps make SciRS2 better for everyone.

Resources

Citation

If you use SciRS2 in your research, please cite:

@software{scirs2_2026,
  title = {SciRS2: Scientific Computing and AI in Pure Rust},
  author = {{COOLJAPAN OU (Team KitaSan)}},
  year = {2026},
  url = {https://github.com/cool-japan/scirs},
  version = {0.1.5}
}

Acknowledgments

SciRS2 builds on the shoulders of giants:

  • NumPy & SciPy: Pioneering scientific computing in Python
  • Rust Community: Creating a safe, fast, and productive language
  • ndarray: High-quality array computing foundation
  • OxiBLAS & OxiFFT: Pure Rust performance libraries (COOLJAPAN ecosystem)
  • Contributors: Everyone who has contributed code, documentation, or feedback

Special thanks to the scientific computing and machine learning communities for their continuous innovation and open collaboration.


Built with ❀️ by COOLJAPAN OU (Team KitaSan)

Part of the Cool Japan Ecosystem - Production-Grade Rust Libraries for Scientific Computing and AI