Repository navigation
test(bench): measure a rolldown + oxc split-chunk shell in bundle-reachability - #2032
Conversation
…chability A production rolldown + oxc app ships Octane as ESM chunks: `codeSplitting` groups put the signal engine and the rest of the octane package in chunks of their own, and the renderer loads on a dynamic-import chain. No reachability fixture built that way, so nothing showed whether the optional-driver eliminations from #1855 and #1942 survive chunk boundaries, or what each chunk costs. The split-shell fixture hydrates a server-rendered shell after activating a renderer-free behavior island, with native reads of imported signals, a visible() Hydrate boundary, a lazy route behind useTransition, @Try over use(), a portal and a keyed list. It reports the whole application and each group's chunk, rejects Octane modules in application chunks, and checks through the source map that the runtime chunk drops the unused ViewTransition and Activity drivers. The chunks run in jsdom linked into one script. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
View logs |
octane-website-mcp | 3ce42c4 | Oct 13 2026, 11:12 AM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
View logs |
octane-website | 3ce42c4 | Oct 13 2026, 11:12 AM |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Chunk linking breaks on Windows paths
- Added
.replaceAll('\\', '/')to thepath.relativeresult inlinkChunks'sresolveIdso the entry branch produces POSIX keys matching the chunkfileNamemap; thesplitGroupsregexes andid.includesguards are not bugs because Rollup/Rolldown module IDs are always forward-slash.
- Added
Or push these changes by commenting:
@cursor push 10e56ad3f6
Preview (10e56ad3f6)
diff --git a/benchmarks/bundle-size/run-minimal.mjs b/benchmarks/bundle-size/run-minimal.mjs
--- a/benchmarks/bundle-size/run-minimal.mjs
+++ b/benchmarks/bundle-size/run-minimal.mjs
@@ -404,7 +404,7 @@
resolveId(source, importer) {
const file = importer?.startsWith(prefix)
? path.posix.join(path.posix.dirname(importer.slice(prefix.length)), source)
- : path.relative(directory, source);
+ : path.relative(directory, source).replaceAll('\\', '/');
return files.has(file) ? prefix + file : null;
},
load(id) {You can send follow-ups to the cloud agent here.
Benchmark report🟢 No byte growth, no added work, and no timing changes beyond ±3%. Compares js-framework: 1k/10k row operationsAll 20 timed operations (20 without a verdict)
All 64 work counters are unchanged. Application bundle size (bytes)No changes across 93 measured values. Public-import reachability bundles (bytes)
111 other measured values are unchanged. |
linkChunks found the entry chunk through path.relative, which joins with backslashes on Windows while chunk file names stay POSIX. Pass the virtual entry id as the link build's input instead. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…plit-shell-reachability # Conflicts: # benchmarks/README.md
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Chunk rows share full module graph
- Added per-chunk
modulesto the runtime and signals rows inbuildSplitScenario, and updated the consumer to preferrow.modulesover the globalmoduleslist, so each row's metadata now reflects only the modules present in its own chunk.
- Added per-chunk
Or push these changes by commenting:
@cursor push b00963d68e
Preview (b00963d68e)
diff --git a/benchmarks/bundle-size/run-minimal.mjs b/benchmarks/bundle-size/run-minimal.mjs
--- a/benchmarks/bundle-size/run-minimal.mjs
+++ b/benchmarks/bundle-size/run-minimal.mjs
@@ -486,8 +486,16 @@
executable: await linkChunks(chunks, entryChunk),
rows: [
{ name: scenario.name, files },
- { name: `${scenario.name}-runtime`, files: [runtime.code] },
- { name: `${scenario.name}-signals`, files: [signals.code] },
+ {
+ name: `${scenario.name}-runtime`,
+ files: [runtime.code],
+ modules: Object.keys(runtime.modules),
+ },
+ {
+ name: `${scenario.name}-signals`,
+ files: [signals.code],
+ modules: Object.keys(signals.modules),
+ },
],
modules,
runtimeExports: runtime.modules[runtimeModule].renderedExports,
@@ -842,7 +850,7 @@
Object.entries(measured).map(([metric, value]) => [metric, stat(value)]),
),
meta: {
- modules: modules.map((id) =>
+ modules: (row.modules ?? modules).map((id) =>
id.startsWith(repository + path.sep) ? path.relative(repository, id) : id,
),
hasRuntime,You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit e9d2902. Configure here.
The runtime and signals rows measure one chunk each but recorded the whole application's module list. Each chunk row now carries its own modules; the behavior snapshot stays on every row because all rows come from the one verified build. Co-Authored-By: Claude Opus 5.5 <[email protected]>


Summary
Adds a
split-shellscenario tobundle-reachabilitythat builds an Octane app the way a production rolldown + oxc app ships it: Vite 8 (Rolldown 1.1.5) withminify: 'oxc', ESM output, andoutput.codeSplittinggroups that put the signal engine (octane-signals-engine) and the rest of the octane package (octane-runtime) in chunks of their own. The renderer loads on a dynamic-import chain.The shell is a server-rendered app hydrated after a renderer-free
octane/behaviorisland activates. It includes early hydration-event capture, native reads of imported signals, a<Hydrate when={visible()}>boundary, a lazy route behinduseTransition,@tryoveruse(), a portal, a controlled input and a keyed@for.The scenario reports three rows:
split-shell: all chunks, each compressed separately.split-shell-runtime: the runtime chunk.split-shell-signals: the signals chunk.It fails the run when either of these happens:
STAGED_DOM,VIEW_TRANSITION_DRIVER,DEFERRED_LAYOUT_DRIVER,STAGED_COMMIT_CAPTURE,activityRefState,renderHiddenActivity,rehideActivityAfterDescendantRender). The check uses the same source-map oracle asoptional-driver-bundle.test.ts, withrenderBlockInneras the positive control.To run the chunks in jsdom, the harness links them into one script as emitted, without minifying or tree-shaking them. That script must reproduce the hydrated shell's observable behavior.
The run's server build now inlines dynamic imports (
codeSplitting: false), because the shell's lazy route would otherwise split the never-measured server bundle. Server builds without dynamic imports are unchanged.These rows are measured after merging main at c8256d8. #2033 cut the runtime chunk by about 5 KB. The findings below were measured at d37bd28.
Findings this scenario reproduces
These come from scratch tooling that is not in this diff: a Chromium precise-coverage probe and source-map attribution by module, top-level declaration and class member.
1. The #1855 / #1942 eliminations survive split chunks. I built the same app (with static imports) two ways and compared them with the source-map oracle:
Both retain the same declarations. The extra 1.3 KB is cross-chunk import/export glue, plus oxc no longer inlining small functions across a chunk boundary (
__derivedAt746 B vs 220 B,visible1,204 B vs 784 B).A few other things I checked:
dist/(buildPublishedRuntime) lands within 10 B of source on both chunks.advancedChunks: the deprecatedadvancedChunksform produces the same chunks ascodeSplitting.groups.__OCTANE_PROFILE_ENABLED__comes from the plugin, so a build without a manual define is byte-identical.Two caveats:
codeSplitting: falsebuild of a shell that has dynamic imports is not a valid baseline. Rolldown wraps every module in__esmMinlazy initializers there, and those add about 18 KB.manualChunksfunction assigns about 13.5 KB of signal modules to the runtime chunk instead of the signals chunk. Its dependency capture followsruntime.ts's imports. The signals group also swallows the whole runtime once an entry importsoctane/signals/client. Chunk totals therefore depend on the chunking config, so compare per module, not per chunk.2. About a third of the runtime chunk executes, and most of what doesn't run is still needed. Chromium precise coverage gives these execution rates:
The audited app measured 36%. The table below groups the runtime chunk by owning capability. The grouping uses name heuristics, so the shares are approximate:
Code that never runs here is not the same as code that can be removed. Nearly all of it belongs to capabilities this shape uses: mismatch recovery, catch arms, keyed reorders and transition rollback.
{createPortal()}in a hole is what retains the generic children / de-opt path, throughtextHoleUpdate→childSlot.The genuinely dead bytes I found:
HydrationCapability.seedOrCreate457 B and.adoptBindingText319 B, whose only callers are tree-shakable exports); in simpler hydrating fixtures, 13.1 KB ofhydrate-root's 118.5 KB and 7.2 KB ofdeferred-hydrationhydratingguards that esbuild never folds, so moving the bodies out would grow esbuild/Rspack createRoot-only bundles. Only three methods whose sole caller isactivateHydrateBoundaryare safe (~0.4 KB).ScopeImpl.serializeRead→serializeScopeRead+scopeSeedEntry+encodeSignalValue)behavior-root.tsthrows in production3. The signals engine did not grow between 0.10.2 and 0.13.1. I built the same shell against both npm tarballs, each with its own compiler:
codeSplitting.groupscodeSplitting.groupsmanualChunksPer module,
signals/*plusalien-signalswent from 76.6 KB to 72.2 KB. #1986's vendoring is a move:graph.jsgrew by 1,270 B.alien-signals/esm/system.mjs(1,866 B) dropped out.Other changes over the same range:
engine.js: −3,363 B.runtime.js: −9,758 B.A chunk-total growth between those releases comes from chunk assignment or from app changes, not from the engine.
Validation
node benchmarks/bundle-size/run-minimal.mjs split-shell hydrate-frame hooks-state server-render binding-aria-esbuild deferred-hydration: all pass. The other rows are unchanged by the refactored row and server-markup paths.renderHiddenActivityto the kept controls fails the run with the driver assertion.pnpm format:files:checkon the changed filespnpm sync: no generated changespnpm typecheck: not applicable. No TypeScript project includesbenchmarks/bundle-size/fixtures/**, as with the existing minimal fixtures.pnpm test: not run locally. This is bench harness only, and PR CI runsbundle-reachability.perf-review: not applicable (benchmark harness only).concise-code:run-split.mjssuite would need its own bench.mjs entry and would duplicate SSR rendering, verification and forbidden-module checks.app-shellset inrun.mjsdoesn't fit: that set compares frameworks under one normalized config, and it has no SSR or behavior oracle.Risk / follow-ups
HydrationCapabilitydead members. A follow-up session checked them: most callers are client-reachable, andhydratingdoesn't fold under esbuild, so a broad move would grow esbuild/Rspack createRoot-only bundles. The 13.1 KB onhydrate-rootis an artifact of its one-component fixture, and the realistichydrate-framehas about 0.9 KB. Only the three methodsactivateHydrateBoundaryalone calls are being moved (~0.4 KB).split-shell-signals): perf(octane): keep server seed serialization out of client signal bundles #2035.Provenance
agent-authored)🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Note
Low Risk
Benchmark and documentation changes only; no production runtime or bundler behavior is modified.
Overview
Adds a
split-shellscenario to bundle-reachability so CI measures a production-style Rolldown + oxc app: ESM code-splitting groups foroctane-signals-engineandoctane-runtime, dynamic-import hydration, and a behavior island before the renderer loads.The harness gains a
vite-splitbuild path that asserts app chunks contain no Octane sources, uses source maps to ensure the runtime chunk drops unused ViewTransition/Activity drivers, links chunks into one jsdom script for the behavior oracle, and reports three byte rows (full app, runtime chunk, signals chunk) with per-file compression. SSR markup for scenarios now accepts an explicit server entry and disables server code splitting so lazy routes stay in one server bundle.Fixture count in the README moves from 25/33 to 29/38 builds;
verify-reachabilityadds the expected snapshot for the new scenario.Reviewed by Cursor Bugbot for commit 3ce42c4. Bugbot is set up for automated code reviews on this repo. Configure here.