tpt-cobalt

Rust

Unified Computational Substrate for differentiable physical & scientific computing: a universal device-agnostic tensor, reverse-mode autograd, an ML API, a SafeTensors weight hub, a multi-tier runtime, and differentiable science (ODE/FEA/PINN) crates.

0 stars0 forks0 watchers

Languages

Rust92.1%Python3.1%SystemVerilog1.6%MLIR0.7%C0.7%C++0.6%HTML0.3%JavaScript0.3%PowerShell0.1%Tcl0.1%Assembly0.1%Makefile0.0%Shell0.0%TypeScript0.0%Stata0.0%Cuda0.0%CMake0.0%
README

TPT Cobalt

Unified computational substrate built on the TPT Solutions ecosystem.

Cobalt integrates mathematical primitives, ML training, scientific simulation, formal verification, and a hardware-agnostic compiler into one workspace. The stack shares one tensor type, one autograd tape, and one execution runtime.

What it is

A Rust monorepo that unifies nine forked pillar repos with five new glue crates into a single computational substrate.

Status

Phase 0–5 are substantially complete.

  • CPU tensor ops + reverse-mode autograd end to end
  • tpt-ml: Linear, Conv2d, MultiHeadAttention, TransformerBlock, optimizers, loss functions, DataLoader, LayerNorm, BatchNorm, Embedding, activations
  • tpt-sci: differentiable RK4/Euler ODE, dense-LU FEA adjoint, PINN residual, DEM soft-contact, reaction-network backprop, Hertz contact VJP, LIF SNN surrogate gradient
  • tpt-runtime: CPU dispatch, WGPU backend, CUDA backend, 3-tier allocator, buffer pool, DualStreams, tpt-hub::shared zero-copy shared memory, SafeTensors / TPTB / Arrow IPC / JSON serialization, ONNX ingestion, GGUF quantized loader
  • tpt-lang: eager interpreter, REPL, notebook kernel (in-process), debugger (run_debug), Chrome Trace profiler, type checker with dimension algebra + compile-time unit errors + tensor shape inference, module/function/parameter object model, gradual typing
  • tpt-lsp: tensor-aware diagnostics, hover, completions
  • tpt-fusion: HLS-C++ tiled GEMM artifact emission, memory-fit proof
  • tpt-alloy-deploy: RP2040 UF2 + ESP32 ROM-UART OTA fleet rollout
  • tpt-bench: criterion micro-benchmarks + Markdown/JSON wall-clock reports

cargo build --workspace is green. cargo test --workspace is green.

Layout

tpt-cobalt/
├── Cargo.toml             # Workspace manifest
├── forked/                # Cobalt's optimized copies of the 9 pillar repos
│   ├── tpt-math/
│   ├── tpt-gpu/
│   ├── tpt-crucible/
│   ├── tpt-fem/
│   ├── tpt-physics/
│   ├── tpt-engineering/
│   ├── tpt-science/
│   ├── tpt-formal/
│   └── tpt-telos/
├── crates/                # The 5 glue crates + language/tooling
│   ├── tpt-tensor/        # Universal tensor
│   ├── tpt-autograd/      # Reverse-mode tape + custom VJPs
│   ├── tpt-ml/            # ML API (nn, optim, loss, data)
│   ├── tpt-hub/           # Model loading, serialization, IPC
│   ├── tpt-runtime/       # CPU / WGPU / CUDA dispatch
│   ├── tpt-lang/          # TPT Script runtime + REPL + notebook + debugger
│   ├── tpt-lsp/           # Language server
│   ├── tpt-fusion/        # FPGA artifact emission + memory-fit proof
│   └── ...
├── docs/
└── tests/

Building

# Default (CPU + WGPU, no CUDA)
cargo build --workspace

# With CUDA backend
cargo build --workspace --features cuda

Documentation

  • Design document: spec.txt
  • Roadmap & status: todo.md
  • TPT Script tutorial: docs/tpt-script-tutorial.md
  • PyTorch benchmark protocol: crates/tpt-bench/PYTORCH_PROTOCOL.md
  • Exotic backends scoping: docs/phase5-exotic-backends.md
  • TPT Script cookbook: docs/tpt-script-cookbook.md

License

MIT OR Apache-2.0 — see individual crate manifests.