Repository navigation
Conversation
The chipdb cache in 48 openXC7 workflows was keyed on github.run_id. actions/cache sets cache-hit only on an exact key match, so the guarded build step ran on every run and the cache never saved a second. Five more used a fixed key on a floating image tag, which never misses but can serve a chipdb built by an image the job no longer runs. A composite action, .github/actions/openxc7-chipdb, now owns this: - key = part + the ID of the image the job's nextpnr runs (docker image inspect), so it hits on every run with the same image and misses exactly when it moves; - one cached path for every workflow (~/.cache/openxc7-chipdb/<part>.bin), copied to each workflow's own `out`, because actions/cache folds the path into the entry version and 50 distinct paths would store 50 copies of one file; - saved with actions/cache/save straight after the build, so a later nextpnr failure does not discard it. The 53 workflows were rewritten by a gated script: each rewrite must parse to the old document with exactly the two chipdb steps replaced by one, must re-classify as OK, and is refused for any shape it does not model (more than one cache step, more than one image, shell variables in the part or path, no checkout before it). Coverage by the speed-loop classifier, 61 chipdb-building workflows: before 1 OK, 48 NEVER_HIT, 5 STALE_RISK, 7 NO_CACHE; after 54 OK, 7 NO_CACHE. The remaining 7 build other parts or their own nextpnr and are tracked in #846. Part of #851. Fixes #843, #845. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
X Brain Health CheckScore: 100.0/100 X Brain is above merge threshold |
🧪 Brain Stress Test ResultsScore: not measured (no stress test prints a Score: line) X Stress test passed |
The note said .github/actions/ is not watched by this workflow's paths: until a tracked file exists there. #852 creates the directory and is the PR that adds the entry, so the note would be wrong on whichever of the two merges second. The reason stays in #894's description. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The openxc7-chipdb action is called by 46 workflows, and every one of them filters push on its own design files only, with no pull_request trigger. A change to .github/actions/openxc7-chipdb/ alone therefore ran nothing, on the PR or on main. Measured on this branch with a paths-coverage script: 46 of 46 triggers did not cover the action. - ax7203-led-onehot.yml (the smallest design, one seed) now runs on a PR that touches the action, and on a push to main that does, so main also warms the cache for a new key. - run-syntax-gate.yml watches .github/actions/**, which this PR creates; the gate reads composite actions once #894 lands. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merge-order note: this PR and #897 both edit the chipdb steps of 🤖 Generated with Claude Code |
…ched Seven workflows still built their chipdb on every run after the composite action landed on this branch (#852). Two of them run often enough to pay for a cache; five are dispatch-only probes where a cache would be wrong or would change an instrument for nothing. Cached through .github/actions/openxc7-chipdb: - part-coverage.yml runs daily on a 4-part matrix and ran bbaexport for every part every time. In run 37196269484 its "Build it" step, which included the chipdb, took 87 s (xc7a35t), 437 s (xc7k325t), 87 s (xc7s50) and 351 s (xc7a200t). The chipdb step has continue-on-error, so a chipdb failure is still an INCONCLUSIVE verdict, as it was when the chipdb was built inside the build step. - fpga-hslm-bitstream.yml, keyed on the ID of regymm/openxc7:latest, so it misses exactly when the tag moves. Left uncached, each with a "# chipdb-uncached: <reason>" line above the step that builds it: - openxc7-vs-vivado-openxc7-half, bufr-divide-probe, iddr-vivado-diff: the chipdb comes from a nextpnr-xilinx revision checked out in the job, not from the image the cache keys on, so an image-keyed entry would be the wrong chipdb. - iddr-golden-diff, router-vcc-reducer: the action would fit, but they have run 3 times each, last on 2026-08-18, and they are the instruments behind openXC7/nextpnr-xilinx#114. The loop's classifier (speed coverage) now counts a stated reason as decided, not as cached: on this branch 56/61 workflows cache the chipdb and 61/61 either cache it or say why not. main is 1/61. Not measured: whether bbasm resolves on PATH inside the pinned image eced1cdd that part-coverage uses. That image installs it with "cp bbasm /usr/local/bin/ || true". A dispatch of part-coverage on this branch settles it. Refs #846 #851 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0c5f415 to
779168a
Compare
… gate check_run_syntax.py read .github/workflows/*.yml only, so a run step inside a composite action (.github/actions/**/action.yml, as #852 adds) could fail to parse and the gate would pass. Closes #854. - Composite actions are read like workflows: bash -n per shell, and the single-quoted bash -c scripts inside a step, via a shared check_run(). - A composite run step must name its shell; one that does not is cannot tell (rc 2), as GitHub itself rejects it. - The runner is the caller's: every job that uses the action, directly or through other local actions (cycles end). A macOS-possible caller under a gate whose bash is not 3.x is cannot tell, as for workflow steps. - An action no workflow calls is still parsed. Node and Docker actions have no run steps and are skipped. Self-test 98 of 98 (23 new cases); 17 of 18 mutants of the new code are killed, the survivor is equivalent. On #852's tree the gate reads 1 of 1 actions and catches an unclosed quote planted in its last step, which the gate at 54020cd passes. .github/actions/** is not added to the gate's paths: here: no tracked file matches it on main yet, and the workflow-path gate rejects that entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The note said .github/actions/ is not watched by this workflow's paths: until a tracked file exists there. #852 creates the directory and is the PR that adds the entry, so the note would be wrong on whichever of the two merges second. The reason stays in #894's description. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The prune from #853 keeps the newest entry of every series on every live ref. On 2026-10-05 that alone came to 7.97 GB (130 entries), and the saves between two prunes took the repository past 10 GB, where GitHub evicts by last read, fixed keys included. The chipdb saved on fix/ci-chipdb-cache on 2026-10-04 was gone by the next morning, and the LED one-hot run on #852 rebuilt it (2 m 54 s). Two changes: - cache-prune.js: after the existing rules, while the kept entries are over BUDGET_BYTES (8e9), drop setup-zig's per-run entries on refs other than main, least recently read first. Nothing else is dropped for the budget: not a fixed key, not main, and not a chipdb whose key ends in a run id (one branch saves chipdb-...-regymm-<run id>). A chipdb hit saves about three minutes; a Zig cache hit tens of seconds at most. - actions-cache-prune.yml: also run on workflow_run after brain-ci and CI complete. The hourly schedule started 2 runs in 9 slots between 18:41Z and 03:46Z. brain-ci's jobs hold 8.59 GB and CI's 1.85 GB of 10.84 GB. Eight new tests (22 in all); 13 of 13 mutants of the budget rule are killed. On the 162-entry list of 2026-10-05 the plan drops 43 entries (3.06 GB), 10 of them (0.72 GB) for the budget, and keeps 119 (7.78 GB), including all 5 chipdb entries and all 9 entries on main. Refs #844 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary by t27-beesThis PR replaces per-workflow chipdb cache+build steps with a shared composite action keyed on the Docker image ID (not Worth a look
Read: 55 files, +330 -605, the whole diff up to 60000 characters (the rest was not read). Head |
Part of #851. Fixes #843 and #845.
What was wrong
61 workflows build the nextpnr-xilinx chipdb for an openXC7 job. Before this PR only one of them could reuse it:
github.run_id, socache-hitis nevertrueand the build step always runs (#843)regymm/openxc7tag (#845)Counts are from
tri devkit speed coverage --repo ., run onmainand on this branch.What changes
A composite action,
.github/actions/openxc7-chipdb:~/.cache/openxc7-chipdb/<part>.binunder the keychipdb-<part>-<image id>-bbasm-le-v1.bbaexport.pythenbbasm -l). It saves it at once withactions/cache/save, so a later nextpnr failure does not lose it.outpath.Why one cached path for every workflow.
actions/cachefolds the path list into the entry version. Caching each workflow'soutpath directly would store 50 copies of one identical file.53 workflows have their cache step and guarded build step replaced by one step:
The step keeps the id
chipdb, so any latersteps.chipdb.outputs.cache-hitstill resolves. The fourbuild-*workflows passimage: regymm/openxc7:latest. The twotnf-*workflows pass their pinned@sha256:image.How the rewrite was checked
actions/checkoutbefore the step.outdirectly, or does not save early.When this merges
46 of the 53 changed workflows list their own file in
push: paths, so the merge push starts 46 FPGA runs at once.maincache, so each one builds its chipdb, as every run does today. One of them saves the entry, and the rest log that another job is creating it.main, and every branch and PR, restores that entry while the image stays the same.Measured on CI
ax7203-gf10-sub.ymlwas run twice on this branch, withmainas the control.Cache hit for: chipdb-xc7a200tfbg484-2-591b377b…-bbasm-le-v1, about 68 MB restored, build step skipped,332105196 bytes cache-hit=truemain, controlPost Run actions/cache@v4step was skipped because the job failed, so nothing was savedAll three fail later, at the nextpnr seed search, with a bare
no clean seed.mainfails the same way, so the failure was already there. Its last success onmainwas 2026-07-14, beforeregymm/openxc7:latestmoved. Why it fails is #856, and #857 makes the log visible.That failure also shows something the "after" column of the table above does not. On
main, a run that fails after the chipdb step never saves the chipdb, so every failing run pays the build again. With the explicit early save here, the first run pays once, failure or not.A change to the action itself (0c5f415)
The action is called by 46 workflows, and none of their triggers covered
.github/actions/openxc7-chipdb/. So a change to the action alone ran nothing, on the PR or onmain.speed actionpathsreported 0 PR and 0 push triggers on this branch before the commit, and 1 and 1 after.ax7203-led-onehot.yml, the smallest design with one seed, now runs on a PR or a push tomainthat touches the action.Its first PR run, 37260180318 on
refs/pull/852/merge, succeeded: chipdb step 2 m 54 s (Cache not found, built, then savedchipdb-xc7a200tfbg484-2-591b377b…-bbasm-le-v1,cache-hit=false), nextpnr 29 s, 9.3 MB.bit. It missed because a PR run reads only its merge ref andmain, and the entry saved on this branch on 2026-10-04 had already been evicted (#844 comment 5987858206; #895 is the fix).Not measured
setup-zig-cache-v2-*(ci: setup-zig caches fill the 10 GB Actions cache and evict every chipdb #844), and at 11.11 GB on 2026-10-05 03:54Z after ci(cache): prune Actions cache entries nothing can restore #853's prune merged. Chipdb entries can still be evicted, and this branch's was. ci(cache): prune to an 8 GB budget, and after brain-ci and CI #895 adds a budget that never spends a chipdb.🤖 Generated with Claude Code