Skip to content

fix(rolldown): always run reduced-atom static cycle check (#9441)#9514

Merged
graphite-app[bot] merged 1 commit into
mainfrom
05-22-fix_9441-cd
May 24, 2026
Merged

fix(rolldown): always run reduced-atom static cycle check (#9441)#9514
graphite-app[bot] merged 1 commit into
mainfrom
05-22-fix_9441-cd

Conversation

@IWANABETHATGUY

@IWANABETHATGUY IWANABETHATGUY commented May 22, 2026

Copy link
Copy Markdown
Member

Removes the should_check_reduced_atom_static_cycle guard that restricted the reduced-atom static cycle detection to manualCodeSplitting or strict preserveEntrySignatures. The cycle check now applies universally during dynamic-import already-loaded optimization, fixing the CJS wrapper hoisting runtime cycle reported in #9441.

Snapshots for issues 8361_2 and 8595 are updated accordingly, and the failing fixture added in the parent commit is renamed to its non-. form.

Closes #9441

IWANABETHATGUY commented May 22, 2026

Copy link
Copy Markdown
Member Author

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.

@netlify

netlify Bot commented May 22, 2026

Copy link
Copy Markdown

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit 7ae80f0
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/6a12682858007600087d15e1

@IWANABETHATGUY IWANABETHATGUY changed the title fix: 9441-cd fix(rolldown): always run reduced-atom static cycle check (#9441) May 22, 2026
@pkg-pr-new

pkg-pr-new Bot commented May 22, 2026

Copy link
Copy Markdown

Open in StackBlitz

@rolldown/browser

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

@rolldown/debug

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

rolldown

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

@rolldown/binding-android-arm64

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

@rolldown/binding-darwin-arm64

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

@rolldown/binding-darwin-x64

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

@rolldown/binding-freebsd-x64

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

@rolldown/binding-linux-arm-gnueabihf

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

@rolldown/binding-linux-arm64-gnu

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

@rolldown/binding-linux-arm64-musl

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

@rolldown/binding-linux-ppc64-gnu

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

@rolldown/binding-linux-s390x-gnu

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

@rolldown/binding-linux-x64-gnu

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

@rolldown/binding-linux-x64-musl

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

@rolldown/binding-openharmony-arm64

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

@rolldown/binding-wasm32-wasi

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

@rolldown/binding-win32-arm64-msvc

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

@rolldown/binding-win32-x64-msvc

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

commit: 65712e1

@codspeed-hq

codspeed-hq Bot commented May 22, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 4 untouched benchmarks
⏩ 10 skipped benchmarks1


Comparing 05-22-fix_9441-cd (65712e1) with main (2c533e4)2

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.

  2. No successful run was found on main (a9e23ec) during the generation of this report, so 2c533e4 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

IWANABETHATGUY commented May 24, 2026

Copy link
Copy Markdown
Member Author

Merge activity

  • May 24, 2:52 AM 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.
  • May 24, 2:52 AM UTC: IWANABETHATGUY added this pull request to the Graphite merge queue.
  • May 24, 2:58 AM UTC: Merged by the Graphite merge queue.

)

Removes the `should_check_reduced_atom_static_cycle` guard that restricted the reduced-atom static cycle detection to `manualCodeSplitting` or strict `preserveEntrySignatures`. The cycle check now applies universally during dynamic-import already-loaded optimization, fixing the CJS wrapper hoisting runtime cycle reported in #9441.

Snapshots for issues 8361_2 and 8595 are updated accordingly, and the failing fixture added in the parent commit is renamed to its non-`.` form.

Closes #9441
@graphite-app graphite-app Bot force-pushed the 05-22-fix_9441-cd branch from 6b670df to 7ae80f0 Compare May 24, 2026 02:53
@graphite-app graphite-app Bot merged commit 7ae80f0 into main May 24, 2026
33 checks passed
@graphite-app graphite-app Bot deleted the 05-22-fix_9441-cd branch May 24, 2026 02:58
IWANABETHATGUY added a commit that referenced this pull request May 25, 2026
The bug is fixed by #9514, so this PR only adds the regression test.

close #9401

The fixture exercises the dynamic-import + CJS-require shape from the
issue: a static `assertNoStaticImportCycle` check against the dist graph
plus a runtime `await import('./dist/entry-0.js')` smoke to catch the
original `TypeError: __exportAll is not a function`.

**Why a regression test still matters.** Any optimization that moves or
merges the runtime host has to anticipate the static imports that
follow. There is no type or invariant enforcing this — it lives entirely
in the head of whoever wrote each optimization pass. Forgetting it
silently introduces a circular import, which is exactly the bug in
#9401.

**Planned follow-up.** A subsequent PR will restructure this: split the
runtime module into a standalone chunk during optimization, then merge
it into an existing chunk as a final step *after* helper usages are
attached. Optimization will then see a complete graph, and the kind of
ad-hoc guarding #9514 added can be removed.
V1OL3TF0X pushed a commit to V1OL3TF0X/rolldown that referenced this pull request May 25, 2026
) (rolldown#9514)

Removes the `should_check_reduced_atom_static_cycle` guard that restricted the reduced-atom static cycle detection to `manualCodeSplitting` or strict `preserveEntrySignatures`. The cycle check now applies universally during dynamic-import already-loaded optimization, fixing the CJS wrapper hoisting runtime cycle reported in rolldown#9441.

Snapshots for issues 8361_2 and 8595 are updated accordingly, and the failing fixture added in the parent commit is renamed to its non-`.` form.

Closes rolldown#9441
V1OL3TF0X pushed a commit to V1OL3TF0X/rolldown that referenced this pull request May 25, 2026
The bug is fixed by rolldown#9514, so this PR only adds the regression test.

close rolldown#9401

The fixture exercises the dynamic-import + CJS-require shape from the
issue: a static `assertNoStaticImportCycle` check against the dist graph
plus a runtime `await import('./dist/entry-0.js')` smoke to catch the
original `TypeError: __exportAll is not a function`.

**Why a regression test still matters.** Any optimization that moves or
merges the runtime host has to anticipate the static imports that
follow. There is no type or invariant enforcing this — it lives entirely
in the head of whoever wrote each optimization pass. Forgetting it
silently introduces a circular import, which is exactly the bug in
rolldown#9401.

**Planned follow-up.** A subsequent PR will restructure this: split the
runtime module into a standalone chunk during optimization, then merge
it into an existing chunk as a final step *after* helper usages are
attached. Optimization will then see a complete graph, and the kind of
ad-hoc guarding rolldown#9514 added can be removed.
@shulaoda shulaoda mentioned this pull request May 27, 2026
shulaoda added a commit that referenced this pull request May 27, 2026
## [1.0.3] - 2026-05-27

### 🚀 Features

- transform: respect decorator strictNullChecks option (#9580) by @kylecannon
- drop `defer` keyword (#9503) by @TheAlexLichter

### 🐛 Bug Fixes

- ci: create target dir before cargo release-oxc update (#9584) by @shulaoda
- ci: reorder prepare-release steps to avoid dirty git check failure (#9583) by @shulaoda
- testing: canonicalize temp dir early and use platform-specific separator in test262 (#9582) by @shulaoda
- testing: resolve symlinked temp dir in test262 snapshot normalization (#9581) by @shulaoda
- testing: canonicalize temp dir path in test262 snapshot normalization (#9579) by @shulaoda
- dev: `onOutput` called twice when initial build fails (#9552) by @hyf0
- dev: make `ensureCurrentBuildFinish` not returning error when engine closes (#9564) by @h-a-n-a
- oxc-runtime: route require() to CJS helper variant (#9263) (#9526) by @IWANABETHATGUY
- generator: use exporter chunk's export mode for CJS default re-exports (#9299) (#9529) by @IWANABETHATGUY
- rolldown: always run reduced-atom static cycle check (#9441) (#9514) by @IWANABETHATGUY
- apply transform.dropLabels before scanning (#9521) (#9522) by @IWANABETHATGUY
- rolldown_watcher: take `rolldown` dep through the workspace (#9510) by @Boshen
- cache: keep the scan-stage cache consistent when a build fails (#9495) by @h-a-n-a
- skip JSON default-import namespace optimization for write targets (#9484) (#9489) by @IWANABETHATGUY
- deps: skip pnpm frozen-lockfile on Netlify to dodge catalog mismatch bug (#9471) by @Boshen

### 🚜 Refactor

- oxc-runtime: use Cow for helper path construction (#9538) by @IWANABETHATGUY
- fold import defer phase drop into PreProcessor (#9524) by @IWANABETHATGUY
- distinguish `map: null` vs `map: undefined` in transform hook output (#9497) by @sapphi-red

### 📚 Documentation

- explain the policy for Rust crates (#9547) by @sapphi-red
- cache: add design doc for cache (#9544) by @h-a-n-a
- guide/troubleshooting: add TDZ error section (#9537) by @sapphi-red
- dev-engine: add design doc for dev-engine (#9479) by @h-a-n-a
- lazy-barrel: tweak some words (#9483) by @shulaoda
- lazy-barrel: expand reasoning behind LARGE_BARREL_MODULES advice (#9477) by @shulaoda

### ⚡ Performance

- generate: thread ast_table by value into codegen consumer (#9555) by @Boshen
- finalizers: replace `_reExport` construction with a direct call to avoid calling `clone_in` (#9501) by @Dunqing
- reorder hot-path boolean checks to short-circuit on cheap predicates first (#9523) by @Boshen

### 🧪 Testing

- rolldown: regression fixture for #9401 (#9418) by @IWANABETHATGUY
- failing test for #9441 (#9504) by @TheAlexLichter

### ⚙️ Miscellaneous Tasks

- deps: upgrade oxc to 0.133.0 (#9563) by @Dunqing
- deps: update crate-ci/typos action to v1.46.3 (#9576) by @renovate[bot]
- deps: update mimalloc-safe to 0.1.62 (#9577) by @shulaoda
- mimalloc-safe: update to a bug-fix branch for verification (#9569) by @shulaoda
- deps: update test262 submodule for tests (#9551) by @rolldown-guard[bot]
- point published crates' readme to root README.md (#9553) by @Boshen
- replace actions-cool/issues-helper with gh CLI (#9543) by @Boshen
- deps: update cargo-shear to 1.12.4 (#9541) by @Boshen
- deps: update taiki-e/install-action action to v2.79.4 (#9535) by @renovate[bot]
- deps: update github actions (#9532) by @renovate[bot]
- deps: update rust crates (#9534) by @renovate[bot]
- deps: update npm packages (#9533) by @renovate[bot]
- gate experimental/testing-only items to silence dead_code in publish builds (#9517) by @Boshen
- docs: deploy to Void (#9509) by @Boshen
- release: set up cargo-release-oxc for publishing crates (#9476) by @Boshen
- rolldown_plugin_lazy_compilation: add missing description (#9507) by @Boshen
- mimalloc-safe: update to a bug-fix branch for verification (#9506) by @shulaoda
- deps: update crate-ci/typos action to v1.46.2 (#9468) by @renovate[bot]

### ❤️ New Contributors

* @kylecannon made their first contribution in [#9580](#9580)
shulaoda pushed a commit that referenced this pull request May 27, 2026
## [1.0.3] - 2026-05-27

### 🚀 Features

- transform: respect decorator strictNullChecks option (#9580) by @kylecannon
- drop `defer` keyword (#9503) by @TheAlexLichter

### 🐛 Bug Fixes

- ci: create target dir before cargo release-oxc update (#9584) by @shulaoda
- ci: reorder prepare-release steps to avoid dirty git check failure (#9583) by @shulaoda
- testing: canonicalize temp dir early and use platform-specific separator in test262 (#9582) by @shulaoda
- testing: resolve symlinked temp dir in test262 snapshot normalization (#9581) by @shulaoda
- testing: canonicalize temp dir path in test262 snapshot normalization (#9579) by @shulaoda
- dev: `onOutput` called twice when initial build fails (#9552) by @hyf0
- dev: make `ensureCurrentBuildFinish` not returning error when engine closes (#9564) by @h-a-n-a
- oxc-runtime: route require() to CJS helper variant (#9263) (#9526) by @IWANABETHATGUY
- generator: use exporter chunk's export mode for CJS default re-exports (#9299) (#9529) by @IWANABETHATGUY
- rolldown: always run reduced-atom static cycle check (#9441) (#9514) by @IWANABETHATGUY
- apply transform.dropLabels before scanning (#9521) (#9522) by @IWANABETHATGUY
- rolldown_watcher: take `rolldown` dep through the workspace (#9510) by @Boshen
- cache: keep the scan-stage cache consistent when a build fails (#9495) by @h-a-n-a
- skip JSON default-import namespace optimization for write targets (#9484) (#9489) by @IWANABETHATGUY
- deps: skip pnpm frozen-lockfile on Netlify to dodge catalog mismatch bug (#9471) by @Boshen

### 🚜 Refactor

- oxc-runtime: use Cow for helper path construction (#9538) by @IWANABETHATGUY
- fold import defer phase drop into PreProcessor (#9524) by @IWANABETHATGUY
- distinguish `map: null` vs `map: undefined` in transform hook output (#9497) by @sapphi-red

### 📚 Documentation

- explain the policy for Rust crates (#9547) by @sapphi-red
- cache: add design doc for cache (#9544) by @h-a-n-a
- guide/troubleshooting: add TDZ error section (#9537) by @sapphi-red
- dev-engine: add design doc for dev-engine (#9479) by @h-a-n-a
- lazy-barrel: tweak some words (#9483) by @shulaoda
- lazy-barrel: expand reasoning behind LARGE_BARREL_MODULES advice (#9477) by @shulaoda

### ⚡ Performance

- generate: thread ast_table by value into codegen consumer (#9555) by @Boshen
- finalizers: replace `_reExport` construction with a direct call to avoid calling `clone_in` (#9501) by @Dunqing
- reorder hot-path boolean checks to short-circuit on cheap predicates first (#9523) by @Boshen

### 🧪 Testing

- rolldown: regression fixture for #9401 (#9418) by @IWANABETHATGUY
- failing test for #9441 (#9504) by @TheAlexLichter

### ⚙️ Miscellaneous Tasks

- deps: upgrade oxc to 0.133.0 (#9563) by @Dunqing
- deps: update crate-ci/typos action to v1.46.3 (#9576) by @renovate[bot]
- deps: update mimalloc-safe to 0.1.62 (#9577) by @shulaoda
- mimalloc-safe: update to a bug-fix branch for verification (#9569) by @shulaoda
- deps: update test262 submodule for tests (#9551) by @rolldown-guard[bot]
- point published crates' readme to root README.md (#9553) by @Boshen
- replace actions-cool/issues-helper with gh CLI (#9543) by @Boshen
- deps: update cargo-shear to 1.12.4 (#9541) by @Boshen
- deps: update taiki-e/install-action action to v2.79.4 (#9535) by @renovate[bot]
- deps: update github actions (#9532) by @renovate[bot]
- deps: update rust crates (#9534) by @renovate[bot]
- deps: update npm packages (#9533) by @renovate[bot]
- gate experimental/testing-only items to silence dead_code in publish builds (#9517) by @Boshen
- docs: deploy to Void (#9509) by @Boshen
- release: set up cargo-release-oxc for publishing crates (#9476) by @Boshen
- rolldown_plugin_lazy_compilation: add missing description (#9507) by @Boshen
- mimalloc-safe: update to a bug-fix branch for verification (#9506) by @shulaoda
- deps: update crate-ci/typos action to v1.46.2 (#9468) by @renovate[bot]

### ❤️ New Contributors

* @kylecannon made their first contribution in [#9580](#9580)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: CJS subpath import in lazy chunk throws "X is not a function" — chunk-split interop mismatch in rolldown 1.0.0 / 1.0.1

2 participants