Skip to content

feat(post): one-line cache save aggregate (closes part of #269) - #283

Merged
zackees merged 1 commit into
mainfrom
feat/post-save-totals-269
May 31, 2026
Merged

zackees merged 1 commit into
mainfrom
feat/post-save-totals-269

Conversation

@zackees

@zackees zackees commented May 31, 2026

Copy link
Copy Markdown
Collaborator

Tiny focused implementation of #269: one-line save-aggregate at end of post step. Operators see at a glance how many layers actually saved + total uploaded + total post-step wall-clock. Each value pulled from existing StatsCollector records; no new instrumentation. Empty when zero save ops recorded (every layer disabled or exact-hit-skip).

The full #269 proposal (per-phase breakdown + ROI ratio) can iterate from this baseline.

Refs: #269, #279, #280

…inimal cut)

Adds `StatsCollector.saveSummaryOneLine()` and logs it right after the
existing per-layer `final cache summary:` line. Operators get a
rolled-up view of how many layers actually saved + total uploaded +
total post-step wall-clock budget, without scrolling per-layer
records:

  cache save totals: layers_saved=2/4 uploaded=1.25GB total_ms=24500

Designed for diagnosing post-step waste — pairs with the per-restore
table from `summaryText()`. Each value pulled from existing
StatsCollector op records; no new instrumentation needed.

Empty (no log line) when zero save ops were recorded — exact-hit-skip
on every layer, or all layers disabled.

This is a focused subset of #269 (the full proposal includes per-
phase wall-clock breakdown + ROI ratio). The one-liner ships now to
surface the budget signal; the broader proposal can iterate from this
baseline.

Refs: #269 (full design), #279 (the bug that motivated wanting this
visibility), #280 (the fix that this signal would have caught the
absence of).

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@zackees
zackees merged commit c07e914 into main May 31, 2026
5 of 6 checks passed
@zackees
zackees deleted the feat/post-save-totals-269 branch May 31, 2026 02:18
zackees added a commit that referenced this pull request May 31, 2026
Picks up #283 (#269 minimal cut) — one-line cache-save aggregate
at end of post step. action.yml default soldr version stays at
0.7.48.

Co-authored-by: Claude Opus 4.7 <[email protected]>
zackees added a commit to forge-ci/zccache that referenced this pull request May 31, 2026
setup-soldr v0.9.25 lands forge-ci/setup-soldr#283 — one-line
cache-save aggregate at the end of post step. Lets us see the
total post-step save budget at a glance instead of scrolling
per-layer records.

19 pins bumped across 9 files.

Co-authored-by: Claude Opus 4.7 <[email protected]>
zackees added a commit that referenced this pull request May 31, 2026
…te (#269) (#285)

Extends the post-step save visibility from #283 with a verbose
companion view. `StatsCollector.saveSummaryText()` emits a table
mirroring the restore-side `summaryText()`:

  cache                 save status              archive    files     time
  ──────────────────────────────────────────────────────────────────────────
  build-cache           saved                     1.19 GB   24284    15.6s
  cargo-registry-cache  saved                    56.1 MB     3142     6.4s
  cook-cache-base       skipped-race-precheck     0 B          -      0.1s
  soldr-mini-cache      exact-hit-skip            0 B          -      0.0s
  ──────────────────────────────────────────────────────────────────────────
  2/4 saved  total upload: 1.25 GB  total wall: 22.1s

The footer rolls up the same totals as the one-liner; the rows
identify WHICH layer ate which slice of the wall-clock budget —
the question the one-liner can't answer.

Both views are logged in post.ts in sequence: table first (detail),
one-liner second (skim-readable summary). Empty when zero save ops
were recorded.

Closes #269 (the per-phase wall-clock breakdown the issue called for).
ROI ratio panel (saved_ms_estimate / stash_cost_ms) requires reading
the compile-cache report from disk + threading hits/median into the
collector; left as a follow-up enhancement since the table + one-liner
together already surface the budget regression signal.

Tests: all 14 post tests still pass (1 skipped, pre-existing
.cmd-shim limitation). Pure-formatting addition.

dist/main.js + dist/post.js rebuilt via Linux/node:24.

Refs: #283 (one-liner companion), #269 (full proposal), #279/#280
(the bug the visibility would have caught faster).

Co-authored-by: Claude Opus 4.7 <[email protected]>
zackees added a commit that referenced this pull request May 31, 2026
) (#287)

The v0.9.26 save table from #285 only shows saved layers because
`postCollector.record()` was gated on `saveResult.status === "saved"`.
Skipped layers (race-precheck, tiny-delta, oversize-skip,
missing-target, exact-hit-skip) just emitted a single-line log.

Operators reading the table saw only what got uploaded — they
couldn't see WHAT was considered and skipped, or how long the
skip-decision took. Both signals matter for tuning:

  - "build-cache skipped tiny-delta in 0.3s" → save gate working
  - "cook-cache skipped-race-precheck in 0.1s" → Fix A doing its job
  - "build-cache skipped oversize" → cap might need raising (#279)

Now every save attempt — saved or skipped — records into the
StatsCollector with the actual status. The table renders all of
them. archiveBytes/inflatedBytes/fileCount stay null for non-saved
ops so the totals row only counts what actually uploaded.

Four call sites patched: solo-toolchain-cache, cook-cache-${layer}
(layered), cook-cache (legacy), soldr-mini-cache. Behavior change:
none beyond the new rows in the table; the existing log lines
remain for backward compat.

Tests: all 14 post tests still pass.

Refs: #269 (closed in spirit by #285; this finishes the visibility
loop), #283 (one-liner companion), #285 (table view).

Co-authored-by: Claude Opus 4.7 <[email protected]>
zackees added a commit that referenced this pull request May 31, 2026
Picks up #287 — record skipped save layers so the post-step table
shows them. Closes the visibility loop opened by #283 / #285.

Co-authored-by: Claude Opus 4.7 <[email protected]>
zackees added a commit that referenced this pull request May 31, 2026
…mpanion) (#289)

Mirrors the post-step `cache save totals:` line from
`StatsCollector.saveSummaryOneLine()` for the pre-build side. Reads
the SETUP_SOLDR_PHASE_*_START_MS env vars (already recorded by
`markPhase`) and computes durations as deltas between adjacent phase
start times in declared serial order:

  setup phase totals: resolve=8.5s parallel-restore=8.9s
    target-tree=0.0s toolchain=8.9s install=2.2s zccache-seed=0.1s
    verify=0.1s cross-bootstrap=0.0s cook=152.4s total=181.0s

Without this, operators looking for "where did the pre-build time go"
have to scrape raw SETUP_SOLDR_PHASE_*_START_MS env vars from the
runner log and do the subtraction by hand. The aggregate makes
phase-level regression visible on the first read — same idea as
#283/#285/#287 for the post-step.

Wired at the end of `run()` in main.ts, just before `finishPhase
("action")`. Phases whose env var isn't set (passthrough mode, test
harness) are silently skipped — empty string returned when none are
present, no log line emitted.

3 new unit tests cover the happy path, the no-env-vars-set case, and
the partial-phase-set case. 8/8 phase-timing tests pass.

dist/main.js rebuilt via Linux/node:24.

Refs: this tick's observation that zccache Integration's pre-build
budget was 28.6s and the only way to see the breakdown was raw env
var inspection.

Co-authored-by: Claude Opus 4.7 <[email protected]>
zackees added a commit that referenced this pull request May 31, 2026
…287 follow-up) (#291)

#287 patched 4 save sites (solo-toolchain, cook-cache layered/legacy,
soldr-mini) to record into the post-step save table regardless of
outcome. But build-cache and cargo-registry use DIFFERENT code paths
that were missed — they only recorded "saved" / "oversize-skip",
filtering out "tiny-delta-skip" / "exact-hit-skip" / etc.

Observed on the v0.9.28 cascade run: build-cache exact-restore +
tiny-delta-skip → invisible in table. cargo-registry restore-key
hit + fallback save → also invisible. Final table showed only
cook-cache-delta even though build + registry layers also ran.

Both sites patched to record-always. archive/inflated/file fields
stay null for non-saved statuses so totals only count actual
uploads. Status string carries the disposition.

Now operators see:
  build-cache           saved                   1.03GB  1319  19.7s
  build-cache           tiny-delta-skip            -      -   0.1s
  build-cache           exact-hit-skip             -      -   0.0s
  cargo-registry        saved                   56.1MB 14339   5.4s
  cargo-registry        missing-dir-skip           -      -   0.0s
  ...

— in addition to the cook-cache-* rows already covered.

Tests: all 14 post tests still pass; pure-formatting reshape.

dist/post.js rebuilt via Linux/node:24.

Refs: #283 (one-liner), #285 (table view), #287 (skipped-row
records for solo/cook/mini), this PR closes the gap for build +
registry.

Co-authored-by: Claude Opus 4.7 <[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