Skip to content

perf(nix): speed up Rust checks and deduplicate Quint MBT - #308

Merged
davidabram merged 1 commit into
ref-reconfrom
perf/nix-test-profile-quint-dedup
Oct 11, 2026
Merged

davidabram merged 1 commit into
ref-reconfrom
perf/nix-test-profile-quint-dedup

Conversation

@davidabram

@davidabram davidabram commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Pull request stack

Review and merge bottom-up. Each PR targets the previous PR's branch, so Files changed shows only that step's incremental changes.

Step Pull request Change
1/4 #308 — Faster Nix checks Rust test-profile cache; deduplicate default MBT check
2/4 #309 — Quint workflow cleanup Stop recompiling Rust MBT separately
3/4 #310 — macOS smoke-build reuse Reuse release artifact for macOS smoke tests
4/4 #311 — CI timing summaries Record Nix phase durations in job summaries

You are reviewing step 1/4: #308. Parent: main. Next: #309.


Summary

  • Compile Rust tests and Clippy with Crane's test profile instead of the default optimized release profile, using line-table-only debug info.
  • Introduce cargoArtifactsTest and pass it consistently to both cli-tests and cli-clippy so they reuse a matching dependency cache. The existing release-profile cargoArtifacts and distributable CLI builds are unchanged.
  • Remove the separately compiled/running mutation-trace-quint-connect check from the default flake checks set. The full cli-tests suite already runs those 16 MBT tests.
  • Expose the focused Quint MBT runner as the opt-in packages.mutation-trace-quint-connect and update .github/workflows/quint.yml to call its new attribute. Preserve its pinned Rust and Quint environment, and document both execution modes.

Motivation

The October 9 baseline Nix CI jobs showed nix flake check taking 20m34s on Linux and 28m59s on macOS. Most wall time was Rust dependency/test compilation, not Nix evaluation. Prior to this patch, cli-tests and the separate Quint MBT check each compiled a release-profile test binary and ran the overlapping MBT suite.

CI timing comparison

Actual wall-clock duration of time nix flake check --fallback --print-build-logs from successful GitHub Actions jobs on October 9, 2026 (lower is better):

Platform Before PR #308 Saved Faster
Linux 20m 34.101s 9m 21.892s 11m 12.209s 54.5%
macOS 28m 59.715s 15m 02.847s 13m 56.868s 48.1%
  • Before: Nix CI #37967537493, Linux job 113945871110, macOS job 113945871153.
  • After: Nix CI #37978379400, Linux job 113982336224, macOS job 113982335618.
  • Both the Nix CI and Quint workflows completed successfully.
  • New test-profile dependency artifacts compile as intended. Linux: 1,753 tests passed; macOS: 1,749 tests passed; no failures on either host. No extra MBT derivation appears in the default flake-check build.
  • Important trade-off: the separate nix build .#sce step took 6m 02.125s (Linux) / 9m 04.637s (macOS) afterward, versus 44.083s / 42.341s before, because the release-profile dependency build is now deferred until the native CLI build step. End-to-end job time improves less than the headline flake-check metric.
  • Both runs reported HTTP 418 / rate-limit errors from Magic Nix Cache, so these are measured outcomes under the available CI cache conditions, not a controlled warm-cache benchmark.

Validation

When CI runs, verify:

nix flake check --no-build
nix build .#checks.x86_64-linux.cli-tests -L
nix build .#checks.x86_64-linux.cli-clippy -L
nix flake check -L
nix build .#mutation-trace-quint-connect -L
nix build .#sce -L

Confirm that cli-tests includes all MBT tests once, and the focused package executes the same 16 tests on explicit invocation. Check Cargo logs for --profile test in test/Clippy derivations and --profile release for native CLI builds.

Status: GitHub Actions Nix CI completed successfully on Linux and macOS; Quint, CodeQL, and Dependency Review also passed. This environment itself has no Nix installation, so results above are measured from GitHub Actions logs.

Trade-off: Test- and release-profile dependency artifacts are necessarily separate. This improves recompilation of tests while potentially adding a second dependency build on completely cold CI stores. Benchmark end-to-end cold and warm builds before asserting a performance gain.

Scope

Four files: flake.nix, Quint CI workflow, existing MBT context documentation, and existing flake-performance context documentation. No changes to Rust application code, tests, Rust toolchain pins, or production build logic.

@davidabram
davidabram force-pushed the perf/nix-test-profile-quint-dedup branch from 7bc4c63 to 89648b2 Compare October 10, 2026 14:24
@davidabram
davidabram removed this pull request from stack #313 October 10, 2026 14:25
@davidabram
davidabram changed the base branch from main to ref-recon October 10, 2026 14:25
@davidabram
davidabram added this pull request to stack #312 October 10, 2026 14:27
@davidabram
davidabram removed this pull request from stack #312 October 10, 2026 22:50
@davidabram
davidabram added this pull request to stack #320 October 10, 2026 22:50
@davidabram
davidabram merged commit a29eeef into remove-tokio-db-runtimes Oct 11, 2026
13 checks passed
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.

1 participant