Skip to content

ci: cache compilations and trim redundant CI and test work - #184

Merged
gouyt13 merged 3 commits into
mainfrom
ci/test-efficiency
Oct 30, 2026
Merged

gouyt13 merged 3 commits into
mainfrom
ci/test-efficiency

Conversation

@gouyt13

@gouyt13 gouyt13 commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Summary

Reduce redundant CI and test work without changing library code or required status-check names.

  • Compiler cache: portable Linux and macOS jobs restore a ccache saved from main (setup-ccache) and only pushes to main save it (save-ccache), so pull requests cannot evict it from the repository cache quota. The native-tuned Ubuntu job is excluded because ccache keys -march=native literally; Visual Studio generators do not support compiler launchers.
  • Core consumers: tests/core_consumer/run.cmake accepts RABITQ_INTEGRATIONS=ALL|PACKAGE (default ALL). All three integration methods still run on GCC Ubuntu (OpenMP ON/OFF) and one MSVC configuration; the other consumers check the installed package only (30 of the former 60 configurations). A new cpp_core change group skips these jobs for index- or clustering-only changes.
  • Builds: pull requests build Windows wheels for cp311 and cp314 in parallel per-ABI jobs (all ABIs on main); the duplicate Python 3.14 Linux source build is removed. googletest is fetched as a hashed release tarball; change detection uses a blob-less clone and the runner's Python.
  • Tests: a rabitq_test::TempFile RAII helper replaces about 45 manual temporary-file cleanups; unused helpers in tests/common are removed; the slowest QG k-means case and one Python HNSW fixture skip redundant combinations covered elsewhere.
  • Contract tests now parse workflows with PyYAML (CI lint job only, not a package dependency) and cover the cache, integration and cpp_core rules.

docs/maintaining.md and tests/README.md are updated.

Testing

  • Portable CTest: 406 passed, 1 skipped (same test count as main); no temporary files left behind.
  • Affected Python tests: 150 passed; ruff passed.
  • CI helper suite: 60 passed. Deliberate workflow mutations (missing cache setup/save, PR-side saving, wrong aggregate group, dropped PR wheel ABI, ccache on the native job) are each rejected.
  • run.cmake with RABITQ_INTEGRATIONS=PACKAGE built and tested only the package integration.
  • C++ formatting, ShellCheck, actionlint (only the known windows-2025-vs2026 label warning) and git diff --check passed.

Validation was local Linux. Cache behavior and the actual time savings can only be measured on hosted runners; caches become available after the first push to main.

@github-actions github-actions Bot added the release:build Release category managed from the PR title label Oct 30, 2026
- Fetch GoogleTest from its checksummed v1.14.0 release archive instead of
  cloning the repository in every configured build.
- Add rabitq_test::TempFile, which removes a test's file and IVF sidecar
  even after a failed assertion, and use it for the index and I/O tests
  that cleaned up by hand.
- Remove the shared float-comparison macro and random-vector generator,
  which had one caller each; use EXPECT_NEAR and a local generator.
- Train QGKMeans at the exact 65536 maximum only with raw storage: its
  quantized rows share the 65536-wide padded layout of the 65535 cases.
- Build the 20000-centroid historical HNSW IVF fixture for one storage
  width; both widths' legacy headers are still covered below it.
- Persist ccache between runs with actions/cache in every Linux and macOS
  job that builds with native tuning disabled. The native-tuned Ubuntu job
  stays uncached because ccache keys -march=native literally.
- Build the Linux Python extension from source once (3.11); release wheel
  jobs already build and fully test cp311 and cp314 on every PR.
- Build each Windows wheel ABI on its own runner, the longest PR check.
- Run the add_subdirectory and FetchContent consumer integrations on the
  GCC Ubuntu partition and one MSVC partition; run.cmake gains
  RABITQ_INTEGRATIONS=ALL|PACKAGE and other partitions check the package.
- Add a cpp_core selection so index- and clustering-only changes skip the
  core/FastScan consumer matrix.
- Use a blob-less clone and the runner Python for change detection, and
  the runner's ShellCheck.
- Parse workflows with PyYAML in the CI contract tests instead of matching
  their text, and cover the new cache, integration and selection rules.
Pull requests now restore the newest cache saved from main and never save,
so their per-commit entries cannot fill the repository cache quota and evict
the main cache that every pull request starts from.
@gouyt13
gouyt13 force-pushed the ci/test-efficiency branch from c86c742 to 302ddfb Compare October 30, 2026 21:15
@gouyt13
gouyt13 merged commit 275b90a into main Oct 30, 2026
48 checks passed
@gouyt13
gouyt13 deleted the ci/test-efficiency branch October 30, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:build Release category managed from the PR title

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant