A General Purpose KMC Crystal Growth Simulator in Rust-WASM
More general than aTAM/kTAM tile models, but the audience is extremely narrow.
3 million particles with voxel gravity field, all GPU-driven in Rust.
Graphics programmers learning GPU compute pipelines
NVIDIA Flex · Unity DOTS · Taichi Lang
I built a GPU “big bang” particle sim in Rust (wgpu) over a 2-day sprint
I’ve spent a lot of time working on web engines, but had never really touched modern GPU compute directly, so I used this as an excuse to dive in and learn.
What it does:
- ~3 million particles simulated in real time - Interactive framerates (hardware-dependent) - Voxel-based “gravity” field that particles both write to and read from - Fully GPU-driven (compute + rendering)
The basic idea: Particles deposit “mass” into a voxel grid → the grid gets blurred over time → particles sample that field to derive a force → that drives motion.
It’s not physically accurate, but it produces some really interesting emergent structure.
What surprised me: I tapped out at a relatively low particle count.
I’ve pushed GPUs much harder on the web before (tens of millions of grass blades in one of my games), so I expected to go further here. Not sure where the bottleneck is:
- WebGPU vs Metal vs wgpu - Something dumb in my pipeline - Or maybe I’m accidentally hitting a software fallback somewhere
I’m on an M1, so I’d expect this to scale better on something like an RTX 30xx+. The project seems almost entirely GPU-bound, but I wouldn’t be shocked if I’m wrong.
What it’s not:
- No collisions - Not real gravity - No conservation laws - I’m not a physicist, and it shows
This is much more of a visual / emergent system than a real simulation.
Context: I wrote the compute + rendering + simulation logic myself. Used AI to scaffold some surrounding pieces (including this post). This was mostly about learning how to actually use compute, not just read about it.
Thanks: Huge shoutout to the Rust and wgpu teams. The fact that this is even approachable is kind of wild.
If you’re interested, check it out / break it / improve it. PRs welcome — I’ll review and merge anything solid.
Happy to answer questions or get roasted for the physics :)
More general than aTAM/kTAM tile models, but the audience is extremely narrow.
Achieves 92,000x memory savings versus fine grids using rotated ensemble averaging.
Basic gravity sim with nothing distinguishing it from existing tools.
Renders 100k particles in real-time on iPhone with synced haptic feedback.
Real orbital mechanics with RK4 integration running entirely in your browser.
Physics-based anomaly detection with no training step, but novelty doesn't match execution maturity.