Skip to content

test(code-splitting): cover circular strict init order#10298

Closed
hyfdev wants to merge 0 commit into
mainfrom
codex/issue-10265-circular-init-order-test
Closed

test(code-splitting): cover circular strict init order#10298
hyfdev wants to merge 0 commit into
mainfrom
codex/issue-10265-circular-init-order-test

Conversation

@hyfdev

@hyfdev hyfdev commented Jul 15, 2026

Copy link
Copy Markdown
Member

Summary

What this proves

The failure addressed by #10270 comes from the legacy ensure_lazy_module_initialization_order() transfer moving an init_*() call before a later wrapper assignment. With #10104's new strict implementation, that function is still called but returns before running the transfer logic; the wrap-all or on-demand execution-order analysis owns scheduling instead.

The exact circular graph executes successfully in both cells, demonstrating that this failure mode is absent from both new strict paths. Current main at 03e1e3422 also passes both strict configurations through the old implementation, so this is path-specific regression coverage rather than a main-fails / parent-passes claim.

Scope

This conclusion is limited to strict execution order, in wrap-all and on-demand modes. Default and non-strict output still use the legacy transfer logic and are outside this test.

Refs #10265 and #10270.

Validation

  • CARGO_TARGET_DIR=/tmp/codex-rolldown-pr10104-target just t-run crates/rolldown/tests/rolldown/issues/10265/_config.json (twice; snapshot-stable)
  • Both strict cells also pass on main at 03e1e3422, with different generated layouts
  • just lint-node
  • just lint-repo
  • git diff --check

hyfdev commented Jul 15, 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.

@hyfdev
hyfdev force-pushed the codex/issue-10265-circular-init-order-test branch from d3f714e to ed01f28 Compare July 15, 2026 13:10
@hyfdev hyfdev changed the title test(code-splitting): cover circular ESM init ordering test(code-splitting): cover CJS on-demand entry init Jul 15, 2026
@hyfdev
hyfdev force-pushed the codex/issue-10265-circular-init-order-test branch from ed01f28 to 4bf7b5d Compare July 15, 2026 13:42
@hyfdev hyfdev changed the title test(code-splitting): cover CJS on-demand entry init test(code-splitting): cover circular on-demand init order Jul 15, 2026
@hyfdev
hyfdev force-pushed the codex/issue-10265-circular-init-order-test branch from 4bf7b5d to 9a79349 Compare July 15, 2026 14:14
@hyfdev hyfdev changed the title test(code-splitting): cover circular on-demand init order test(code-splitting): cover circular strict init order Jul 15, 2026
@hyfdev
hyfdev marked this pull request as ready for review July 16, 2026 02:16
@hyfdev
hyfdev requested a review from IWANABETHATGUY as a code owner July 16, 2026 02:16
Copilot AI review requested due to automatic review settings July 16, 2026 02:16
@hyfdev
hyfdev requested a review from shulaoda as a code owner July 16, 2026 02:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@graphite-app
graphite-app Bot changed the base branch from codex/vite-chunk-execution-order-plan to graphite-base/10298 July 17, 2026 08:41

hyfdev commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

Merge activity

  • Jul 17, 8:41 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.
  • Jul 17, 8:55 AM UTC: hyfdev added this pull request to the Graphite merge queue.
  • Jul 17, 9:31 AM UTC: This pull request was removed from the Graphite merge queue because the batch it was included in timed out. Please re-enqueue the PR to retry merge.

graphite-app Bot pushed a commit that referenced this pull request Jul 17, 2026
## Summary

- Add the circular ESM initialization graph reported in #10265, whose legacy init-call transfer failure is addressed by #10270.
- Exercise both strict modes: `strictExecutionOrder: true` by itself (wrap-all), and strict execution order with `experimental.onDemandWrapping: true`.
- Execute the generated entry in both cells and assert that the circular `init_a` / `init_b` path completes without calling an uninitialized wrapper.

## What this proves

The failure addressed by #10270 comes from the legacy `ensure_lazy_module_initialization_order()` transfer moving an `init_*()` call before a later wrapper assignment. With #10104's new strict implementation, that function is still called but returns before running the transfer logic; the wrap-all or on-demand execution-order analysis owns scheduling instead.

The exact circular graph executes successfully in both cells, demonstrating that this failure mode is absent from both new strict paths. Current `main` at `03e1e3422` also passes both strict configurations through the old implementation, so this is path-specific regression coverage rather than a `main`-fails / parent-passes claim.

## Scope

This conclusion is limited to strict execution order, in wrap-all and on-demand modes. Default and non-strict output still use the legacy transfer logic and are outside this test.

Refs #10265 and #10270.

## Validation

- `CARGO_TARGET_DIR=/tmp/codex-rolldown-pr10104-target just t-run crates/rolldown/tests/rolldown/issues/10265/_config.json` (twice; snapshot-stable)
- Both strict cells also pass on `main` at `03e1e3422`, with different generated layouts
- `just lint-node`
- `just lint-repo`
- `git diff --check`
@graphite-app
graphite-app Bot force-pushed the codex/issue-10265-circular-init-order-test branch from 9a79349 to 5a00f1f Compare July 17, 2026 08:56
@graphite-app
graphite-app Bot changed the base branch from graphite-base/10298 to codex/vite-chunk-execution-order-plan July 17, 2026 08:57
Base automatically changed from codex/vite-chunk-execution-order-plan to main July 17, 2026 09:00
@hyfdev hyfdev closed this Jul 17, 2026
@hyfdev
hyfdev force-pushed the codex/issue-10265-circular-init-order-test branch from 5a00f1f to 0e1e8aa Compare July 17, 2026 09:52
@netlify

netlify Bot commented Jul 17, 2026

Copy link
Copy Markdown

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit 0e1e8aa
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/6a59fb4841b47500083de92d

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]: onDemandWrapping emits circular init_* calls before initialization

3 participants