Skip to content

test(code-splitting): cover entries-aware strict init cycle#10307

Merged
graphite-app[bot] merged 1 commit into
mainfrom
codex/issue-10259-entries-aware-strict-init-cycle
Jul 17, 2026
Merged

test(code-splitting): cover entries-aware strict init cycle#10307
graphite-app[bot] merged 1 commit into
mainfrom
codex/issue-10259-entries-aware-strict-init-cycle

Conversation

@hyfdev

@hyfdev hyfdev commented Jul 15, 2026

Copy link
Copy Markdown
Member

Summary

  • Add a three-entry regression fixture for the strictExecutionOrder failure caused by entries-aware manual code splitting.
  • Exercise both strict modes: on-demand planning and the wrap-all control.
  • Execute the generated admin, theming, and personal entries and assert entry isolation, dependency side-effect order, and the imported PaletteIcon value.

What this proves

The source module graph is acyclic:

personal -> app-personal -> palette-icon
admin    -> app-admin
theming  -> app-theming

The manual group selects only the three app-* modules. entriesAware first separates them by entry reachability, then the large merge threshold combines those small subgroups into one common chunk. palette-icon remains in the personal entry implementation chunk because recursive dependency capture is disabled.

That placement creates a static output cycle: the common app chunk imports PaletteIcon from the personal chunk, while the personal chunk imports app-personal from the common chunk. Starting with admin or theming therefore enters the personal chunk before the common chunk has finished evaluating.

The previous strict wrapper form assigned init_app_personal from a var initializer, so the cycle could call it while it was still undefined. The new strict implementation emits a callable declaration-form wrapper. This fixture keeps the output cycle intact and verifies that both on-demand and wrap-all execute all three entries with the original source semantics.

Validation

  • CARGO_TARGET_DIR=/tmp/codex-rolldown-pr10104-target just t-run crates/rolldown/tests/rolldown/issues/10259/_config.json (twice; snapshot-stable)
  • The same fixture fails on the pre-implementation main baseline in both strict modes with init_app_personal is not a function
  • just lint-node
  • just lint-repo
  • git diff --check

Closes #10259.

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 marked this pull request as ready for review July 16, 2026 02:05
Copilot AI review requested due to automatic review settings July 16, 2026 02:06

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.

@IWANABETHATGUY

Copy link
Copy Markdown
Member

I guess you should swap the order of impl and test ? Or is it intentional?

@hyfdev

hyfdev commented Jul 16, 2026

Copy link
Copy Markdown
Member Author

I guess you should swap the order of impl and test ? Or is it intentional?

Intentional. There're here to verify that the new implementation solve these issues.

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:38 AM UTC: Merged by the Graphite merge queue.

@graphite-app
graphite-app Bot changed the base branch from codex/vite-chunk-execution-order-plan to graphite-base/10307 July 17, 2026 08:41
graphite-app Bot pushed a commit that referenced this pull request Jul 17, 2026
## Summary

- Add a three-entry regression fixture for the `strictExecutionOrder` failure caused by entries-aware manual code splitting.
- Exercise both strict modes: on-demand planning and the wrap-all control.
- Execute the generated `admin`, `theming`, and `personal` entries and assert entry isolation, dependency side-effect order, and the imported `PaletteIcon` value.

## What this proves

The source module graph is acyclic:

```text
personal -> app-personal -> palette-icon
admin    -> app-admin
theming  -> app-theming
```

The manual group selects only the three `app-*` modules. `entriesAware` first separates them by entry reachability, then the large merge threshold combines those small subgroups into one common chunk. `palette-icon` remains in the personal entry implementation chunk because recursive dependency capture is disabled.

That placement creates a static output cycle: the common app chunk imports `PaletteIcon` from the personal chunk, while the personal chunk imports `app-personal` from the common chunk. Starting with `admin` or `theming` therefore enters the personal chunk before the common chunk has finished evaluating.

The previous strict wrapper form assigned `init_app_personal` from a `var` initializer, so the cycle could call it while it was still `undefined`. The new strict implementation emits a callable declaration-form wrapper. This fixture keeps the output cycle intact and verifies that both on-demand and wrap-all execute all three entries with the original source semantics.

## Validation

- `CARGO_TARGET_DIR=/tmp/codex-rolldown-pr10104-target just t-run crates/rolldown/tests/rolldown/issues/10259/_config.json` (twice; snapshot-stable)
- The same fixture fails on the pre-implementation `main` baseline in both strict modes with `init_app_personal is not a function`
- `just lint-node`
- `just lint-repo`
- `git diff --check`

Closes #10259.
@graphite-app
graphite-app Bot force-pushed the codex/issue-10259-entries-aware-strict-init-cycle branch from 2f754b0 to 5f93fce Compare July 17, 2026 08:57
@graphite-app
graphite-app Bot changed the base branch from graphite-base/10307 to codex/issue-10265-circular-init-order-test July 17, 2026 08:57
@graphite-app
graphite-app Bot changed the base branch from codex/issue-10265-circular-init-order-test to main July 17, 2026 09:32
## Summary

- Add a three-entry regression fixture for the `strictExecutionOrder` failure caused by entries-aware manual code splitting.
- Exercise both strict modes: on-demand planning and the wrap-all control.
- Execute the generated `admin`, `theming`, and `personal` entries and assert entry isolation, dependency side-effect order, and the imported `PaletteIcon` value.

## What this proves

The source module graph is acyclic:

```text
personal -> app-personal -> palette-icon
admin    -> app-admin
theming  -> app-theming
```

The manual group selects only the three `app-*` modules. `entriesAware` first separates them by entry reachability, then the large merge threshold combines those small subgroups into one common chunk. `palette-icon` remains in the personal entry implementation chunk because recursive dependency capture is disabled.

That placement creates a static output cycle: the common app chunk imports `PaletteIcon` from the personal chunk, while the personal chunk imports `app-personal` from the common chunk. Starting with `admin` or `theming` therefore enters the personal chunk before the common chunk has finished evaluating.

The previous strict wrapper form assigned `init_app_personal` from a `var` initializer, so the cycle could call it while it was still `undefined`. The new strict implementation emits a callable declaration-form wrapper. This fixture keeps the output cycle intact and verifies that both on-demand and wrap-all execute all three entries with the original source semantics.

## Validation

- `CARGO_TARGET_DIR=/tmp/codex-rolldown-pr10104-target just t-run crates/rolldown/tests/rolldown/issues/10259/_config.json` (twice; snapshot-stable)
- The same fixture fails on the pre-implementation `main` baseline in both strict modes with `init_app_personal is not a function`
- `just lint-node`
- `just lint-repo`
- `git diff --check`

Closes #10259.
@graphite-app
graphite-app Bot force-pushed the codex/issue-10259-entries-aware-strict-init-cycle branch from 5f93fce to 2db2079 Compare July 17, 2026 09:33
@netlify

netlify Bot commented Jul 17, 2026

Copy link
Copy Markdown

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit 2db2079
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/6a59f6ec2fc1d4000891aa87

@graphite-app
graphite-app Bot merged commit 2db2079 into main Jul 17, 2026
33 checks passed
@graphite-app
graphite-app Bot deleted the codex/issue-10259-entries-aware-strict-init-cycle branch July 17, 2026 09:38
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.

[Bug]: codeSplitting + strictExecutionOrder causes undefined behavior

3 participants