Repository navigation
ci: per-job cache ledger and baseline rollup - #3831
Merged
Merged
Conversation
Nothing in CI reported whether the S3 remote cache was helping, so 'are we getting hits' had no answer. soldr already writes per-session stats; this step rolls them up into the job summary (hit rate, hits/misses, time saved, compilations). A second step on master/linux summarises the Spaces bucket with the same credentials so the 50G watermark is visible, not inferred. Both steps are fail-open: missing stats or credentials print a line and exit 0 rather than failing a build.
The step's top-level parser, moved verbatim into ci/soldr_cache_report.py, prints 0.0% (0 hits / 0 misses) for a real session with one hit, because soldr nests every counter under last_session. Co-Authored-By: Claude Opus 5.5 <[email protected]>
soldr nests its counters under last_session, so the report printed 0.0% (0/0) on every build. ci/soldr_cache_report.py now reads last_session, reports status, errors, zccache version and session source, and says n/a instead of 0% when SOLDR_RUSTC_WRAPPER=none bypasses the Rust cache or nothing compiled. The steps also could not run where the PR put them: macos-build runs only on full builds and has no matrix.os, so the S3 step's condition was never true. Add the report to rust-tests-linux and move the S3 step there, guarded by command -v aws. macos-build now installs uv when native reuse did not. test_ci_proptest_regressions.py treated every summary-writing step in those jobs as a seed step; narrow it to the proptest steps it is about. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Dedupe, eligible-rate math with the changed-inputs exclusion, bypassed labelling and fail-open on malformed input. Fails here: the modules do not exist yet. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ci/cache_ledger.py writes one JSON record per job: identity, soldr and zccache versions, wrapper state, deduplicated journal counters and miss reasons, the eligible hit rate and setup-soldr's layers. A bypassed job with no compilations is n/a, never 0%. ci/cache_baseline.py rolls those up per lane and event, using job logs for runs that predate the ledger, and prints the true sample size. Fast Gate, Rust Tests on macOS and Windows, and the Tier 2 Linux build upload a ledger. The composite action's steps are fail-open and change no cache setting. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ci/test_no_sys_path_edits.py rejects the path edit; discover -s ci provides it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Split the journal line parser out of read_journals (C901) and drop an unused noqa. Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts: # .github/workflows/build-project.yaml # ci/soldr_cache_report.py
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.
Makes cache hit rates measurable per lane: one JSON ledger per job, plus a rollup across runs. No caching behaviour changes: no wrapper enablement, no S3 edits, and
SOLDR_RUSTC_WRAPPER: nonestays.Builds on #3806 (merged). The only edit to
ci/soldr_cache_report.pyextractsread_report()so the ledger can reuse it.What it adds
ci/cache_ledger.py: writes one record per job with job, lane, OS, arch, sha, event, versions, wrapper state, counters, deduplicated miss reasons,eligible_hit_rateand layers. Bypassed with no compilations isn/a (bypassed), never 0%. Bypassed with compilations is scoped to non-Rust.ci/cache_baseline.py: rolls ledgers up per lane and event and prints the true n. Runs from before the ledger fall back to their job logs..github/actions/job-cache-ledger: artifact upload and summary line. Its steps arecontinue-on-error, because the gate rejects that key in gated jobs themselves. It is named sotest_ci_toml'sactions/cachematch does not fire.Baseline
40 successful runs from 2026-11-07 and just before: 20
merge_groupand 20 masterpush, 695 job records. All of it is log backfill, since no run has a ledger artifact yet.(≥): changed paths are unknown in logs, so no miss was excluded and the rate is a lower bound.n/a (bypassed)for Rust Tier 2 macOS and Windows; the table above corrects that by hand. Those lanes compile C/C++ but print no counters, so they are unmeasured rather than bypassed.Restore layers across the same logs (Linux lanes that print the table, 122 setup tables; cook-cache-base 65):
Not measured yet
.tier2-zccache/history/*/compile_journal.jsonlexists in CI is unproven. If not, the Tier 2 ledger reportscounter_source: soldr-reportornonerather than zccache's counters.setup-phase-summary's layout is unverified, so the record keeps it verbatim and livelayersmay be empty until it is mapped. The layer table above comes from logs.Tests
RED (937729b):
ModuleNotFoundError: No module named 'cache_baseline'.GREEN:
python -m unittest discover -s ci -p test_cache_ledger.pyruns 43 tests, OK;test_soldr_cache_report.pyruns 13, OK;./lintpasses. No Rust tests changed. No network in tests.Refs #3806
🤖 Generated with Claude Code