ExploreWorkspaceAbout

intro

Introduction to PHYS.RUN

.md

Introduction to PHYS.RUN

PHYS.RUN is a computational physics engine that bridges rigorous physical laws with interactive simulation. It enables researchers, students, and engineers to build, share, and explore physics simulations directly in the browser.

What is PHYS.RUN?

At its core, PHYS.RUN is a simulation runtime powered by WebAssembly and WebGPU. You define physical systems using a declarative schema (a "Codex"), and the engine handles numerical integration, rendering, and interaction.

Key Capabilities

  • Real-time 2D/3D physics — Rigid bodies, particle systems, and field simulations running at 60fps in the browser.
  • Declarative Codex format — Define simulations as structured data, not imperative code.
  • WebAssembly physics — Rapier2D/3D physics engine compiled to WASM for near-native performance.
  • Multiple renderers — SVG, Canvas (Pixi.js), and WebGL (Three.js) backends.

Architecture Overview

┌─────────────┐     ┌──────────────┐     ┌────────────┐
│  Codex JSON  │ ──▶ │   Director    │ ──▶ │  Renderer   │
│  (Schema)    │     │  (Runtime)    │     │  (SVG/GL)   │
└─────────────┘     └──────────────┘     └────────────┘

A Codex is the source of truth — a JSON document describing entities, forces, constraints, and timeline keyframes. The Director interprets the Codex at runtime, stepping the simulation forward. The Renderer visualizes the state.

Next Steps