[PR #3661] [CLOSED] parity: probes build incrementally, also on runners that set CARGO_INCREMENTAL=0 #5133

Closed
opened 2026-11-03 05:10:28 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3661
Author: @ludovic111
Created: 10/29/2026
Status: ❌ Closed

Base: main ← Head: ci/parity-incremental


📝 Commits (1)

  • 76b68d0 parity: probes build incrementally, also on runners that set CARGO_INCREMENTAL=0

📊 Changes

2 files changed (+11 additions, -0 deletions)

View changed files

📝 tests/test_parity_runner.py (+6 -0)
📝 tools/parity.py (+5 -0)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

The PR parity runners spend a fifth to a quarter of each run on building probes, mostly rebuilding the same big crate from scratch. Probes should build incrementally, as parity.py already asks.

Measured (49 finished run-parity jobs, 2026-10-28/29): "Probes built in" has a median of 345 s on the Mac mini's runner (job median ~22 min) and 687 s on playhorizon's (~40 min). One game-binary change builds horizon-client in two or three profiles (client_probe dev, the fast game binary, one release bin). Each time, the changed crate and everything above it is a sccache miss.

Cause. tools/ci/runner-env.sh writes CARGO_INCREMENTAL=0 to the runners' environment, because sccache caches no incremental build. That variable overrides the profiles' settings, so the incremental builds that parity.py's PROFILE (CARGO_PROFILE_RELEASE_INCREMENTAL=true) and Cargo.toml (fast, dev) ask for never happen on CI.

Change. run_environment (used for the prebuild and for every harness) drops CARGO_INCREMENTAL, so each profile's own setting applies. The runner's other jobs keep it, and release builds (HORIZON_NO_SCCACHE=1) are unaffected. sccache stays the wrapper: it passes the incremental workspace crates through and still serves every dependency, which is never built incrementally.

Checked on the Mac mini, -j6, a warm worktree at main, cargo build --profile fast -p horizon-client --bin horizon-client, adding one function to item_tooltip.rs between builds:

build time
sccache, CARGO_INCREMENTAL=0 (as on CI), edit 1 96 s
same, edit 2 104 s
incremental, first build (no state yet) 123 s
incremental, edit 4 5 s
incremental, edit 5 6 s

A real pull request changes more than one function, and main moves between runs, so the saving per run is smaller than this. Expected: a few minutes per Mac mini run and more on playhorizon, where builds take twice as long. tests/test_parity_runner.py checks that the variable is dropped.

Disk, for the reviewer. The incremental state is ~2.8 GB for that one profile of horizon-client. The parity target (8.7 GB on the Mac mini's runner now) will pass runner-gc.sh's 12 GB more often. Today it already passes it (the gc log shows 26–37 GB removals), so the build after each 6-hourly gc is cold, as it is today, but without sccache for the workspace crates (+~1–2 min once per gc). The Mac mini's data volume is at 92 % (70 GB free).

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at 6a5cd3cc2, 1 min 13 s)

Check Result
Scope ✅ 2 files, +11 −0
Cargo.lock ✅ unchanged
Public tree ✅ (1 s)
Python tests ✅ 409 passed (1 min 12 s)
rustfmt / clippy / tests ➖ no Rust change
Parity ➖ 1 affected, to run in CI (--quick): lan_integration
Label skip-release

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/3661 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/29/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `ci/parity-incremental` --- ### 📝 Commits (1) - [`76b68d0`](https://github.com/horizon-rust/horizon/commit/76b68d00dcbf21ecaf0310a5b7308529ce60d17f) parity: probes build incrementally, also on runners that set CARGO_INCREMENTAL=0 ### 📊 Changes **2 files changed** (+11 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_parity_runner.py` (+6 -0) 📝 `tools/parity.py` (+5 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. The PR parity runners spend a fifth to a quarter of each run on building probes, mostly rebuilding the same big crate from scratch. Probes should build incrementally, as `parity.py` already asks. **Measured** (49 finished run-parity jobs, 2026-10-28/29): "Probes built in" has a median of 345 s on the Mac mini's runner (job median ~22 min) and 687 s on playhorizon's (~40 min). One game-binary change builds horizon-client in two or three profiles (client_probe `dev`, the `fast` game binary, one `release` bin). Each time, the changed crate and everything above it is a sccache miss. **Cause.** `tools/ci/runner-env.sh` writes `CARGO_INCREMENTAL=0` to the runners' environment, because sccache caches no incremental build. That variable overrides the profiles' settings, so the incremental builds that `parity.py`'s `PROFILE` (`CARGO_PROFILE_RELEASE_INCREMENTAL=true`) and Cargo.toml (`fast`, `dev`) ask for never happen on CI. **Change.** `run_environment` (used for the prebuild and for every harness) drops `CARGO_INCREMENTAL`, so each profile's own setting applies. The runner's other jobs keep it, and release builds (`HORIZON_NO_SCCACHE=1`) are unaffected. sccache stays the wrapper: it passes the incremental workspace crates through and still serves every dependency, which is never built incrementally. **Checked** on the Mac mini, `-j6`, a warm worktree at main, `cargo build --profile fast -p horizon-client --bin horizon-client`, adding one function to `item_tooltip.rs` between builds: | build | time | | --- | --- | | sccache, `CARGO_INCREMENTAL=0` (as on CI), edit 1 | 96 s | | same, edit 2 | 104 s | | incremental, first build (no state yet) | 123 s | | incremental, edit 4 | 5 s | | incremental, edit 5 | 6 s | A real pull request changes more than one function, and main moves between runs, so the saving per run is smaller than this. Expected: a few minutes per Mac mini run and more on playhorizon, where builds take twice as long. `tests/test_parity_runner.py` checks that the variable is dropped. **Disk, for the reviewer.** The incremental state is ~2.8 GB for that one profile of horizon-client. The parity target (8.7 GB on the Mac mini's runner now) will pass `runner-gc.sh`'s 12 GB more often. Today it already passes it (the gc log shows 26–37 GB removals), so the build after each 6-hourly gc is cold, as it is today, but without sccache for the workspace crates (+~1–2 min once per gc). The Mac mini's data volume is at 92 % (70 GB free). **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at 6a5cd3cc2, 1 min 13 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +11 −0 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ (1 s) | | Python tests | ✅ 409 passed (1 min 12 s) | | rustfmt / clippy / tests | ➖ no Rust change | | Parity | ➖ 1 affected, to run in CI (--quick): lan_integration | | Label | `skip-release` | 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:10:28 +07:00
Sign in to join this conversation.
No milestone
No project
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.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#5133
No description provided.