feat: add test for rolldown#9754#32
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
rolldown/rolldown#9754