WebAssembly AI Atlas
From portable bytecode to local intelligence.
Low-Level Atlas explained the machine. AI Atlas explained intelligent systems. This independent crossover studies how to execute those systems portably, locally, with acceleration when available, inside explicit boundaries, and with outputs that can be verified.
Learn each layer by making it observable.
Start with WAT and linear memory, build a tiny inference engine, measure SIMD and workers, move real models through real browser runtimes, then add adaptive acceleration, offline product behavior, portable components, and sandboxed tools.
Prerequisites: Comfort with TypeScript, typed arrays, basic memory layout, and the shape of an inference pipeline. Wasm and accelerator mechanisms are introduced progressively.
WasmAI Workbench · v0 → v8
A local-first browser workbench that progressively loads, executes, compares, verifies, and reports AI models across CPU/Wasm, WebGPU, WebNN, and portable components. Every backend decision remains visible.
WebAssembly visible
- Layer
- WAT · module · linear memory
- Expected output
- A hand-written WAT vector module instantiated from TypeScript, with its binary inspected.
Tiny inference engine
- Layer
- tensor kernels · forward pass
- Expected output
- Dense tensors, matmul, bias, ReLU, softmax, and a verified pretrained MLP.
SIMD and parallelism
- Layer
- SIMD128 · workers · shared memory
- Expected output
- Scalar, SIMD, and parallel kernels compared under one reproducible benchmark.
Real models, real runtimes
- Layer
- ONNX · TFLite · runtime adapters
- Expected output
- The same exported model run through ONNX Runtime Web and LiteRT.js against golden outputs.
Adaptive backend
- Layer
- WebNN → WebGPU → Wasm SIMD → scalar
- Expected output
- Capability detection, explicit selection, visible fallbacks, metrics, and output verification.
Multimodal local-first
- Layer
- image · audio · embeddings · offline
- Expected output
- Local image and speech pipelines that remain useful without a network connection.
Semantic search local
- Layer
- IndexedDB · embeddings · vector search
- Expected output
- Document import, local chunking and embeddings, persistent retrieval, and evidence-first results.
Portable inference component
- Layer
- WIT · Component Model · WASI
- Expected output
- A typed pipeline component executed outside the browser with a WASI runtime.
Sandboxed AI tools
- Layer
- capabilities · fuel · typed tools
- Expected output
- A local agent host invoking deterministic Wasm tools with explicit budgets and no ambient access.
Stable core, conditional acceleration.
Support is detected at runtime and recorded in reports. Experimental or browser-dependent paths never masquerade as universal.
WebAssembly Core · JS API
Validated modules, linear memory, SIMD and threads where the host enables the required isolation.
WebGPU · Wasm threads
Feature-detected acceleration with device limits, browser policy and transfer costs recorded.
WebNN · WASI-NN
Promising graph and host-inference paths whose availability and semantics still require explicit checks.
Wasm SIMD → scalar
Every adaptive path names the selected backend and verifies output before claiming success.
Different layers, different jobs.
WebAssembly, WebGPU, and WebNN are complementary mechanisms, not interchangeable runtimes.
Orientation
Prerequisites, platform distinctions, capability limits, tool expectations, and linear versus project-led reading paths.
Start Here
Prerequisites, platform boundaries, reading routes, and the practical throughline for beginning WebAssembly AI Atlas.
Open branchMust Know
The minimum distinctions and evidence rules needed to reason correctly about portable, local, accelerated, and sandboxed AI.
Open branchWasm AI Index
Root map for the WebAssembly AI Atlas, connecting portable bytecode, browser inference, acceleration, local-first AI, WASI components, and verifiable delivery.
Open branchWebAssembly Foundations
Understand modules and bytecode, compare language toolchains, and make the linear-memory boundary between guest and host explicit.
WebAssembly Execution Model
WAT, binary modules, validation, stack execution, imports, exports, tables, references, linear memory, traps, instantiation, and the sandbox contract.
Toolchains & Language Targets
How WAT, C/C++ and Rust reach Wasm; glue code, source maps, debugging, Binaryen optimization, browser targets, and WASI targets.
Linear Memory, ABI & Host Interop
Pointers, offsets, typed arrays, ownership, allocation, growth, strings and structs, tensor transfer, the Canonical ABI, and the limits of zero-copy.
Inference from First Principles
Implement tensor mechanics below a runtime, then measure what SIMD, threads, workers, and memory sharing actually change.
Tensor Kernels & Inference from Scratch
Shapes, strides, layouts, matmul, convolution, activations, normalization, weights, forward passes, and numerical tolerances below a runtime.
SIMD, Threads & Workers
SIMD128, autovectorization, shared memory, atomics, worker pools, cross-origin isolation, false sharing, and measurable parallel speedups.
From Models to Browser Inference
Export models, understand formats and quantization, compare real runtimes, and validate the preprocessing and postprocessing around them.
Model Formats, Conversion & Quantization
Compute graphs, ONNX, TFLite/LiteRT, safetensors, GGUF boundaries, export, operator coverage, graph optimization, quantization, and drift.
Browser Inference Runtimes
Critical comparison of ONNX Runtime Web, LiteRT.js, Transformers.js, MediaPipe and TensorFlow.js across lifecycle, backends, coverage, memory and fallbacks.
Pre/Postprocessing & Media Pipelines
The image, audio and text transformations demos hide: decode, resize, normalize, tokenize, spectrograms, masks, NMS, logits, thresholds and determinism.
Hardware Acceleration
Treat WebGPU and WebNN as distinct acceleration paths with capability detection, transfer costs, explicit fallbacks, and verified outputs.
WebGPU for AI
Adapters, devices, buffers, bind groups, WGSL compute, dispatch, workgroups, synchronization, tensor residency, profiling and transfer costs.
WebNN & Adaptive Backends
Graph building, MLTensor, CPU/GPU/NPU selection, feature detection, buffer sharing, compatibility, explicit fallback, and auditable backend policy.
Local-First AI
Design model delivery, persistence, offline behavior, multimodal pipelines, embeddings, and retrieval around real device constraints.
Local-First Offline Multimodal AI
Service workers, model caches, IndexedDB, resumable downloads, warm-up, memory pressure, cancellation, privacy and lifecycle for offline multimodal inference.
Browser LLMs, Embeddings & RAG
Small models, tokenization, prefill/decode, KV cache, streaming, embeddings, vector search, local chunking, evidence-first retrieval and optional generation.
Beyond the Browser
Use WIT, the Component Model, WASI, and capability-oriented hosts to move portable inference and deterministic tools beyond one browser.
WASI, Components & WASI-NN
Core modules versus components, WIT, Canonical ABI, composition, resources, async streams/futures, capabilities, WASI runtimes and host-provided inference.
Sandboxed AI Tools & Plugins
Typed WIT contracts, explicit capabilities, deterministic tools, memory and CPU budgets, fuel, timeouts, supply chain, signatures and the agent/tool boundary.
Always Active
Benchmark cold and warm paths, test numerical drift, protect the supply chain, and make every fallback and output auditable.
Specifications before abstractions
The registry keeps standards, implementation documentation, runtime references, and change-sensitive APIs explicit and reviewable.