This repository aims for strict Graphviz parity (dot / xdot / svg) using byte-for-byte fixtures.
Strict parity fixtures are reference artifacts, not self-generated expectations.
- The fixture reference version is upstream Graphviz
14.1.1. - Generate or refresh
dot/xdot/svgfixtures with an external Graphviz14.1.1binary, preferably a Homebrew-installedgraphviz@14.1.1binary such as/opt/homebrew/opt/graphviz@14.1.1/bin/dotor/usr/local/opt/graphviz@14.1.1/bin/dot. - Treat
refs/graphvizprimarily as source/input corpus and upstream code reference, not as the default fixture-authoring binary. Its checked-out revision may drift for other repository needs and must not silently redefine fixture expectations. - Do not generate or refresh parity fixtures with this repository's own
dot.exe. Using the implementation under test to author its own expected outputs makes the parity check meaningless. - The repository
dot.exeremains the subject ofscripts/check_strict_parity.py; the fixture corpus must come from upstream Graphviz outputs. - If the fixture reference version is intentionally changed in the future, treat that as a reference-version migration: regenerate the affected fixtures from upstream, rerun parity checks, and validate the broader corpus before committing.
Before pushing a no-regression milestone, run the full local guard and ensure it passes:
scripts/run_local_guard.shFor long-running refactors, once the current slice passes local validation, you may create a checkpoint commit before the full guard finishes and begin the next slice while the guard runs. The minimum local validation for such a checkpoint is:
moon check --target native --deny-warn
moon test <affected packages> --target native --release --deny-warnDo not push a checkpoint commit until scripts/run_local_guard.sh passes for that checkpoint.
scripts/run_local_guard.sh validates:
- full release MoonBit test suite via
scripts/run_moon_test_full.sh- runs
moon test --target native --release --deny-warn - default parallelism auto-detects CPU count (override via
MOON_TEST_JOBS) - runs strict full-corpus parity via
scripts/check_strict_parity.py(dot/xdot/svg) against the releasedot.exe
- runs
- snapshot-input candidate alignment (
scripts/check_snapshot_input_candidates.py) - strict parity case-list invariants (
scripts/check_strict_parity_case_lists.py) DOT_CAPTURE_ORDERING_INPUTSenv-invariance (dot/xdot/svg) ontests/capture_env_invariant_cases.txt
Performance/reliability mode:
- guard reuses
_build/local_guard/worktree/_build,.mooncakes, andrefs/graphvizbetween runs for faster iterative refactors - set
LOCAL_GUARD_PRISTINE=1to force a fully clean worktree build when needed - set
LOCAL_GUARD_TIMING=1to print per-step guard timing breakdown - guard caches last successful result by staged tree hash +
moon --version; useLOCAL_GUARD_FORCE=1to bypass cache - cache auto-bypasses when
LOCAL_GUARD_PRISTINE=1orLOCAL_GUARD_TIMING=1; setLOCAL_GUARD_CACHE=0to disable cache globally - cache key also includes guard tuning env overrides (
LOCAL_GUARD_FROZEN,LOCAL_GUARD_SUBMODULE_CHECK,LOCAL_GUARD_SUPPRESS_CLANG_EXIT_WARNING,LOCAL_GUARD_SANITIZE_DOT_ENV,MOON_TEST_JOBS,STRICT_PARITY_JOBS,CAPTURE_ENV_INVARIANCE_JOBS,DOT_WRITE_PARITY_ARTIFACTS) - guard skips
git submodule updatewhen worktreerefs/graphvizalready matches staged gitlink (setLOCAL_GUARD_SUBMODULE_CHECK=0to always sync) - guard defaults to
--frozenfor moon commands when.mooncakesdeps are available, and auto-falls back to non-frozen on failure (setLOCAL_GUARD_FROZEN=0to disable) - guard clears ambient
DOT_*env vars before running checks (exceptDOT_WRITE_PARITY_ARTIFACTS; setLOCAL_GUARD_SANITIZE_DOT_ENV=0to keep caller DOT env) - parity tests only persist snapshot artifacts for mismatches by default; set
DOT_WRITE_PARITY_ARTIFACTS=1to force writing all parity outputs undertarget/render/* - set
STRICT_PARITY_JOBSto tune full-corpus strict parity checker parallelism (defaults toMOON_TEST_JOBS) - set
CAPTURE_ENV_INVARIANCE_JOBSto tune env-invariance checker parallelism (defaults toMOON_TEST_JOBS) - guard uses
git -c core.hooksPath=/dev/nullfor worktree sync to avoid local hook noise/interference - guard defaults to
scripts/moon_cc_wrapper.shto suppress known generated-Cexitredeclaration noise (disable viaLOCAL_GUARD_SUPPRESS_CLANG_EXIT_WARNING=0) scripts/run_local_guard.shis intentionally argument-free; tune behavior viaLOCAL_GUARD_*env vars
If the guard fails:
- do not push the failing checkpoint or milestone commit
- stash or shelve any later WIP based on top of that checkpoint
- return to the failing commit, fix regressions first, and rerun the guard until it passes
- resume later queued work only after the checkpoint is green again
When changing guard scripts/workflows (scripts/run_local_guard.sh, scripts/run_moon_test_full.sh, scripts/check_capture_env_invariance.py, scripts/check_strict_parity.py, scripts/check_strict_parity_case_lists.py, scripts/scan_strict_parity_history.py, scripts/find_first_strict_parity_regression.py, .github/workflows/*strict-parity*), also run at least one local smoke command for the changed path.
History/bisect workflow defaults:
tests/strict_parity_history_focus_cases.txtis the default focus file for strict parity history and bisect workflows.tests/strict_parity_known_regression_cases_f9bfd00.txtis the required known-regression cluster; history focus list must cover it.tests/strict_parity_uncovered_input_cases.txtlists input-corpus cases intentionally excluded from strict parity manifests.- keep this list aligned with known high-signal regression clusters.