Loom Documentation

M-POLY-VTD Engine Docs

Complete reference for Loom's poly package — the Multi-numerical POLYmorphic Volumetric Tiled-tensor Dispatcher that powers every Loom integration.

Where to start?

New? Read Overview → Layers → Training. Deploying to web or mobile? Go to Deployment. Need a snippet? Quick Reference has everything copy-paste ready.

M-POLY-VTD: Architecture Overview
Multi-numerical POLYmorphic Volumetric Tiled-tensor Dispatcher
Read docs
Deployment: TypeScript, WASM, and NPM
Loom is designed to be **isomorphic**, meaning the exact same mathematical engine runs in both Node.js (backend) and the Browser (frontend) via a bit-perfect WebAssembly (WASM) bridge.
Read docs
Donate compute (TCP)
The **`donate_compute_*.go`** files in `poly/` implement an optional **TCP protocol** so a **donor** machine can accept inference-style work from clients on the same network (or loopback). Work is exchanged as **lengt...
Read docs
TANHI — UDP layer telemetry
TANHI** streams **sparse, non-blocking JSON-line events** over **UDP** so external tools (notably the **SoulGlitch → TANHI** HUD) can visualize **per-layer forward/backward** activity, timing, dtypes, and **routing ...
Read docs
Numerical Types, DType System, and WeightStore
This document covers all 21 `DType` values, the `Numeric` generic constraint, the `WeightStore` master/versioned architecture, and the Metamorphosis mechanism that lets a layer switch precision on the fly.
Read docs
Layer Reference
This document describes every `LayerType` in `poly/`. For each layer: what it computes, which fields of `VolumetricLayer` configure it, weight layout in the `WeightStore`, and an ASCII data-flow diagram.
Read docs
The Dispatcher Pattern and 3D Coordinate System
This document explains how `DispatchLayer` and `DispatchLayerBackward` work as runtime jump tables, how the 3D coordinate system maps to `VolumetricLayer` positions, and how `IsRemoteLink` enables spatial hopping acro...
Read docs
Training: Forward Pass, Backward Pass, Optimizers, and Learning
This document covers the full training pipeline: the forward and backward pass mechanics, loss computation, weight update strategies, gradient clipping, Tween, and the `VGStepBP` adaptive rate.
Read docs
GPU Backend: WebGPU (WGPU)
This document covers the WebGPU backend: initialization, the `BeginFrame`/`FlushFrame` command batching pattern, the buffer pool and pipeline cache, which layers have GPU support, and the tiling strategy.
Read docs
The step mesh engine
This document covers the `StepState`, `StepForward`, `StepBackward`, and `StepApplyTween` functions that implement a clock-cycle-accurate discrete-time neural mesh.
Read docs
The DNA Engine: Topological Network Fingerprinting
This document covers `ExtractDNA`, `CosineSimilarity`, `CompareNetworks`, `LogicShift` detection, and the recursive signature extraction for all 19 layer types in `dna.go`.
Read docs
The Evolution Engine: DNA Splice & NEAT Topology Evolution
This document covers `SpliceDNA`, `SpliceDNAWithReport`, `NEATMutate`, and `NEATPopulation` from `evolution.go`. The evolution engine builds on the DNA fingerprinting system described in dna.md.
Read docs
Softmax Variants
LayerSoftmax` (type 15) implements ten distinct softmax variants, controlled by the `SoftmaxType` field on `VolumetricLayer`. All variants are fully differentiable and work across all 21 DTypes.
Read docs
Serialization, Persistence, and Loading
This document covers how `VolumetricNetwork` instances are saved and loaded, the bit-packed persistence format for low-bit types, the idempotency guarantee, and SafeTensors support.
Read docs
Parallel and Sequential Layers
This document explains `LayerParallel` and `LayerSequential` in depth: how they fan out and chain sub-layers, the five combination modes, the recursive activation tree, and how backpropagation flows through nested str...
Read docs
Quantization: DType Conversion and PTQ Pipeline
This document covers the Post-Training Quantization (PTQ) pipeline in `poly/`: how weights move from FP32 masters into lower-precision formats, the `WeightStore` versioning system, the `Q4_0Block` block-quantization f...
Read docs
Transformer Architecture: MHA, RoPE, GQA, and Full Block Assembly
This document covers `LayerMultiHeadAttention` (MHA), how RoPE positional encoding is applied, Grouped-Query Attention (GQA) and Multi-Query Attention (MQA), the KV cache, SwiGLU and RMSNorm layers, full transformer b...
Read docs
Quick Reference: Common Code Snippets
Concise, copy-paste-ready patterns for the most common `poly/` tasks. Each snippet assumes `import poly "github.com/openfluke/soul/loom/poly"` (adjust to your module path).
Read docs
Testing, validation, and Lucy logs
This page ties together **how we stress `poly/`**, where **artifacts land**, and how to read **parity tables** in captured logs (for example `lucy/lucy_testing_output/log.txt`).
Read docs
BitNet CPU Ternary Path
poly` has an explicit CPU path for BitNet b1.58-style ternary weights.
Read docs