1
0
Fork 0
mirror of https://github.com/imjasonh/webgpu-war synced 2026-07-07 00:23:00 +00:00
No description
Find a file
2026-04-13 09:12:40 -04:00
.github/workflows deploy 2026-04-13 09:03:14 -04:00
src deploy 2026-04-13 09:03:14 -04:00
.gitignore deploy 2026-04-13 09:03:14 -04:00
index.html deploy 2026-04-13 09:03:14 -04:00
LICENSE Initial commit 2026-04-13 08:55:52 -04:00
package-lock.json fix GitHub Pages deploy: add lockfile, fix base path 2026-04-13 09:09:58 -04:00
package.json deploy 2026-04-13 09:03:14 -04:00
README.md Update README to reflect simulation scale improvements 2026-04-13 09:12:40 -04:00
vite.config.js fix GitHub Pages deploy: add lockfile, fix base path 2026-04-13 09:09:58 -04:00

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

  1. Update base in vite.config.js to match your repo name
  2. Push to main — the GitHub Action builds and deploys automatically
  3. 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)