Skip to content

perf(ci): research sub-10% routine Actions usage and full-gated releases #4543

Open

Description

@zackees

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

  1. Inventory every workflow on ordinary PR, master, tag, dispatch, and chained workflow_run events. 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 with ci-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).
  2. Prototype one Linux native build producing the existing fastled.so plus 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 in ci-full and release mode rather than weakening their meaning.
  3. 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 master separately; 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.
  4. 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 master commit 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 remote master/tag/version state immediately before writing; creates the X.Y.Z tag 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. A master version-change push by itself must not possess the tag-writing path.
  5. 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 master while 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. Update RELEASE.md, ci/release.py help, and a short, prominent warning in CLAUDE.md (which CODEX.md loads): use ci-full for platform-sensitive PRs; normal PR/master is 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 label ci-platform:esp* expands to every canonical target ID beginning esp (including ESP32 and ESP8266 variants); ci-platform:teensy41 chooses 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 hoc contains() tests in workflow YAML.
  • ci-test:<selector> chooses an independently named test family, such as ci-test:qemu*, ci-test:wasm, or ci-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-full supersedes 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*, exact ci-platform:teensy41, a ci-test: suite, multiple-label union, ci-full precedence, 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/master events 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/master ratios. 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-full and 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_tag remains 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: and ci-test: labels; only a final * performs anchored prefix matching through the script-backed registry. Existing platform: 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 fastled shared-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

Activity

  1. zackees commented on Sep 23, 2026

    @zackees
    MemberAuthor

    update this with tags for explicit platform testing and other ci tests activing.

    For example esp*

    For the esp family.

    This needs to be documented an systemetised in a script for all platform tuypes to be emitted, this can be used by an LLM to tag a PR for testing.

    another example

    tag: teensy41

    prefer prefix wild carding

  2. zackees commented on Sep 23, 2026

    @zackees
    MemberAuthor

    Addressed in the issue body. Selective PR validation now uses script-backed labels: ci-platform:esp* for the ESP prefix family, ci-platform:teensy41 for an exact target, and ci-test:<selector> for other test families. The catalog must emit valid labels and concrete CI cells, check label/workflow drift, and handle label add/remove on the exact PR SHA. ci-full and release still require the complete matrix; existing platform: labels remain descriptive.

  3. zackees commented on Sep 23, 2026

    @zackees
    MemberAuthor

    Owner policy decision for this C++/embedded rollout: GitHub-hosted macos-15-intel and macos-15 are allowed for explicit ci-full and release validation, but not ordinary unlabeled PR or master runs. PR #4548 has landed the opt-in native Intel/ARM unit+example CI half, with same-SHA full passes and unlabeled skips. The release half is still open: the release worker must run both native architectures and the complete platform/board manifest on the exact candidate SHA before creating any tag or publishing. Do not infer that the merged CI PR alone makes the existing version-change release path safe.

  4. zackees commented on Sep 23, 2026

    @zackees
    MemberAuthor

    Phase 2 native-CI research for the strict <10% routine PR/master target: matched PR baseline is 128.89 runner-min, so ceiling is 12.889. The green Phase 1 unlabeled event at SHA 402f523 used 36.70 min (28.5%; five executed jobs), and Linux unit alone cost 22.18 min. This is not acceptance. template_unit_test.yml passes --no-parallel, setting NO_PARALLEL=1; ci/util/cpu_count.py thereby limits both compile and custom streaming test execution to one worker. tests/meson.build declares three serial/racy tests (fl_file_system, channel_driver_uart, fl_remote_loopback) via Meson is_parallel: false, but ci/meson/streaming.py has its own executor and does not honor that metadata. Before lifting the global serial setting, add RED→GREEN coverage proving those three tests never overlap any other unit test, preserve the #3011 missing/stale-artifact guard against parallel link storms, and measure per-link/test peak RSS plus OOM/flake rates on hosted Linux. A separate Phase 2 PR should use one configured Meson build/shared fastled.so for native unit+example smoke, bounded safe parallelism, an explicit checked-in smoke manifest, and concurrent unit/example execution where memory allows. Keep full native Linux/Windows/Intel+ARM macOS suites and all matrix cells on exact-SHA ci-full/release. Estimate memory and positive job runner-min before claiming <10%; require matched clean PR and master proofs.

  5. zackees commented on Sep 23, 2026

    @zackees
    MemberAuthor

    Correction to my earlier serial-test inventory: tests/meson.build names fl_file_system, channel_driver_uart, and fl_remote_loopback as serial, but only channel_driver_uart currently has a test source/metadata entry. The other two are stale names, not currently executed tests. Phase 2 must keep a generic exclusive-test scheduling mechanism and RED→GREEN cover the live UART test; it must not claim the absent two execute. Cold-ish isolated local benchmark under debug-thin --no-parallel: named fastled_core passed in 160.4s (144.6s compilation, 35 cold zccache misses), then fl_hsv2rgb_accuracy in 7.0s and live serial channel_driver_uart in 4.34s sharing the same Meson build. Five selected Python guard/color test files ran 39 tests + 10 subtests in 2.70s locally. These are benchmark evidence, not GHA acceptance. Full exact-SHA 109-cell sweep is still running; draft PR remains unmerged.

  6. zackees commented on Sep 23, 2026

    @zackees
    MemberAuthor

    Exact-SHA ci-full pilot at 9c0def16885d9bbb7b350927c17266e35f27ad65: 93 labeled workflow runs; 109/109 catalog cells instantiated, 108 cells passed, one ESP32-S3 all-examples cell was cancelled solely by the 45-minute reusable-job cap (run 35930376244). Its ./compile esp32s3 all step succeeded in 43m31 (22:56:03–23:39:34 UTC); post-build Blink, symbol, and log upload steps also succeeded through 23:40:05, then the job timeout cancelled at 23:40:13. This proves the work is just over the wrapper cap, not a compile failure. The draft PR has a targeted timeout-minutes reusable input defaulting to 45 and an ESP32-S3-only 60-minute override; all other boards keep 45. The full event consumed 1011.14 raw positive job runner-minutes including the cancelled 45.03-minute job; final-SHA full rerun is required before any merge/acceptance. Separate ordinary final-SHA <10% proof is also required.

  7. zackees commented on Sep 23, 2026

    @zackees
    MemberAuthor

    Denominator correction for the <10% compute goal: the old PR #4418 128.89 runner-min/20 workflows is a historical ordinary PR event, not a full sweep. Comparing the 9c0def unlabeled 30.57-min event to 128.89 gives 23.7% of prior routine cost (a savings comparison), but the same-SHA ci-full event actually consumed 1011.14 raw positive runner-minutes across 93 workflows, so the relevant fractional/full ratio is 30.57 / 1011.14 = 3.02%. The full sweep had one ESP32-S3 timeout-cancelled job despite successful compilation, so it is not a complete full-pass acceptance proof. The new SHA needs both a clean ordinary measurement and 109/109 full-cell pass; do not use 128.89 as the <10% denominator.

  8. zackees commented on Sep 24, 2026

    @zackees
    MemberAuthor

    Phase 2 pilot on exact SHA aaca3e47e8444f00c5732421422fe3a4a55c1d23: green ordinary PR event had 97 triggered workflows, 116 check jobs including skips, four executed jobs and 17.87 raw positive runner-minutes: Linux unit smoke 6.68 (35935742841), Windows unit smoke 8.57 (35935741265), Linux CompileTests 2.35 (35935741116), selector 0.27 (35935742640). The full ci-full label event on this unchanged SHA has spawned exactly 97 workflows: all 90 selected catalog workflows, selector, Linux/Windows native unit+example wrappers, and Intel/Apple Silicon Mac unit+example wrappers. Full cell conclusions/denominator are pending. The PR remains draft/unmerged; no release/tag.

  9. zackees commented on Sep 24, 2026

    @zackees
    MemberAuthor

    Final same-commit FastLED CI measurement for draft PR #4549 at aaca3e47e8444f00c5732421422fe3a4a55c1d23:

    Routine/full ratio: 17.8667 / 1,014.8167 = 1.7606%, below the strict <10% PR budget. This is raw elapsed runner time, not billing-weighted OS pricing. Reproduction: query Actions runs for this exact head_sha, partition the 23:52 ordinary event from the 00:01–00:02 labeled event, paginate each run's jobs, and sum max(0, completed_at - started_at) for executed jobs only; skipped jobs contribute zero. All triggered workflows and their jobs are included. The PR remains draft/unmerged; an ordinary master proof and release safety work remain separate acceptance items in this issue.

  10. zackees commented on Sep 24, 2026

    @zackees
    MemberAuthor

    Post-merge release evidence:

    • Exact merge SHA dc0da70540b03dce50dccbe158dbe93d78014d7e passed all 97 required workflow-dispatch sweeps.
    • Ordinary merged-master CI used 34.32 runner-minutes, about 3.38% of the matched full sweep.
    • The dry release remained fail-closed because master advanced to 2dbe0bcbcb82f317eb0136b892f52a743718b2e4 during the long sweep. The queued stale-candidate dry run was cancelled before material compute.
    • No tag or release was created.

    This validates both the fractional mode and exact-SHA refusal, while exposing the remaining release-coordination requirement: freeze or queue the candidate so ordinary merges cannot invalidate a completed full sweep.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions