libwgsl · WebAssembly · WebGPU

wgsl.run

A browser playground for WGSL shader modules. Validate source with libwgsl, inspect diagnostics and module JSON, tune host parameters, and preview compute or render output without leaving the tab.

565,599 CTS WGSL compile cases matched
36/36 native test targets passing
0 SPIR-V / MSL / HLSL backend promises
C99 frontend core, wasm-packaged

Browser Tooling

Validation, preview, and shader metadata on one surface.

Spec-facing validator

Lexer, parser, resolver, const-eval, type checker, validator, uniformity, alias analysis, and layout checks all run through the same C API.

Editor-grade signals

Diagnostics use LSP-shaped ranges. Semantic tokens, hover types, definition lookup, and module summary JSON are available to wrappers.

WebGPU host preview

Run curated render and compute examples, adjust parameters, inspect host plans, and keep shader feedback close to the source.

Shareable projects

Project files and params round-trip through the URL, so repro cases can be sent as a link instead of a zipped local workspace.

Frontend Pipeline

The playground is a thin UI over libwgsl.

WGSL
Parse
Resolve
Type Check
Validate
JSON
WebGPU
Diagnostics
compute.wgsl:7:12 error
initializer type bool cannot be converted to i32

rule: shader_creation
range: line 7, columns 12-16
Module JSON
{
  "entry_points": [{ "name": "main", "stage": "compute" }],
  "resources": [{ "group": 0, "binding": 0 }],
  "structs": [],
  "overrides": []
}