tpt-runtime

Rust

Unified workload runtime for Windows and heterogeneous compute — a common substrate for native, Linux, OCI, WASM, and AI workloads with capability-based security. Not a WSL clone.

0 stars0 forks0 watchersApache License 2.0

Languages

Rust100.0%
README

TPT Runtime

A unified workload runtime for Windows and heterogeneous compute, providing a coherent execution, storage, networking, security, device, and observability environment for Windows, Linux, OCI, WASM, and TPT-native workloads.

tpt-runtime is not a WSL clone. Its goal is to provide a common workload substrate beneath Windows and Linux execution rather than making one pretend to be the other — so that native processes, containers, WASM modules, and AI workloads can be managed with the same lifecycle, resource, and capability model.

See SPEC.md for the full design specification, docs/ARCHITECTURE.md for the implemented architecture, and todo.md for the project checklist.

Status

MVP implemented (SPEC §43): Windows host daemon, tpt.runtime/v1 manifests, workload lifecycle, native Windows-process backend (Job Objects), WASM backend (wasmtime + WASI), logical volumes/networks, capability model, resource accounting, local named-pipe API, tpt CLI, structured events and observability. OCI support is complete end to end: image pull, layer unpacking, and a Windows isolation provider (tpt-runtime-sandbox) that runs bundles under job objects and restricted tokens. Linux runs through WSL.

The OCI provider runs Windows-based images and refuses Linux (ELF) ones, since Windows cannot execute them; see the sandbox README. Starting OCI workloads requires an elevated daemon.

Requires a Rust toolchain (stable, MSVC) to build. Windows is the primary host.

Quick start

cargo build --release -p tpt-runtime-cli -p tpt-runtime-daemon

tpt daemon start            # background daemon (named pipe \\.\pipe\tpt-runtime-api)
tpt status                  # daemon status

tpt run --windows cmd.exe -- /C echo hello
tpt run --manifest examples/windows-echo.toml
tpt run --wasm examples/hello.wasm
tpt list
tpt inspect <workload-id>
tpt logs <workload-id>
tpt stop <workload-id>
tpt events --limit 30

tpt volume create project
tpt devices                 # GPUs discovered via nvidia-smi
tpt daemon stop

Project environments (SPEC §34): one tpt.toml describes a whole project's workloads and their dependencies; tpt up starts them in dependency order, tpt down stops them in reverse.

tpt init --template services    # scaffold tpt.toml (minimal, services, wasm)
tpt up                          # start every workload, dependencies first
tpt up --only api               # start one workload plus its dependencies
tpt down                        # stop and destroy the project's workloads

Every CLI command is a client of the daemon's local API; the wire protocol (newline-delimited JSON over a named pipe) is documented in docs/ARCHITECTURE.md.

Examples

Runnable manifests live in examples/, each annotated with what it demonstrates:

FileShows
windows-echo.tomlthe smallest useful manifest: one process, no network
windows-service.tomlservice mode, a fixed port, a volume, limits, labels
windows-limited.tomlover-requests that policy denies or clamps
windows-gpu.tomla device request plus the matching capability
windows-secret.tomla secret held behind a capability, not an env var
wasm-hello.tomla WASM module bounded by fuel and a timeout

Every example manifest is covered by a test in tpt-runtime-config, so the shipped examples cannot drift out of validity.

Crates

22 crates, layered so the workload model never depends on a backend. Each crate has its own README with runnable examples, and its own changelog.

Foundations

CrateResponsibility
coreidentifiers, lifecycle state machine, RuntimeError, RuntimeEvent, ResourceUsage
modelWorkloadSpec, execution payloads, memory/network/device/volume models
configtpt.runtime/v1 TOML manifests, daemon settings

Policy and access

CrateResponsibility
capabilitytyped capability grants, revocation, checks
policyadmission: hard/soft limits, GPU presence checks
securitycapability-gated secret store

Backends

CrateResponsibility
processthe ExecutionBackend / WorkloadInstance traits, log capture
windowsJob Object isolation, kill-tree, env allowlist, job accounting
wasmwasmtime + WASI p1, fuel/epoch limits, preopened volumes
ociimage references, bundle model, content store, isolation seam
sandboxWindows OCI isolation: job objects, restricted tokens
linuxWSL-backed execution, layered strategy phase 1

Resources and observability

CrateResponsibility
storagelogical volumes over host directories
networknetwork intents and port allocation
devicelogical device registry, claims
gpuNVIDIA discovery via nvidia-smi
observeevent hub (broadcast + JSONL), metrics registry

Interfaces

CrateResponsibility
ipcrequest/response envelope, NDJSON framing
apinamed-pipe server, CLI client
workloadlifecycle orchestration across backends
daemonassembles the stack, serves until shutdown
clithe tpt binary; a pure API client

Development

cargo build --workspace
cargo test --workspace
cargo test -p tpt-runtime-config   # also validates every example manifest

Related projects

  • tpt-archon — low-level substrate (storage, IPC, resources)
  • tpt-boxcar — workload isolation, packaging, networking, sandboxing
  • tpt-infer — inference
  • tpt-dsp — signal processing
  • tpt-orchestra — multi-agent / repository orchestration

License

Licensed under either of

at your option.

Copyright © 2026 TPT Solutions.