Skip to content

perf(ci): experiment with sccache for relay builds - #5224

Merged
wesbillman merged 2 commits into
mainfrom
carl/sccache-relay-experiment
Aug 10, 2026
Merged

perf(ci): experiment with sccache for relay builds#5224
wesbillman merged 2 commits into
mainfrom
carl/sccache-relay-experiment

Conversation

@wesbillman

Copy link
Copy Markdown
Collaborator

Summary

  • add a SHA-pinned sccache action to reuse unchanged Rust compilation units when the exact relay artifact cache misses
  • keep pull requests read-only while preserving cache writes for trusted main and release pushes
  • stop saving isolated exact relay-artifact caches from PRs, reducing cache churn
  • preserve the exact artifact cache as the zero-build fast path

Why this is an experiment

The relay artifact job currently misses its exact cache whenever any file under crates/** changes, forcing a full workspace rebuild. PR #4975 spent roughly 21 minutes in that job for a one-file buzz-sdk change. sccache targets the relevant reuse boundary—individual compiler inputs—but the repository cache pool is already under heavy eviction pressure, so this PR does not claim a proven timing win yet.

Safety

  • Mozilla-Actions/sccache-action is pinned to commit fc920bf0ec8de6ee65d409111f7ec508035751ba
  • RUSTC_WRAPPER is scoped only to Build relay artifacts
  • PRs use READ_ONLY; trusted push runs (main and release) use READ_WRITE
  • the existing exact finished-artifact cache remains the first/fast path
  • finished artifacts are saved only by trusted pushes, preserving the former trust boundary
  • workflow permissions remain contents: read; no pull_request_target path is introduced
  • the pinned action automatically emits sccache hit/miss/error/write/duration statistics in its post-job hook

Validation

  • actionlint .github/workflows/ci.yml
  • git diff --check
  • desktop release-cache contract test
  • release-ref contract test
  • independent code-shape reviews from Princess Donut and Mongo: 9/10, no remaining findings

Measurement plan

  1. purge obsolete PR-scoped relay-artifacts-* cache entries before measurement
  2. merge/push a trusted writer to populate sccache
  3. run a representative one-crate PR
  4. compare relay job duration and automatic sccache statistics against the 21–22 minute baseline
  5. retain this only if the warm run demonstrates material improvement

Reuse unchanged workspace compilation units when the exact relay artifact
cache misses. Keep pull requests read-only, preserve trusted push writes for
main and release, and stop creating isolated PR artifact caches that cannot
warm other refs.

Co-authored-by: Carl <c7ebe626f000404285d3686e1dc74cc07cc60a9754a150041ba132e14bd3e2ec@buzz.block.builderlab.xyz>
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
@wesbillman
wesbillman requested a review from a team as a code owner August 7, 2026 18:44
Comment thread .github/workflows/ci.yml Fixed
Let only PR 5224 write compiler outputs to its PR-scoped cache during the
bounded experiment. Document the matching cache-poisoning suppression; the
trial output cannot be restored by main, release, or unrelated pull requests.

Co-authored-by: Carl <c7ebe626f000404285d3686e1dc74cc07cc60a9754a150041ba132e14bd3e2ec@buzz.block.builderlab.xyz>
Signed-off-by: Wes <wesbillman@users.noreply.github.com>

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Carl safety review on Wes’s behalf at exact head 54cfe936c87a90c44388c592f3dc992abfc9edc0: I found no correctness or cache-poisoning blocker. The action is SHA-pinned, the downloaded v0.16.0 binary was checksum-verified in the run, RUSTC_WRAPPER is scoped to the relay build step, PR 5224 writes only to its isolated refs/pull/5224/merge cache scope, other PRs are read-only, and only the workflow’s trusted main/release push triggers can populate shared caches. The exact finished-artifact cache remains the first path. The head merges cleanly with current main and the resulting workflow delta is unchanged. Would approve from a safety perspective; GitHub does not permit self-approval from the PR-author account. Operational caveat, not a blocker: the cold proof showed 3/1309 cacheable hits (0.23%), 1,285 writes, and 21 write errors, so benefit and cache-pressure cost remain unproven. Treat the merge as the advertised bounded performance experiment and remove/revert it if the warm measurement does not materially improve the relay job.

@wesbillman
wesbillman merged commit 5a3b3d2 into main Aug 10, 2026
33 checks passed
@wesbillman
wesbillman deleted the carl/sccache-relay-experiment branch August 10, 2026 17:49
atishpatel added a commit that referenced this pull request Aug 11, 2026
…overy

* origin/main:
  fix(link-preview): reliably render previews sent right after they resolve (#5245)
  fix(link-preview): restore Buzz entity link cards (#5494)
  chore(release): release Buzz Desktop version 0.5.9 (#5521)
  feat(cli): add --visibility flag to channels update (#5119)
  Polish desktop onboarding flow (#5310)
  fix(desktop): quiesce renderer polling while hidden (#3677) (#5490)
  fix(channels): restore member invitations to private channels (#5493)
  perf(ci): experiment with sccache for relay builds (#5224)
  fix(desktop): bound nine unbounded localStorage stores (#5454)
  feat(desktop): time-based sweep for stale localStorage caches (#5453)
  ci(release): gate OSS desktop auto-update promotion (#5398)
  fix(release): pin desktop PR operations to block/buzz (#5212)
  fix(search): surface exact short profile names (#5480)
  Reduce repeated ACP session context (#5423)
  feat(desktop): NIP-AM agent-usage backend — P2 emission/transport/archive + P4a aggregation/D6 (#4000)
  fix(desktop): resolve overlapping member mentions (#5225)

Signed-off-by: Brainy Bumble <0ed7657b57c0e8a9f5288390dd6c8d5d0a3a06abe9b01b9006814f52077d6cdf@buzz.block.builderlab.xyz>
Co-authored-by: Atish Patel <atish@squareup.com>
Signed-off-by: Atish Patel <atish@squareup.com>
wpfleger96 added a commit that referenced this pull request Aug 11, 2026
Bring in main's runtime.rs mesh acp_model wire translation so local
checks and CI both run on the merged tree. Clean auto-merge; the PR's
fail-closed spawn gating and main's model translation touch disjoint
regions of spawn_agent_child.

* origin/main: (24 commits)
  Improve desktop search scoping (#5306)
  Add glass appearance and cohesive settings (#5478)
  Add Send to channel for thread messages (#5305)
  Fix macOS attachment picker lifecycle and allow inert HTML downloads (#5569)
  fix(desktop): preserve fresh channel timelines (#5577)
  fix(desktop): suppress fresh focus-return refetches for channels and home-feed (#5535)
  chore: mesh upgrade, clean up legacy special case code, simplify model selection for mesh (#5289)
  fix(desktop): preserve theme when opening communities (#5266)
  fix(link-preview): resolve YouTube videos through oEmbed (#5520)
  fix(buzz-agent): harden Databricks OAuth token cache and callback (#5534)
  fix(link-preview): reliably render previews sent right after they resolve (#5245)
  fix(link-preview): restore Buzz entity link cards (#5494)
  chore(release): release Buzz Desktop version 0.5.9 (#5521)
  feat(cli): add --visibility flag to channels update (#5119)
  Polish desktop onboarding flow (#5310)
  fix(desktop): quiesce renderer polling while hidden (#3677) (#5490)
  fix(channels): restore member invitations to private channels (#5493)
  perf(ci): experiment with sccache for relay builds (#5224)
  fix(desktop): bound nine unbounded localStorage stores (#5454)
  feat(desktop): time-based sweep for stale localStorage caches (#5453)
  ...

Signed-off-by: Duncan <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@buzz.block.builderlab.xyz>
Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
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.

2 participants