Skip to content

fix(chunk-optimizer): pick dominator for runtime placement to avoid cycles#9164

Merged
graphite-app[bot] merged 1 commit intomainfrom
fix-9057-dominator-runtime-placement
Apr 26, 2026
Merged

fix(chunk-optimizer): pick dominator for runtime placement to avoid cycles#9164
graphite-app[bot] merged 1 commit intomainfrom
fix-9057-dominator-runtime-placement

Conversation

@IWANABETHATGUY
Copy link
Copy Markdown
Member

@IWANABETHATGUY IWANABETHATGUY commented Apr 20, 2026

Fixes a chunk-splitting issue where the runtime module could be placed in a chunk that introduced a cyclic dependency between chunks. The optimizer now selects the dominator of all runtime consumers for placement, ensuring runtime-containing chunks load before their dependents. Includes a regression test for issue #8920 and updates to the code-splitting design doc.

closes #9161
closes #9224

Copy link
Copy Markdown
Member Author

IWANABETHATGUY commented Apr 20, 2026


How to use the Graphite Merge Queue

Add the label graphite: merge-when-ready to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@IWANABETHATGUY IWANABETHATGUY force-pushed the fix-9057-dominator-runtime-placement branch from 69141e8 to 5916b54 Compare April 20, 2026 11:14
@graphite-app graphite-app Bot changed the base branch from refactor-extract-rehome-runtime-module to graphite-base/9164 April 20, 2026 11:41
@graphite-app graphite-app Bot force-pushed the fix-9057-dominator-runtime-placement branch from 9035fcb to 9466c46 Compare April 20, 2026 11:46
@graphite-app graphite-app Bot force-pushed the graphite-base/9164 branch from 8a843af to aae6aaf Compare April 20, 2026 11:46
@graphite-app graphite-app Bot changed the base branch from graphite-base/9164 to main April 20, 2026 11:47
@graphite-app graphite-app Bot force-pushed the fix-9057-dominator-runtime-placement branch from 9466c46 to 26795f0 Compare April 20, 2026 11:47
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 20, 2026

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit 5a5f8f5
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/69ee31c6d1e29e000896f7d0

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 25, 2026

Open in StackBlitz

@rolldown/browser

npm i https://pkg.pr.new/@rolldown/browser@9164

@rolldown/debug

npm i https://pkg.pr.new/@rolldown/debug@9164

@rolldown/pluginutils

npm i https://pkg.pr.new/@rolldown/pluginutils@9164

rolldown

npm i https://pkg.pr.new/rolldown@9164

@rolldown/binding-android-arm64

npm i https://pkg.pr.new/@rolldown/binding-android-arm64@9164

@rolldown/binding-darwin-arm64

npm i https://pkg.pr.new/@rolldown/binding-darwin-arm64@9164

@rolldown/binding-darwin-x64

npm i https://pkg.pr.new/@rolldown/binding-darwin-x64@9164

@rolldown/binding-freebsd-x64

npm i https://pkg.pr.new/@rolldown/binding-freebsd-x64@9164

@rolldown/binding-linux-arm-gnueabihf

npm i https://pkg.pr.new/@rolldown/binding-linux-arm-gnueabihf@9164

@rolldown/binding-linux-arm64-gnu

npm i https://pkg.pr.new/@rolldown/binding-linux-arm64-gnu@9164

@rolldown/binding-linux-arm64-musl

npm i https://pkg.pr.new/@rolldown/binding-linux-arm64-musl@9164

@rolldown/binding-linux-ppc64-gnu

npm i https://pkg.pr.new/@rolldown/binding-linux-ppc64-gnu@9164

@rolldown/binding-linux-s390x-gnu

npm i https://pkg.pr.new/@rolldown/binding-linux-s390x-gnu@9164

@rolldown/binding-linux-x64-gnu

npm i https://pkg.pr.new/@rolldown/binding-linux-x64-gnu@9164

@rolldown/binding-linux-x64-musl

npm i https://pkg.pr.new/@rolldown/binding-linux-x64-musl@9164

@rolldown/binding-openharmony-arm64

npm i https://pkg.pr.new/@rolldown/binding-openharmony-arm64@9164

@rolldown/binding-wasm32-wasi

npm i https://pkg.pr.new/@rolldown/binding-wasm32-wasi@9164

@rolldown/binding-win32-arm64-msvc

npm i https://pkg.pr.new/@rolldown/binding-win32-arm64-msvc@9164

@rolldown/binding-win32-x64-msvc

npm i https://pkg.pr.new/@rolldown/binding-win32-x64-msvc@9164

commit: 25c7103

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 25, 2026

Merging this PR will not alter performance

✅ 4 untouched benchmarks
⏩ 10 skipped benchmarks1


Comparing fix-9057-dominator-runtime-placement (15373fa) with main (31d0403)

Open in CodSpeed

Footnotes

  1. 10 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Copy link
Copy Markdown
Member Author

IWANABETHATGUY commented Apr 26, 2026

Merge activity

  • Apr 26, 3:38 PM UTC: The merge label 'graphite: merge-when-ready' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Apr 26, 3:38 PM UTC: IWANABETHATGUY added this pull request to the Graphite merge queue.
  • Apr 26, 3:44 PM UTC: Merged by the Graphite merge queue.

…ycles (#9164)

Fixes a chunk-splitting issue where the runtime module could be placed in a chunk that introduced a cyclic dependency between chunks. The optimizer now selects the dominator of all runtime consumers for placement, ensuring runtime-containing chunks load before their dependents. Includes a regression test for issue #8920 and updates to the code-splitting design doc.

closes #9161
closes #9224
@graphite-app graphite-app Bot force-pushed the fix-9057-dominator-runtime-placement branch from 15373fa to 5a5f8f5 Compare April 26, 2026 15:39
@graphite-app graphite-app Bot merged commit 5a5f8f5 into main Apr 26, 2026
33 checks passed
@graphite-app graphite-app Bot deleted the fix-9057-dominator-runtime-placement branch April 26, 2026 15:44
@rolldown-guard rolldown-guard Bot mentioned this pull request Apr 29, 2026
@rolldown-guard rolldown-guard Bot mentioned this pull request Apr 29, 2026
shulaoda added a commit that referenced this pull request Apr 29, 2026
## [1.0.0-rc.18] - 2026-04-29

### 💥 BREAKING CHANGES

- optimization: default unspecified inlineConst.mode to smart (#9248) by @IWANABETHATGUY

### 🐛 Bug Fixes

- rolldown_plugin_vite_import_glob: return error instead of panicking when virtual module uses a relative glob (#9241) by @shulaoda
- binding: treat empty inlineConst object as omitted (#9247) by @IWANABETHATGUY
- rolldown: keep enum declaration for optional-chain access (#9229) by @Dunqing
- link_stage: restore inline let-else in exports-kind filter (#9237) by @IWANABETHATGUY
- dev/lazy: avoid module reinitialization in lazy compilation patches (#9179) by @h-a-n-a
- dev: visit identifier references for runtime rewrites in HMR finalizer (#9191) by @h-a-n-a
- chunk-optimizer: pick dominator for runtime placement to avoid cycles (#9164) by @IWANABETHATGUY
- make `this.emitFile` chunk path synchronous to avoid deadlock (#9031) by @lazarv
- use sentinel id for `browser: false` ignored modules (#9192) by @shulaoda
- prevent chunk optimizer from creating import cycles (#9228) by @IWANABETHATGUY

### 🚜 Refactor

- replace tokio::sync::Mutex with std::sync::Mutex for non-IO data (#9176) by @shulaoda
- rolldown_plugin_vite_import_glob: do not rewrite import path for absolute base (#9195) by @shulaoda
- runtime_helper: wrap DependedRuntimeHelperMap in a struct (#9215) by @IWANABETHATGUY
- drop redundant clear() in determine_safely_merge_cjs_ns (#9206) by @IWANABETHATGUY
- clean up generate_lazy_export (#9208) by @IWANABETHATGUY
- bitset: return bool from set_bit to fuse guard-and-set (#9207) by @IWANABETHATGUY
- link_stage: simplify exports-kind filter and clarify safety comments (#9205) by @IWANABETHATGUY

### 📚 Documentation

- determine_module_exports_kind (#9252) by @IWANABETHATGUY
- fix dead link to esbuild ESM/CJS interop tests (#9230) by @Copilot
- remove CSS bundling references (#9234) by @shulaoda
- correct IncrementalFullBuild row in BundleMode table (#9214) by @IWANABETHATGUY
- design: add bundler data lifecycle design doc (#9212) by @hyf0
- remove minifier alpha status notices (#9202) by @sapphi-red

### ⚙️ Miscellaneous Tasks

- upgrade oxc to 0.128.0 (#9260) by @shulaoda
- deps: bump rolldown-ariadne to 0.6.0 (#9254) by @IWANABETHATGUY
- deps: update github actions (#9259) by @renovate[bot]
- deps: update github actions (#9258) by @renovate[bot]
- remove renovate overrides (#9257) by @Boshen
- use ubuntu-latest for security workflow (#9256) by @Boshen
- notify Discord around release publish (#9251) by @Boshen
- add release environment to npm publish workflow (#9250) by @Boshen
- justfile: drop the `--` separator before forwarded args in `vp run` (#9246) by @shulaoda
- deps: update test262 submodule for tests (#9243) by @sapphi-red
- add more tracing instrumentations (#9220) by @sapphi-red
- rolldown_plugin_vite_import_glob: remove outdated sourcemap doc comment (#9213) by @shulaoda
- update security workflow (#9201) by @Boshen

### ❤️ New Contributors

* @lazarv made their first contribution in [#9031](#9031)

Co-authored-by: shulaoda <165626830+shulaoda@users.noreply.github.com>
@rolldown-guard rolldown-guard Bot mentioned this pull request Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

3 participants