test(tests): R4.3d browser proofs on the production build: app import baseline on the Rust path, CSP with and without the keyword, leak series, WebKit repetition

Same perimeter as the TS baseline (226 files, 3 engines, real Home page): 666/678 outcome
and message agreements, the 12 others the 4 declared files; W5 0 long tasks (TS 91 and
173 ms); 50 MiB file in WebKit 145/126 MiB against 324 with the worker read and 76 for the
TS. CSP: editor opens with the keyword, the engine message without, in 3 engines, the
worker's wasm-eval refusal reported by Chromium and Firefox. Leak series on the app:
Chromium ≤ 2 MiB per import after init, Firefox GC sawtooth reclaimed, WebKit grows with
same-tab navigations (control too) and levels off on one page; 20/20 WebKit workers closed.
This commit is contained in:
bchanot committed 2026-10-18 19:48:31 +02:00
1 parent 8ddf185aa6
commit 08f01ef363
17 files changed
+26759 -28

No files matched your search

+13 -3
View File
@@ -1,12 +1,15 @@
import { execFileSync } from 'node:child_process'
import { existsSync, readdirSync, statSync } from 'node:fs'
import { existsSync, readFileSync, readdirSync, statSync } from 'node:fs'
import { join } from 'node:path'
import { sha256 } from './inputs.mjs'
import { DIST_DIR, REPO_ROOT } from './paths.mjs'
/**
* The harness measures a production build that embeds the reference sheet.
* It never builds by itself: the build command is printed instead, so a run
* always names the build it measured (mtime, chunk sizes, HEAD).
* always names the build it measured (mtime, chunk sizes and digests, HEAD).
* `headCommit` is HEAD when the run starts, which can differ from the commit
* the build was made from: the chunk digests identify the build itself.
*/
export const BUILD_COMMAND =
@@ -17,7 +20,13 @@ const MIN_SHEET_CHUNK_BYTES = 10_000
function assetSize(pattern) {
const assets = join(DIST_DIR, 'assets')
const name = readdirSync(assets).find((file) => pattern.test(file))
return name ? { name, bytes: statSync(join(assets, name)).size } : null
if (!name) return null
const path = join(assets, name)
return {
name,
bytes: statSync(path).size,
sha256: sha256(readFileSync(path)),
}
}
function headCommit() {
@@ -44,6 +53,7 @@ export function checkBuild() {
sheetChunk: sheet,
entryChunk: assetSize(/^index-.*\.js$/),
wasm: assetSize(/\.wasm$/),
importWorker: assetSize(/^import\.worker-.*\.js$/),
headCommit: headCommit(),
}
}
+15
View File
@@ -117,6 +117,21 @@ export function installProbes() {
listenToEvents()
}
/**
* Counts the inline import error lines HomeRoute inserts (`window.__errorLines`):
* a new pick removes the line, its end adds it again, so several picks on one
* page each end with one more insertion, even when the text repeats.
*/
export function countErrorLines() {
window.__errorLines = 0
const isLine = (n) => n.nodeType === 1 && n.matches('p.text-red-700')
new MutationObserver((records) => {
for (const r of records) {
window.__errorLines += [...r.addedNodes].filter(isLine).length
}
}).observe(document.body, { childList: true, subtree: true })
}
/** Reads the probe back (a structured-clone copy). */
export const readProbe = () => window.__harness