Skip to content

perf(ci): upload only current portable build cache entries - #4744

Merged
N0zoM1z0 merged 1 commit into
mainfrom
perf/ci-current-build-cache-20261017
Oct 17, 2026
Merged

N0zoM1z0 merged 1 commit into
mainfrom
perf/ci-current-build-cache-20261017

Conversation

@N0zoM1z0

@N0zoM1z0 N0zoM1z0 commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Keep rea-build-cache limited to the completed test:prepare task closure instead of uploading every historical entry restored by the cross-run cache. A real cache inventory contained 343 entries/1,029 files (413.4 MiB); only six current tasks/18 files (6.14 MiB) were needed, a 98.5% byte reduction.

Approach and boundary

A shared parser owns eager Turbo task identity/hash validation for both the unchanged cross-run key algorithm and snapshot selection. Stage required archives/metadata and available manifests by copying files into an owned job-local directory. Reject malformed/ambiguous plans, missing required entries and non-files; remove prior/partial snapshots on failure. The producer uses Bash pipefail and uploads only after successful preparation/staging. The original cross-run cache remains intact; consumers retain their existing build/prepack/live checks and current-run artifact lineage.

This is internal CI preparation, with no CLI/MCP, Evidence, provider, installation, dependency or authority changes. A new maintainer scope decision is not applicable. It implements the measured cache finding from the CI efficiency audit following #4737; there is no separate product bug to close. It does not claim to fix #4713.

Executed validation

  • npm run test:focused -- the new cache boundary tests plus CI lanes/cache-policy/project-ownership/change-selection tests: 252 passed. After a controlled copy-all-cache fault was detected and removed, the directly affected tests passed 22/22 again.
  • Complete npm run check:ci, npm run check:fast, npm run docs:check, actionlint 1.7.12 and git diff --check: passed.
  • Actual Turbo 2.11.7 full/compact/full/compact restores with outputs removed each time: 6/6 cache hits and byte-identical 1,673 output files. A manifest-free archive/metadata cache also restored 6/6 with the same digest. Source cache contents stayed byte-identical across production staging. Source, Node-pin and lockfile changes invalidate hashes; an ignored note does not.
  • Restored compiled CLI/stdio MCP analysis: the selected matrix passed all four CLI + four MCP input scenarios. Full Linux npm run verify:package passed pack/install/update, CLI, 207 MCP tools, six prompts, Evidence and cleanup. These checks do not establish real external Hopper/Ghidra behavior.

Measurements use two pinned Linux cores, serial heavy jobs and a 3 GiB default Node heap. The actual added dry-plan/staging pipeline took 0.46 s wall / 0.64 s reaped CPU / 186 MiB sampled family RSS, with a warm local filesystem. Median full vs compact restoration was 0.620 vs 0.623 s wall, 0.642 vs 0.626 s CPU, and peak 305 vs 303 MiB family RSS: no local restoration speedup is claimed. Package verification took 226 s / 202 s CPU / 1.37 GiB; full static checks peaked at 4.91 GiB. CPU excludes unreaped descendants and sampled RSS can double-count shared pages. Artifact transfer latency, hosted CPU/memory, machine-cold behavior and agent token costs are unmeasured. Cache data combines a real hosted artifact at 70de702109 with completed current-base (9d5b931875) task entries. Current-head hosted Linux x64/arm64 and macOS arm64 package checks, Windows capability/package checks, real Apple artifact E2E, and all eight Linux real-system workflows passed in CI run 39021033414. The downloaded published artifact has exactly six task entries/18 root-level files (6,450,684 bytes; 6,217,555-byte ZIP). Linux JavaScript recovery and macOS package preparation both show 3/3 portable build cache hits. Greptile reviewed this exact head with no actionable findings; automatic Codex review was unavailable because repository credits were exhausted.

Author readiness

Human owner: @N0zoM1z0. The declarations below are transcribed under the owner's explicit standing instruction on 2026-10-17: “後續審閱,承擔,聲明 都同意!不用問我了”. This records that direction, rather than a separate agent assertion that a new human-review event occurred.

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-17T09:24:54.299021Z 17e9a75 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@greptile-apps

greptile-apps Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[High impact] The PR appears safe to merge; no actionable issues were found.

Summary

The PR limits rea-build-cache to entries selected by the current test:prepare plan.

  • CI uploads only cache files for the current preparation tasks.

No actionable correctness or security issues were identified. Tests were inspected but not run during this review. Supersession could not be checked because GitHub authentication was unavailable.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Restore cross-run cache] --> B[Run test:prepare]
  B --> C[Read current dry plan]
  C --> D[Validate tasks and hashes]
  D --> E[Copy selected cache entries]
  E --> F[Upload rea-build-cache]
  E -->|Copy fails| G[Remove partial snapshot and fail]
  F --> H[Consumers restore into .turbo/cache]
Loading

Reviews (1) · Last reviewed commit: "perf(ci): upload only current portable b..." · Reviewed by Greptile

@N0zoM1z0
N0zoM1z0 merged commit 2092f90 into main Oct 17, 2026
39 checks passed
@N0zoM1z0
N0zoM1z0 deleted the perf/ci-current-build-cache-20261017 branch October 17, 2026 09:44
@morluto morluto added area: build Build, CI, packaging, and publishing performance Performance regressions, scaling limits, and bounded-resource work labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build Build, CI, packaging, and publishing performance Performance regressions, scaling limits, and bounded-resource work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Linux cli-boundary worker intermittently exhausts its 384 MiB heap

2 participants