Notes
- I built a WebIDL compiler to get type-safe WebGPU in Kotlin/Wasm
Kotlin/Wasm has no WebGPU bindings, so I generate them from the spec's own WebIDL. It uses an ANTLR grammar, a chain of pure resolution passes and KotlinPoet, and golden files and a compile test check the output.
- 1M boids in the browser: spatial hashing with compute shaders
Every frame, the GPU counting-sorts the flock into a grid with atomics, a parallel scan and a scatter, so each boid only checks the cells around it. Tests check it against a CPU reference, boid by boid.
- A navigation graph where the edges are the transitions
Pages are nodes, and every edge carries its transition as a value. A transition can be timed or wait for a signal, and transitions combine with +, with and or. Compose and WebGPU play them from one clock.