Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

RustKernels

GPU-accelerated kernel library for financial services, compliance, and enterprise analytics

Version 0.4.0 | RingKernel 0.4.2 | 106 kernels | 14 domains | 19 crates


Overview

RustKernels provides 106 GPU-accelerated algorithms across 14 domain-specific crates, engineered for financial services, regulatory compliance, and enterprise analytics workloads. Built on RingKernel 0.4.2, it delivers both CPU-orchestrated batch execution and GPU-persistent ring execution with sub-microsecond message latency.

RustKernels is a specialized compute library for financial and enterprise workloads. It is not a general-purpose GPU compute framework.

Key Features

FeatureDescription
14 Domain CategoriesGraph analytics, ML, compliance, risk, treasury, and more
106 KernelsComprehensive coverage of financial and analytical algorithms
Dual Execution ModesBatch (CPU-orchestrated) and Ring (GPU-persistent actor)
Type-Erased ExecutionTypeErasedBatchKernel enables REST/gRPC dispatch without compile-time types
Factory Registrationregister_batch_typed() with automatic type inference
Enterprise SecurityJWT/API key auth, RBAC, multi-tenancy, secrets management
Production ObservabilityPrometheus metrics, OTLP tracing, structured logging, SLO alerting
Resilience PatternsCircuit breakers, retry with backoff, deadline propagation, health probes
Service DeploymentREST (Axum), gRPC (Tonic), Tower middleware, Actix actors
K2K MessagingCross-kernel coordination: iterative, scatter-gather, fan-out, pipeline
Fixed-Point ArithmeticGPU-compatible exact financial calculations
RingKernel 0.4.2Deep integration with GPU-native persistent actor runtime

Execution Model

Kernels operate in one of two modes, selected based on latency and throughput requirements:

ModeLatencyOverheadState LocationBest For
Batch10–50 μsHigher (CPU round-trip)CPU memoryHeavy periodic computation
Ring100–500 nsMinimal (lock-free)GPU memoryHigh-frequency streaming

Batch kernels implementing BatchKernel<I, O> can be executed directly via typed calls or through the type-erased BatchKernelDyn interface used by REST and gRPC endpoints. Ring kernels require the RingKernel persistent actor runtime.

Domains at a Glance

DomainCrateKernelsDescription
Graph Analyticsrustkernel-graph28PageRank, community detection, GNN inference, graph attention
Statistical MLrustkernel-ml17Clustering, NLP embeddings, federated learning, healthcare
Compliancerustkernel-compliance11AML patterns, KYC scoring, sanctions screening
Temporal Analysisrustkernel-temporal7ARIMA, Prophet decomposition, change-point detection
Risk Analyticsrustkernel-risk5Credit scoring, Monte Carlo VaR, stress testing, correlation
Bankingrustkernel-banking1Fraud pattern matching
Behavioral Analyticsrustkernel-behavioral6Profiling, forensics, event correlation
Order Matchingrustkernel-orderbook1Order book matching engine
Process Intelligencerustkernel-procint7DFG, conformance, digital twin simulation
Clearingrustkernel-clearing5Netting, settlement, DVP matching
Treasuryrustkernel-treasury5Cash flow, FX hedging, liquidity optimization
Accountingrustkernel-accounting9Network generation, reconciliation
Paymentsrustkernel-payments2Payment processing, flow analysis
Auditrustkernel-audit2Feature extraction, hypergraph construction

Quick Start

Add to your Cargo.toml:

[dependencies]
rustkernels = "0.4.0"

Basic usage:

use rustkernels::prelude::*;
use rustkernels::graph::centrality::{BetweennessCentrality, BetweennessCentralityInput};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let kernel = BetweennessCentrality::new();
    println!("Kernel: {}", kernel.metadata().id);

    let input = BetweennessCentralityInput {
        num_nodes: 4,
        edges: vec![(0, 1), (1, 2), (2, 3), (0, 3)],
        normalized: true,
    };

    let result = kernel.execute(input).await?;
    for (node, score) in result.scores.iter().enumerate() {
        println!("  Node {}: {:.4}", node, score);
    }
    Ok(())
}

Feature Flags

# Default domains (graph, ml, compliance, temporal, risk)
rustkernels = "0.4.0"

# Selective compilation
rustkernels = { version = "0.4.0", features = ["graph", "accounting"] }

# All 14 domains
rustkernels = { version = "0.4.0", features = ["full"] }

# Service deployment
rustkernel-ecosystem = { version = "0.4.0", features = ["axum", "grpc"] }

Enterprise Features

Version 0.4.0 provides production-ready enterprise capabilities with deep RingKernel 0.4.2 integration:

ModuleFeatures
SecurityJWT/API key auth, RBAC, multi-tenancy, secrets management
ObservabilityPrometheus metrics, OTLP tracing, structured logging, SLO alerting
ResilienceCircuit breakers, retry with backoff, deadline propagation, health probes
RuntimeLifecycle state machine, graceful shutdown, configuration presets
MemorySize-stratified pooling, pressure handling, multi-phase reductions
EcosystemAxum REST with real execution, Tower middleware, Tonic gRPC, Actix actors

See Enterprise Features for detailed documentation.

Requirements

  • Rust 1.85 or later
  • RingKernel 0.4.2 (from crates.io)
  • CUDA toolkit (optional; falls back to CPU execution)

Project Structure

crates/
├── rustkernels/             # Facade crate — re-exports all domains
├── rustkernel-core/         # Core traits, registry, enterprise modules
│   ├── security/            # Auth, RBAC, multi-tenancy
│   ├── observability/       # Metrics, tracing, logging
│   ├── resilience/          # Circuit breaker, retry, health
│   ├── runtime/             # Lifecycle, configuration
│   ├── memory/              # Pooling, reductions
│   └── config/              # Production configuration
├── rustkernel-ecosystem/    # Service integrations (Axum, gRPC, Actix)
├── rustkernel-derive/       # Procedural macros
├── rustkernel-cli/          # Command-line interface
└── rustkernel-{domain}/     # 14 domain-specific crates

Building

# Build entire workspace
cargo build --workspace

# Run all tests (895 tests)
cargo test --workspace

# Test a single domain
cargo test --package rustkernel-graph

# Lint with warnings as errors
cargo clippy --all-targets --all-features -- -D warnings

# Generate API documentation
cargo doc --workspace --no-deps --open

License

Licensed under Apache-2.0. See LICENSE for details.