ci: run pytest in parallel, start it with lint, cache the C++ runtime #348

Merged
LooperSalty merged 2 commits from upstream-pr/348 into main 2026-11-26 11:12:30 +00:00
LooperSalty commented 2026-11-26 10:53:35 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by LooperSalty on 2026-11-26T10:53:35Z.


Cuts the time of the tests workflow on pull requests to main.

Measured before (pytest job, two green runs of today)

Step Time
Runtime C++ (cmake) 55–58 s
Rust (bridge to TomBox) 59–69 s
pytest 58–75 s
Waiting for lint first (needs: lint) ~15–30 s (job plus runner start)

Changes

  1. pytest in parallel: python -m pytest -n auto with pytest-xdist==3.6.1 (added to requirements-dev.txt). Measured locally on 1,421 tests: 61 s serial, 21 s with -n 4, and 15 s with ANYXBOXX_REQUIRE_RUNTIME=1 ANYXBOXX_GPU=warp -n 4. Same results in all three runs, and the README test-count check still passes (each xdist worker collects the full suite).
  2. No needs: lint: the three jobs start together. lint is still a required check and still blocks the merge when it fails.
  3. C++ runtime cache: runtime/build (about 9 MB, without runtime/build/tombox), keyed by hashFiles('runtime/**') and the runner image version (MSVC). It is restored on every run and saved from main only, like the Rust cache. The build only reads runtime/ (checked in runtime/CMakeLists.txt), so it is skipped whenever runtime/ is unchanged.

Expected: about 1.5–2.5 min less per run (more when runtime/ is unchanged). The check names (lint, politique VIctory, pytest) are unchanged, so branch protection needs no edit.

Test plan

  • YAML parses, and the job and step names are unchanged where protection reads them
  • Full suite with -n 4 locally, serial and CI env: all passed
  • This PR's own CI: green, with pytest faster than ~1 min
  • After merge, the next run on main saves runtime-cpp-*, and the PR after that restores it (Runtime C++ skipped)

A matching PR for rust/full follows. There, the Rust cache is never saved (no push trigger on rust/full, save-if main only), so every PR recompiles the whole workspace.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LwHrL62nyr3m1M4tJsHRox

<!-- greyfinch-sync:LooperSalty/AnyXboxX:issue:6625068046 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/348). Originally posted by [LooperSalty](https://github.com/LooperSalty) on 2026-11-26T10:53:35Z. --- Cuts the time of the `tests` workflow on pull requests to `main`. ## Measured before (pytest job, two green runs of today) | Step | Time | | --- | --- | | Runtime C++ (cmake) | 55–58 s | | Rust (bridge to TomBox) | 59–69 s | | pytest | 58–75 s | | Waiting for `lint` first (`needs: lint`) | ~15–30 s (job plus runner start) | ## Changes 1. **pytest in parallel**: `python -m pytest -n auto` with `pytest-xdist==3.6.1` (added to `requirements-dev.txt`). Measured locally on 1,421 tests: 61 s serial, 21 s with `-n 4`, and 15 s with `ANYXBOXX_REQUIRE_RUNTIME=1 ANYXBOXX_GPU=warp -n 4`. Same results in all three runs, and the README test-count check still passes (each xdist worker collects the full suite). 2. **No `needs: lint`**: the three jobs start together. `lint` is still a required check and still blocks the merge when it fails. 3. **C++ runtime cache**: `runtime/build` (about 9 MB, without `runtime/build/tombox`), keyed by `hashFiles('runtime/**')` and the runner image version (MSVC). It is restored on every run and saved from `main` only, like the Rust cache. The build only reads `runtime/` (checked in `runtime/CMakeLists.txt`), so it is skipped whenever `runtime/` is unchanged. Expected: about 1.5–2.5 min less per run (more when `runtime/` is unchanged). The check names (`lint`, `politique VIctory`, `pytest`) are unchanged, so branch protection needs no edit. ## Test plan - [x] YAML parses, and the job and step names are unchanged where protection reads them - [x] Full suite with `-n 4` locally, serial and CI env: all passed - [ ] This PR's own CI: green, with pytest faster than ~1 min - [ ] After merge, the next run on `main` saves `runtime-cpp-*`, and the PR after that restores it (Runtime C++ skipped) A matching PR for `rust/full` follows. There, the Rust cache is never saved (no push trigger on `rust/full`, `save-if` main only), so every PR recompiles the whole workspace. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01LwHrL62nyr3m1M4tJsHRox
chatgpt-codex-connector[bot] commented 2026-11-26 10:53:44 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T10:53:44Z.


Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T10:54:49.542125Z 9f583fc PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

<!-- greyfinch-sync:LooperSalty/AnyXboxX:comment:7189981320 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/348#issuecomment-7189981320). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/apps/chatgpt-codex-connector) on 2026-11-26T10:53:44Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"9f583fcfad1b06cfe78cb18093f844aa599449dd","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-26T10:54:49.542125Z">2026-11-26T10:54:49.542125Z</relative-time> | `9f583fc` | PR opened | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review" or "@codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
LooperSalty/AnyXboxX!348
No description provided.