Skip to content

feat: add test for rolldown#9754#32

Merged
sapphi-red merged 6 commits into
mainfrom
add-test-for-rolldown-9754
Jun 19, 2026
Merged

feat: add test for rolldown#9754#32
sapphi-red merged 6 commits into
mainfrom
add-test-for-rolldown-9754

Conversation

@sapphi-red

Copy link
Copy Markdown
Member

sapphi-red and others added 4 commits June 16, 2026 00:36
Pull the truly shared fuzz machinery (`GraphCase`, the proptest
`acyclic_graph_case_strategy`, case materialization, fixture / case-spec
helpers, `bundler_options_for_case`, `collect_chunk_info`,
`run_deterministic_check`, REPL URL builder) into a new `output_fuzz_common`
library crate.

`acyclic_output_fuzz` keeps everything cycle- and acyclic-specific:
`graph_cycle_checker`, `run_case`, `dynamic_hub_case_strategy`, the JS-syntax
and entry-export validators, the output dependency-graph builder, the
CJS-cycle helpers (`is_immediate_cycle`, `cycle_involves_cjs`,
`chunk_contains_cjs_module`), the failure-message formatter, and the
`cjs_cycle_tests` unit-test module. It now depends on `output_fuzz_common`
and the `generate_fixture` binary calls into the common crate.

Add a new `deterministic_output_fuzz` test crate that hosts the
`deterministic_output` property test, also depending on `output_fuzz_common`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Generalize `GraphCase` with an `external_static_default_edges` dimension
modelling each importing module choosing one of four local-name variants for
the default export of a given external module. Two modules picking different
variants for the same external triggers rolldown's nondeterministic
default-binding merge from #9754.

Plumbing in `output_fuzz_common`:

- Mirror the dimension through `acyclic_graph_case_strategy`,
  `case_from_seed`, `build_case_from_masks`, the `xs=` case-spec key, and
  the REPL URL.
- `render_graph_modules` emits `import dn_<ext>_<variant> from "external-<ext>"`
  and a `globalThis.__use_…` assignment so the import survives tree-shaking;
  CJS modules fall back to a deterministic `require` (the bug is ESM-only).
- `run_deterministic_check` now bundles each case four times against a
  baseline; the rolldown#9754 flip is probabilistic per build, so two runs
  were not enough to catch it at default `PROPTEST_CASES`.

Plumbing in `acyclic_output_fuzz`:

- `format_failure_message` gains an "Input External Static Default Imports"
  section that lists each importer with its chosen local name.
- `dynamic_hub_case_strategy` sets the new field to `Vec::new()` to keep its
  hub-cycle focus.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The fixture generator works off the shared `GraphCase` machinery, so park it
next to `output_fuzz_common::generate_fixture_from_*` instead of the
acyclic-only test crate. Both fuzz crates can now point at the same
reproduce command.

- Move `generate_fixture.rs` and its `[[bin]]` entry into
  `output_fuzz_common`; drop them from `acyclic_output_fuzz`.
- Add a shared `output_fuzz_common::fixture_command(&case)` helper and use
  it from `acyclic_output_fuzz::format_failure_message`.
- Extend `compare_chunk_info` (used by `run_deterministic_check`) to take
  the full `GraphCase` so its failure string now includes the seed, the
  encoded case spec, and the reproduce command — matching what the acyclic
  failure markdown already provided.
- Update README repo layout, the reproduce command snippet, and switch the
  test-run examples to `--workspace`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The fuzz workflow used to run only `acyclic_output_fuzz` via a per-crate
manifest path, so `deterministic_output_fuzz` would never run in CI. Switch
the cargo invocation to `--workspace`, rename the workflow / job / log /
artifact / issue title to drop the "acyclic" qualifier, and rename the
workflow file to match.

Also give `compare_chunk_info` (used by `run_deterministic_check`) the same
`## Failed Seed` ... `### Generate Fixture` markdown envelope the acyclic
failure formatter already produces, so the existing tracking-issue regex
(`## Failed Seed[\s\S]*?### Generate Fixture …`) captures determinism
failures unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@sapphi-red sapphi-red changed the title Add test for rolldown#9754 feat: add test for rolldown#9754 Jun 19, 2026
@sapphi-red sapphi-red marked this pull request as ready for review June 19, 2026 02:49
@sapphi-red sapphi-red merged commit ee7a3ea into main Jun 19, 2026
4 checks passed
@sapphi-red sapphi-red deleted the add-test-for-rolldown-9754 branch June 19, 2026 02:49
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.

1 participant