Skip to content

test(code-splitting): add strict execution order regressions#10253

Merged
graphite-app[bot] merged 1 commit into
mainfrom
test/strict-execution-order-core-regressions
Jul 14, 2026
Merged

test(code-splitting): add strict execution order regressions#10253
graphite-app[bot] merged 1 commit into
mainfrom
test/strict-execution-order-core-regressions

Conversation

@hyfdev

@hyfdev hyfdev commented Jul 13, 2026

Copy link
Copy Markdown
Member

Summary

This is the first PR in the #10104 stack. It adds the test infrastructure and core integration coverage before the implementation changes production behavior.

The key harness change is fail-closed support for known runtime failures. A fixture may declare expectExecutionFailure with an explicit reason and required output fragments. The runner accepts only a matching nonzero runtime exit: an unexpected pass, a different runtime error, an invalid configuration, or a bundler-creation failure still fails the test.

This PR changes no production bundler code and adds no inline tests to production modules. All strict-order assertions live in integration fixtures or the Rolldown integration-test tree.

What is covered

  • Adds 30 Rolldown fixture directories: 24 directed strict-order regressions, 2 fixture graphs used by the strict-order invariant suite, and 4 top-level-await fixtures.
  • Adds 12 integration tests that exercise real Bundler instances for entry facades, emitted entries, runtime-helper closure, flag-off compatibility, output-file validation, hazard-free on-demand output, and wrap-all behavior.
  • Adds an executable runtime oracle to the existing issue_4684 fixture.
  • Adds a shared console-capture helper used by 12 runtime order oracles; it supports async callbacks and restores console.log in finally.
  • Adds schema and config-variant support for base-level and per-variant expected execution failures.
  • Adds 9 self-tests for the failure harness, including matching failure, mismatched failure, XPASS, variant scoping, blank reason/matcher rejection, bundler-creation errors, and manual API coverage.

The fixture graphs cover CJS carriers and cross-chunk cycles, manual groups, user/dynamic/emitted entry facades, retained re-export paths, namespace reads, top-level-await output legality, and external-module boundaries.

Known failures are marked only so this test-first layer can pass on main. The markers include exact output signatures and are removed by #10104 only after the implementation makes the corresponding cells pass.

Review guide

  1. Review crates/rolldown_testing/src/integration_test.rs together with crates/rolldown_testing/tests/expected_execution_failure.rs; this is the fail-closed contract that makes the test-first stack possible.
  2. Review crates/rolldown/tests/rolldown/function/strict_execution_order_invariants/mod.rs; these are integration tests over real bundler output, not production inline tests.
  3. Review each new fixture's _test.mjs before its snapshot. Runtime behavior is the primary oracle; snapshots pin the associated chunk and facade shape.
  4. Review the four topics/tla/strict_* fixtures as output-legality coverage. They do not broaden the semantic guarantee of strictExecutionOrder.

Stack

Merge and review in this order:

  1. test(code-splitting): add strict execution order regressions #10253 (this PR): fail-closed runtime-failure harness and core integration regressions.
  2. test(code-splitting): harden strict execution order coverage #10252: additional hardening fixtures and paired wrap-all/on-demand coverage.
  3. feat(code-splitting): wrap strict execution order modules on demand #10104: on-demand implementation, removal of all temporary failure markers, and final output baselines.

Validation

Validated at 9063159cb3bb99da98a7d6cec1a214ee45f708cb:

  • Expected-execution-failure harness: 9/9 passed.
  • Strict execution-order fixture tests: 63/63 passed on this layer, including the expected-failure cells.
  • GitHub required checks pass, including Rust Validation, Cargo Test, Node Validation, repository validation, and the Ubuntu Node matrices.
  • The PR contains 250 changed files: 241 new files and 9 modified files, limited to Rolldown tests and test infrastructure.

hyfdev commented Jul 13, 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 13, 2026 06:41
Copilot AI review requested due to automatic review settings July 13, 2026 06:41

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.

Pull request overview

Adds a comprehensive set of regression fixtures to ensure strictExecutionOrder (and its wrap-all vs on-demand variants) preserves correct execution order across code-splitting edge cases (TLA, cycles, CJS/ESM interop carriers, manual chunking, dynamic facades), and anchors those guarantees in docs and unit tests.

Changes:

  • Added many new executed fixture suites (plus snapshots/configs) covering strict execution-order hazards across TLA, dynamic imports, interop, and manual chunking.
  • Introduced a small JS test helper (captureConsoleLog) to make ordering assertions ergonomic and consistent.
  • Added targeted Rust unit tests for helper functions involved in strict-order/cross-chunk symbol liveness and order analysis.

Reviewed changes

Copilot reviewed 237 out of 245 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
internal-docs/code-splitting/design.md Documents strict-order contract boundaries; references executed fixtures.
crates/rolldown/tests/rolldown/topics/tla/strict_shared_chunk/shared.js TLA shared-chunk fixture module.
crates/rolldown/tests/rolldown/topics/tla/strict_shared_chunk/a.js TLA shared-chunk entry A.
crates/rolldown/tests/rolldown/topics/tla/strict_shared_chunk/b.js TLA shared-chunk entry B.
crates/rolldown/tests/rolldown/topics/tla/strict_shared_chunk/_test.mjs Asserts shared chunk TLA values.
crates/rolldown/tests/rolldown/topics/tla/strict_shared_chunk/_config.json TLA shared-chunk config variants.
crates/rolldown/tests/rolldown/topics/tla/strict_shared_chunk/artifacts.snap Snapshot for shared-chunk TLA outputs.
crates/rolldown/tests/rolldown/topics/tla/strict_entry_also_imported/entry-a.js TLA entry also imported (producer).
crates/rolldown/tests/rolldown/topics/tla/strict_entry_also_imported/entry-b.js TLA entry also imported (consumer).
crates/rolldown/tests/rolldown/topics/tla/strict_entry_also_imported/_test.mjs Asserts entry-also-imported behavior.
crates/rolldown/tests/rolldown/topics/tla/strict_entry_also_imported/_config.json Entry-also-imported config variants.
crates/rolldown/tests/rolldown/topics/tla/strict_entry_also_imported/artifacts.snap Snapshot for entry-also-imported outputs.
crates/rolldown/tests/rolldown/topics/tla/strict_dynamic_root/main.js Dynamic root importing a TLA module.
crates/rolldown/tests/rolldown/topics/tla/strict_dynamic_root/tla-target.js Dynamically imported TLA module.
crates/rolldown/tests/rolldown/topics/tla/strict_dynamic_root/_test.mjs Asserts dynamic import resolves TLA.
crates/rolldown/tests/rolldown/topics/tla/strict_dynamic_root/_config.json Dynamic-root config variants.
crates/rolldown/tests/rolldown/topics/tla/strict_dynamic_root/artifacts.snap Snapshot for dynamic-root outputs.
crates/rolldown/tests/rolldown/topics/tla/strict_cycle_ring/ring-a.js TLA cycle-ring module A.
crates/rolldown/tests/rolldown/topics/tla/strict_cycle_ring/ring-b.js TLA cycle-ring module B side-effect.
crates/rolldown/tests/rolldown/topics/tla/strict_cycle_ring/main.js Cycle-ring entry.
crates/rolldown/tests/rolldown/topics/tla/strict_cycle_ring/_test.mjs Asserts cycle + side-effect ordering.
crates/rolldown/tests/rolldown/topics/tla/strict_cycle_ring/_config.json Cycle-ring config variants.
crates/rolldown/tests/rolldown/topics/tla/strict_cycle_ring/artifacts.snap Snapshot for cycle-ring outputs.
crates/rolldown/tests/rolldown/function/mod.rs Registers new strict_execution_order_invariants module.
crates/rolldown/tests/rolldown/function/strict_execution_order_invariants/mod.rs New Rust-side invariant tests (bundler-driven).
crates/rolldown/tests/rolldown/function/strict_execution_order_invariants/main.js Hazard-free invariant fixture entry.
crates/rolldown/tests/rolldown/function/strict_execution_order_invariants/shared.js Shared export for invariants.
crates/rolldown/tests/rolldown/function/strict_execution_order_invariants/dynamic.js Dynamic-side entry fixture.
crates/rolldown/tests/rolldown/function/strict_execution_order_invariants/strict_off_interop_esm_wrapper/esm.js Strict-off require-of-ESM interop fixture.
crates/rolldown/tests/rolldown/function/strict_execution_order_invariants/strict_off_interop_esm_wrapper/entry.js Strict-off CJS entry requiring ESM.
crates/rolldown/tests/rolldown/function/strict_execution_order_invariants/runtime_inert/e0.js Runtime-inert entry fixture.
crates/rolldown/tests/rolldown/function/strict_execution_order_invariants/runtime_inert/e2.js Runtime-inert entry fixture w/ dyn import registry.
crates/rolldown/tests/rolldown/function/strict_execution_order_invariants/runtime_inert/m06.js Runtime-inert chain module.
crates/rolldown/tests/rolldown/function/strict_execution_order_invariants/runtime_inert/m18.js Runtime-inert side-effect module (logs).
crates/rolldown/tests/rolldown/function/strict_execution_order_invariants/runtime_inert/m32.js Runtime-inert chain module.
crates/rolldown/tests/rolldown/function/strict_execution_order_invariants/runtime_inert/m34.js Runtime-inert chain module.
crates/rolldown/tests/rolldown/function/strict_execution_order_invariants/runtime_inert/m40.js Runtime-inert chain module.
crates/rolldown/tests/rolldown/function/strict_execution_order_invariants/runtime_inert/m41.js Runtime-inert chain module.
crates/rolldown/tests/rolldown/function/strict_execution_order_invariants/runtime_inert/m44.js Runtime-inert leaf module.
crates/rolldown/tests/rolldown/function/strict_execution_order_invariants/m4_dynamic_facade_race/a.js Dynamic facade race: entry A.
crates/rolldown/tests/rolldown/function/strict_execution_order_invariants/m4_dynamic_facade_race/b.js Dynamic facade race: entry B.
crates/rolldown/tests/rolldown/function/strict_execution_order_invariants/m4_dynamic_facade_race/observer.js Dynamic facade race: observer module.
crates/rolldown/tests/rolldown/function/strict_execution_order_invariants/m4_dynamic_facade_race/target.js Dynamic facade race: target module.
crates/rolldown/tests/rolldown/function/strict_execution_order_invariants/m4_dynamic_facade_dependency/e0.js Dynamic facade dep: entry.
crates/rolldown/tests/rolldown/function/strict_execution_order_invariants/m4_dynamic_facade_dependency/m13.js Dynamic facade dep: side-effect module.
crates/rolldown/tests/rolldown/function/strict_execution_order_invariants/m4_dynamic_facade_dependency/m29.js Dynamic facade dep: exported function module.
crates/rolldown/tests/rolldown/function/strict_execution_order_invariants/m4_dynamic_facade_dependency/m31.js Dynamic facade dep: side-effect module.
crates/rolldown/tests/rolldown/function/strict_execution_order_invariants/emitted_entry/host.js Emitted entry: host entry.
crates/rolldown/tests/rolldown/function/strict_execution_order_invariants/emitted_entry/target.js Emitted entry: emitted chunk target.
crates/rolldown/tests/rolldown/function/strict_execution_order_invariants/emitted_entry/dep-a.cjs Emitted entry: CJS dependency.
crates/rolldown/tests/rolldown/function/strict_execution_order_invariants/emitted_entry/dep-b.js Emitted entry: ESM dependency.
crates/rolldown/tests/rolldown/function/strict_execution_order_invariants/emitted_dynamic_entry/host.js Emitted dynamic entry: host.
crates/rolldown/tests/rolldown/function/strict_execution_order_invariants/emitted_dynamic_entry/target.js Emitted dynamic entry: target.
crates/rolldown/tests/rolldown/function/strict_execution_order_invariants/emitted_dynamic_entry/dep-a.cjs Emitted dynamic entry: CJS dep.
crates/rolldown/tests/rolldown/function/strict_execution_order_invariants/emitted_dynamic_entry/dep-b.js Emitted dynamic entry: ESM dep.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/wrapped_entry_chunk_cycle/shared.js Experimental strict-order fixture (cycle via reexports/interop).
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/wrapped_entry_chunk_cycle/dep.js Experimental strict-order fixture module.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/wrapped_entry_chunk_cycle/hub.js Experimental strict-order fixture hub.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/wrapped_entry_chunk_cycle/interop.cjs Experimental strict-order fixture interop.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/wrapped_entry_chunk_cycle/main.js Experimental strict-order fixture entry.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/wrapped_entry_chunk_cycle/_test.mjs Executes wrapped-entry-cycle build output.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/wrapped_entry_chunk_cycle/_config.json Config for wrapped-entry-cycle grouping.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/wrap_all_wraps_hazard_free/dep.js Hazard-free graph module.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/wrap_all_wraps_hazard_free/main.js Hazard-free graph entry.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/wrap_all_wraps_hazard_free/_test.mjs Captures logs; asserts wrap-all vs on-demand shape.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/wrap_all_wraps_hazard_free/_config.json Config enabling strict mode + on-demand variant.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/wrap_all_wraps_hazard_free/artifacts.snap Snapshot for hazard-free wrapping behavior.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/suffix_closure_gap/setup.js Fixture for suffix closure gap.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/suffix_closure_gap/reader.js Fixture reader.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/suffix_closure_gap/intermediate.js Fixture intermediate module.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/suffix_closure_gap/dyn.js Fixture dynamic module.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/suffix_closure_gap/main.js Fixture entry.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/suffix_closure_gap/_test.mjs Captures console logs to verify ordering.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/suffix_closure_gap/_config.json Config for suffix-closure-gap variants.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/suffix_closure_gap/artifacts.snap Snapshot for suffix-closure-gap outputs.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/retained_star_renamed_cycle/common.js Retained-star renamed-cycle common side effect.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/retained_star_renamed_cycle/bridge.js Bridge with renamed star reexports.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/retained_star_renamed_cycle/middle.js Middle reexport renaming layer.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/retained_star_renamed_cycle/page-a.js Page A module.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/retained_star_renamed_cycle/page-b.js Page B module.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/retained_star_renamed_cycle/main.js Entry coordinating dynamic imports.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/retained_star_renamed_cycle/_test.mjs Executes built output.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/retained_star_renamed_cycle/_config.json Config for retained-star renamed-cycle.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/retained_star_renamed_cycle/artifacts.snap Snapshot for retained-star renamed-cycle.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/order_wrapped_bare_cjs_import/main.js Fixture entry for bare CJS import ordering.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/order_wrapped_bare_cjs_import/m1.js Fixture module m1.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/order_wrapped_bare_cjs_import/m2.js Fixture module m2.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/order_wrapped_bare_cjs_import/c3.cjs CJS module exporting a value.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/order_wrapped_bare_cjs_import/c4.cjs CJS side-effect module.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/order_wrapped_bare_cjs_import/_test.mjs Captures logs; asserts source order.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/order_wrapped_bare_cjs_import/_config.json Manual group config for ordering test.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/order_wrapped_bare_cjs_import/artifacts.snap Snapshot for wrapped bare-CJS import.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/mixed_static_dynamic_same_target/dep-a.js Fixture: shared state CJS dep.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/mixed_static_dynamic_same_target/dep-b.js Fixture: mutating module.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/mixed_static_dynamic_same_target/main.js Fixture: static + dynamic import same target.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/mixed_static_dynamic_same_target/_config.json Config; marked expectExecuted false.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/mixed_static_dynamic_same_target/artifacts.snap Snapshot includes warning capture.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/manual_group_phantom_dynamic/y.js Phantom dynamic fixture module Y.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/manual_group_phantom_dynamic/x.js Phantom dynamic fixture module X.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/manual_group_phantom_dynamic/m6.js Phantom dynamic target module.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/manual_group_phantom_dynamic/leafhost.js Hosts dynamic import hook.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/manual_group_phantom_dynamic/main.js Fixture entry.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/manual_group_phantom_dynamic/_test.mjs Captures logs; asserts M6 not run.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/manual_group_phantom_dynamic/_config.json Manual group config.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/manual_group_phantom_dynamic/artifacts.snap Snapshot for phantom-dynamic grouping.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/manual_group_interop_cycle/m3.cjs Interop cycle fixture CJS module.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/manual_group_interop_cycle/m1.js Interop cycle module.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/manual_group_interop_cycle/m2.js Interop cycle module.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/manual_group_interop_cycle/main.js Interop cycle entry.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/manual_group_interop_cycle/_test.mjs Captures logs; asserts no crash + order.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/manual_group_interop_cycle/_config.json Manual group config for interop-cycle.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/manual_group_interop_cycle/artifacts.snap Snapshot for interop-cycle grouping.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/manual_group_entry_with_leaf/m4.js Manual group entry+leaf fixture leaf.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/manual_group_entry_with_leaf/m3.js Manual group fixture chain module.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/manual_group_entry_with_leaf/m2.js Manual group fixture chain module.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/manual_group_entry_with_leaf/m1.js Manual group fixture chain module.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/manual_group_entry_with_leaf/main.js Manual group entry.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/manual_group_entry_with_leaf/_test.mjs Captures logs; asserts order preserved.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/manual_group_entry_with_leaf/_config.json Manual group config for entry+leaf.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/manual_group_entry_with_leaf/artifacts.snap Snapshot for entry+leaf manual group.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/manual_chunk_cycle_order/m0.js Manual chunk cycle ordering module.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/manual_chunk_cycle_order/m1.js Manual chunk cycle ordering module.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/manual_chunk_cycle_order/m2.js Manual chunk cycle ordering module.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/manual_chunk_cycle_order/m3.js Manual chunk cycle ordering module.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/manual_chunk_cycle_order/_test.mjs Asserts cycle order in global logs.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/manual_chunk_cycle_order/_config.json Manual chunk cycle config.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/manual_chunk_cycle_order/artifacts.snap Snapshot for manual chunk cycle.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/issue_4684/_test.mjs Regression test for issue 4684 behavior.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/interop_trigger_host_transfer/s.mjs Interop trigger host transfer fixture ESM.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/interop_trigger_host_transfer/c2.cjs Interop trigger chain CJS dep.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/interop_trigger_host_transfer/c1.cjs Interop trigger chain CJS dep.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/interop_trigger_host_transfer/m3.js Host module for interop trigger.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/interop_trigger_host_transfer/m1.js Interop chain module.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/interop_trigger_host_transfer/main.js Entry module.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/interop_trigger_host_transfer/b.cjs Second entry requiring shared ESM.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/interop_trigger_host_transfer/_test.mjs Captures logs; asserts transfer + order.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/interop_trigger_host_transfer/_config.json Config for interop trigger transfer test.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/interop_trigger_host_transfer/artifacts.snap Snapshot for interop trigger transfer.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/internal_wrapped_entry_order/m5.cjs Wrapped-entry order fixture module.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/internal_wrapped_entry_order/m2.js Wrapped-entry order fixture module.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/internal_wrapped_entry_order/e1.cjs Wrapped-entry order fixture entry.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/internal_wrapped_entry_order/e2.cjs Wrapped-entry order fixture entry.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/internal_wrapped_entry_order/_test.mjs Asserts interop order sequence.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/internal_wrapped_entry_order/_config.json Config for internal-wrapped-entry-order.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/external_builtin_in_wrapped_module/dep.js Fixture importing external builtin.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/external_builtin_in_wrapped_module/main.js Entry asserting external binding usage.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/external_builtin_in_wrapped_module/_test.mjs Asserts output and side-effect marker.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/external_builtin_in_wrapped_module/_config.json Config marking node:path external.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/external_builtin_in_wrapped_module/artifacts.snap Snapshot for external-builtin strict order.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/esm_interop_entry_facade/e.js ESM interop entry fixture module.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/esm_interop_entry_facade/a.js ESM entry importing E.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/esm_interop_entry_facade/b.cjs CJS entry requiring E.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/esm_interop_entry_facade/_test.mjs Captures logs; asserts facade placement.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/esm_interop_entry_facade/_config.json Config for ESM interop entry facade.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/esm_interop_entry_facade/artifacts.snap Snapshot for ESM interop entry facade.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/entry_external_reexport_facade/setup.js External reexport facade setup side effect.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/entry_external_reexport_facade/reader.js Reads setup side effect.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/entry_external_reexport_facade/main.js Entry reexporting external.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/entry_external_reexport_facade/_test.mjs Asserts namespace includes external export.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/entry_external_reexport_facade/_config.json Config for external reexport facade grouping.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/entry_external_reexport_facade/artifacts.snap Snapshot for external reexport facade.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/entry_external_reexport_facade/node_modules/external/package.json Test-local external package metadata.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/entry_external_reexport_facade/node_modules/external/index.js Test-local external package entry.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/entry_external_reexport_facade_attributes/setup.js Same as above but with export attributes.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/entry_external_reexport_facade_attributes/reader.js Reader for setup value.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/entry_external_reexport_facade_attributes/main.js export * ... with { type } fixture.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/entry_external_reexport_facade_attributes/_test.mjs Asserts attributes preserved in output.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/entry_external_reexport_facade_attributes/_config.json Config for export-attributes fixture.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/entry_external_reexport_facade_attributes/artifacts.snap Snapshot for export-attributes fixture.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/entry_external_reexport_facade_attributes_multi_entry/setup.js Shared setup for multi-entry attributes.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/entry_external_reexport_facade_attributes_multi_entry/reader.js Shared reader for multi-entry.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/entry_external_reexport_facade_attributes_multi_entry/a.js Entry A with export attributes.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/entry_external_reexport_facade_attributes_multi_entry/b.js Entry B with export attributes.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/entry_external_reexport_facade_attributes_multi_entry/_test.mjs Asserts both outputs keep attributes.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/entry_external_reexport_facade_attributes_multi_entry/_config.json Multi-entry grouping config.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/entry_external_reexport_facade_attributes_multi_entry/artifacts.snap Snapshot for multi-entry attributes.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/dynamic_entry_retained_star/common.js Dynamic entry + retained star fixture common.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/dynamic_entry_retained_star/bridge.js Star reexport bridge.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/dynamic_entry_retained_star/page-a.js Page A assertions (assert externalized).
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/dynamic_entry_retained_star/page-b.js Page B assertions.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/dynamic_entry_retained_star/main.js Entry dynamic-import sequence.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/dynamic_entry_retained_star/_test.mjs Executes built output.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/dynamic_entry_retained_star/_config.json Config externalizing node:assert.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/dynamic_entry_retained_star/artifacts.snap Snapshot for dynamic-entry retained star.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/dynamic_entry_retained_star_named/common.js Named retained-exports common.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/dynamic_entry_retained_star_named/middle.js Named reexport middle module.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/dynamic_entry_retained_star_named/bridge.js Named bridge reexports.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/dynamic_entry_retained_star_named/page-a.js Page A assertions.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/dynamic_entry_retained_star_named/page-b.js Page B assertions.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/dynamic_entry_retained_star_named/main.js Entry dynamic-import sequence.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/dynamic_entry_retained_star_named/_test.mjs Executes built output.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/dynamic_entry_retained_star_named/_config.json Config for named retained-star.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/dynamic_entry_retained_star_named/artifacts.snap Snapshot for named retained-star.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/dynamic_entry_retained_star_fanout/common-a.js Fanout common A side effect.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/dynamic_entry_retained_star_fanout/common-b.js Fanout common B side effect.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/dynamic_entry_retained_star_fanout/bridge.js Fanout bridge reexporting A+B.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/dynamic_entry_retained_star_fanout/page-a.js Fanout page A assertions.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/dynamic_entry_retained_star_fanout/page-b.js Fanout page B assertions.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/dynamic_entry_retained_star_fanout/main.js Fanout entry.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/dynamic_entry_retained_star_fanout/_test.mjs Executes built output.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/dynamic_entry_retained_star_fanout/_config.json Config for fanout retained-star.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/dead_barrel_reexport/common.js Dead barrel reexport common side effect.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/dead_barrel_reexport/bridge.js Barrel reexport bridge.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/dead_barrel_reexport/page-a.js Page A asserting side effects.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/dead_barrel_reexport/page-b.js Page B asserting ordering despite unused import.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/dead_barrel_reexport/main.js Dynamic import sequence.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/dead_barrel_reexport/_test.mjs Executes built output.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/dead_barrel_reexport/_config.json Config externalizing node:assert.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/dead_barrel_reexport/artifacts.snap Snapshot for dead-barrel ordering.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/cjs_entry_shared_carrier/s1.mjs Shared ESM carrier for CJS entries.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/cjs_entry_shared_carrier/a.cjs CJS entry A requiring shared ESM.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/cjs_entry_shared_carrier/b.cjs CJS entry B requiring shared ESM.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/cjs_entry_shared_carrier/_test.mjs Captures logs; asserts facade keeps order.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/cjs_entry_shared_carrier/_config.json Config for shared carrier grouping.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/cjs_entry_shared_carrier/artifacts.snap Snapshot for shared-carrier case.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/cjs_carrier_pure_value_gap/node_modules/pure-forwarder/package.json Test-local pure forwarder pkg.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/cjs_carrier_pure_value_gap/node_modules/pure-forwarder/index.js Forwarder module.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/cjs_carrier_pure_value_gap/node_modules/pure-cjs/package.json Test-local pure CJS pkg.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/cjs_carrier_pure_value_gap/node_modules/pure-cjs/index.cjs Pure CJS exporting snapshot.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/cjs_carrier_pure_value_gap/node_modules/pure-carrier/package.json Test-local ESM carrier pkg.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/cjs_carrier_pure_value_gap/node_modules/pure-carrier/index.js Carrier reexporting CJS value.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/cjs_carrier_pure_value_gap/reader.js Reader consuming carrier snapshot.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/cjs_carrier_pure_value_gap/unused.js Unused import to force carrier path.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/cjs_carrier_pure_value_gap/e.js Eager sensitive module sets global.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/cjs_carrier_pure_value_gap/main.js Entry reading snapshot after E.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/cjs_carrier_pure_value_gap/second.js Second entry for carrier reuse.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/cjs_carrier_pure_value_gap/_test.mjs Captures logs; asserts value not stale.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/cjs_carrier_pure_value_gap/_config.json Multi-input strict config for pure carrier.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/cjs_carrier_gap/c.js CJS side-effect module.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/cjs_carrier_gap/p.js Bare-import pass-through.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/cjs_carrier_gap/e.js Eager sensitive module.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/cjs_carrier_gap/main.js Entry asserting E precedes C.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/cjs_carrier_gap/second.js Second entry.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/cjs_carrier_gap/_test.mjs Captures logs; asserts correct order.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/cjs_carrier_gap/_config.json Config for carrier gap regression.
crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/cjs_carrier_gap/artifacts.snap Snapshot for carrier gap regression.
crates/rolldown/tests/rolldown/_test_helpers/capture-console-log.mjs New helper to capture console.log ordering.
crates/rolldown/src/utils/chunk/deconflict_chunk_symbols.rs Adds unit test for synthetic imported symbol capture.
crates/rolldown/src/stages/generate_stage/order_analysis.rs Adds unit tests for premature_sensitive_modules.
crates/rolldown/src/stages/generate_stage/compute_cross_chunk_links.rs Adds unit test for synthetic-only symbol liveness.

Comment thread internal-docs/code-splitting/design.md Outdated
Comment thread crates/rolldown/tests/rolldown/function/strict_execution_order_invariants/mod.rs Outdated
@codspeed-hq

codspeed-hq Bot commented Jul 13, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 7 untouched benchmarks
⏩ 10 skipped benchmarks1


Comparing test/strict-execution-order-core-regressions (9063159) with main (654075e)

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.

@hyfdev
hyfdev marked this pull request as draft July 13, 2026 07:07
@hyfdev
hyfdev force-pushed the test/strict-execution-order-core-regressions branch from 4ea6b3e to f1ffd45 Compare July 13, 2026 07:51
@hyfdev
hyfdev force-pushed the codex/vite-chunk-execution-order-plan branch from 9d0a88c to 1bcf595 Compare July 13, 2026 07:51
Comment thread crates/rolldown/src/stages/generate_stage/compute_cross_chunk_links.rs Outdated
Comment thread crates/rolldown/src/stages/generate_stage/order_analysis.rs Outdated
Comment thread crates/rolldown/src/utils/chunk/deconflict_chunk_symbols.rs Outdated
Comment thread crates/rolldown/src/stages/generate_stage/order_wrap_state.rs Outdated
@hyfdev
hyfdev force-pushed the test/strict-execution-order-core-regressions branch from f1ffd45 to fdf433b Compare July 13, 2026 10:57
@hyfdev
hyfdev changed the base branch from codex/vite-chunk-execution-order-plan to graphite-base/10253 July 13, 2026 16:21
@hyfdev
hyfdev force-pushed the test/strict-execution-order-core-regressions branch from fdf433b to cf6aede Compare July 13, 2026 16:21
@hyfdev
hyfdev force-pushed the graphite-base/10253 branch from 1bcf595 to 1142210 Compare July 13, 2026 16:21
@hyfdev
hyfdev changed the base branch from graphite-base/10253 to main July 13, 2026 16:22
@netlify

netlify Bot commented Jul 13, 2026

Copy link
Copy Markdown

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit 19a6a4a
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/6a560dc1a51d410008ebbead

@hyfdev
hyfdev force-pushed the test/strict-execution-order-core-regressions branch from 34999ed to 9063159 Compare July 13, 2026 18:43
@hyfdev
hyfdev marked this pull request as ready for review July 14, 2026 09:23
@graphite-app

graphite-app Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Merge activity

  • Jul 14, 10:19 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 14, 10:21 AM UTC: hyfdev added this pull request to the Graphite merge queue.
  • Jul 14, 10:26 AM UTC: Merged by the Graphite merge queue.

@IWANABETHATGUY

Copy link
Copy Markdown
Member

The branch has moved on but the body hasn't — it still cites fdf433be as the validated head, and the branch is at 9063159c now. Reading the body next to the actual diff, they describe two different PRs.

Concretely, the body talks about #[cfg(test)] modules appended to order_analysis.rs / order_wrap_state.rs, "6 focused unit tests", and a design-guide link. None of that is in this diff — those files don't exist below #10104; that content lives up the stack now.

Meanwhile the body never mentions the biggest thing this PR does add: the whole expectExecutionFailure harness feature (rolldown_testing, rolldown_testing_config, the schema change, plus the 8 self-test fixtures for it). It also doesn't say that 8 of the 12 new invariant tests are #[should_panic] — they pin what's currently broken on main so #10104 can flip them, they're not passing invariants. That's the core idea of the tests-first stack and a reviewer should learn it from the body, not have to reverse-engineer it from the diff.

Could you refresh the body against the current diff? The substance here is good — this is purely about the description matching what lands.

## Summary

This is the first PR in the #10104 stack. It adds the test infrastructure and core integration coverage before the implementation changes production behavior.

The key harness change is fail-closed support for known runtime failures. A fixture may declare `expectExecutionFailure` with an explicit reason and required output fragments. The runner accepts only a matching nonzero runtime exit: an unexpected pass, a different runtime error, an invalid configuration, or a bundler-creation failure still fails the test.

This PR changes no production bundler code and adds no inline tests to production modules. All strict-order assertions live in integration fixtures or the Rolldown integration-test tree.

## What is covered

- Adds 30 Rolldown fixture directories: 24 directed strict-order regressions, 2 fixture graphs used by the strict-order invariant suite, and 4 top-level-await fixtures.
- Adds 12 integration tests that exercise real `Bundler` instances for entry facades, emitted entries, runtime-helper closure, flag-off compatibility, output-file validation, hazard-free on-demand output, and wrap-all behavior.
- Adds an executable runtime oracle to the existing `issue_4684` fixture.
- Adds a shared console-capture helper used by 12 runtime order oracles; it supports async callbacks and restores `console.log` in `finally`.
- Adds schema and config-variant support for base-level and per-variant expected execution failures.
- Adds 9 self-tests for the failure harness, including matching failure, mismatched failure, XPASS, variant scoping, blank reason/matcher rejection, bundler-creation errors, and manual API coverage.

The fixture graphs cover CJS carriers and cross-chunk cycles, manual groups, user/dynamic/emitted entry facades, retained re-export paths, namespace reads, top-level-await output legality, and external-module boundaries.

Known failures are marked only so this test-first layer can pass on `main`. The markers include exact output signatures and are removed by #10104 only after the implementation makes the corresponding cells pass.

## Review guide

1. Review `crates/rolldown_testing/src/integration_test.rs` together with `crates/rolldown_testing/tests/expected_execution_failure.rs`; this is the fail-closed contract that makes the test-first stack possible.
2. Review `crates/rolldown/tests/rolldown/function/strict_execution_order_invariants/mod.rs`; these are integration tests over real bundler output, not production inline tests.
3. Review each new fixture's `_test.mjs` before its snapshot. Runtime behavior is the primary oracle; snapshots pin the associated chunk and facade shape.
4. Review the four `topics/tla/strict_*` fixtures as output-legality coverage. They do not broaden the semantic guarantee of `strictExecutionOrder`.

## Stack

Merge and review in this order:

1. #10253 (this PR): fail-closed runtime-failure harness and core integration regressions.
2. #10252: additional hardening fixtures and paired wrap-all/on-demand coverage.
3. #10104: on-demand implementation, removal of all temporary failure markers, and final output baselines.

## Validation

Validated at `9063159cb3bb99da98a7d6cec1a214ee45f708cb`:

- Expected-execution-failure harness: 9/9 passed.
- Strict execution-order fixture tests: 63/63 passed on this layer, including the expected-failure cells.
- GitHub required checks pass, including Rust Validation, Cargo Test, Node Validation, repository validation, and the Ubuntu Node matrices.
- The PR contains 250 changed files: 241 new files and 9 modified files, limited to Rolldown tests and test infrastructure.
@graphite-app
graphite-app Bot force-pushed the test/strict-execution-order-core-regressions branch from 9063159 to 19a6a4a Compare July 14, 2026 10:21
graphite-app Bot pushed a commit that referenced this pull request Jul 14, 2026
## Summary

This is the second test-only PR in the #10104 stack. It extends the core layer from #10253 with the later real-app and fuzzer-derived regressions, and it runs existing strict fixtures in both wrap-all and on-demand wherever the baseline can be established before the implementation lands.

It contains no production code, test-harness code, or documentation changes. All 185 changed files are under Rolldown fixture directories.

## What is covered

- Adds 14 executed integration fixtures for re-export and barrel init forwarding, dead and ambiguous namespace paths, post-lowering emergent chunk cycles, cross-chunk CJS init exports, entry isolation, dynamic targets hosted in entry chunks, and wrapped-value capture through package barrels.
- Adds or strengthens runtime assertions so failures are checked by observable execution, not snapshots alone.
- Adds paired wrap-all/on-demand configurations to existing strict fixtures while preserving the same non-mode options in each pair.
- Preserves structural snapshots for output-sensitive cases and updates the `runtime_merge_respects_preserve_entry_signatures` oracle so both legal `allow-extension` layouts are accepted while `strict` still requires helper isolation.

Wrap-all and on-demand must preserve the same observable behavior and link-stage tree-shaking result. Their emitted files are not expected to be byte-identical: wrap-all intentionally wraps more modules and may choose additional facades or a separate runtime chunk.

This layer still runs against pre-implementation behavior, so known runtime failures remain guarded by the fail-closed markers introduced in #10253. The final #10104 baseline commit removes every marker, adds the remaining legacy output counterparts whose snapshots depend on the implementation, and establishes the repository-wide 100-pair matrix.

## Review guide

1. Review the 14 new fixture directories and their `_test.mjs` runtime assertions first.
2. Treat most remaining `_config.json` and `artifacts.snap` changes as the mechanical paired-mode sweep; compare the non-mode options within each pair.
3. Review `runtime_merge_respects_preserve_entry_signatures` separately: both entries intentionally demand runtime helpers, `allow-extension` permits either valid layout, and `strict` requires entry isolation.
4. Review the manual-group regular expressions in the affected fixtures for separator-neutral matching; the same cells were also exercised from a deliberately deep checkout path.

## Stack

Merge and review in this order:

1. #10253: fail-closed runtime-failure harness and core integration regressions.
2. #10252 (this PR): additional hardening fixtures and paired-mode coverage.
3. #10104: on-demand implementation, removal of all temporary failure markers, and final output baselines.

## Validation

Validated at `bb18ff9270554026993d06d437764346aa2ba93f`:

- Strict execution-order fixture tests: 77/77 passed on this layer.
- The PR contains 185 changed files: 118 new files and 67 modified files, all under Rolldown fixture directories.
- 14 new fixture directories, 15 changed runtime test scripts, and 33 changed artifact snapshots were checked.
- GitHub's Rolldown, Rust, Node, repository, WASI, and Ubuntu matrix checks pass.
- `Vite Test Ubuntu` retains the known `scan jsx-runtime` / `ERR_OUTDATED_OPTIMIZED_DEP` and tsconfig error-overlay expectation failures; both signatures reproduce on current `main` and are unrelated to these fixture-only changes.
@graphite-app
graphite-app Bot merged commit 19a6a4a into main Jul 14, 2026
33 of 34 checks passed
@graphite-app
graphite-app Bot deleted the test/strict-execution-order-core-regressions branch July 14, 2026 10:26
graphite-app Bot pushed a commit that referenced this pull request Jul 15, 2026
## Summary

This PR isolates the review-only test layout changes requested for #10104.

- Apply the final base/variant ordering and explicit names used by the implementation PR.
- Remove 44 temporary `snapshot: false` gates and record the current `main` output in those positions.
- Keep all 44 expected-execution-failure markers attached to the same semantic configuration cells. No known failure is fixed in this layer.

Only `_config.json` and `artifacts.snap` files change: 86 configs and 85 snapshots. There are no production-code, test-input, harness, or runtime-assertion changes.

## Why this is separate

The previous #10104 diff changed variant order while also changing generated output. GitHub's positional diff then compared wrap-all output on one side with on-demand output on the other, which made unchanged behavior look like a large regression.

With this PR as the base, #10104 compares the same named configurations in the same order. Its config diff only removes expected-failure markers, and its snapshot diff shows the implementation result at the corresponding positions.

## Test-first sequence

The earlier test-first layers are already merged into `main`:

1. #10253 added the fail-closed runtime-failure harness and core integration regressions.
2. #10252 added the later hardening fixtures and paired-mode coverage.

The remaining Graphite stack is:

1. #10287 (this PR) establishes the final review layout and current-`main` snapshots while preserving every known failure.
2. #10104 adds the implementation, removes the failure markers, and records the implementation output.

## Validation

Validation ran on `main` at `c4e25974b8ff7598bf507ae4a2d7602cbcbc86fd`.

- All 86 changed fixture configs passed twice on the old implementation.
- The second pass was snapshot-stable.
- Structural audit: 96 strict-enabled fixture configs, 200 named strict executions, no missing or duplicate names, and 44 expected-failure cells preserved.
- Layout audit: all 87 target config layouts match the final #10104 layout after ignoring names and expected-failure metadata.
- `just lint-repo` passed.
shulaoda pushed a commit that referenced this pull request Jul 15, 2026
## Summary

This PR isolates the review-only test layout changes requested for
#10104.

- Apply the final base/variant ordering and explicit names used by the
implementation PR.
- Remove 44 temporary `snapshot: false` gates and record the current
`main` output in those positions.
- Keep all 44 expected-execution-failure markers attached to the same
semantic configuration cells. No known failure is fixed in this layer.

Only `_config.json` and `artifacts.snap` files change: 86 configs and 85
snapshots. There are no production-code, test-input, harness, or
runtime-assertion changes.

## Why this is separate

The previous #10104 diff changed variant order while also changing
generated output. GitHub's positional diff then compared wrap-all output
on one side with on-demand output on the other, which made unchanged
behavior look like a large regression.

With this PR as the base, #10104 compares the same named configurations
in the same order. Its config diff only removes expected-failure
markers, and its snapshot diff shows the implementation result at the
corresponding positions.

## Test-first sequence

The earlier test-first layers are already merged into `main`:

1. #10253 added the fail-closed runtime-failure harness and core
integration regressions.
2. #10252 added the later hardening fixtures and paired-mode coverage.

The remaining Graphite stack is:

1. #10287 (this PR) establishes the final review layout and
current-`main` snapshots while preserving every known failure.
2. #10104 adds the implementation, removes the failure markers, and
records the implementation output.

## Validation

Validation ran on `main` at `c4e25974b8ff7598bf507ae4a2d7602cbcbc86fd`.

- All 86 changed fixture configs passed twice on the old implementation.
- The second pass was snapshot-stable.
- Structural audit: 96 strict-enabled fixture configs, 200 named strict
executions, no missing or duplicate names, and 44 expected-failure cells
preserved.
- Layout audit: all 87 target config layouts match the final #10104
layout after ignoring names and expected-failure metadata.
- `just lint-repo` passed.
@rolldown-guard rolldown-guard Bot mentioned this pull request Jul 15, 2026
shulaoda added a commit that referenced this pull request Jul 15, 2026
## [1.2.0] - 2026-07-15

### 🚀 Features

- dev: skip shipping factories for newly imported top-level modules (#10223) by @h-a-n-a
- dev: per-client ship map for HMR patch sizing (#10208) by @h-a-n-a
- dev: client-side HMR (#10164) by @h-a-n-a
- dev: send a full-reload update to clients when a tsconfig changes (#10262) by @shulaoda
- treat `import.meta['url']` and `import.meta['ROLLUP_FILE_URL_*']` as side-effect free (#10267) by @sapphi-red
- rewrite `import.meta['url']` (#10251) by @sapphi-red
- add `FILE_NOT_FOUND` error (#10220) by @sapphi-red
- treat `import.meta.ROLLUP_FILE_URL_*` as side-effect free (#10217) by @sapphi-red

### 🐛 Bug Fixes

- sourcemap: preserve unmapped boundaries during composition (#10254) by @hyfdev
- `[format]` in `*FileNames` option for ESM format should be `es` instead of `esm` (#10214) by @sapphi-red
- sourcemap: preserve coarse mappings during composition (#10249) by @hyfdev
- rolldown_plugin_vite_import_glob: support tsconfig paths with `import.meta.glob` (#10167) by @sapphi-red
- dev: clear tsconfig caches for bare full builds (#10276) by @shulaoda
- dev: force a full rebuild when a tsconfig changes (#10261) by @shulaoda
- treat rooted drive-less module ids as absolute in preserveModules naming (#10235) by @IWANABETHATGUY
- watch: rebuild when tsconfig files change (#10258) by @shulaoda
- watch: drop tsconfig-merged transform options on each rebuild (#10257) by @shulaoda
- incorrect `EMPTY_IMPORT_META` warning for `import.meta.ROLLUP_FILE_URL_*` for CJS output (#10221) by @sapphi-red
- deconflict: rename CJS locals shadowing wrapped-ESM namespace objects (#9970) by @IWANABETHATGUY
- rolldown: drop the unused runtime module after entry-level external flattening (#10237) by @IWANABETHATGUY
- rolldown: re-propagate has_dynamic_exports to transitive star importers (#10239) by @IWANABETHATGUY
- tree-shaking: tree-shake destructured dynamic import namespace bindings (#10213) by @logaretm
- s390x: use json-escape-simd 3.1.1 for big-endian JSON escaping fix (#10211) by @satyamg1620

### 🚜 Refactor

- dev: move full-reload to client side (#10207) by @h-a-n-a
- readability follow-ups to the ReplaceWith migration (#10286) by @IWANABETHATGUY
- replace take_in-then-write-back with ReplaceWith and by-value moves (#10285) by @Boshen
- share the main resolver's cache with the transformer's tsconfig lookups (#10205) by @shulaoda
- rolldown: extract the ns star-external __reExport emission rule into LinkingMetadata (#10238) by @IWANABETHATGUY
- rolldown: unify link/generate diagnostics into a Diagnostics accumulator (#10234) by @IWANABETHATGUY
- sourcemap_filenames: drop dead sourcemap-filename plumbing (#10189) by @IWANABETHATGUY
- extract external import symbol merging into a method (#10224) by @IWANABETHATGUY
- rolldown: skip CJS namespace merging under strict execution order (#10203) by @hyfdev
- resolve the manual tsconfig per file instead of once at startup (#10200) by @shulaoda
- rolldown: route interop ESM init emission through a shared init-target view (#10202) by @hyfdev
- rolldown: collapse vestigial wrap-kind state and share chunk sort helper (#10201) by @hyfdev

### 📚 Documentation

- show plugin kinds in JSDoc and each hook's description (#10218) by @sapphi-red
- add an explanation about removing imports from external modules without any messages (#10215) by @sapphi-red

### ⚡ Performance

- sourcemap: owned merge in SourceJoiner::join (4005->5 allocs/chunk) (#10250) by @Boshen
- avoid redundant sourcemap string copies in collapse and minify paths (#10093) by @Boshen

### 🧪 Testing

- code-splitting: establish strict-order review baselines (#10287) by @hyfdev
- dev: add hot API test cases (#10181) by @h-a-n-a
- code-splitting: normalize strict execution order variants (#10277) by @hyfdev
- code-splitting: harden strict execution order coverage (#10252) by @hyfdev
- code-splitting: add strict execution order regressions (#10253) by @hyfdev

### ⚙️ Miscellaneous Tasks

- deps: update github actions (#10241) by @renovate[bot]
- deps: update oxc to 0.140.0 (#10274) by @shulaoda
- update Yunfei's GitHub username (#10275) by @hyfdev
- deps: update napi (#10260) by @renovate[bot]
- deps: update test262 submodule for tests (#10266) by @rolldown-guard[bot]
- deps: update dependency vite-plus to v0.2.4 (#10256) by @renovate[bot]
- deps: update napi (#10240) by @renovate[bot]
- deps: update oxc resolver to v11.24.2 (#10245) by @renovate[bot]
- deps: update rust crates (#10244) by @renovate[bot]
- disable Renovate updates for idna_adapter (#10248) by @shulaoda
- deps: update oxc resolver to v11.24.1 (#10232) by @renovate[bot]
- deps: update rust crate oxc_sourcemap to v8.1.1 (#10233) by @renovate[bot]
- deps: update dependency rolldown-plugin-dts to ^0.27.0 (#10206) by @renovate[bot]
- deps: upgrade sugar_path to v3 (#10230) by @hyfdev
- add `dist-*` to `.gitignore` in sourcemap-filenames/hash-final-content fixture (#10216) by @sapphi-red
- deps: update dependency rust to v1.97.0 (#10209) by @renovate[bot]

### ❤️ New Contributors

* @satyamg1620 made their first contribution in [#10211](#10211)

Co-authored-by: shulaoda <[email protected]>
graphite-app Bot pushed a commit that referenced this pull request Jul 17, 2026
…10104)

## Summary

This PR adds an opt-in on-demand planner for `output.strictExecutionOrder` while preserving both the flag-off path and strict mode's existing wrap-all default.

| Configuration | Execution-order behavior |
| --- | --- |
| `strictExecutionOrder: false` | No execution-order wrapping |
| `strictExecutionOrder: true` | Wrap every eligible module (wrap-all, the conservative default) |
| `strictExecutionOrder: true` + `experimental.onDemandWrapping: true` | Derive a conservative wrapping plan from the generated chunk graph |

The on-demand plan is deliberately conservative rather than minimal. It begins with predicted source-order versus chunk-order hazards, then closes over importers, trigger hosts, retained re-export paths, and cyclic chunks where eager evaluation cannot be proven safe.

This PR does not change the default behavior of `strictExecutionOrder` and does not enable strict execution order globally.

Fixes #10236.

> [!IMPORTANT]
> Strict-order output may change the entry-chunk shape. When an entry implementation must remain inert while another chunk is evaluated, Rolldown emits a small entry facade that calls the relevant `init_*()` function and moves the implementation into a separate chunk. Reviewers and downstream tooling should expect this facade/implementation split.

## Why the analysis runs after chunking

Interop wrapping answers how a module is represented and remains a link-stage decision. Execution-order wrapping answers when an already-included module body may run, which depends on generated chunk placement, manual groups, facade elimination, shared entries, and chunk cycles.

This PR keeps link-owned `WrapKind` and user-code liveness immutable, computes an `OrderWrapPlan` after provisional chunking, and lowers that plan into a separate `OrderWrapState`. Lowering may add synthetic wrappers, init calls, runtime symbols, entry facades, and topology state; it cannot make an excluded user statement or binding live.

The on-demand path then projects imports added by lowering back into the chunk graph. If those imports create a new chunk cycle, every eligible module in the cyclic chunks is added to the plan and projection repeats until stable. The process is monotone and bounded by the module count.

## Correctness hardening

- Preserve init obligations through re-export barrels without reviving tree-shaken imports or unrelated exports.
- Share init-obligation enumeration between emission, cross-chunk registration, and fixpoint projection so their record gates cannot drift.
- Preserve the same link-stage tree-shaking result in wrap-all and on-demand, including consumer-local named and namespace re-export paths.
- Keep cross-chunk `init_*` bindings live and deconflicted for both ESM and CJS output.
- Restore user, dynamic, and emitted entry facades after strict lowering changes chunk topology.
- Recompute topology-derived metadata and final output validation after lowering.

Tree-shaking parity here is specifically between wrap-all and on-demand. It does not claim byte identity with flag-off output and does not include the separate `wrappedModuleTreeshaking` work.

## Review guide

1. Start with `internal-docs/code-splitting/design.md` for the invariants, mode split, conservative decisions, and projected/omitted edge inventory.
2. Read `order_analysis.rs` for source-order versus chunk-order prediction and the emergent-cycle fixpoint.
3. Read `order_wrap_state.rs` and `order_wrapping.rs` for the late synthetic state and lowering boundary.
4. Read `esm_init_obligations.rs` together with the module finalizers and cross-chunk-link pass for the shared emit/register/project contract.
5. Review #10287 for config/variant normalization and the current-main output baseline.
6. Review this PR's test diff for removal of every temporary expected-failure marker and the same-position snapshots of the final facade/runtime/chunk layouts.

## Test-first sequence

The earlier test-first layers are already merged into `main`:

1. #10253 adds the fail-closed runtime-failure harness and core integration regressions.
2. #10252 adds the later hardening fixtures and paired-mode coverage.

The remaining Graphite stack is:

1. #10287 establishes the final config/variant review layout and current-`main` snapshots while preserving all expected-failure markers.
2. #10104 (this PR) adds the implementation, removes all temporary failure markers, and records the implementation output.

The final tree contains 96 strict-enabled fixture configs and 200 named strict executions. Between #10287 and #10104, 21 config files only delete 44 expected-failure markers, and all 93 changed snapshots retain identical variant-heading order.

## Validation

Local validation ran on rebased head `79efe909bb3f0bcd2abcc76dcd33e58069c3474c`, based on `main` at `c4e25974b8ff7598bf507ae4a2d7602cbcbc86fd`.

- The 86 changed fixtures passed twice on #10287 with the old implementation; the second pass was snapshot-stable.
- All 96 strict-enabled fixture configs passed twice on this implementation, with a snapshot-stable final pass.
- Full Rust workspace tests passed with `just test-rust`.
- Rolldown Node tests passed: 793 main tests and 38 watcher tests.
- The Rollup compatibility suite passed 1,213 tests with 0 failures.
- `cargo check --workspace --all-features --all-targets --locked` and `cargo fmt --all --check` passed.
- Clippy passed with `--deny warnings` for every changed Rust crate: `rolldown`, `rolldown_common`, and `rolldown_ecmascript_utils`.
- `just lint-node` and `just lint-repo` passed.
- Full-workspace `just lint-rust` is locally blocked on Rust 1.97 by `clippy::ignore-without-reason` in the unchanged `rolldown_plugin_isolated_declaration/tests/mod.rs`; the failing path is byte-identical to `main`.

## Frozen closure evidence

The broader correctness campaign was frozen on one build of `42628c18b`:

- Differential fuzzer full matrix: 3,000/3,000 passed (ESM/CJS/mixed inputs × wrap-all/on-demand × 500 cases).
- Directed barrel/definer family: 600/600 passed; the same generated shapes failed about 23.7% of the time before the fix.
- Directed eager-barrel family: 20/20 passed in wrap-all and 20/20 in on-demand.
- #9887 strict-path bracket passed on the branch and failed 20/20 on released `[email protected]`. This PR restores strict mode as an escape hatch; the non-strict path remains a separate issue, so this PR does not close #9887.
- #10236 CJS-output/on-demand bracket passed on the branch and failed all 8 directed seeds on released `[email protected]`.
- ComfyUI, Camunda, shadcn-admin, and vue-vben-admin passed the flag-off/on-demand/wrap-all browser-probed matrix.

Fuzzer source and machine-readable evidence: https://github.com/hyf0/rolldown-order-fuzzer/tree/853fb775d1e949ced567deb0c163d044a031ba4f/.agents/evidence

## Boundaries and known residuals

- Top-level-await output remains legal, but this PR does not promise stronger TLA scheduling semantics than the default build.
- External-module evaluation order remains outside the strict-order guarantee; generated output must still be legal.
- #9998 is a separate bug in the non-strict/default code-splitting path and is not fixed here. The strict path covered by this PR passes its directed controls.
- Camunda still emits two `init_*` functions with no call site (`OverflowMenu$1` and `RadioButton$1`). They were harmless on all probed routes and have no synthetic reproduction.
- The partial-forwarder per-obligation refinement is present in the shared contract, but no constructible corpus shape currently exercises that narrower branch directly.
- On vue-vben-admin, the emergent-cycle fixpoint converged in two rounds and added 141 wrappers over the one-shot plan. `ROLLDOWN_ORDER_DEBUG=1` reproduces the per-round trace.
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.

3 participants