Skip to content

Commit 57509c0

Browse files
fuzzie360claude
andcommitted
deps: gpu.js 2.24.0, which makes headless-gl optional
`gl` moves from dependencies to optionalDependencies upstream. It was the reason a fresh install had to compile a native module — node-gyp, nan, X11 and GL headers — for a package this site never calls: the browser bundle is what ships, and the recorder drives real Chromium. An optional dependency that fails to build no longer fails the install. Carets, not a pin: ^2.24.0, as ^2.23.0 was. Also in bench-record.mjs, from testing the compiler-optimizations branch: a branch build reports the version of the release it was cut from, so a run recorded against unreleased code was about to be filed as plain "2.23.0" beside two tables that really are 2.23.0. When the dependency is a git URL the ref and short commit now go in the name — 2.23.0-compiler-optimizations+12d83cd — taken from yarn.lock. semver() reads the leading numbers and ignores the rest, so ordering is unaffected. The saved runs still say 2.23.0 and were measured there. Nothing in 2.24.0's changelog touches codegen, but the tables and the shipped library are now one minor apart, and the next recorded run closes that. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RJujXBsBhXBbQ72tS7E7GV
1 parent aa8f477 commit 57509c0

3 files changed

Lines changed: 29 additions & 7 deletions

File tree

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"@nivo/line": "^0.99.0",
1414
"@uiw/react-codemirror": "^4.25.11",
1515
"canvas-confetti": "^1.9.4",
16-
"gpu.js": "^2.23.0",
16+
"gpu.js": "^2.24.0",
1717
"material-icons": "^0.3.1",
1818
"materialize-css": "^1.0.0-rc.2",
1919
"prop-types": "^15.8.1",

‎scripts/bench-record.mjs‎

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,29 @@ const stamp = arg('--date') || new Date().toISOString().slice(0, 10);
132132
// The gpu.js version is part of a run's identity. Without it, re-recording one
133133
// machine after a library upgrade overwrites the table a reader most wants to
134134
// compare against.
135-
const gpujsVersion = JSON.parse(readFileSync(join(ROOT, 'node_modules/gpu.js/package.json'), 'utf8')).version;
135+
// A branch build reports the version of whatever release it was cut from — an
136+
// unreleased tree installed from git still says "2.23.0" — so taking that
137+
// number at face value files a table under a released version it was never
138+
// measured on. When the dependency is a git URL, the ref and the short commit
139+
// go in the name: 2.23.0-compiler-optimizations+12d83cd. semver() parses the
140+
// leading numbers and ignores the rest, so ordering is unaffected.
141+
function resolveGpujsVersion() {
142+
const version = JSON.parse(readFileSync(join(ROOT, 'node_modules/gpu.js/package.json'), 'utf8')).version;
143+
const pkg = JSON.parse(readFileSync(join(ROOT, 'package.json'), 'utf8'));
144+
const spec = (pkg.dependencies && pkg.dependencies['gpu.js']) || '';
145+
if (!/^(https?:|git\+|github:)/.test(spec)) return version;
146+
const ref = (spec.split('#')[1] || 'git').replace(/^feature\//, '');
147+
let commit = '';
148+
try {
149+
const lock = readFileSync(join(ROOT, 'yarn.lock'), 'utf8');
150+
const entry = lock.split(/\n(?=\S)/).find(b => b.startsWith(`"gpu.js@${spec}"`));
151+
const sha = entry && (entry.match(/resolved "[^"]*#([0-9a-f]{7,40})"/) || [])[1];
152+
if (sha) commit = `+${sha.slice(0, 7)}`;
153+
} catch (e) { /* a name without the commit still beats a wrong version */ }
154+
return `${version}-${slug(ref)}${commit}`;
155+
}
136156
const slug = t => t.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '');
157+
const gpujsVersion = resolveGpujsVersion();
137158
const id = arg('--id') || `${stamp}-${slug(label)}-gpujs${gpujsVersion}`;
138159

139160
if (argv.includes('--index')) {

‎yarn.lock‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2018,15 +2018,16 @@ gpu-mock.js@^1.4.1:
20182018
resolved "https://registry.yarnpkg.com/gpu-mock.js/-/gpu-mock.js-1.4.1.tgz#390f9d22667f9e3e73416d4e1f3f1261d0906a0a"
20192019
integrity sha512-LhCznlFsadwIJCYysx9OJZ4TXluvnKyBHZXt0F3Dbh5ENWbZsCm7TIyrOY2Dh/4DvaOfK67rAmDLYHFqBZ6B1Q==
20202020

2021-
gpu.js@^2.23.0:
2022-
version "2.23.0"
2023-
resolved "https://registry.yarnpkg.com/gpu.js/-/gpu.js-2.23.0.tgz#ea43cef0b90a01ff2de9ffad78b5be0e5bf5f8c9"
2024-
integrity sha512-rfcIBKVxlUS/yIY2bfVlq9b20+NqeJiE++icF+2trTGfphOMglOg3Ede2aZjZExF/xxXnI0k00KKElgogJbTIw==
2021+
gpu.js@^2.24.0:
2022+
version "2.24.0"
2023+
resolved "https://registry.yarnpkg.com/gpu.js/-/gpu.js-2.24.0.tgz#9127fe9c75e73ab151a74b5aa0ca4b8669476652"
2024+
integrity sha512-Fmn8PT1oiVf3NavfJAn/KBodNeEPXYZYTX5yjxjoH0xEyjM+LjVIaJ4Gn7ykSSD241P1Gx5o+WKR5jmRpNxbaA==
20252025
dependencies:
20262026
acorn "8.14.0"
2027-
gl "8.1.6"
20282027
gpu-mock.js "^1.4.1"
20292028
webgpu "0.2.9"
2029+
optionalDependencies:
2030+
gl "8.1.6"
20302031

20312032
graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.6:
20322033
version "4.2.11"

0 commit comments

Comments
 (0)