#actor #gpu #cpu

ringkernel-cpu

CPU backend for RingKernel - testing and fallback implementation

11 unstable releases (3 breaking)

0.4.2 Feb 6, 2026
0.4.1 Feb 6, 2026
0.4.0 Jan 25, 2026
0.3.2 Jan 21, 2026
0.1.3 Dec 17, 2025

#771 in Concurrency

Download history 7/week @ 2025-11-29 15/week @ 2025-12-06 4/week @ 2025-12-13 7/week @ 2026-01-10 5/week @ 2026-01-17 7/week @ 2026-01-31 48/week @ 2026-02-07 4/week @ 2026-02-14 14/week @ 2026-02-21

73 downloads per month
Used in 8 crates (3 directly)

Apache-2.0

1.5MB
33K SLoC

ringkernel-cpu

CPU backend implementation for RingKernel.

Overview

This crate provides a CPU-based implementation of the RingKernelRuntime trait. It serves two purposes:

  1. Development and Testing: Test kernel logic without GPU hardware
  2. Fallback: Run on systems without GPU support

The CPU backend implements the full RingKernel API including kernel lifecycle, message queues, HLC timestamps, and K2K messaging.

Usage

use ringkernel_cpu::CpuRuntime;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let runtime = CpuRuntime::new().await?;

    let kernel = runtime.launch("worker", LaunchOptions::default()).await?;

    // Process messages...

    kernel.terminate().await?;
    runtime.shutdown().await?;
    Ok(())
}

Features

  • Full RingKernelRuntime implementation
  • Lock-free message queues using crossbeam
  • HLC timestamp generation
  • K2K messaging support
  • Kernel lifecycle management (Created, Active, Paused, Terminated)

Performance

The CPU backend is optimized for correctness over performance. For production workloads requiring high throughput, use the CUDA or WebGPU backends.

Typical performance characteristics:

  • Message throughput: ~10M messages/sec
  • Latency: <1ms per message batch

Testing

cargo test -p ringkernel-cpu

When to Use

  • Unit testing kernel logic
  • Development without GPU hardware
  • CI/CD pipelines
  • Systems without GPU support
  • Debugging message flow

License

Apache-2.0

Dependencies

~17MB
~221K SLoC