WebGPU Sorting is a browser-focused GPU sorting project built around WebGPU compute shaders. The repository serves three roles:
- A small TypeScript library for GPU sorting experiments
- A benchmark/demo application
- A reference docs site for the library, demo, and implementation notes
docs/ VitePress docs, Pages source, and generated demo assets
src/ Library and standalone demo implementation
test/ Vitest and browser tests
examples/ Usage snippets
.github/ CI, Pages, and release workflows
When these layers disagree, treat them in this order:
src/andtest/for runtime behaviorpackage.jsonand.github/workflows/for supported commands and automationREADME.md,README.zh.md,CONTRIBUTING.md, anddocs/for public and contributor guidanceCHANGELOG.mdfor project history
| Area | Purpose |
|---|---|
src/core/ |
WebGPU context, buffers, validation, errors, timeout |
src/sorting/ |
Bitonic and radix sorter implementations |
src/shaders/ |
WGSL compute shaders |
src/benchmark/ |
Performance comparison utilities |
src/main.ts + index.html |
Browser demo entry |
| Area | Purpose |
|---|---|
docs/ |
Public docs and Pages source |
.github/workflows/ |
CI, Pages, release, security workflows |
.github/copilot-instructions.md |
Optional, concise Copilot repo guidance |
.husky/ |
Git hook entrypoints |
CHANGELOG.md |
Single repository changelog |
CONTRIBUTING.md |
Direct contributor workflow and expectations |
The supported validation commands are:
npm run lint
npm run typecheck
npm run test
npm run buildThis repository should optimize for coherence and trust:
- keep docs purposeful and accurate
- keep workflows high-signal
- prefer direct maintenance over meta-process
- prefer small serial improvements over sprawling branches