Uniquely adaptable engine for AI-driven worlds, built on two pillars. Performance: the Trinity Mainframe is 14 pure-logic kernels (acoustic propagation, voxel mesh, packet routing, AI Director governance, anti-cheat, more) over a data-oriented core, driving a deferred WebGPU / WebTransport / WebCrypto / WASM-SIMD integration layer. Determinism + cross-language portability: the deterministic core is now published source-available and proven byte-identical across TypeScript, Python, and Rust - one Rust core compiled to WebAssembly, a native Python wheel (PyO3), and a C ABI for Unity / Godot / C, with the same seed yielding the same bytes on every surface, enforced by a shared golden-vector suite. That is what makes replay, anti-cheat, and "the engine owns the dice, the AI only narrates" true rather than a claim. Published to npm (loom-engine), PyPI (loom-engine-rpg), and crates.io (loom_math / loom_combat / loom_events); 4,270 tests green; cleared a full external security + cross-language-determinism audit. v3.0 - Living Persistent World + real-time multiplayer: the engine is now server-authoritative - an any-system ruleset AST (bring 5e / PF2e / homebrew as DATA, statically validated fail-closed before any RNG draw), verifiable world snapshot + replay, a deterministic offline epoch world-tick, suspend / resume WorldSessions, and a real-time command-frame core with client-side rollback reconciliation + region-hash partial sync - the client can predict but never forge an outcome. Cross-session NPC memory via NarrativeMemory, asymmetric relationships via RelationshipGraph + EmotionState, deterministic replay via mulberry32 + per-tick state hash. Try the live playground in Section 05 below. Built from scratch for TheWorldTable.ai, available standalone on npm.

01Surfaces

02Quickstart

// 1. install $ npm i loom-engine // 2. attach to a canvas import { Engine } from 'loom-engine'; var canvas = document.querySelector('canvas'); var engine = Engine.create({ canvas: canvas }); // 3. drive the frame loop function tick(now) { engine.tick(now); requestAnimationFrame(tick); } requestAnimationFrame(tick);

03Stats / integrity

Tests
4,270
4,270 / 4,270 green at v3.1.1
Versions
136
since v0.10.0 / 2026
Source
69,500
LOC / 247 files
License
BUSL-1.1
Apache on 2030-05-08

04Wave milestones

v1.0.0
BenchmarkHarness
v1.1.5
GhostReplay
v1.2.5
LootTier
v1.3.5
NarrativeMemory
v1.4.5
SoundtrackDirector
v1.5.5
KnowledgeMap
v1.6.5
WorldSeed (procgen complete)
v1.7.5
ChatChannel (Wave 1.7 networking complete)
v2.0.0
Trinity Mainframe (14 kernels)
v2.1.0
BestiaryKernel (creature lifecycle)
v2.2.5
EventChain (tamper-evident HMAC log)
v2.3.0
Combat determinism (range bands + reaction economy + narration contract)
v3.1.1
Living Persistent World: any-system AST + snapshot/replay + epoch tick + WorldSessions + real-time multiplayer core (4 binding surfaces)

04AWave 1.6 - Procedural generation (complete)

v1.6.0 NameGenerator
Markov-chain name synthesis. Deterministic per seed.
v1.6.1 NoiseField
Multi-octave value noise. Heightmaps, biome noise, smoke shapes.
v1.6.2 VoronoiPartition
Region tiling with 3 distance metrics (Euclidean / Manhattan / Chebyshev).
v1.6.3 DungeonGenerator
BSP rooms + corridors. Powers Crypt procgen in /arpg-loom/.
v1.6.4 BiomeMixer
Whittaker climate classifier (temperature x precipitation).
v1.6.5 WorldSeed
Single-seed reproducible worlds - milestone. Atlas in /arpg-loom/ rides on this.

04BWave 1.7 - Networking (complete)

v1.7.0 PresenceTracker
Online roster + heartbeat + auto-timeout. SHIPPED
v1.7.1 LobbyState
Waiting room with ready states + host election. SHIPPED
v1.7.2 MatchmakingPool
Skill-based pairing (ELO/Glicko). SHIPPED
v1.7.3 AuthorityHandoff
Host migration on disconnect. SHIPPED
v1.7.4 LagCompensation
Client-side rollback netcode primitive. SHIPPED
v1.7.5 ChatChannel
Moderated channels with rate-limit + filter hooks. Live in /arpg-loom/ world chat. SHIPPED milestone

04CWave 2.0 - Trinity Mainframe (complete)

14 pure-logic kernels enforcing 90+ Codex hardening gates. All non-negotiable engine invariants honoured: no RNG, no wall clock, no Atomics, fixed-capacity, every input bounds-checked. Try them live in Section 07 below.

SonicSync
Acoustic propagation kernel. Q16.16 fp voxel grid + Amanatides-Woo 3D DDA + double-buffered perception-event ring. 40 tests / 7 gates
LoomVerify
Anti-cheat verifier with PASS / RESYNC / REJECT verdicts. Single-use nonces, regional Merkle witnesses, key-epoch rotation. 36 tests / 7 gates
NeuralMaterial
Runtime PBR material synthesis. PACKED_F16 / F16 / F32 path picker, atlas LRU, GPU-timestamp p50/p95 latency window. 33 tests / 7 gates
InferenceOrchestrator
NPC AI router. Two lanes (LOCAL_SLM consented + CLOUD), batched dispatch, critical-priority budget ceiling. 37 tests / 6 gates
LoomPulse
Player-vibe inference. Q16.16 EMA + confidence + hysteresis, default-deny consent, NO direct reputation surface. 22 tests / 7 gates
LoomFlow
Adaptive-network packet router. Three lanes (UNRELIABLE / RELIABLE_COMBAT / RELIABLE_ECONOMY), jitter buffer, throttle hysteresis. 37 tests / 6 gates
NeuralAnimationSystem
Motion-matching + inertialization. Brute-force feature-DB search, real per-bone pose delta, exp() LUT decay, foot-locking. 24 tests / 6 gates
VoxelComputeSystem
Marching-cubes voxel mesher. Front/back epoch-swapped density, externally-loaded Bourke MC tables, capacity-checked vertex emit. 24 tests / 6 gates
AetherGrid
N2N authority handoff. Two-phase transfer state machine, idempotency dedup, split-brain detection, crash recovery. 29 tests / 6 gates
LoomFSR
Temporal upscaler. Halton(2,3) jitter, ping-pong color/depth/normal history, reactive/disocclusion mask, FSR-class sharpening. 26 tests / 7 gates
SealedAssetRegistry
AES-GCM delayed-key disclosure. AAD binding (event/asset/version/hash), entitlement+region scoping, transferable buffers. 27 tests / 7 gates
LoomForgeBridge
WASM-SIMD physics integration. Strict build contract, single-source memory layout, double-buffered position phase barrier. 26 tests / 6 gates
GlobalStateLedger
Spatio-temporal persistence. (region, lamport64, node, sequence) ordering, per-component merge rules, auditable compaction. 27 tests / 7 gates
LoomStudioOrchestrator
AI Director governance. Telemetry epochs, batched SLM queries, allowed-action-mask validation, fact-tier guard, reserved index 0. 29 tests / 6 gates

05Playground - run the engine in your browser

Every demo below runs the actual loom-engine v3.1.1 bundle - the same one you'd get from npm i loom-engine. Open your devtools and window.LOOM exposes the imported classes for ad-hoc poking.

SUSTAIN DIAL idle
FPS
--
FRAME P50
--
ms
FRAME P95
--
ms
HEAP
--
MB
PHYSICS
--
collisions/tick
AUDIO
--
events/tick

Spawns N entities each wired to PhysicsSystem + AIBehaviorBuffer + SonicSync + LoomFlow. Watch the FPS gauge - the dial number where it drops below 60 is your device's headroom.

Component demos - click any to expand

AVoxelComputemarching cubes
Drag a slider, watch the 3D mesh regenerate. Triangles/sec counter. Real Bourke MC tables.
BSonicSyncacoustic DDA
Place sound source + listener on a voxel grid. Click to add walls. Watch the ray attenuate through occlusion.
CLoomFlowpacket router
Inject packets at controllable rate per lane. Simulated jitter. Watch throttle hysteresis activate at threshold.
DPhysicsSystemN-body AABB
Click to spawn boxes. Dial entity count up to 10k. Watch AABB collisions resolve in real time.
ECognitiveMapHTN planner
Pick a goal. Watch the deterministic HTN decomposition execute step-by-step. Plan generation counter.
FLoomChronorewind / replay
Spawn entities, click rewind to scrub the keyframe ring. Bit-for-bit identical replay from the same seed.
GMarketSimulationbatch auction
Live order book. Click to place bids/asks. Deterministic batch matching. Idempotent trade IDs.
HAetherGridN2N authority
Two simulated nodes. Trigger a split-brain by committing under same epoch. Watch the resolver detect it.

06What's new

07Authors

Engineered by
Misha Mitiev (@sadhaka)
with Claude / Anthropic
  • Pair-engineered architecture, primitive design, code review
  • Deterministic-replay-first stance, var-only browser source
  • 130 commits since v0.10.0 land Pure Addition
Niche
TS engine for AI-driven worlds. The differentiation is not engine breadth (Babylon, Excalibur, Phaser, Kaboom all do that well already) but:
  • Cross-session NPC memory via NarrativeMemory (v1.3.5)
  • Asymmetric relationships via RelationshipGraph + EmotionState
  • Deterministic replay via mulberry32 + clock seams