Skip to main content

Crate repartir

Crate repartir 

Source
Expand description

§Repartir: Sovereign AI-Grade Distributed Computing

Repartir is a pure Rust library for distributed execution across CPUs, GPUs, and remote machines. Built on the Iron Lotus Framework and validated by the certeza testing methodology.

§Features

  • 100% Rust, Zero C/C++: True digital sovereignty through complete auditability
  • Memory Safety Guaranteed: Provably safe via RustBelt formal verification
  • Work-Stealing Scheduler: Based on Blumofe & Leiserson (1999)
  • Supply Chain Security: Dependency pinning, binary signing, license enforcement
  • Iron Lotus Quality: ≥95% coverage, ≥80% mutation score, formal verification

§Quick Start

use repartir::{Pool, task::{Task, Backend}};

#[tokio::main]
async fn main() -> repartir::error::Result<()> {
    // Create a pool with CPU executor
    let pool = Pool::builder()
        .cpu_workers(8)
        .build()?; // Note: build() is sync, not async

    // Submit a task
    let task = Task::builder()
        .binary("./worker")
        .arg("--input")
        .arg("data.csv")
        .backend(Backend::Cpu)
        .build()?;

    let result = pool.submit(task).await?;

    if result.is_success() {
        println!("Task completed: {}", result.stdout_str()?);
    }

    Ok(())
}

§Architecture

Repartir follows a clean, layered architecture:

  • Task: Unit of work (binary + args + env)
  • Executor: Runs tasks on a specific backend (CPU, GPU, Remote)
  • Scheduler: Distributes tasks across executors (work-stealing)
  • Pool: High-level API for task submission and result retrieval

§Toyota Way Principles

Repartir embodies the Iron Lotus Framework:

  • Genchi Genbutsu (現地現物): Transparent execution, traceable to source
  • Jidoka (自働化): Automated quality gates (CI enforces ≥95% coverage)
  • Kaizen (改善): Continuous improvement (TDG ratchet, mutation testing)
  • Muda (無駄): Waste elimination (zero-copy, single language, no FFI)

§Certeza Testing

Three-tiered testing for asymptotic effectiveness:

  • Tier 1 (ON-SAVE): Sub-second feedback (<3s)
  • Tier 2 (ON-COMMIT): Comprehensive (1-5min, 95% coverage)
  • Tier 3 (ON-MERGE): Exhaustive (hours, 80% mutation score)

Modules§

checkpoint
Checkpoint management for persistent task state.
error
Error types for repartir.
executor
Execution backends for repartir.
messaging
Advanced messaging patterns for distributed coordination.
scheduler
Task scheduling and work distribution.
task
Task definition and execution results.

Structs§

Pool
High-level API for distributed task execution.
PoolBuilder
Builder for Pool.