ygg-verify: rust image caches compiled crates with sccache
sccache 0.18.0 as RUSTC_WRAPPER with a shared eureka-sccache volume. Idunn lib test build: 51 s cold, 29 s warm (83/83 hits). Slot wait, not compilation, is the larger cost. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
c62eeac548
commit
c17cf6bf80
3 changed files with 43 additions and 2 deletions
|
|
@ -2,6 +2,30 @@
|
|||
|
||||
Record each change to the skill together with the evidence that motivated it.
|
||||
|
||||
## 2026-09-30: the rust verify image caches compiled crates with sccache
|
||||
|
||||
The idunn-watchdog campaign's passes were slow. Some examples: a 263-line
|
||||
Bifrost deletion took 38 min of Hands wall-clock time, and one Soul pass took
|
||||
85 min. Self suspected cold builds, because every stopgap job gets an empty
|
||||
`/src/target`. The operator ordered the sccache change.
|
||||
|
||||
What changed:
|
||||
- The rust image installs sccache 0.18.0 and sets `RUSTC_WRAPPER`, a 60G
|
||||
`SCCACHE_DIR=/sccache` and `CARGO_INCREMENTAL=0` as image ENV. Images without
|
||||
sccache get no wrapper.
|
||||
- `ygg-verify.sh` mounts the shared `eureka-sccache` volume on every job.
|
||||
- sccache keys each entry on its inputs, not on mtime. So the scar that keeps
|
||||
target directories unshared between checkouts does not apply to it.
|
||||
|
||||
Measured on Yggdrasil, 2026-09-30, `cargo test --lib --no-run` on Idunn main:
|
||||
- Cold (18 of 83 crates already cached): 51 s.
|
||||
- Warm (83 of 83 hits): 29 s.
|
||||
- Slot wait before each run: about 2 and 5 minutes.
|
||||
|
||||
So the cache saves roughly 20 s per build, which adds up over a mutation run.
|
||||
But cold builds were not the main cost. Slot contention and test and mutation
|
||||
runtime are. Look there before adding more build machinery.
|
||||
|
||||
## 2026-09-30: substrate gaps are read from the mind, and Imagination owns the model page
|
||||
|
||||
The first typed campaign, `idunn-watchdog`, admitted the eight gaps from
|
||||
|
|
|
|||
|
|
@ -3,6 +3,20 @@
|
|||
# `cargo check --target x86_64-pc-windows-gnu` without downloading it. It dies
|
||||
# with ygg-verify.sh (see that file's deletion line). ygg-verify.sh tags the
|
||||
# image by this file's hash, so an edit here rebuilds it.
|
||||
#
|
||||
# sccache (2026-09-30): every job clones fresh and builds into an empty
|
||||
# /src/target, so a job cannot pick up another checkout's stale output (cargo
|
||||
# decides by mtime). That made every run, rerun, Soul pass and mutant a cold
|
||||
# build. sccache caches rustc outputs by the hash of their inputs, not by mtime,
|
||||
# so sharing its cache between checkouts cannot hand one tree another's build.
|
||||
# ygg-verify.sh mounts the shared cache at /sccache. Incremental compilation is
|
||||
# off because sccache does not cache incremental crates.
|
||||
FROM rust:1.95-bookworm
|
||||
RUN rustup target add x86_64-pc-windows-gnu
|
||||
RUN cargo install --locked cargo-mutants && rm -rf /usr/local/cargo/registry
|
||||
RUN cargo install --locked cargo-mutants \
|
||||
&& cargo install --locked --no-default-features sccache --version 0.18.0 \
|
||||
&& rm -rf /usr/local/cargo/registry
|
||||
ENV RUSTC_WRAPPER=/usr/local/cargo/bin/sccache \
|
||||
SCCACHE_DIR=/sccache \
|
||||
SCCACHE_CACHE_SIZE=60G \
|
||||
CARGO_INCREMENTAL=0
|
||||
|
|
|
|||
|
|
@ -80,7 +80,9 @@
|
|||
# DOCKER_ARGS='--network host'). Word-split by the remote shell, so quote a
|
||||
# flag's own value inside the string if it needs one.
|
||||
# Images:
|
||||
# rust eureka-verify-rust:<Dockerfile hash> (rust 1.95 plus cargo-mutants)
|
||||
# rust eureka-verify-rust:<Dockerfile hash> (rust 1.95, cargo-mutants, sccache;
|
||||
# every job shares the eureka-sccache volume at /sccache, keyed by
|
||||
# input hash, so a cold /src/target still reuses compiled crates)
|
||||
# kotlin eureka-verify-kotlin:<Dockerfile hash> (JDK 21, kotlinc 2.2.21, Node 24, pwsh;
|
||||
# for packages/cultmesh-kotlin: `pwsh -File build.ps1`)
|
||||
# dotnet mcr.microsoft.com/dotnet/sdk:10.0 (install Stryker in the command:
|
||||
|
|
@ -187,6 +189,7 @@ set +e
|
|||
sudo nice -n 10 docker run --rm --name "$cname" --cpus="$cpus" --memory="$mem" \
|
||||
-v "$work:/src" -v /etc/machine-id:/etc/machine-id:ro \
|
||||
-v eureka-cargo-registry:/usr/local/cargo/registry -v eureka-nuget:/root/.nuget/packages \
|
||||
-v eureka-sccache:/sccache \
|
||||
-e CARGO_TARGET_DIR=/src/target -e BASH_ENV=/tmp/.ygg-bash-env \
|
||||
-e GIT_CONFIG_COUNT=1 -e GIT_CONFIG_KEY_0=safe.directory -e GIT_CONFIG_VALUE_0='*' \
|
||||
$docker_args \
|
||||
|
|
|
|||
Loading…
Reference in a new issue