Repository navigation
CI: build the host crates with line tables only - #1383
Merged
Merged
Conversation
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
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The
host-rustcomposite action (used byhost lint + type-checks,host unit tests (default features)andhost unit tests (hostsim)) now appends this to the runner's per-user~/.cargo/config.tomlbefore any cargo runs:and gives its
Swatinem/rust-cachestepprefix-key: v1-rust-linetables.CI's host jobs built the
dev/testprofile 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:
rust-modules/Cargo.toml: a developer's checkout keeps full DWARF (the documented policy formain), andmake build-bench/ the daily bench onmainare unchanged;release/tvdev, which do not inheritdev, and the cross-build job does not usehost-rust: the shipped library is byte-for-byte unaffected;rust-cachehashes the manifests,Cargo.lock, the toolchain files and the workspace's.cargo/config.toml, but not~/.cargo/config.toml, so without the newprefix-keythe first push of this branch restoredmain's full-DWARF cache as an exact hit (full match: true), cargo rebuilt every dependency (134 / 135 / 76Compilinglines in the unit-default / hostsim / lint jobs, against 18 / 18 / 37 on a warmmainrun), and the post step saidCache 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 wheneverCargo.lockor the toolchain moves, like any other key of this cache. Until that first run onmainhas saved the entry, a pull request builds its dependencies cold once. The oldv0-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 buildcargo 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):dwell.rs(ui)cbuf.rs(leaf)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 threev1-rust-linetables-...keys, and the post step saved them (gh cache listshows the three entries onrefs/pull/1383/merge). Attempt 2, a rerun of the completed run, is the warm measurement: every job restored its line-tables cache withfull match: true.Compilinglines:mainwarm 43528579834 / this PR warmmainwarm / this PR warm / this PR coldv1-rust-linetables-host-unit-default-Linux-x64-421d5575-7b886e90full match: truev1-rust-linetables-host-unit-hostsim-Linux-x64-421d5575-7b886e90full match: truev1-rust-linetables-host-lint-Linux-x64-421d5575-7b886e90full match: true(Baseline medians are job seconds over 2026-11-06..14; this PR cold: 134 / 135 / 76
Compilinglines.)Steps of the unit-default job,
mainwarm vs this PR warm:cargo --timingstest-binary compile 127 s vs 100 s,make check-cargo-unit-default244 s vs 197 s.make check-cargo-unit-hostsimwas 237 s vs 251 s, andmake check-cargo-lint86 s vs 119 s: no gain in those two samples.The
cargo --timingsartifact 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):main43528579834 (full DWARF, warm dependencies)main43510044453 (full DWARF, cold dependencies)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-checksrunscheck/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/OKon the committed head79eff6ea7;python3 test_arm_profile.py->Ran 24 tests in 77.780s/OK. No Rust source changed, so nomake check/make check-nodefwas run. CI on79eff6ea7, run 43558025990: attempt 1 (cold) and attempt 2 (warm) both finished with every jobsuccess, includinghost checks (NOT a device gate).🤖 Generated with Claude Code