Skip to content

Commit 673ecde

Browse files
committed
fix(ci): knip red on my own probe, and the GL ledger cannot answer the question it was built for
TWO THINGS, and the second matters more than the first. KNIP. CI went red on `knip (unused files / exports / deps)` — "Unlisted binaries (1): uptime scripts/visual/gpu-cost-probe.mjs". Mine, from this session. Fixed by removing the dependency rather than allowlisting it: `os.loadavg()` is a Node builtin, so there is no subprocess, no PATH assumption, no output parsing and no platform question. An `ignoreBinaries` entry would have silenced the finding while leaving the dependency in place, which is the worse of the two repairs and the tempting one. THE GL LEDGER'S FIRST READING IS NOT THE ANSWER IT LOOKS LIKE. CI seeded it: `prod-smoke: GL errors: 0 over 8 frames — NO LEDGER YET, recording this as the ceiling.` That reading is worth stating clearly because it is about to be quoted as if the storm were fixed, and it is not evidence of that. `prod-smoke` launches with `--use-angle=swiftshader` — in CI exactly as locally. SwiftShader is a CPU rasteriser. It reports MAX_SAMPLES 4, it does not perform the driver-side validation that emits `GL_INVALID_OPERATION: glBlitFramebuffer: Read and write depth stencil attachments cannot be the same image`, and the storm was only ever OBSERVED in a real Chrome on a real GPU. A 0 from it is exactly the reading a driver that CANNOT raise the error would always produce. So the ledger is a regression guard for the SwiftShader path and nothing more. It will catch a new GL error class that even SwiftShader validates; it cannot confirm the real-driver storm is gone. That limit is now written into the file, because a ledger seeded at 0 reads like an all-clear, and an all-clear from an instrument that cannot see the subject is the DEGRADED shape — the one that looks like success and is the most dangerous of the three. CONSEQUENCE FOR THE UPSTREAM DECISION. I said I would not comment on pmndrs/postprocessing#750 or N8python/n8ao#53 until there was a real-browser measurement. There still is not one. This reading does not change that, and reporting it upstream would be handing a maintainer a number from a rasteriser that cannot produce the symptom. The only instrument that can settle it is a real GPU — which on this machine means the operator's own Chrome, where the original ~256-per-load observation came from. Not gated beyond the existing gl-error-ledger tests: this commit changes a docblock and swaps a subprocess for a builtin. The behaviour under test is unchanged and its six cases still pass.
1 parent 44eb7f3 commit 673ecde

2 files changed

Lines changed: 30 additions & 11 deletions

File tree

‎frontend/scripts/ci/prod-smoke.mjs‎

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,30 @@ const PORT = 4180;
4949
* no muting. One call per frame, because reading DRAINS — a single poll at the end reports at most ONE
5050
* error for the whole run, which is how a count like this reads as clean.
5151
*
52-
* RATCHETED, NOT THRESHOLDED. The honest problem is that nobody knows the post-fix number: the headless
53-
* probe runs SwiftShader, which reports MAX_SAMPLES 4 and emitted zero GL errors, so it cannot settle the
54-
* question and a threshold picked here would be a guess wearing a gate's clothes. So the first run
55-
* RECORDS, and later runs may FALL and never RISE — the same shape as the opsec, killability and
56-
* source-grep ledgers in this repo. That makes the number falsifiable without pretending to know it.
52+
* RATCHETED, NOT THRESHOLDED. Nobody knows the post-fix number, so the first run RECORDS and later runs
53+
* may FALL and never RISE — the same shape as the opsec, killability and source-grep ledgers here. That
54+
* makes the number falsifiable without pretending to know it.
55+
*
56+
* ─────────────────────────────────────────────────────────────────────────────────────────────────────
57+
* WHAT THIS LEDGER CANNOT SETTLE, AND IT IS THE QUESTION IT WAS BUILT FOR
58+
*
59+
* CI's first seeded reading was `GL errors: 0 over 8 frames`. That is NOT evidence that the
60+
* `glBlitFramebuffer` storm is gone, and it must not be quoted as if it were.
61+
*
62+
* This probe launches with `--use-angle=swiftshader` — in CI exactly as locally. SwiftShader is a CPU
63+
* rasteriser: it reports MAX_SAMPLES 4, it does not implement the driver-side validation that emits
64+
* `GL_INVALID_OPERATION: glBlitFramebuffer: Read and write depth stencil attachments cannot be the same
65+
* image`, and the storm was only ever OBSERVED in a real Chrome on a real GPU. So a 0 here means "this
66+
* rasteriser raised nothing", which is the reading a driver that cannot raise it would always give.
67+
*
68+
* The ledger is therefore a REGRESSION GUARD FOR THE SWIFTSHADER PATH and nothing more. It will catch a
69+
* new GL error class that even SwiftShader validates; it cannot confirm the real-driver storm is fixed.
70+
* A real reading has to come from a real GPU — the operator's own Chrome, which is where the original
71+
* ~256-per-load observation came from (.claude/rules/gates-and-probes.md).
72+
*
73+
* This limit is stated here rather than discovered later because a ledger seeded at 0 reads like an
74+
* all-clear, and an all-clear from an instrument that cannot see the thing is the DEGRADED shape — the
75+
* most dangerous of the three, because it looks like success.
5776
*/
5877
export const GL_LEDGER_PATH = resolve(ROOT, 'frontend/tests/gates/.gl-error-ledger.json');
5978

‎frontend/scripts/visual/gpu-cost-probe.mjs‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
import puppeteer from 'puppeteer';
4343
import { writeFileSync } from 'node:fs';
4444
import { resolve } from 'node:path';
45-
import { execSync } from 'node:child_process';
45+
import os from 'node:os';
4646
import { serveVite, probePort } from './_serve.mjs';
4747

4848
const PORT = probePort(import.meta.url);
@@ -57,11 +57,11 @@ const SECONDS = Number(arg('--seconds', '6'));
5757
const DPR = Number(arg('--dpr', '1'));
5858
const JSON_OUT = arg('--json', '');
5959

60-
const loadAvg = () => {
61-
try {
62-
return execSync('uptime', { encoding: 'utf8' }).match(/load averages?: ([\d.]+)/)?.[1] ?? '?';
63-
} catch { return '?'; }
64-
};
60+
// os.loadavg() rather than shelling out to `uptime`: knip correctly flagged the latter as an unlisted
61+
// binary, and the builtin is better anyway — no subprocess, no PATH dependency, no output parsing, and it
62+
// works on any platform Node runs on. An allowlist entry would have silenced the finding rather than
63+
// removing the dependency.
64+
const loadAvg = () => os.loadavg()[0].toFixed(2);
6565

6666
async function main() {
6767
const { url, waitReady, shutdown } = serveVite(PORT, { preview: true });

0 commit comments

Comments
 (0)