Skip to content

feat(perf-kit): check rendered output against the original build - #11140

Merged
IWANABETHATGUY merged 2 commits into
feat/metrics-lab-nodefrom
feat/metrics-lab-parity
Oct 29, 2026
Merged

IWANABETHATGUY merged 2 commits into
feat/metrics-lab-nodefrom
feat/metrics-lab-parity

Conversation

@IWANABETHATGUY

@IWANABETHATGUY IWANABETHATGUY commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Compare every build's rendered output with the original build so that an LCP gain from a page that broke (a style that stopped applying, a font that never loads, a placeholder that became the LCP element) doesn't count.

The demo app with its hero heading hidden:

vs pinned baseline: LCP -328ms (-26.5%) -> improvement beyond noise (noise threshold 30ms)
next: NOT a keeper - this build renders differently from the original (see "rendered output" below), so this LCP number does not count. Revert the change that broke it, rebuild, re-scan.

rendered output vs the original build (saved 2026-10-06 17:00 UTC, commit c0a11debd):
  /  OPEN - first screen: 1.4% of pixels changed (1 region); full page: 0.8% of pixels changed (1 region); text: 1 line(s) missing, 0 new; accessible names: 1 missing, 0 new; LCP element changed: h1#hero-title 900x114 "Ship faster with Quokka Analytics" -> p#hero-subtitle 900x26 "Handcrafted insights, checksum 1477e1d1,"
      first screen region 808x48 at 32,136: h1#hero-title "Ship faster with Quokka Analyt": visibility visible -> hidden
      text missing: "Ship faster with Quokka Analytics"
      accessible names missing: "heading \"Ship faster with Quokka Analytics\""

The design notes are in the "Rendered-output parity" section of packages/perf-kit/README.md.

requires #10601

@cloudflare-workers-and-pages

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

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://feat-metrics-lab-parity-rolldown-rs.voidzero-docs.workers.dev (commit 7bcb507)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://3b523649-rolldown-rs.voidzero-docs.workers.dev 7bcb507 2026-10-29T12:13:26.108Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://9861f866-rolldown-rs.voidzero-docs.workers.dev 18e626a 2026-10-28T15:59:40.923Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://697b8a9b-rolldown-rs.voidzero-docs.workers.dev ba6bcbd 2026-10-28T13:20:40.573Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://1f7945a7-rolldown-rs.voidzero-docs.workers.dev a27d0e3 2026-10-28T03:58:30.960Z Visit the dashboard ↗
  • Build: In progress 🔵

View logs ↗
c61c4f6 2026-10-28T03:50:04.883Z View logs ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://f4baaba8-rolldown-rs.voidzero-docs.workers.dev eff1c1f 2026-10-15T01:45:25.582Z Visit the dashboard ↗
  • Build: Failed ❌

View logs ↗
6cfb7ed 2026-10-06T17:24:57.229Z View logs ↗

@netlify

netlify Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for rolldown-rs ready!

Name Link
🔨 Latest commit 7bcb507
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/6ae337fa015a1bea622e3f3c
😎 Deploy Preview https://deploy-preview-11140--rolldown-rs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@IWANABETHATGUY
IWANABETHATGUY force-pushed the feat/metrics-lab-parity branch from 6cfb7ed to eff1c1f Compare October 15, 2026 01:43
@IWANABETHATGUY
IWANABETHATGUY force-pushed the feat/metrics-lab-parity branch from eff1c1f to c61c4f6 Compare October 28, 2026 03:50
@IWANABETHATGUY
IWANABETHATGUY force-pushed the feat/metrics-lab-parity branch from a27d0e3 to ba6bcbd Compare October 28, 2026 13:17
@IWANABETHATGUY IWANABETHATGUY changed the title feat(metrics-lab): check rendered output against the original build feat(perf-kit): check rendered output against the original build Oct 28, 2026
@IWANABETHATGUY
IWANABETHATGUY force-pushed the feat/metrics-lab-parity branch from ba6bcbd to 33b9491 Compare October 28, 2026 15:34
@IWANABETHATGUY
IWANABETHATGUY force-pushed the feat/metrics-lab-parity branch from 33b9491 to 18e626a Compare October 28, 2026 15:50
@IWANABETHATGUY
IWANABETHATGUY marked this pull request as ready for review October 29, 2026 02:11
An LCP gain only counts if the page still renders what it rendered before.
Agent runs broke a style, deferred a font that then never loaded, or let a
placeholder become the LCP element, and the harness counted the faster number.

The first scan/measure/parity of a target now copies the build as the
original. Every full scan renders the original and the current build back to
back in one browser session and compares, per pinned page: first-screen and
full-page pixels, page height, visible text, accessible names, new runtime
errors, and the LCP element from the timed runs. A difference opens the
verdict, turns "keep" into "NOT a keeper" and blocks pinning.

Captures are stabilized the way hosted visual-regression tools do it, and the
noise is measured rather than guessed: the original renders twice under
different clocks and random seeds, and whatever differs between those two is
never judged.
…ver mode

Checking on every scan cost three page loads per page on each iteration, mostly
to confirm that nothing changed. The comparison now runs once, when the
optimizing is done (`scan --parity`), and the verdict holds it as PENDING until
then. Scans only report whether the LCP element is still the original's, which
the timed runs already observe.

A difference starts recover mode: the agent picks how to re-check its fixes
(every scan with `parity strategy each-tweak`, or `parity` on demand, `--only`
for the broken pages), every check is recorded with its snapshot images
(`parity history`), and `parity --exit-code` lets `git bisect run` find the
kept change that broke the page. A check of every page without a difference
ends it.
@IWANABETHATGUY
IWANABETHATGUY force-pushed the feat/metrics-lab-parity branch from 18e626a to 7bcb507 Compare October 29, 2026 12:11
@IWANABETHATGUY
IWANABETHATGUY merged commit d2d8295 into main Oct 29, 2026
77 of 88 checks passed
@IWANABETHATGUY
IWANABETHATGUY deleted the feat/metrics-lab-parity branch October 29, 2026 12:26
@rolldown-guard rolldown-guard Bot mentioned this pull request Oct 29, 2026
shulaoda added a commit that referenced this pull request Oct 29, 2026
## [1.2.16] - 2026-10-29

### 🚀 Features

- perf-kit: check rendered output against the original build (#11140) by @IWANABETHATGUY
- perf-kit: node/deno server startup mode (#10601) by @IWANABETHATGUY
- perf-kit: browser page-load perf harness for coding agents (#10365) by @IWANABETHATGUY
- devtools: report mode - agent-readable build metrics report (#10364) by @IWANABETHATGUY
- inline-common-chunks: print record factories parenthesized so they compile eagerly (#11282) by @mattlewis92
- fold `'key' in ns` on namespace imports with statically known exports (#11333) by @danielroe
- inline-common-chunks: inline chunks using `import.meta.hot` in dev mode (#11339) by @hyfdev
- support `experimentalInlineCommonChunks` in dev mode (#11335) by @hyfdev
- use `INVALID_TLA_FORMAT` error for Rollup compatibility (#11266) by @sapphi-red

### 🐛 Bug Fixes

- await bundle.close() in loadConfig and clean up every generated config file (#10347) by @Brooooooklyn
- deps: update mimalloc-safe to 0.1.69 (#11376) by @shulaoda
- transform: don't crash when the working directory has been deleted (#11352) by @shulaoda
- import-glob: follow directory symlinks on the wasm binding (#10624) by @hyfdev
- tree-shaking: preserve exported rest bindings from dynamic imports (#11365) by @shuvroroy
- transform: report `tsconfigFilePaths` for a tsconfig resolved through `TsconfigCache` (#11346) by @cainrus
- tsconfig: don't apply tsconfig when resolving imports from virtual modules (#11089) by @rubas
- code-splitting: handle emitted entries the same as `input` entries when placing the runtime (#11353) by @IWANABETHATGUY
- error: make Diagnostic::add_file idempotent (#10610) by @Nic-Polumeyv
- avoid retaining callable builtin callback owners (#10961) by @IWANABETHATGUY
- code-splitting: only host the runtime in a chunk that every consumer's entries load (#11293) by @IWANABETHATGUY
- code-splitting: keep the source order of chunk imports (#11298) by @IWANABETHATGUY
- dev: don't treat a wrapped module's init as a no-op in dev mode (#11334) by @hyfdev
- treat `cwd` as a literal path in relative glob filters (#11291) by @onmax
- deps: update emnapi to 2.0.0-beta.2 and pin `@napi-rs/wasm-runtime` to 1.2.6 (#11292) by @IWANABETHATGUY
- chunk-import-map: hash stable module ids so keys don't depend on the build folder (#11277) by @mandyheg
- respect CPU limits when sizing native runtime workers (#11280) by @Brooooooklyn
- deconflict the namespace of a module without module syntax (#11256) by @IWANABETHATGUY
- code-splitting: rebuild an absorbed dynamic entry's namespace from what its imports read (#11200) by @mattlewis92
- escape line terminators in debug-info comments (#11258) by @IWANABETHATGUY

### 🚜 Refactor

- extract callable builtin hook wrapper (#10964) by @IWANABETHATGUY

### 📚 Documentation

- add an in-depth explanation for inline common chunks (#11239) by @hyfdev

### ⚡ Performance

- incremental cycle check for `avoidRedundantChunkLoads` (#11320) by @IWANABETHATGUY
- avoid copying module code for `renderedLength` and share `chunk.code` across plugins (#11342) by @IWANABETHATGUY
- count UTF-16 lengths with `simd-utf16-len` (#11259) by @IWANABETHATGUY
- don't load consola when importing rolldown (#11257) by @magurotuna

### 🧪 Testing

- dev: cover hot updates that need modules the tab never received (#9647) by @matthewdavis-oai
- dev: add dynamic import rebuild test (#7123) by @sapphi-red
- code-splitting: import file URLs in fresh-process runtime host tests on Windows (#11354) by @shulaoda
- esbuild: mark loader_data_url_base64_invalid_utf8 as an intentional difference (#10790) by @CoderSerio
- watch: fix flaky `watch buildDelay` (#11175) by @Brooooooklyn

### ⚙️ Miscellaneous Tasks

- install `cmake-core` instead of the `cmake` metapackage on FreeBSD (#11361) by @shulaoda
- deps: update oxc to 0.156.0 (#11326) by @Dunqing
- stop the Discord notification when the metric workflow fails (#11357) by @IWANABETHATGUY
- connect to the Void platform before the docs deploy (#11350) by @shulaoda
- deps: update rust crates (#11297) by @renovate[bot]
- deps: update dependency vite-plus to v1.4.0 (#11288) by @renovate[bot]
- deps: update npm packages (#11296) by @renovate[bot]
- deps: update napi (#11287) by @renovate[bot]
- deps: update rollup submodule for tests to v4.65.1 (#11331) by @rolldown-guard[bot]
- deps: update test262 submodule for tests (#11332) by @rolldown-guard[bot]
- deps: update dependency rolldown-plugin-dts to v0.28.8 (#11286) by @renovate[bot]
- deps: bump tokio to 1.53.3 (#11317) by @Brooooooklyn

### ❤️ New Contributors

* @mattlewis92 made their first contribution in [#11282](#11282)
* @shuvroroy made their first contribution in [#11365](#11365)
* @cainrus made their first contribution in [#11346](#11346)
* @matthewdavis-oai made their first contribution in [#9647](#9647)
* @rubas made their first contribution in [#11089](#11089)
* @danielroe made their first contribution in [#11333](#11333)
* @onmax made their first contribution in [#11291](#11291)
* @mandyheg made their first contribution in [#11277](#11277)
* @magurotuna made their first contribution in [#11257](#11257)

Co-authored-by: shulaoda <[email protected]>
IWANABETHATGUY pushed a commit that referenced this pull request Oct 30, 2026
## [0.0.1] - 2026-10-30

### 🚀 Features

- perf-kit: check rendered output against the original build (#11140) by
@IWANABETHATGUY
- perf-kit: node/deno server startup mode (#10601) by @IWANABETHATGUY
- perf-kit: browser page-load perf harness for coding agents (#10365) by
@IWANABETHATGUY

### ⚙️ Miscellaneous Tasks

- release `@rolldown/perf-kit` independently (#11394) by @shulaoda

Co-authored-by: shulaoda <[email protected]>
IWANABETHATGUY added a commit that referenced this pull request Nov 4, 2026
Measure a Vite-built Cloudflare Worker's startup under the app's own
workerd and attribute it to modules, with the loop the browser and node
modes have: `worker-config` writes a Vite config that puts the rolldown
metrics report on every environment; `worker-scan` times the main
module's import on fresh workerd instances minus an empty-import floor,
hits the pinned requests on the real entry, profiles the import, and
takes precise coverage from inside the isolate (wrangler >= 4.108.0, or
`--tools <dir>` for that run); `worker-attrib` charges startup CPU to
the evaluating module from a preserveModules build; `why <module>` lists
the importers and the chain; `cut --root a,b` keeps Durable Object class
modules eager so the cut lands below them.

cloudflare/agents-starter after one scan:

```
[consolidated] 5 cold runs (fresh workerd each)
startup 23ms (p75 24ms) | floor 4ms | app 19ms | instance boot 87ms (not counted)
guard: PASS
first requests on the real entry (startup already done; a deferred module loads on its first hit):
  /                            200      6ms  785 bytes
  /agents/chat-agent/default   404      9ms  15 bytes
startup CPU (profile): active 24ms = app modules 10ms (57.1%) + runtime 3ms + engine 4ms + parse/compile "(program)" 4ms; GC 4ms; 168 samples
  top self-time at startup:
          5ms  ../../node_modules/zod/v4/core/core.js
          4ms  (engine: gc)
          3ms  ../../node_modules/zod/v4/classic/schemas.js
          3ms  (unmapped)
          1ms  ../../node_modules/zod/v4/core/util.js
          1ms  ../../node_modules/zod/v4/core/schemas.js
  3ms sits in chunk top-level code V8 gave no line ticks for - `node harness.mjs worker-attrib` on an attribution build charges it to the evaluating module
evaluated at startup: 547.3KB of 1940.2KB in the static closure (183 modules, 28% executed); 4 runtime module(s) loaded (node-internal:internal_inspector, cloudflare:workers, node:async_hooks, node:diagnostics_channel)
cold at startup - in the closure, never executed to start (2):
      24.5KB  ../../node_modules/@cfworker/json-schema/dist/esm/validate.js
       4.3KB  ../../node_modules/zod/v3/locales/en.js
parsed but mostly not executed at startup (libraries run a slice of themselves at import; the rest is load cost):
     202.3KB idle of   269.3KB   25% executed  ../../node_modules/agents/dist/index.js
     172.5KB idle of   184.0KB    6% executed  ../../node_modules/ai/dist/index.mjs
     102.0KB idle of   152.7KB   33% executed  ../../node_modules/@cloudflare/ai-chat/dist/index.js
      75.5KB idle of    84.7KB   11% executed  ../../node_modules/zod/v3/types.js
      64.9KB idle of    77.0KB   16% executed  ../../node_modules/workers-ai-provider/dist/index.mjs
      62.9KB idle of   120.8KB   48% executed  ../../node_modules/agents/dist/chat/index.js
      52.3KB idle of    58.0KB   10% executed  ../../node_modules/@ai-sdk/provider-utils/dist/index.mjs
```

Shared changes, used by every mode: profile attribution splits a frame's
self-time by its line ticks and maps every chunk that has a sourcemap
(checklist A4); the ownership split counts multi-chunk source rows as
app code; `cut --root`.

Shaped on cloudflare/agents-starter and cloudflare/vibesdk; the vibesdk
pass is cloudflare/vibesdk#466 (`wrangler check startup`: 102.5 ms ->
63.3 ms). Design notes: "Worker startup mode (Cloudflare Workers)" in
`packages/perf-kit/README.md`; the agent contract in `AGENTS.md`.

The first commit, the `serve.mjs` socket fix, is a parity matter and can
move down into #11140.

requires #11140
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants