Skip to content

ci(bench): rebaseline the CSS-module client minified ratio after #1762 - #1843

Merged
trueadm merged 1 commit into
mainfrom
test/css-modules-client-ratio-rebaseline
Oct 7, 2026
Merged

trueadm merged 1 commit into
mainfrom
test/css-modules-client-ratio-rebaseline

Conversation

@trueadm

@trueadm trueadm commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This is a ratios-only rebaseline. One guard changes in benchmarks/baselines/ratios.json: the codegen-size minified guard for css-modules-client-proven against css-modules-client-control goes from 0.84 to 0.91. Its note records the measurements and the cause.

This is an expected rebaseline, not a regression in the compiler's CSS-module constant folding. e233e4a (#1762) made the control variant's class bindings cheaper. The proven variant had already removed those bindings, so its saving relative to the control fell. The folding itself is unchanged.

Why

On main, node benchmarks/bench.mjs --quick --ratios codegen-size fails with 2,294 / 2,582 = 0.888×, above maxRatio 0.84. Bench runs weekly and on manual dispatch, so the next scheduled run would report it.

The lane is compiler-only (benchmarks/codegen-size/css-modules.mjs). I compiled and minified the client fixture with the compiler from e233e4a^ and from e233e4a, then compared the outputs.

client, minified control proven ratio saving
e233e4a^ 3,890 3,183 0.818× 707 B
e233e4a (= b8e55da) 2,582 2,294 0.888× 288 B

Evidence that this is a rebaseline:

  • The folding is identical. In both commits the proven variant folds the same 15 of the 18 class attributes into its templates. Its template strings are byte-identical across the two commits (same SHA-1). The ceiling variant folds all 18 in both. The control folds none in both.
  • What changed is the cost of each control binding. Before perf(octane): stop shipping the signal binding runtime in apps without signals #1762, every opaque class={styles.x} hole could carry a signal handle, so the control emitted e.d=l(n,e.d,e.e,"class",a.header,"b:1d1fd180","class") (bindSignalAttribute). After it, a module without signals emits e.d=t(n.header,e.d,e.e) (setClassNameIfChanged). The 15 bindings the proof removes cost 755 minified bytes before and 352 after. That 403 B accounts for almost all of the 419 B drop in the saving.
  • The rest is the import list. Before perf(octane): stop shipping the signal binding runtime in apps without signals #1762, setClassNameIfChanged was imported only by the control; now both variants import it, which is about 27 B. Minifier renaming accounts for the last few bytes.
  • Both variants shrank. Text holes also lost their bindSignalText path in both, which shrinks the denominator but not the saving.

Changes

No other guard changes. Every sibling CSS guard moved with #1762 but still passes. Raising a guard that passes would only loosen it:

guard ceiling e233e4a^ now
css-modules-client raw 0.75 0.745 0.740
css-modules-client gzip 0.86 0.784 0.824
css-modules-client brotli 0.86 0.802 0.823
css-modules-server raw 0.84 0.805 0.830
css-modules-server minified 0.89 0.865 0.873
css-modules-server gzip / brotli 0.96 / 0.96 0.939 / 0.916 0.949 / 0.925
rspack-css-named-client minified / gzip / brotli 0.84 / 0.88 / 0.90 0.753 / 0.790 / 0.803 0.745 / 0.818 / 0.828
rspack-css-named-server minified / gzip / brotli 0.88 / 0.99 / 0.98 0.723 / 0.928 / 0.916 0.779 / 0.939 / 0.924
rspack-css-default-client minified / gzip / brotli 0.86 / 0.88 / 0.90 0.791 / 0.817 / 0.830 0.801 / 0.840 / 0.830
rspack-css-default-server minified / gzip / brotli 0.90 / 0.96 / 0.96 0.789 / 0.945 / 0.928 0.854 / 0.955 / 0.934

The raw values depend on the checkout path, because esbuild's unminified output includes absolute namespace paths. The "now" column is from this worktree. Minified, gzip and Brotli do not depend on the path.

Validation

  • node benchmarks/bench.mjs --quick --ratios codegen-size on this head: PASS — no ratio guards breached (34 guards). On main the same command reports the one breach.

  • The same command in detached checkouts of e233e4a^ (passes, 0.818×) and e233e4a (breaches, 0.888×), each with its own pnpm install --frozen-lockfile.

  • Negative check against the new ceiling. I compiled with a proof that withholds some classes:

    classes withheld minified gzip brotli
    1 0.900 0.844 0.845
    3 0.908 0.861 (breaches 0.86) 0.857
    4 0.910 (breaches 0.91) 0.867 0.856
    all 15 1.000 1.000 1.000

    So withholding 3 or more of the 15 folds still breaches a guard.

  • pnpm format:files:check benchmarks/baselines/ratios.json

  • pnpm sync (no generated changes)

  • pnpm format:check, pnpm typecheck, pnpm test: not run. The diff is one JSON value and its note.

Risk / follow-ups

  • The minified guard is now the second most sensitive client CSS guard: gzip at 0.86 trips first, on 3 withheld folds. A tighter 0.90 would trip on a single withheld fold with 1 B to spare, so unrelated compiler changes would breach it.
  • benchmarks/compiler-output/server.md mentions this guard breaching at an older revision. That is a historical measurement, so it is left as written.

Provenance

  • An agent produced this diff (agent-authored)

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Note

Low Risk
Only adjusts a CI benchmark threshold and documentation in JSON; no runtime or compiler behavior changes.

Overview
Updates the codegen-size minified ratio guard for css-modules-client-proven vs css-modules-client-control in benchmarks/baselines/ratios.json: maxRatio 0.84 → 0.91, with an expanded note documenting the 2026-10-07 measurement and why the ceiling moved.

This is a benchmark rebaseline, not a change to CSS-module constant folding. After #1762, the control client emits cheaper per-class bindings (setClassNameIfChanged instead of bindSignalAttribute), so the proven variant’s relative minified savings dropped (~707 B → ~288 B) even though both still fold the same 15 classes. The new 0.91 cap matches the measured ~0.888× ratio and leaves ~55 B headroom so bench.mjs --quick --ratios codegen-size passes again.

Reviewed by Cursor Bugbot for commit 788d11c. Bugbot is set up for automated code reviews on this repo. Configure here.

The codegen-size guard for css-modules-client-proven/control minified has
breached on main since e233e4a (#1762): 2294 / 2582 = 0.888x against a
0.84 ceiling (0.818x at e233e4a^, 3183 / 3890).

#1762 binds opaque holes in modules without signals through plain
writers, so each control class binding shrank from bindSignalAttribute
(seven arguments plus a signal key) to setClassNameIfChanged. The 15 class
bindings the CSS proof removes fell from 755 to 352 minified bytes, so the
saving fell from 707 to 288 B. The proof itself did not change: both
commits fold the same 15 of 18 classes into byte-identical templates.

Raise the ceiling to 0.91 (55 B headroom, 2.4%, against 84 B, 2.6%,
before). No other guard changes; every sibling CSS guard still passes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added agent-authored Diff or issue body substantially produced by an AI agent ci PR: CI or build pipeline labels Oct 7, 2026
@trueadm
trueadm marked this pull request as ready for review October 7, 2026 10:46
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Benchmark report

  • 🟡 js-framework: 1 timed operation(s) slower beyond ±3%

Compares b8e55da03, the merge commit's first parent with a2c9ab9ea on the same runner. A byte value over its committed budget or any increase in a js-framework work counter fails this check. Wall time is a report: base and head samples alternate in one browser, and an operation is called slower or faster only when the 95% confidence interval of its ratio excludes ±3%. Workflow run

js-framework: 1k/10k row operations

target operation base ms head ms head/base 95% CI
octane-jsx select 0.126 0.134 +9.1% +5.5% … +15.3% 🟡 slower
All 20 timed operations (19 without a verdict)
target operation base ms head ms head/base 95% CI
octane-tsrx run 2.517 2.667 ±0.0% −3.8% … +7.7% ⚪ within noise
octane-tsrx replace 6.025 6.175 ±0.0% −3.3% … +3.4% ⚪ within noise
octane-tsrx add 2.367 2.325 −0.0% −4.0% … +2.1% ⚪ within noise
octane-tsrx update 0.121 0.122 +1.0% ±0.0% … +2.8% ⚪ within noise
octane-tsrx select 0.005 0.005 +0.3% −0.3% … +1.1% ⚪ within noise
octane-tsrx swap 0.031 0.031 −1.4% −4.5% … +2.3% ⚪ within noise
octane-tsrx remove 0.014 0.014 −2.2% −4.7% … −0.9% ⚪ within noise
octane-tsrx runlots 22.933 23.275 +0.4% −2.6% … +2.6% ⚪ within noise
octane-tsrx select_lots 0.006 0.006 +1.8% +0.9% … +2.4% ⚪ within noise
octane-tsrx clear 41.400 41.600 +0.2% −0.7% … +1.5% ⚪ within noise
octane-jsx run 3.200 3.117 −2.8% −5.1% … ±0.0% ⚪ within noise
octane-jsx replace 6.008 5.825 −1.7% −4.6% … +0.8% ⚪ within noise
octane-jsx add 3.025 2.917 −0.0% −5.9% … +3.4% ⚪ within noise
octane-jsx update 0.238 0.242 +2.3% +0.7% … +3.1% ⚪ within noise
octane-jsx select 0.126 0.134 +9.1% +5.5% … +15.3% 🟡 slower
octane-jsx swap 0.211 0.216 +2.3% +2.0% … +2.9% ⚪ within noise
octane-jsx remove 0.167 0.167 +1.2% +0.0% … +2.3% ⚪ within noise
octane-jsx runlots 28.708 29.125 +0.2% −3.9% … +2.6% ⚪ within noise
octane-jsx select_lots 1.475 1.481 +2.4% −1.1% … +5.9% ⚪ within noise
octane-jsx clear 45.183 42.258 −3.8% −5.5% … −1.0% ⚪ within noise

All 64 work counters are unchanged.

Application bundle size (bytes)

No changes across 60 measured values.

Public-import reachability bundles (bytes)

No changes across 108 measured values.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
octane-website 788d11c Commit Preview URL

Branch Preview URL
Oct 07 2026, 11:14 AM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
octane-website-mcp 788d11c Commit Preview URL

Branch Preview URL
Oct 07 2026, 11:16 AM

@trueadm
trueadm merged commit 56f232e into main Oct 7, 2026
53 checks passed
@trueadm
trueadm deleted the test/css-modules-client-ratio-rebaseline branch October 7, 2026 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-authored Diff or issue body substantially produced by an AI agent ci PR: CI or build pipeline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant