SonicBoom is a native tensor runtime — a generic interpreter (v0) that executes neural-network graphs through native C++ backends, with a first-class Guile binding.
Four layers with strictly downward dependencies:
Layer 3 C ABI / Guile / other bindings
Layer 2 SonicBoom stable runtime interface (nt::)
Layer 1 native-torch implementation + adapter
Layer 0 CPU / CUDA
libsonicboom.so is the published core library (built SHARED); native-torch and
MLIR are statically linked into it (position-independent code). The stable
binary-compatibility boundary is the C ABI (capi/); the C++ Layer 2 interface
is source-level only.
The (sonicboom …) modules provide a minimal PyTorch/Keras-like model API:
- Define / compose —
(sonicboom nn):linear,relu,sequential. - Train —
(sonicboom model):make-model+model-train!drive native-torch reverse-mode autograd (linear/relu/mse/SGD) through the C ABI; parameters live as native tensors, not Scheme copies. - Export —
model-export!writes a self-containedmodel.sx+weights.binartifact viasb_export_model. - Independent inference — standalone C++
sonicboom::Model::loadruns the S-Expr → MLIR path with no Guile or Python.
Training (native-torch autograd) and deployment (S-Expr → MLIR) are two engines
that agree on structure, parameter naming, shapes, and math semantics. See
design/guile-ai-framework-progress.md for the step-by-step record.
C++23 with g++-13. MLIR/LLVM are pinned and installed to build/llvm-mlir-install
via tools/mlir/build-mlir.sh.
cmake -S . -B build
cmake --build buildctest --test-dir build --output-on-failureruns the full suite — 40 tests (36 C++ suites + 4 Guile suites) — in one pass.