mirror of
https://github.com/imjasonh/webgpu-war
synced 2026-07-07 00:23:00 +00:00
No description
| .github/workflows | ||
| src | ||
| .gitignore | ||
| index.html | ||
| LICENSE | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| vite.config.js | ||
War GPU Simulator
Massively parallel card game simulation using WebGPU compute shaders.
Simulates ~millions of games of War per second on the GPU (depending on hardware), with animated stats, record-breaking game detection, and round-by-round replay.
How it works
- A WGSL compute shader runs 65,536 independent games per GPU dispatch
- Each game: Fisher-Yates shuffle → circular buffer card management → full War rules including multi-level wars
- Double-buffered pipeline: next dispatch runs while CPU processes current results
- Seeds are deterministic and sequential from a random base — every game is reproducible via replay
Run locally
npm install
npm run dev
Deploy to GitHub Pages
- Update
baseinvite.config.jsto match your repo name - Push to
main— the GitHub Action builds and deploys automatically - Enable Pages in repo Settings → source: "GitHub Actions"
Requirements
- A browser with WebGPU support (Chrome 113+, Edge, Firefox 141+, Safari 26+)
- A GPU (integrated is fine, discrete is faster)