Skip to content

CI: build the host crates with line tables only - #1383

Merged
GLinnik21 merged 3 commits into
mainfrom
lane/build-speed
Nov 14, 2026
Merged

GLinnik21 merged 3 commits into
mainfrom
lane/build-speed

Conversation

@GLinnik21

@GLinnik21 GLinnik21 commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

What

The host-rust composite action (used by host lint + type-checks, host unit tests (default features) and host unit tests (hostsim)) now appends this to the runner's per-user ~/.cargo/config.toml before any cargo runs:

[profile.dev]
debug = "line-tables-only"
[profile.dev.package."*"]
debug = false

and gives its Swatinem/rust-cache step prefix-key: v1-rust-linetables.

CI's host jobs built the dev/test profile with cargo's default full DWARF for every crate, dependencies included, and nothing in CI reads it (no debugger; a panic backtrace needs only the line table). The lane worktrees already run under this exact policy (tools/build-gc.sh, docs/agent-reference.md).

Scope, deliberately narrow:

  • it is the per-user config, not rust-modules/Cargo.toml: a developer's checkout keeps full DWARF (the documented policy for main), and make build-bench / the daily bench on main are unchanged;
  • the ARM binary is built with release / tvdev, which do not inherit dev, and the cross-build job does not use host-rust: the shipped library is byte-for-byte unaffected;
  • the cache key has to carry the profile. rust-cache hashes the manifests, Cargo.lock, the toolchain files and the workspace's .cargo/config.toml, but not ~/.cargo/config.toml, so without the new prefix-key the first push of this branch restored main's full-DWARF cache as an exact hit (full match: true), cargo rebuilt every dependency (134 / 135 / 76 Compiling lines in the unit-default / hostsim / lint jobs, against 18 / 18 / 37 on a warm main run), and the post step said Cache up-to-date. and saved nothing, so the line-tables dependency build would never have been cached. The prefix puts the profile into the key. Each of the three jobs now builds its dependencies cold once per cache key: on the first run after the merge, then again whenever Cargo.lock or the toolchain moves, like any other key of this cache. Until that first run on main has saved the entry, a pull request builds its dependencies cold once. The old v0-rust- host entries are never read again and age out. Whoever changes the config block bumps the number.

Evidence

Local, paired and interleaved on one tree (6a74d2a8b, rustc 1.100.0, Apple M4, -j3, the bench's host test build cargo test --lib -p ... --no-run, 3 rounds each, medians; the machine was loaded by other lanes' builds, so CPU seconds are the figure to read and wall is noisy):

Edit-rebuild full DWARF (CI today) CPU / wall line tables only CPU / wall change
plx_ui dwell.rs (ui) 121.8 s / 56.8 s 99.7 s / 48.6 s -18% CPU
plx_base cbuf.rs (leaf) 311.8 s / 171.1 s 243.3 s / 110.0 s -22% CPU

Rounds, CPU s (full DWARF vs line tables): ui 121.8 / 121.1 / 125.8 vs 99.2 / 100.3 / 99.7; leaf 311.8 / 283.4 / 314.1 vs 243.3 / 253.6 / 241.1.

On Linux CI, measured on head 79eff6ea7 (run 43558025990). Attempt 1 was cold: No cache found. for all three v1-rust-linetables-... keys, and the post step saved them (gh cache list shows the three entries on refs/pull/1383/merge). Attempt 2, a rerun of the completed run, is the warm measurement: every job restored its line-tables cache with full match: true.

job Compiling lines: main warm 43528579834 / this PR warm rust-cache restore, this PR warm job seconds: baseline median / main warm / this PR warm / this PR cold
host unit tests (default features) 18 / 18 v1-rust-linetables-host-unit-default-Linux-x64-421d5575-7b886e90 full match: true 468 / 434 / 360 / 421
host unit tests (hostsim) 18 / 18 v1-rust-linetables-host-unit-hostsim-Linux-x64-421d5575-7b886e90 full match: true 395 / 288 / 312 / 259
host lint + type-checks 37 / 37 v1-rust-linetables-host-lint-Linux-x64-421d5575-7b886e90 full match: true 273 / 224 / 293 / 316

(Baseline medians are job seconds over 2026-11-06..14; this PR cold: 134 / 135 / 76 Compiling lines.)

Steps of the unit-default job, main warm vs this PR warm: cargo --timings test-binary compile 127 s vs 100 s, make check-cargo-unit-default 244 s vs 197 s. make check-cargo-unit-hostsim was 237 s vs 251 s, and make check-cargo-lint 86 s vs 119 s: no gain in those two samples.

The cargo --timings artifact of the unit-default job gives the sum of the workspace crates' unit durations (the compile CPU, less sensitive to the job's wall clock than the step time):

run workspace units, summed cargo units built
this PR, warm: 43558025990 attempt 2 (line tables) 389 s 47
main 43528579834 (full DWARF, warm dependencies) 496 s 47
this PR, cold-dependency run 43556544280 (line tables) 349 s 219
main 43510044453 (full DWARF, cold dependencies) 425 s 219

Both pairs agree in sign and size with the macOS pairing (-22% warm, -18% cold). The cache entries are about 30% smaller, which shortens the restore and save: unit-default 152.9 MB (was 214.9 MB), hostsim 119.5 MB (171.3 MB), lint 79.5 MB (112.4 MB).

Runner-to-runner variance on these jobs is 30-40% (the same run's hostsim job took 202 s and then 358 s on two pushes of this branch), so every Linux figure here is one sample and indicative only: it is not a controlled A/B. Only the unit-default job moves by more than that noise against its baseline median (360 s vs 468 s, -23%; against main's warm 434 s, -17%); the hostsim and lint job seconds cannot be told from noise. host lint + type-checks runs check/clippy, which write no debug info; its 293 s against 224 s was not investigated and is not attributed to the setting.

Gates

From ci/: python3 -m unittest test_ci_workflows test_ci_split test_dependencies -> Ran 124 tests in 6.146s / OK on the committed head 79eff6ea7; python3 test_arm_profile.py -> Ran 24 tests in 77.780s / OK. No Rust source changed, so no make check / make check-nodef was run. CI on 79eff6ea7, run 43558025990: attempt 1 (cold) and attempt 2 (warm) both finished with every job success, including host checks (NOT a device gate).

🤖 Generated with Claude Code

GLinnik21 and others added 3 commits November 14, 2026 07:13
The host jobs that compile a test binary (host unit tests, default and hostsim) built the `dev`/`test`
profile with cargo's default full DWARF for every crate, third-party ones included. Nothing in CI
reads it: no debugger is attached, and a panic backtrace needs only the line table.

The host-rust action now writes the per-user cargo config with `debug = "line-tables-only"` for the
workspace and `debug = false` for dependencies, the same policy the lane worktrees already run under
(tools/build-gc.sh). It is the per-user config rather than the manifest, so a developer's checkout
keeps full DWARF and the `release`/`tvdev` profiles the ARM binary is built with, which do not
inherit `dev`, are untouched.

Measured on this tree (6a74d2a, rustc 1.100.0, Apple M4, `-j3`, the bench's host test build, three
interleaved rounds, machine loaded by other builds): the ui edit-rebuild costs 122 s of CPU with full
DWARF and 100 s with this profile (-18%), the plx_base edit-rebuild 312 s and 243 s (-22%).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
ci/test_arm_profile.py keeps every workflow and action file from naming that profile; the comment
added in the previous commit did.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
rust-cache's key hashes the manifests, the lockfile, the toolchain files and the workspace's
.cargo/config.toml, not the per-user ~/.cargo/config.toml the host-rust action appends the
line-tables profile to. The branch therefore restored the full-DWARF cache as an exact hit,
cargo rebuilt every dependency (134/135/76 "Compiling" lines per job against 18/18/37 on a warm
main run), and the post step found the cache up to date and saved nothing, so the line-tables
dependency build would never have been cached.

The cache step now carries prefix-key v1-rust-linetables, which puts the profile into the key;
the comments say why and that a change to the config block bumps it. The earlier comment's
"rebuilt once" is corrected to once per cache key.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@GLinnik21
GLinnik21 merged commit a8e460b into main Nov 14, 2026
24 checks passed
@GLinnik21
GLinnik21 deleted the lane/build-speed branch November 14, 2026 05:08
GLinnik21 added a commit that referenced this pull request Nov 14, 2026
Brings in #1383 and #1385; nothing in them touches the hostsim suite or
the files this branch edits.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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