tpt-rust6

Rust

A purely native, Rust-first scientific computing, math, and AI stack — leapfrogs Python instead of wrapping or replicating it.

0 stars0 forks0 watchersMIT License

Languages

Rust99.8%Python0.2%
README

TPT — The Rust-Native Scientific Stack (tpt-rust6)

Leapfrog, don't replicate. Every crate does something Python fundamentally cannot.

TPT is a purely native, Rust-first scientific computing, mathematics, and AI stack. It refuses to wrap Python and refuses to replicate Python: it exploits Rust's unique superpowers — Wasm, fearless concurrency, zero-cost abstractions, and compile-time codegen — to make Python's architectural flaws obsolete.

The full design lives in spec.txt. This repository tracks the roadmap in TODO.md.

The 12 Crates

#CrateWhat it does that Python cannotPhaseStatus
1tpt-omniOne Arrow-backed memory layout for tables, tensors, N-D arrays, and sparse matrices with zero-copy views1implemented
2tpt-ioA single read() for every format, auto-detected by extension + magic bytes1implemented
3tpt-gradAutograd via procedural macros — gradients emitted at compile time, zero runtime graph2implemented
4tpt-statUnified distributions, hypothesis tests, regression, and Bayesian inference (incl. NUTS), SIMD + Rayon-parallel2implemented
5tpt-symCompile-time computer-algebra: typed symbols, simplification, differentiation, LaTeX, unit-aware arithmetic2partial
6tpt-dagIn-process concurrent pipeline executor: #[task], pipeline![], content-addressed caching, retries3implemented
7tpt-vizGrammar-of-graphics plotting with level-of-detail; GPU/Wasm/3D rendering pending3partial
8tpt-learnHigh-level ML training with compile-time tensor shape verification; sweeps/export pending3implemented
9tpt-uiServerless Wasm dashboards via #[tpt_app], deployable as a single HTML file; cargo tpt-serve pending4partial
10tpt-labReactive, strictly-typed notebook with an automatic dependency DAG4implemented
11tpt-scriptPythonic scripting layer: tpt script file.tpt with zero ceremony5implemented
12tpt-docType-checked documents with compile-time reference/citation verification; EPUB/Wasm/HarfBuzz pending5partial

Status legend: implemented = core API shipped and tested; partial = core shipped but some roadmap features still pending (see TODO.md); scaffolded = skeleton only. tpt-io is the most format-limited of the "implemented" crates: it reads CSV/JSON/Parquet/Arrow-IPC (HDF5 behind --features hdf5) and writes CSV/JSON only — FITS/NetCDF/Zarr/Excel/SQLite readers and PNG/PDF writers are not yet present.

Quickstart

use tpt_io::prelude::*;
use tpt_omni::prelude::*;

let frame = read("data.csv")?;                 // auto-detect, infer schema
let adults = frame.as_table().filter(&col("age").ge(18))?;
let tensor = frame.as_tensor::<f64>("score", &[frame.num_rows()])?;
let normalized = (&tensor - tensor.mean()) / tensor.std();   // auto-broadcasting
let head = Tensor::from_view(slice![normalized, 0..5]);     // NumPy-style slice

Run the example:

cargo run -p example-01-quickstart

Workspace Layout

crates/      # the 12 TPT crates
examples/   # runnable examples (one per milestone)
docs/       # mdBook documentation
benches/    # Criterion benchmarks vs. Python equivalents

Benchmarks vs. Python

The "leapfrog Python" claim is backed by evidence, not assertion. benches/ runs the same numerical kernels on the TPT side (Criterion) and, with TPT_COMPARE_PYTHON=1, against a numpy/pandas baseline (benches/python_baseline/ops.py). See benches/README.md for the methodology and a results table.

cargo bench -p tpt-benches                              # TPT side only
TPT_COMPARE_PYTHON=1 cargo bench -p tpt-benches --bench python_cmp  # + numpy/pandas

Building

cargo build --workspace
cargo test  --workspace

License

Dual-licensed under MIT or Apache-2.0 (see LICENSE).