gpu.js
CLAUDE.md15k starsChanged 3 months agoMITView on GitHub
Node 22. Node 23 breaks headless-gl, and early 22.x hits a vinyl-fs bug, so pin something recent within 22. npm run make runs build → beautify → minify → build-tests, from plain Node scripts in scripts/. It rewrites dist/ and regenerates test/all.html, so run it before anything that loads the browser bundle, and commit dist/ with the change. Individual steps are available as npm run build, minify, beautify, build-tests; npm run dev serves the repo for test/all.html. Bundling is rolldown,…
- Reads credentials
- Commits and pushes
We split this CLAUDE.md into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 72
Every step below is required.
≈ “Common” is an estimate: at least 1 in 5 of the 25,680 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Working on gpu.js
Build environment
Node 22. Node 23 breaks headless-gl, and early 22.x hits a vinyl-fs bug, so pin something recent within 22.
npm run make runs build → beautify → minify → build-tests, from plain Node
scripts in scripts/. It rewrites dist/ and regenerates test/all.html, so
run it before anything that loads the browser bundle, and commit dist/ with
the change. Individual steps are available as npm run build, minify,
beautify, build-tests; npm run dev serves the repo for test/all.html.
Bundling is rolldown, minifying is terser. Two things there are load-bearing:
gland (for the core build)acornare aliased toscripts/empty-module.js. That is browserify's old.ignore(). They must be aliased, notexternal— external leaves a liverequire()that throws in a browser.- both the bundle and the minified bundle are run through terser with
ascii_only. acorn ships its unicode tables already escaped, but rolldown decodes string literals and prints the characters, which puts ~68k raw UTF-8 bytes in the bundle. Serving that without a matching charset is #743/#744.
The banner interpolates new Date(), so two builds are never byte-identical —
compare dist/ with the @date lines normalized. All four bundles of one run
share a timestamp: the minify step passes the banner through (terser keeps it
via output.comments, since it carries @license) rather than prepending its
own. Prepending is what used to put the banner in the minified files twice,
seconds apart.
Note beautify reformats src/, so npm run make can produce unrelated
whitespace churn in files you did not touch. That is expected.
Tests
npm test runs qunit over test/issues test/internal test/features.
The suite has platform-dependent failures that are not regressions:
- Linux/Mesa: a set of failures baselined in
.github/known-test-failures.txt. CI compares against it with.github/compare-test-failures.jsand fails only on new failures, so the raw exit code is not the signal. test/internal/math.random.js"unique every time" is flaky (seed collisions, related to #850). A single failure there is not meaningful.
Confirm any new regression test actually catches the bug by reverting the fix and watching it fail — a test that passes both ways is worse than none.
Real devices
Bugs that only reproduce on real GPU drivers are a recurring theme here; three were found this way in 2.19.8 alone, none of which any CI runner could have caught. See the Testing section of README.md for how to run it.
npm run make # devices load dist/, so build first
npm run test:browserstack # real iOS/Android
node test/browserstack/run.js --dry-run --browsers=desktop # inspect caps, no sessionCredentials live in gitignored test/browserstack/.credentials.json, and as
BROWSERSTACK_USERNAME / BROWSERSTACK_ACCESS_KEY repo secrets for CI.
BrowserStack groups runs into one build by buildName, distinguishing them by
buildIdentifier. Keep buildName stable — a name that varies per run creates
a separate build every time and there is no single gpu.js entry to find in
the dashboard.
Releasing
Every step below is required; skipping the npm publish is the usual mistake — 2.19.5 and 2.19.7 have tags and GitHub releases but were never published, so their release notes tell people to install a version that does not exist.
npm version <version> --no-git-tag-version # package.json only
npm run make # dist/ carries the version header
npm test # expect the known baseline
git add -A && git commit -m "chore: Release <version>"
git tag <version>
git push origin develop && git push origin <version>
gh release create <version> --title "<version>" --notes-file <notes>Publishing
npm publish requires 2FA and prompts for a one-time code. Two things that
otherwise waste time:
npm view gpu.js versionlags a publish by up to a minute.curl -s https://registry.npmjs.org/gpu.jsis authoritative.E404 PUT ... not foundon publish means the npm token expired, not that anything is wrong with the package. Runnpm login.
Pushing workflow files
Changes under .github/workflows/ are rejected unless the credential pushing
them carries the workflow scope. Push with one that does, or add the file
through the GitHub API.
Trending
Quiet since September.about the whole repository
Who's talking about gpujs/gpu.js
- Nabil Mansour“GPGPU in React”YouTube · Oct 24, 2025 · 887 views
- A Hacker News story“Gpu.js: GPU Accelerated JavaScript”Hacker News · Jan 22, 2023 · 106 points
- Stack Overflow“Hello world example of WebGL parallelism”Stack Overflow · Apr 25, 2018 · 9 votes
- eduardoleao052/js-pytorch“GPU Support”GitHub · Mar 29, 2024 · 7 reactions
- A Hacker News story“Gpu.js – GPU Accelerated JavaScript”Hacker News · Jul 19, 2017 · 5 points
The biggest 5 of 61 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 61
Talked about on GitHub, Hacker News, Stack Overflow, the web, YouTube and Bluesky (61 times).
On GitHub · 50
- Mar 29, 2024GPU Support — eduardoleao052/js-pytorch7 reactions · 38 comments
- Feb 19, 2019NodeJS GPU Acceleration — BrainJS/brain.js3 reactions · 56 comments
- Mar 6, 2019Use gpu.js to speed up computation — CodingTrain/Suggestion-Box2 reactions
- Nov 13, 2025fix(CoCaro): Fix GPU.js constructor issue - downgrade to v2.4.2 — thanhinfore/CongCuVui1 reaction
- Aug 12, 2026Compiler: assess restricted JavaScript device helpers to eliminate consumer CUDA source — iteathen/CUDA-JS0 reactions · 7 comments
45 more on GitHub
- Feb 13, 2026Bump qs, gpu.js and react-scripts — anselbrandt/gpu-demo0 reactions
- Dec 31, 2025Bump qs, gpu.js and react-scripts — anselbrandt/gpu-demo0 reactions · 1 comment
- Oct 10, 2025Optimize GPU performance by reducing GPU↔CPU memory transfers — rulehunt/rulehunt0 reactions
- Aug 17, 2025build(deps): bump the npm_and_yarn group across 1 directory with 2 updates — Centaurioun/gpu.js0 reactions · 1 comment
- May 28, 2024Bump tough-cookie and gpu.js — retiutut/LogJr_AutoSortPlaylist0 reactions
- May 22, 2024[Snyk] Security upgrade gpu.js from 2.11.3 to 2.16.0 — Kingcrypto38/hedgehog-lab0 reactions
- May 21, 2024[Snyk] Security upgrade gpu.js from 2.15.2 to 2.16.0 — MoriartyC/brain.js0 reactions
- May 21, 2024[Snyk] Security upgrade gpu.js from 2.11.3 to 2.16.0 — Kingcrypto38/hedgehog-lab0 reactions
- Jan 10, 2024Bump the npm_and_yarn group group with 2 updates — peterprib/node-red-contrib-gpu0 reactions
- Jan 10, 2024Bump tough-cookie, gpu.js and node-red — peterprib/node-red-contrib-gpu0 reactions · 1 comment
- Dec 6, 2023chore(deps-dev): bump the npm_and_yarn group group with 2 updates — BrainJS/brain.js0 reactions
- Oct 19, 2023Bump the npm_and_yarn at /test_node_env security update group in /test_node_env with 1 update — source-academy/sicp0 reactions · 1 comment
- Oct 19, 2023Bump tough-cookie and gpu.js in /test_node_env — source-academy/sicp0 reactions · 1 comment
- Jul 9, 2023chore(deps): bump tough-cookie, gpu.js and react-scripts in /hedgehog-lab — shaunstanislauslau/hedgehog-lab0 reactions
- Jul 9, 2023chore(deps): bump tough-cookie and gpu.js — GeauxWeisbeck4/brain.js0 reactions · 1 comment
- Jul 8, 2023Bump tough-cookie, gpu.js and jsdom — virgs/flappy-bird-ai0 reactions
- Jul 8, 2023Bump tough-cookie and gpu.js — flickleafy/Udacity.PhotoLightness0 reactions
- Jul 8, 2023Bump tough-cookie and gpu.js — flickleafy/Udacity.SimpleML0 reactions
- Jul 8, 2023Bump tough-cookie and gpu.js — callumhay/omnivox0 reactions
- Jul 8, 2023Bump tough-cookie and gpu.js — eriklandmark/nn-lib0 reactions · 1 comment
- Jul 8, 2023Bump tough-cookie and gpu.js — kevinmlee/neural-network0 reactions · 2 comments
- Jul 8, 2023chore(deps): bump tough-cookie and gpu.js — BrainJS/brain.js0 reactions · 2 comments
- Jun 24, 2023build(deps): bump semver and gpu.js in /js — hhschu/fizzbuzz-net0 reactions
- Jun 24, 2023Bump semver, better-sqlite3 and gpu.js in /roles/socks/files — wizawu/sysconf0 reactions · 1 comment
- Jun 24, 2023Bump semver and gpu.js — flickleafy/Udacity.PhotoLightness0 reactions · 1 comment
- Jun 24, 2023Bump semver and gpu.js — flickleafy/Udacity.SimpleML0 reactions · 1 comment
- Jun 23, 2023Bump semver and gpu.js — eriklandmark/nn-lib0 reactions · 1 comment
- Jun 23, 2023Bump semver and gpu.js — kevinmlee/neural-network0 reactions · 2 comments
- Nov 17, 2022Bump gpu.js from 2.11.3 to 2.16.0 — sjbcastro/image-sequencer0 reactions
- Nov 14, 2022Override gpu.js gl dependency — BrainJS/brain.js0 reactions · 2 comments
- Sep 19, 2022Webgl kernel experimental — wanadev/gpu.js0 reactions
- Sep 19, 2022Uglify ascii option — wanadev/gpu.js0 reactions
- Sep 2, 2022Proposal: Ability to compile to WebGL / WebGPU Shader — AssemblyScript/assemblyscript0 reactions · 7 comments
- Aug 16, 2022Can't import gpu.js — oven-sh/bun0 reactions · 8 comments
- Apr 1, 2022Bump gpu.js from 2.11.4 to 2.15.2 — source-academy/js-slang0 reactions · 6 comments
- Mar 29, 2022Bump gpu.js from 2.11.3 to 2.15.2 — sjbcastro/image-sequencer0 reactions · 1 comment
- Mar 28, 2022Bump gpu.js from 2.15.1 to 2.15.2 — publiclab/image-sequencer0 reactions · 1 comment
- Mar 28, 2022Bump gpu.js from 2.15.0 to 2.15.1 — publiclab/image-sequencer0 reactions · 1 comment
- Feb 1, 2022Bump gpu.js from 2.11.4 to 2.15.0 — source-academy/js-slang0 reactions · 1 comment
- Jan 30, 2022GPU use — Michal2SAB/Bitcoin-Stealer0 reactions · 1 comment
- Jan 27, 2022Bump gpu.js from 2.11.3 to 2.15.0 — sjbcastro/image-sequencer0 reactions · 1 comment
- Jan 27, 2022Bump gpu.js from 2.11.4 to 2.15.0 — publiclab/image-sequencer0 reactions · 1 comment
- Jan 14, 2022Wrap GPU.js kernel functions in templates — vanvalenlab/deepcell-label0 reactions
- Nov 1, 2021fix(deps): gpu.js on macOS M1 chip — Hedgehog-Computing/hedgehog-lab0 reactions · 2 comments
- Sep 14, 2021Bump gpu.js from 2.11.3 to 2.11.4 — sjbcastro/image-sequencer0 reactions · 1 comment
On Hacker News · 5
- Jan 22, 2023Gpu.js: GPU Accelerated JavaScript106 points · 10 comments
- Jul 19, 2017Gpu.js – GPU Accelerated JavaScript5 points
- May 14, 2018GPU Accelerated JavaScript3 points
- Jul 12, 2017GPU Accelerated JavaScript2 points
- Feb 28, 2019Gpu.js: GPU Accelerated JavaScript1 point
On Stack Overflow · 2
- Apr 25, 2018Hello world example of WebGL parallelism9 votes · 1 answer
- Jul 16, 2022gpu.js with BigDecimal or float64array possible?0 votes
On the web · 2
- Sep 23, 2026gpujs/gpu.js 2.24.1 on GitHub — google.com
- Jul 19, 2017Introducing gpu.js: GPU Accelerated JavaScript — google.com
On YouTube · 1
- Oct 24, 2025GPGPU in React — Nabil Mansour887 views · 4 comments
On Bluesky · 1
- Jul 19, 2026you might have luck with gpgpu stuff? github.com/gpujs/gpu.js/ — @symbo1ics.bsky.social2 likes and reposts · 1 reply
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

