perf(ci): research sub-10% routine Actions usage and full-gated releases
Context
FastLED is a C++/embedded library, not a Rust platform crate. The fleet idea still applies: keep ordinary PRs and merges to master quick and cheap, then collate the long platform/board/OS/sanitizer validation on an explicit ci-full PR or a release candidate. Target: each ordinary PR and ordinary master update consumes strictly less than 10% of the matched current full-validation GitHub Actions runner usage. This is whole-event compute across every triggered workflow and its descendants, not a claim based on running one of ten boards or on wall-clock latency alone.
The Actions API for one master SHA, df106dfe6a2124c03143ef611c7d1174ea70f06c returns 99 push workflow runs created within seconds on 2026-09-14 (92 success, 7 failure). That demonstrates the broad fan-out; it is not yet a runner-minute baseline. Linux/macOS/Windows unit and example tests are separate workflows, while many per-board build_*.yml jobs use build_template.yml. The Linux unit template and example template each install and build independently.
The preferred common-library layout is largely already present: native Meson builds one fastled shared library, and unit-test DLLs and example DLLs link against it. Research should exploit this existing path, not propose a second fastled.so. On Linux the artifact is fastled.so; Windows/macOS have their platform equivalents. Existing sanitizer and ABI compatibility constraints must survive any cross-job artifact reuse.
The current release workflow is triggered by master changes to library.properties/library.json and executes gh release create <version> --target "$GITHUB_SHA"; merging the version PR can create the tag without first waiting for full CI on that exact SHA. RELEASE.md calls the merge itself the release. check_tag.yml checks a hand-pushed tag after creation; it cannot act as a pre-tag gate, and a tag created with GITHUB_TOKEN does not trigger that push workflow. Also, ci/release.py documents a PlatformIO crawler that can publish the default-branch version even without a tag. The migration must handle this external race deliberately.
Research and proposed direction
- Inventory every workflow on ordinary PR,
master, tag, dispatch, and chainedworkflow_runevents. Classify a reviewed minimal contract (fast C++ unit and representative example execution, essential lint/structural checks, any safety-critical smoke that fits the budget) and a full contract (all release-relevant boards/toolchains, host OSes, examples, longer tests, full sanitizers, WASM/QEMU and other required release checks). Use one source-of-truth coverage manifest and one mode selector: ordinary PR/master= minimal; PR withci-full= full; explicit release attempt = full on a fixed candidate SHA. Label add/remove and PR update must re-evaluate the mode; full must override fast/skip settings. Preserve the existing external-fork security boundary and stable required check(s). - Prototype one Linux native build producing the existing
fastled.soplus compatible test/example modules, then fan out to two parallel execution runners/jobs, one for unit tests and one for examples. Validate artifact completeness, loader paths, ABI/build-mode/sanitizer runtime, source SHA, and failure reporting. If shipping build artifacts between two jobs is not portable or costs too much, keep one build runner and execute the two suites in parallel child processes there; independent builds are a last fallback, with measured justification. In every option, unit and example execution must overlap, neither suite may silently disappear, and peak memory/concurrency must remain safe. Measure peak RSS and aggregate concurrent memory against today's duplicate native compiles; make lower memory use an explicit design objective, not merely lower runner time. Keep full sanitizer/long-running suites inci-fulland release mode rather than weakening their meaning. - Measure the whole routine event before and after. Add a reproducible collector using Actions runs/jobs APIs, paginating all workflows and summing actual allocated job time, including failed/cancelled attempts and reruns (skipped jobs consume no runner). Report raw runner-minutes plus standard-runner-equivalent/billed weighting when OS classes differ, alongside wall time. Compare matched path-change classes and clean/warm cache conditions for PR and
masterseparately; do not use the 99-run count as the savings calculation. The finished ordinary paths must each be <10% of their full-equivalent baseline. If the chosen smoke gate misses that budget, refine the suite/build strategy instead of relabeling full work as minimal. - Replace implicit version-push tagging with a systematic release-attempt state machine. A release-attempt issue is the live control record: its structured directive identifies the version, exact candidate
mastercommit SHA, required full matrix, expected artifacts, and current attempt status, and it records every run, failure, retry, and final tag/release URL. A read-only validation worker runs the complete full contract and emits a coverage result tied to that SHA. Only a separate, explicitly authorized tag/publish stage with write permission may act after that result is green, complete, and still current. It re-reads the remotemaster/tag/version state immediately before writing; creates theX.Y.Ztag at the tested SHA exactly once (never force/move it), verifies any existing tag matches, then creates the GitHub release with--verify-tag. Fail closed on a wrong SHA, missing cell, failed/pending/cancelled run, version mismatch, or stale directive. Retries must resume the same attempt without a new version bump or an accidental second tag. Amasterversion-change push by itself must not possess the tag-writing path. - Resolve the default-branch registry-crawler sequencing before changing the release workflow: determine whether a release branch, merge queue/staging ref, registry settings, or another promotion design can avoid exposing an untagged new version on
masterwhile still proving full CI on the exact commit that is tagged. Document any unavoidable interval and its mitigation; do not preserve auto-tagging as an unexamined workaround. UpdateRELEASE.md,ci/release.pyhelp, and a short, prominent warning inCLAUDE.md(whichCODEX.mdloads): useci-fullfor platform-sensitive PRs; normal PR/masteris minimal; never manually or automatically tag/release from a version bump; start/resume the explicit release attempt and require its exact-SHA full green gate first. Link detailed procedure from the short rule so agents always find it without loading it all by default.
Selective CI activation by PR label
ci-full remains the complete matrix. Add additive, narrower PR labels for deliberate pre-merge validation:
ci-platform:<selector>chooses platform/board targets. Examples: the literal GitHub labelci-platform:esp*expands to every canonical target ID beginningesp(including ESP32 and ESP8266 variants);ci-platform:teensy41chooses that exact target and its declared companion checks such as the Teensy 4.1 size gate. Prefer a small set of reviewed prefix selectors (esp*,teensy*, etc.) plus exact IDs; a single trailing*is the only wildcard syntax. No infix/regex/glob ambiguity, no empty match, and no ad hoccontains()tests in workflow YAML.ci-test:<selector>chooses an independently named test family, such asci-test:qemu*,ci-test:wasm, orci-test:sanitizer, from the same reviewed inventory. Platform selectors include their declared build, size, emulator, and other platform-specific companion checks; test-family selectors can request suites without a board. Multiple labels union their required cells with the always-on minimal gate.ci-fullsupersedes selectors and still runs every release-required cell. Selective labels are opt-in runs, not part of the default <10% measurement and never a substitute for full release validation.
Systemize this in one script-backed registry, not a handwritten label-to-workflow table spread across dozens of YAML files. A new repository wrapper such as bash ci-labels list --json must emit every valid exact board/platform ID, approved prefix-family label, and test-family label, with the concrete workflows/cells each resolves to; bash ci-labels expand 'ci-platform:esp*' and bash ci-labels check should use the same resolver as CI. Derive or validate the registry against ci/boards.py, the per-board workflow wrappers, and the full-coverage manifest; fail on target/workflow drift, duplicate IDs, unknown labels, or a selector resolving to zero cells. Generate a short Markdown/JSON catalog usable by an LLM before it labels a PR, and provide an idempotent label-sync/check command so every emitted label actually exists in GitHub. Existing broad platform: esp32/platform: teensy labels are metadata; do not silently repurpose them as costly CI triggers.
The workflow must recompute the selection on PR opened, synchronize, reopened, labeled, and unlabeled events, bind the result to the exact PR head SHA, and retain the fork/security boundary. A label added after a push starts the requested cells; removal cannot leave a stale green result for a different selection. Unknown/malformed CI labels must produce a clear validation failure, not silently run less or trigger the whole fleet. Report resolved cells and estimated/actual runner cost in the workflow summary. Do not run untrusted fork code in a privileged pull_request_target context.
Acceptance for this extension is RED → GREEN coverage for ci-platform:esp*, exact ci-platform:teensy41, one ci-test: suite, union of labels, ci-full precedence, invalid/no-match selectors, label add/remove on an unchanged SHA, catalog/label drift, and release full coverage regardless of PR labels. Add the short agent-doc instruction to run bash ci-labels list --json (or its chosen stable wrapper) before choosing a platform/test label; never guess a label name from a board nickname.
Acceptance criteria
- RED → GREEN selective activation: prove
ci-platform:esp*, exactci-platform:teensy41, aci-test:suite, multiple-label union,ci-fullprecedence, label add/remove, invalid/no-match rejection, and catalog/GitHub-label drift. Requested jobs run on the exact PR SHA and cannot replace the complete release gate. - RED → GREEN: focused tests first demonstrate that routine PR/
masterevents currently select the broad fan-out and that version-change pushes can reach tag creation without an exact-SHA full gate. After the change, tests prove minimal/full mode selection, label transitions, complete full-matrix coverage, stable required statuses, fork safety, and a version push with no release directive cannot tag. - Report the reproducible before/after Actions query, run IDs, matched path classes, inclusion of all triggered workflows/reruns, and separate ordinary PR/
masterratios. Both must be strictly <10% in actual runner usage; also report weighted usage and elapsed latency. A missing/failed workflow cannot be treated as a compute saving. - Show the native shared-library/artifact experiment and timed comparison among dual execution jobs, parallel processes on one runner, and independent builds. Include peak RSS and aggregate concurrent memory; select the cheapest memory-safe design. Unit tests and examples execute concurrently in minimal mode and report independent pass/fail/coverage; the complete long-running suites remain runnable on
ci-fulland required on release. - A release dry run proves a fixed candidate SHA triggers every required full cell and cannot create any tag. Failure injection covers missing/failed/cancelled full CI, wrong SHA, changed
master, existing matching/conflicting tag, duplicate dispatch, and publication retry. Only a complete green exact-SHA attempt can create the immutable tag and release;check_tagremains defense in depth, not the gate. - Agent/release documentation is updated to remove “merge is the release” instructions and make accidental/manual tagging explicitly forbidden outside the gated release path. Record the PlatformIO crawler sequencing decision and test or operational evidence for it.
Decisions
Use namespaced
ci-platform:andci-test:labels; only a final*performs anchored prefix matching through the script-backed registry. Existingplatform:labels remain descriptive so old metadata cannot unexpectedly allocate runners.Make this a FastLED-specific research/rollout issue, not a copy of the Rust fleet CI issue: embedded board coverage, native C++ shared libraries, sanitizer modes, and registry crawling create different constraints.
Prefer reusing the existing Meson
fastledshared-library target. Two parallel execution jobs are preferred only if artifact portability and total runner usage support them; parallel processes on one runner are the acceptable fallback.Treat full CI before tag creation as a hard release invariant. Current post-tag validation and version-consistency lint are valuable but cannot substitute for that gate.
Use whole-event, matched runner usage as the <10% measure; keep wall-clock improvement as a separate goal so extra parallel runners do not disguise increased compute.
Open questions to resolve in the research
- What exact full coverage manifest includes release-blocking board, host, WASM/QEMU, size, and sanitizer checks, and which current workflows are advisory only?
- What is the safe PlatformIO crawler/promotion sequence that satisfies both no untagged release exposure and full validation of the exact tag commit?
Related issues
- #4529 investigates slow Linux unit/example jobs and provides phase timings; this issue governs whole-event selection and release safety.
- #4535 covers the core-only ASan
debug-thinpreset; retain its full-sanitizer backstop inci-full/release mode. - #4444 added version/tag consistency checks; extend safety before tag creation rather than relying on its post-tag check.
Source: FastLED/FastLED