# webgpu/webgpufundamentals architecture

> Architecture diagram of the GitHub repository webgpu/webgpufundamentals, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/webgpu/webgpufundamentals
- Repository: https://github.com/webgpu/webgpufundamentals

## Overview

WebGPU Fundamentals is a browser-based tutorial series, not a WebGPU application service. Readers follow lessons with interactive examples and visual diagrams; lesson scripts run those examples in the browser. The README also documents localization and an automatically generated WGSL function reference. The graph includes those product capabilities alongside the sampled lesson/runtime layer. Several subsystems are represented by exact enclosing directories because their individual sources were not sampled; arrows are limited to documented or indexed relationships.

Main entry points: [`webgpu/lessons/webgpu-perspective-projection.js`](https://github.com/webgpu/webgpufundamentals/blob/main/webgpu/lessons/webgpu-perspective-projection.js) (Projection example), [`webgpu/lessons/webgpu-picking.js`](https://github.com/webgpu/webgpufundamentals/blob/main/webgpu/lessons/webgpu-picking.js) (Picking example), [`webgpu/lessons/webgpu-compute-shaders-histogram.js`](https://github.com/webgpu/webgpufundamentals/blob/main/webgpu/lessons/webgpu-compute-shaders-histogram.js) (Histogram example), [`webgpu/lessons`](https://github.com/webgpu/webgpufundamentals/tree/main/webgpu/lessons) (WebGPU lessons)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_content["Tutorial content"]
  node_lessons["WebGPU lessons"]
  node_translations["Localized lessons"]
  node_wgslref["WGSL function reference"]
end

subgraph group_runtime["Lesson runtime"]
  node_lessonruntime["Lesson page runtime<br/>[lesson.js]"]
  node_lessonhelper["Lesson helpers<br/>[lessons-helper.js]"]
  node_diagramregistry["Diagram rendering<br/>[diagrams.js]"]
  node_dom["DOM utilities<br/>[elem.js]"]
  node_animation["Animation loop<br/>[good-raf.js]"]
end

subgraph group_visuals["Interactive examples"]
  node_histogram["Histogram example"]
  node_projection["Projection example"]
  node_picking["Picking example<br/>[webgpu-picking.js]"]
  node_storage["Storage buffers diagram"]
  node_byteview["Data layout diagrams"]
  node_types["WGSL data types<br/>[wgsl-data-types.js]"]
  node_matrix["Matrix math"]
  node_twgl["TWGL utilities"]
  node_gui["Example controls"]
  node_svg["SVG drawing<br/>[svg.esm.js]"]
  node_imagefeatures["Image lessons"]
  node_featurelessons["WebGPU feature lessons"]
end

subgraph group_reference["Reference resources"]
end

node_reader(("Reader"))
node_webgpu(("WebGPU browser"))

node_reader -->|"reads"| node_lessons
node_reader -->|"reads"| node_translations
node_lessons -.->|"uses"| node_lessonruntime
node_translations -.->|"uses"| node_lessonruntime
node_lessons -->|"includes"| node_wgslref
node_histogram -->|"registers diagrams"| node_diagramregistry
node_projection -->|"registers diagrams"| node_diagramregistry
node_picking -->|"registers diagrams"| node_diagramregistry
node_storage -->|"registers diagrams"| node_diagramregistry
node_histogram -->|"creates elements"| node_dom
node_projection -->|"creates elements"| node_dom
node_picking -->|"creates elements"| node_dom
node_histogram -->|"uses loop"| node_animation
node_projection -->|"uses loop"| node_animation
node_picking -->|"uses loop"| node_animation
node_projection -->|"imports math"| node_matrix
node_picking -->|"imports math"| node_matrix
node_projection -->|"imports utilities"| node_twgl
node_picking -->|"imports utilities"| node_twgl
node_projection -->|"creates controls"| node_gui
node_picking -->|"creates controls"| node_gui
node_histogram -->|"imports drawing"| node_svg
node_storage -->|"draws with"| node_svg
node_byteview -->|"reads type info"| node_types
node_imagefeatures -.->|"demonstrates"| node_webgpu
node_featurelessons -.->|"demonstrates"| node_webgpu
node_lessonhelper -.->|"supports"| node_lessons

click node_lessons "https://github.com/webgpu/webgpufundamentals/tree/main/webgpu/lessons"
click node_translations "https://github.com/webgpu/webgpufundamentals/tree/main/webgpu/lessons"
click node_wgslref "https://github.com/webgpu/webgpufundamentals/blob/main/webgpu/lessons/webgpu-wgsl-function-reference.js"
click node_lessonruntime "https://github.com/webgpu/webgpufundamentals/blob/main/webgpu/lessons/resources/js/lesson.js"
click node_lessonhelper "https://github.com/webgpu/webgpufundamentals/blob/main/webgpu/resources/lessons-helper.js"
click node_diagramregistry "https://github.com/webgpu/webgpufundamentals/blob/main/webgpu/lessons/resources/js/diagrams.js"
click node_dom "https://github.com/webgpu/webgpufundamentals/blob/main/webgpu/lessons/resources/js/elem.js"
click node_animation "https://github.com/webgpu/webgpufundamentals/blob/main/webgpu/lessons/resources/js/good-raf.js"
click node_histogram "https://github.com/webgpu/webgpufundamentals/blob/main/webgpu/lessons/webgpu-compute-shaders-histogram.js"
click node_projection "https://github.com/webgpu/webgpufundamentals/blob/main/webgpu/lessons/webgpu-perspective-projection.js"
click node_picking "https://github.com/webgpu/webgpufundamentals/blob/main/webgpu/lessons/webgpu-picking.js"
click node_storage "https://github.com/webgpu/webgpufundamentals/blob/main/webgpu/lessons/webgpu-storage-buffers.js"
click node_byteview "https://github.com/webgpu/webgpufundamentals/blob/main/webgpu/lessons/resources/js/data-byte-diagram.js"
click node_types "https://github.com/webgpu/webgpufundamentals/blob/main/webgpu/lessons/resources/js/wgsl-data-types.js"
click node_matrix "https://github.com/webgpu/webgpufundamentals/blob/main/3rdparty/wgpu-matrix.module.js"
click node_twgl "https://github.com/webgpu/webgpufundamentals/blob/main/3rdparty/twgl-full.module.js"
click node_gui "https://github.com/webgpu/webgpufundamentals/blob/main/3rdparty/muigui-0.x.module.js"
click node_svg "https://github.com/webgpu/webgpufundamentals/blob/main/3rdparty/svg.esm.js"
click node_imagefeatures "https://github.com/webgpu/webgpufundamentals/tree/main/webgpu/lessons"
click node_featurelessons "https://github.com/webgpu/webgpufundamentals/tree/main/webgpu/lessons"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_lessons,node_translations,node_wgslref,node_webgpu toneBlue
class node_lessonruntime,node_lessonhelper,node_diagramregistry,node_dom,node_animation toneAmber
class node_histogram,node_projection,node_picking,node_storage,node_byteview,node_types,node_matrix,node_twgl,node_gui,node_svg,node_imagefeatures,node_featurelessons toneMint
class node_reader toneIndigo
```

## Components

### Tutorial content

- [WebGPU lessons](https://github.com/webgpu/webgpufundamentals/tree/main/webgpu/lessons): `webgpu/lessons`
- [Localized lessons](https://github.com/webgpu/webgpufundamentals/tree/main/webgpu/lessons): `webgpu/lessons`
- [WGSL function reference](https://github.com/webgpu/webgpufundamentals/blob/main/webgpu/lessons/webgpu-wgsl-function-reference.js): `webgpu/lessons/webgpu-wgsl-function-reference.js`

### Lesson runtime

- [Lesson page runtime](https://github.com/webgpu/webgpufundamentals/blob/main/webgpu/lessons/resources/js/lesson.js): `webgpu/lessons/resources/js/lesson.js`
- [Lesson helpers](https://github.com/webgpu/webgpufundamentals/blob/main/webgpu/resources/lessons-helper.js): `webgpu/resources/lessons-helper.js`
- [Diagram rendering](https://github.com/webgpu/webgpufundamentals/blob/main/webgpu/lessons/resources/js/diagrams.js): `webgpu/lessons/resources/js/diagrams.js`
- [DOM utilities](https://github.com/webgpu/webgpufundamentals/blob/main/webgpu/lessons/resources/js/elem.js): `webgpu/lessons/resources/js/elem.js`
- [Animation loop](https://github.com/webgpu/webgpufundamentals/blob/main/webgpu/lessons/resources/js/good-raf.js): `webgpu/lessons/resources/js/good-raf.js`

### Interactive examples

- [Histogram example](https://github.com/webgpu/webgpufundamentals/blob/main/webgpu/lessons/webgpu-compute-shaders-histogram.js): `webgpu/lessons/webgpu-compute-shaders-histogram.js`
- [Projection example](https://github.com/webgpu/webgpufundamentals/blob/main/webgpu/lessons/webgpu-perspective-projection.js): `webgpu/lessons/webgpu-perspective-projection.js`
- [Picking example](https://github.com/webgpu/webgpufundamentals/blob/main/webgpu/lessons/webgpu-picking.js): `webgpu/lessons/webgpu-picking.js`
- [Storage buffers diagram](https://github.com/webgpu/webgpufundamentals/blob/main/webgpu/lessons/webgpu-storage-buffers.js): `webgpu/lessons/webgpu-storage-buffers.js`
- [Data layout diagrams](https://github.com/webgpu/webgpufundamentals/blob/main/webgpu/lessons/resources/js/data-byte-diagram.js): `webgpu/lessons/resources/js/data-byte-diagram.js`
- [WGSL data types](https://github.com/webgpu/webgpufundamentals/blob/main/webgpu/lessons/resources/js/wgsl-data-types.js): `webgpu/lessons/resources/js/wgsl-data-types.js`
- [Matrix math](https://github.com/webgpu/webgpufundamentals/blob/main/3rdparty/wgpu-matrix.module.js): `3rdparty/wgpu-matrix.module.js`
- [TWGL utilities](https://github.com/webgpu/webgpufundamentals/blob/main/3rdparty/twgl-full.module.js): `3rdparty/twgl-full.module.js`
- [Example controls](https://github.com/webgpu/webgpufundamentals/blob/main/3rdparty/muigui-0.x.module.js): `3rdparty/muigui-0.x.module.js`
- [SVG drawing](https://github.com/webgpu/webgpufundamentals/blob/main/3rdparty/svg.esm.js): `3rdparty/svg.esm.js`
- [Image lessons](https://github.com/webgpu/webgpufundamentals/tree/main/webgpu/lessons): `webgpu/lessons`
- [WebGPU feature lessons](https://github.com/webgpu/webgpufundamentals/tree/main/webgpu/lessons): `webgpu/lessons`

### Other components

- **Reader**
- **WebGPU browser**

## Connections

- Reader → WebGPU lessons: reads (evidence: `README.md`)
- Reader → Localized lessons: reads (evidence: `README.md`)
- WebGPU lessons → Lesson page runtime: uses (evidence: `webgpu/lessons/resources/js/lesson.js`)
- Localized lessons → Lesson page runtime: uses (evidence: `webgpu/lessons/resources/js/lesson.js`)
- WebGPU lessons → WGSL function reference: includes (evidence: `README.md`)
- Histogram example → Diagram rendering: registers diagrams (evidence: `webgpu/lessons/webgpu-compute-shaders-histogram.js`)
- Projection example → Diagram rendering: registers diagrams (evidence: `webgpu/lessons/webgpu-perspective-projection.js`)
- Picking example → Diagram rendering: registers diagrams (evidence: `webgpu/lessons/webgpu-picking.js`)
- Storage buffers diagram → Diagram rendering: registers diagrams (evidence: `webgpu/lessons/webgpu-storage-buffers.js`)
- Histogram example → DOM utilities: creates elements (evidence: `webgpu/lessons/webgpu-compute-shaders-histogram.js`)
- Projection example → DOM utilities: creates elements (evidence: `webgpu/lessons/webgpu-perspective-projection.js`)
- Picking example → DOM utilities: creates elements (evidence: `webgpu/lessons/webgpu-picking.js`)
- Histogram example → Animation loop: uses loop (evidence: `webgpu/lessons/webgpu-compute-shaders-histogram.js`)
- Projection example → Animation loop: uses loop (evidence: `webgpu/lessons/webgpu-perspective-projection.js`)
- Picking example → Animation loop: uses loop (evidence: `webgpu/lessons/webgpu-picking.js`)
- Projection example → Matrix math: imports math (evidence: `webgpu/lessons/webgpu-perspective-projection.js`)
- Picking example → Matrix math: imports math (evidence: `webgpu/lessons/webgpu-picking.js`)
- Projection example → TWGL utilities: imports utilities (evidence: `webgpu/lessons/webgpu-perspective-projection.js`)
- Picking example → TWGL utilities: imports utilities (evidence: `webgpu/lessons/webgpu-picking.js`)
- Projection example → Example controls: creates controls (evidence: `webgpu/lessons/webgpu-perspective-projection.js`)
- Picking example → Example controls: creates controls (evidence: `webgpu/lessons/webgpu-picking.js`)
- Histogram example → SVG drawing: imports drawing (evidence: `webgpu/lessons/webgpu-compute-shaders-histogram.js`)
- Storage buffers diagram → SVG drawing: draws with (evidence: `webgpu/lessons/webgpu-storage-buffers.js`)
- Data layout diagrams → WGSL data types: reads type info (evidence: `webgpu/lessons/resources/js/data-byte-diagram.js`)
- Image lessons → WebGPU browser: demonstrates
- WebGPU feature lessons → WebGPU browser: demonstrates
- Lesson helpers → WebGPU lessons: supports
