From 68081d8c9fa2eabed18167b6b59b3ae5988fef7a Mon Sep 17 00:00:00 2001 From: Aron Date: Sun, 8 Nov 2026 02:18:42 +0800 Subject: [PATCH 1/5] Build(Rust): Restore unchanged Wasm artifacts from the Turbo cache build:rust:wasm called cargo xtask build-wasm directly, bypassing the cached build:artifacts tasks. Every CI job therefore spent about 3.5 minutes recompiling the Wasm bindings, after which Turbo replayed its cached outputs over them anyway. Running the same tasks through Turbo compiles only when crates, Cargo or the toolchain change and restores byte-identical artifacts otherwise. Co-Authored-By: Claude Opus 5.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index da76b0fdc..31750f86b 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "postinstall": "bun scripts/isolate-tooling-typescript.mjs && bun --bun husky install", "build": "bun scripts/storage-retention.mjs --apply --auto && bun run build:rust:wasm && bun ./node_modules/turbo/bin/turbo run build --filter=\"./packages/*\"", "build:rust:native": "cargo xtask build-native --release", - "build:rust:wasm": "cargo xtask build-wasm all", + "build:rust:wasm": "bun ./node_modules/turbo/bin/turbo run build:artifacts --filter=\"./packages/binding-wasm-*\"", "build:site": "bun scripts/storage-retention.mjs --apply --auto && bun run build && bun run --filter site build", "build:site:cloudflare-pages": "bash scripts/build-site-hosted.sh", "build:examples": "bun ./node_modules/turbo/bin/turbo run build --filter=\"./examples/*\"", From ea018df526efdf661252ec155f22b256ff16a82a Mon Sep 17 00:00:00 2001 From: Aron Date: Sun, 8 Nov 2026 02:18:42 +0800 Subject: [PATCH 2/5] Test(Site): Verify release pages two at a time within each browser Each engine walked its 68 profiles one by one, mostly waiting for network idle, fonts and axe. A small pool per engine (--concurrency, default 2) overlaps that waiting; on efficiency cores the run dropped from 198s to 133s. Entries are sorted by their place in the profile matrix, so the report is identical to the sequential one. Co-Authored-By: Claude Opus 5.5 --- site/scripts/verify-release-site.mjs | 33 ++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/site/scripts/verify-release-site.mjs b/site/scripts/verify-release-site.mjs index f2debb4ac..8909d0384 100644 --- a/site/scripts/verify-release-site.mjs +++ b/site/scripts/verify-release-site.mjs @@ -14,6 +14,8 @@ const out = path.resolve(argument('--out', 'site/out')) const origin = new URL(argument('--origin', 'https://css.master.co')).origin const reportPath = path.resolve(argument('--report', 'site/test-results/release-site/report.json')) const engines = argument('--browsers', 'chromium,firefox,webkit').split(',') +const concurrency = Number(argument('--concurrency', '2')) +assert.ok(Number.isInteger(concurrency) && concurrency > 0, '--concurrency is a positive integer of pages per engine') const report = { revision: execFileSync('git', ['rev-parse', 'HEAD'], { encoding: 'utf8' }).trim(), origin, out, pages: 0, localLinks: 0, profiles: [], noJavaScript: [], failures: [] } report.sourceStatus = execFileSync('git', ['status', '--porcelain=v1', '--untracked-files=normal'], { encoding: 'utf8' }).trim().split('\n').filter(Boolean) const files = directory => readdirSync(directory, { withFileTypes: true }).flatMap(entry => entry.isDirectory() ? files(path.join(directory, entry.name)) : [path.join(directory, entry.name)]) @@ -53,10 +55,18 @@ const findFile = pathname => { if (file !== out && !file.startsWith(out + path.sep)) return undefined return [file, file + '.html', path.join(file, 'index.html')].find(candidate => existsSync(candidate) && statSync(candidate).isFile()) } -// Engines run concurrently; order their entries by --browsers for a stable report. +// Engines and their pages run concurrently; order entries by --browsers and then +// by their place in the profile matrix for a stable report. const byEngine = (a, b) => engines.indexOf(a.engine) - engines.indexOf(b.engine) +let sortReport = () => { report.profiles.sort(byEngine); report.noJavaScript.sort(byEngine) } +const pool = async (items, run) => { + let next = 0 + await Promise.all(Array.from({ length: Math.min(concurrency, items.length) }, async () => { + while (next < items.length) await run(items[next++]) + })) +} const save = () => { - report.profiles.sort(byEngine); report.noJavaScript.sort(byEngine) + sortReport() mkdirSync(path.dirname(reportPath), { recursive: true }); writeFileSync(reportPath, JSON.stringify(report, null, 2) + '\n') } const check = async (name, operation) => { @@ -160,14 +170,23 @@ if (!process.argv.includes('--static-only')) { ...edition, route: edition.prefix + suffix || '/' }))) routes.push(...['/guide/migration', '/guide/language-service'].map(route => ({ ...editions[0], route }))) + const profiles = routes.flatMap(route => [390, 1280].flatMap(width => ['light', 'dark'].map(scheme => ({ ...route, width, scheme })))) + const profileIndex = ({ route, width, scheme }) => profiles.findIndex(profile => profile.route === route && profile.width === width && profile.scheme === scheme) + const editionIndex = ({ language }) => editions.findIndex(edition => edition.language === language) + sortReport = () => { + report.profiles.sort((a, b) => byEngine(a, b) || profileIndex(a) - profileIndex(b)) + report.noJavaScript.sort((a, b) => byEngine(a, b) || editionIndex(a) - editionIndex(b)) + } try { // Each engine has its own browser process and checks; running them together - // takes the slowest engine's time instead of the sum of all three. + // takes the slowest engine's time instead of the sum of all three. Every + // profile has its own context, so a few also run at once within an engine: + // most of a profile's time is spent waiting for network idle, fonts and axe. await Promise.all(engines.map(engine => check(`${engine}: launch and profiles`, async () => { assert.ok({ chromium, firefox, webkit }[engine], `unknown browser ${engine}`) const browser = await ({ chromium, firefox, webkit })[engine].launch() try { - for (const { route, language, search } of routes) for (const width of [390, 1280]) for (const scheme of ['light', 'dark']) await check(`${engine} ${route} ${width} ${scheme}`, async () => { + await pool(profiles, ({ route, language, search, width, scheme }) => check(`${engine} ${route} ${width} ${scheme}`, async () => { const context = await browser.newContext({ viewport: { width, height: 1000 }, colorScheme: scheme, reducedMotion: 'reduce' }) try { const page = await context.newPage() @@ -197,8 +216,8 @@ if (!process.argv.includes('--static-only')) { assert.deepEqual(errors, []) report.profiles.push({ engine, route, width, scheme, axeRules: audit.passes.length, incomplete: audit.incomplete.map(({ id }) => id) }) } finally { await context.close(); save() } - }) - for (const { prefix, language } of editions) await check(`${engine}: ${language} no-JavaScript reading`, async () => { + })) + await pool(editions, ({ prefix, language }) => check(`${engine}: ${language} no-JavaScript reading`, async () => { const page = await browser.newPage({ javaScriptEnabled: false, viewport: { width: 390, height: 900 } }) try { assert.equal((await page.goto(base + prefix + '/guide/installation')).status(), 200) @@ -209,7 +228,7 @@ if (!process.argv.includes('--static-only')) { if (language === 'en') assert.ok(article.includes('Installation')) report.noJavaScript.push({ engine, language, route: prefix + '/guide/installation' }) } finally { await page.close() } - }) + })) } finally { await browser.close() } }))) } finally { await new Promise(resolve => server.close(resolve)) } From 086c5349e55ceecb83f43cf0431af3844cbaf1a2 Mon Sep 17 00:00:00 2001 From: Aron Date: Sun, 8 Nov 2026 02:18:42 +0800 Subject: [PATCH 3/5] CI(Validation): Skip the second i18n audit after the site build The site build already runs audit:i18n before rendering pages. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/validation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index 4a74b9e92..2a21acfcf 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -267,8 +267,8 @@ jobs: if [ "$RELEASE_BUILD" != true ]; then bun run build fi + # The site build already runs audit:i18n before rendering pages. bun run --filter site build - bun run --filter site audit:i18n bun run --filter site test:css-contract node --test site/scripts/verify-release-site.test.mjs node --import tsx --test site/utils/release-code-export.test.ts site/utils/agent-guide-data.test.ts site/utils/agent-content.test.ts From b1f4bfa6ad24a04fc61c17e729d9eee935461af2 Mon Sep 17 00:00:00 2001 From: Aron Date: Sun, 8 Nov 2026 02:29:25 +0800 Subject: [PATCH 4/5] Build(Rust): Build Wasm artifacts one task at a time On a runner without the pinned toolchain, the three cargo xtask tasks started together and each made rustup auto-install it, racing on the same download files ("could not rename 'downloaded' file"). Cargo's build lock already serializes the compiles, so one task at a time costs nothing and lets the first install the toolchain for the rest. Co-Authored-By: Claude Opus 5.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 31750f86b..f75ca5a9a 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "postinstall": "bun scripts/isolate-tooling-typescript.mjs && bun --bun husky install", "build": "bun scripts/storage-retention.mjs --apply --auto && bun run build:rust:wasm && bun ./node_modules/turbo/bin/turbo run build --filter=\"./packages/*\"", "build:rust:native": "cargo xtask build-native --release", - "build:rust:wasm": "bun ./node_modules/turbo/bin/turbo run build:artifacts --filter=\"./packages/binding-wasm-*\"", + "build:rust:wasm": "bun ./node_modules/turbo/bin/turbo run build:artifacts --filter=\"./packages/binding-wasm-*\" --concurrency=1", "build:site": "bun scripts/storage-retention.mjs --apply --auto && bun run build && bun run --filter site build", "build:site:cloudflare-pages": "bash scripts/build-site-hosted.sh", "build:examples": "bun ./node_modules/turbo/bin/turbo run build --filter=\"./examples/*\"", From ccb7439423dc94b8f4da4eaf9187b8acbe4d3560 Mon Sep 17 00:00:00 2001 From: Aron Date: Sun, 8 Nov 2026 03:09:03 +0800 Subject: [PATCH 5/5] Revert "Test(Site): Verify release pages two at a time within each browser" This reverts commit ea018df52. On the 4-vCPU CI runner the three browsers already saturate the CPU: two pages per engine shortened verification only from 414s to 394s, and the extra load made a networkidle navigation time out. The local measurement on efficiency cores did not represent CI. Co-Authored-By: Claude Opus 5.5 --- site/scripts/verify-release-site.mjs | 33 ++++++---------------------- 1 file changed, 7 insertions(+), 26 deletions(-) diff --git a/site/scripts/verify-release-site.mjs b/site/scripts/verify-release-site.mjs index 8909d0384..f2debb4ac 100644 --- a/site/scripts/verify-release-site.mjs +++ b/site/scripts/verify-release-site.mjs @@ -14,8 +14,6 @@ const out = path.resolve(argument('--out', 'site/out')) const origin = new URL(argument('--origin', 'https://css.master.co')).origin const reportPath = path.resolve(argument('--report', 'site/test-results/release-site/report.json')) const engines = argument('--browsers', 'chromium,firefox,webkit').split(',') -const concurrency = Number(argument('--concurrency', '2')) -assert.ok(Number.isInteger(concurrency) && concurrency > 0, '--concurrency is a positive integer of pages per engine') const report = { revision: execFileSync('git', ['rev-parse', 'HEAD'], { encoding: 'utf8' }).trim(), origin, out, pages: 0, localLinks: 0, profiles: [], noJavaScript: [], failures: [] } report.sourceStatus = execFileSync('git', ['status', '--porcelain=v1', '--untracked-files=normal'], { encoding: 'utf8' }).trim().split('\n').filter(Boolean) const files = directory => readdirSync(directory, { withFileTypes: true }).flatMap(entry => entry.isDirectory() ? files(path.join(directory, entry.name)) : [path.join(directory, entry.name)]) @@ -55,18 +53,10 @@ const findFile = pathname => { if (file !== out && !file.startsWith(out + path.sep)) return undefined return [file, file + '.html', path.join(file, 'index.html')].find(candidate => existsSync(candidate) && statSync(candidate).isFile()) } -// Engines and their pages run concurrently; order entries by --browsers and then -// by their place in the profile matrix for a stable report. +// Engines run concurrently; order their entries by --browsers for a stable report. const byEngine = (a, b) => engines.indexOf(a.engine) - engines.indexOf(b.engine) -let sortReport = () => { report.profiles.sort(byEngine); report.noJavaScript.sort(byEngine) } -const pool = async (items, run) => { - let next = 0 - await Promise.all(Array.from({ length: Math.min(concurrency, items.length) }, async () => { - while (next < items.length) await run(items[next++]) - })) -} const save = () => { - sortReport() + report.profiles.sort(byEngine); report.noJavaScript.sort(byEngine) mkdirSync(path.dirname(reportPath), { recursive: true }); writeFileSync(reportPath, JSON.stringify(report, null, 2) + '\n') } const check = async (name, operation) => { @@ -170,23 +160,14 @@ if (!process.argv.includes('--static-only')) { ...edition, route: edition.prefix + suffix || '/' }))) routes.push(...['/guide/migration', '/guide/language-service'].map(route => ({ ...editions[0], route }))) - const profiles = routes.flatMap(route => [390, 1280].flatMap(width => ['light', 'dark'].map(scheme => ({ ...route, width, scheme })))) - const profileIndex = ({ route, width, scheme }) => profiles.findIndex(profile => profile.route === route && profile.width === width && profile.scheme === scheme) - const editionIndex = ({ language }) => editions.findIndex(edition => edition.language === language) - sortReport = () => { - report.profiles.sort((a, b) => byEngine(a, b) || profileIndex(a) - profileIndex(b)) - report.noJavaScript.sort((a, b) => byEngine(a, b) || editionIndex(a) - editionIndex(b)) - } try { // Each engine has its own browser process and checks; running them together - // takes the slowest engine's time instead of the sum of all three. Every - // profile has its own context, so a few also run at once within an engine: - // most of a profile's time is spent waiting for network idle, fonts and axe. + // takes the slowest engine's time instead of the sum of all three. await Promise.all(engines.map(engine => check(`${engine}: launch and profiles`, async () => { assert.ok({ chromium, firefox, webkit }[engine], `unknown browser ${engine}`) const browser = await ({ chromium, firefox, webkit })[engine].launch() try { - await pool(profiles, ({ route, language, search, width, scheme }) => check(`${engine} ${route} ${width} ${scheme}`, async () => { + for (const { route, language, search } of routes) for (const width of [390, 1280]) for (const scheme of ['light', 'dark']) await check(`${engine} ${route} ${width} ${scheme}`, async () => { const context = await browser.newContext({ viewport: { width, height: 1000 }, colorScheme: scheme, reducedMotion: 'reduce' }) try { const page = await context.newPage() @@ -216,8 +197,8 @@ if (!process.argv.includes('--static-only')) { assert.deepEqual(errors, []) report.profiles.push({ engine, route, width, scheme, axeRules: audit.passes.length, incomplete: audit.incomplete.map(({ id }) => id) }) } finally { await context.close(); save() } - })) - await pool(editions, ({ prefix, language }) => check(`${engine}: ${language} no-JavaScript reading`, async () => { + }) + for (const { prefix, language } of editions) await check(`${engine}: ${language} no-JavaScript reading`, async () => { const page = await browser.newPage({ javaScriptEnabled: false, viewport: { width: 390, height: 900 } }) try { assert.equal((await page.goto(base + prefix + '/guide/installation')).status(), 200) @@ -228,7 +209,7 @@ if (!process.argv.includes('--static-only')) { if (language === 'en') assert.ok(article.includes('Installation')) report.noJavaScript.push({ engine, language, route: prefix + '/guide/installation' }) } finally { await page.close() } - })) + }) } finally { await browser.close() } }))) } finally { await new Promise(resolve => server.close(resolve)) }