Skip to content

perf(ci): persist bounded ESP-IDF compiler cache without reusing firmware images - #199

Merged
masarray merged 1 commit into
mainfrom
perf/esp32p4-ccache-across-runs-20261016
Oct 16, 2026
Merged

masarray merged 1 commit into
mainfrom
perf/esp32p4-ccache-across-runs-20261016

Conversation

@masarray

Copy link
Copy Markdown
Owner

Performance root cause

The pinned espressif/idf:v5.5.4 container has ccache enabled, but the ephemeral GitHub runner discards its object cache after every run. The Studio Native Preview intentionally rebuilds firmware at every PR HEAD so the ESP32 image embeds and attests ARSTACK_SOURCE_COMMIT; skipping this build or rewriting provenance would be unsafe.

Bounded and verifiable solution

  • Persist only ccache compiler objects, keyed by the actual embedded + shared process-bus dependencies, sdkconfig and workflow version. QML-only commits retain the same content key; firmware source changes get a new key, with safe object-level fallback.
  • Cap cache size to 350 MiB, with compiler content verification.
  • Print per-run ccache hit/miss statistics.
  • Preserve idf.py build, merged recovery image, source SHA/build ID embedded inside the binary, firmware SHA-256 verification, package manifest and exact-head source checks unchanged. No firmware artifact or release binary is reused.
  • One workflow YAML file only; no changes to firmware, SV/PTP runtime, studio QML, or packaging.

Acceptance

  1. ESP32-P4 SMV Injector exact-head CI passes.
  2. Firmware manifest sourceCommit equals exact PR HEAD, and buildId remains visible in binary; release package SHA remains verified.
  3. Cache step works in pinned container and log exposes hit rate; warm hit rate is evaluated on the next compatible run, not claimed based on a cold run.
  4. No redundant manual CI dispatch or workflow rerun. A cache outage must not become a hardware safety or firmware quality bypass.

This optimization deliberately avoids skip-build heuristics and preserves current safety/physical testing gates.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

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 ✅ Completed 2026-10-16T11:29:08.267861Z c172b36 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.

@masarray
masarray merged commit 463e48e into main Oct 16, 2026
3 checks passed

Copy link
Copy Markdown
Owner Author

Measured acceptance (first cold-cache CI, exact head c172b368): ESP32-P4 job PASS, cache restore step PASS (expected cold miss), ccache enabled by ESP-IDF CMake, 958 / 958 compiler calls cacheable, cold run 0 / 958 hits, cache size ~12% of 350 MiB, Cache saved with key confirmed. Firmware manifest sourceCommit and build-ID binary embed verified, recovery image SHA-256 075ef0d29106cf827644d9124798f3636ff62b9aeabdc2c9cc595c64712cffd3, artifact uploaded. Next same-content run should measure warm hits and duration; no speedup claimed yet. Squash merged to main@463e48e.

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