Ruvon Swarm Studio 3D

A live demonstration of ruvon-edge agents running entirely inside browser tabs, forming coordinated 3D drone swarms with no server required.

WebGPU SharedArrayBuffer Pyodide ruvon-edge BroadcastChannel mesh Zero servers

What you're looking at

Each browser tab runs 64 fully simulated drones under the control of a live RuvonEdgeAgent — the same Python runtime that powers payment terminals and industrial IoT gateways — compiled to WebAssembly via Pyodide.

Open multiple tabs from the same sovereign link and the tabs form a private fog network: they elect a leader, divide the formation space, and render a unified swarm with each browser contributing its own slice. Close any tab and the remaining nodes re-elect a new sovereign and recompute the fleet in under a second.

Architecture at a glance

BROWSER TAB (sovereign) BROWSER TAB (follower N) ┌─────────────────────────────────┐ ┌──────────────────────────────────┐ │ RuvonEdgeAgent (Pyodide/WASM) │ │ RuvonEdgeAgent (Pyodide/WASM) │ │ DroneCommand workflow │ │ DroneCommand workflow │ │ SwarmFormation workflow │ │ SwarmFormation workflow │ ├─────────────────────────────────┤ ├──────────────────────────────────┤ │ mesh_brain.js (Worker) │◄──────────►│ mesh_brain.js (Worker) │ │ BroadcastChannel gossip mesh │ │ gossip + election follower │ │ Sovereign election (scored) │ │ FORMATION_INTENT receiver │ ├─────────────────────────────────┤ ├──────────────────────────────────┤ │ physics_worker.js × 4 (SAB) │ │ physics_worker.js × 4 (SAB) │ │ Reynolds flocking + PID alt │ │ Reynolds flocking + PID alt │ │ Shared memory (SharedArrayBuf) │ │ Shared memory (SharedArrayBuf) │ ├─────────────────────────────────┤ ├──────────────────────────────────┤ │ renderer_webgpu.js │ │ renderer_webgpu.js │ │ Instanced drone mesh │ │ Instanced drone mesh │ │ LED glow + trails │ │ Ghost dots for remote squads │ └─────────────────────────────────┘ └──────────────────────────────────┘ │ BroadcastChannel (same-device) · PeerJS (cross-device, planned) └──────────────────────────────────────────────────────────────────►

How to use the demo

  1. Open the demo in any Chrome or Edge browser (WebGPU required). Firefox support coming when WebGPU ships in stable.
  2. Click Launch Drones. 64 drones spool up and fly to the default Ruvon-R formation. This tab is the sovereign — it controls the swarm.
  3. Copy the Sovereign Link shown in the top-left panel and paste it into a second tab or window. The second tab joins the mesh as a follower.
  4. On the follower tab, click Join Formation. The sovereign expands the fleet to 128 drones and each tab renders its own 64-drone slice of the formation.
  5. Add more tabs from the same link. Each adds another 64-drone squad. The formation math scales deterministically — no extra network traffic per drone.
  6. Try the 3D Formations panel: Sphere, Helix, DNA, Torus, Vortex, Wave, Cube.
  7. Type a command in the Command box (e.g. "form a sphere", "scatter", "land all"). MiniLM matches it to the nearest preset; complex prompts escalate to wllama/Ollama.
  8. Close the sovereign tab. The remaining tab detects the departure via GOODBYE broadcast, re-elects itself sovereign, and recomputes the fleet — all in under one second.

Key technology

🧠

ruvon-edge in the browser

RuvonEdgeAgent runs via Pyodide (CPython → WASM). The full DroneCommand and SwarmFormation workflows execute as real Python — same code that runs on hardware edge devices.

🌐

BroadcastChannel mesh

Tabs gossip via the Web BroadcastChannel API. A scored capability-vector election picks the sovereign. FOUNDING_BIAS ensures the original tab wins ties; stable pod_id tiebreaker prevents split-brain.

SharedArrayBuffer physics

Four Web Workers share a SAB (64 drones × 16 f32 = 4 KB). Reynolds flocking + PID altitude run in parallel worker threads with zero serialization overhead.

🎮

WebGPU renderer

Instanced drone meshes with LED glow, motion trails, and rotor animation. Ghost dots show remote squads. The camera is fully independent per tab — orbit, zoom, pan freely.

🔢

Deterministic sync

Formation changes broadcast a seed + preset name (not coordinates). Each tab independently computes its own index slice using mulberry32 PRNG — bitwise-identical in JS and Python.

🌿

92% less CO₂

Computation stays on the device. No round-trips to a cloud inference server. The green energy estimate in the HUD is calculated from active drone count and idle power displacement.

Sovereignty election

Every tab runs a gossip heartbeat every ~2 s, broadcasting a capability vector (battery, CPU load, RAM, task queue). The mesh scores all pods and elects the highest-scoring one as sovereign.

How split-brain is prevented

Sovereignty transfer

When a follower is elected sovereign it:

  1. Resets its slot to 0 (sovereign is always slot 0).
  2. Adopts all currently flying pods as active fleet members.
  3. Rebroadcasts the current formation with the corrected slot map.

ruvon-swarm package

The Python workflow logic is packaged as ruvon-swarm and installed inside Pyodide at runtime via micropip. It provides:

pip install ruvon-swarm

Run locally

git clone https://github.com/KamikaziD/ruvon-swarm
cd ruvon-swarm/examples/swarm_studio
python serve.py          # serves on http://localhost:8081

The local server proxies the Pyodide CDN through localhost and adds the COOP/COEP headers required for SharedArrayBuffer. No installation needed beyond Python 3.9+.