Skip to content

refactor(autoresearch): gate runSimdTests() behind FL_RUN_SIMD_TESTS_AT_BOOT - #2618

Merged
zackees merged 1 commit into
masterfrom
refactor/2542-gate-runSimdTests-at-boot
May 31, 2026
Merged

zackees merged 1 commit into
masterfrom
refactor/2542-gate-runSimdTests-at-boot

Conversation

@zackees

@zackees zackees commented May 31, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Stop running the 85-test SIMD validation suite unconditionally on every boot of the AutoResearch example
  • Gate the boot-time call behind -DFL_RUN_SIMD_TESTS_AT_BOOT=1 (off by default), mirroring FL_BENCH_WAVE8_AT_BOOT / FL_BENCH_PARLIO_AT_BOOT from perf(wave8): byte-indexed expansion LUT (#2526) — 1.66x on ESP32-P4 #2539
  • runSimdTests() itself is unchanged; the existing testSimd RPC handler in AutoResearchRemote.cpp remains the canonical invocation path

Closes #2542.

Why

Every boot of AutoResearch was paying ~50–100 ms + log dump for a validation suite already callable on demand via RPC. Same anti-pattern PR #2539 fixed for the wave8 expansion bench.

Test plan

  • Compile AutoResearch for esp32p4 — SIMD tests should NOT run at boot
  • Compile with -DFL_RUN_SIMD_TESTS_AT_BOOT=1 — SIMD tests SHOULD run at boot (bridge mode)
  • testSimd RPC call still works (unchanged)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Behavior Changes
    • SIMD validation tests now run only on explicit RPC request; startup execution available via configuration flag.
    • PARLIO encode benchmarking removed from startup; accessible through RPC only.

…AT_BOOT

Stop running the 85-test SIMD validation suite unconditionally on every
boot of the AutoResearch example. The testSimd RPC handler in
AutoResearchRemote.cpp is the canonical invocation path; the boot-time
call was a redundant ~50-100 ms tax plus log noise for anyone using
AutoResearch as the regular LED autoresearch tool.

Mirrors the FL_BENCH_WAVE8_AT_BOOT / FL_BENCH_PARLIO_AT_BOOT pattern from
PR #2539: keep the function callable, gate the boot-time invocation
behind an opt-in macro for use as a bridge until the testSimd RPC
routing on P4 is fixed (#2541).

Closes #2542

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@coderabbitai

coderabbitai Bot commented May 31, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 083ae278-d0f9-452b-a343-ce3deec90ad4

📥 Commits

Reviewing files that changed from the base of the PR and between 21bf87b and 959d6c3.

📒 Files selected for processing (1)
  • examples/AutoResearch/AutoResearch.ino

📝 Walkthrough

Walkthrough

The AutoResearch sketch setup() is refactored to move validation and benchmarking from unconditional boot-time execution to RPC-driven invocation. SIMD tests are now gated behind FL_RUN_SIMD_TESTS_AT_BOOT (off by default), while the boot-time PARLIO encode benchmark block is removed entirely.

Changes

Boot-time test and benchmark consolidation

Layer / File(s) Summary
Move SIMD tests and PARLIO benchmark to RPC-only execution
examples/AutoResearch/AutoResearch.ino
SIMD test invocation in setup() is wrapped behind FL_RUN_SIMD_TESTS_AT_BOOT flag (off by default), eliminating the unconditional ~50–100 ms boot-time test cost. Boot-time PARLIO encode measurement block is removed, leaving both suites to be invoked only via existing RPC handlers (testSimd and PARLIO encode validation endpoints).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Possibly related PRs

  • FastLED/FastLED#2562: Adjusts AutoResearch.ino to shift PARLIO/SIMD test execution from boot-time to RPC-driven validation flow.
  • FastLED/FastLED#2539: Establishes the precedent pattern of gating boot-time benchmarking behind #ifdef flags (e.g., FL_BENCH_WAVE8_AT_BOOT) and redirecting validation to RPC handlers.
  • FastLED/FastLED#2541: RPC routing fix that makes RPC-only invocation fully usable, supporting the broader migration of validation logic away from boot paths.

Poem

🐰 Boot-time tests now take a rest,
RPC handlers serve them best,
Fast startup, cleaner logs to see—
Validation on demand, wild and free! 🎆

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR removes the boot-time PARLIO benchmark block guarded by FL_BENCH_PARLIO_AT_BOOT, which extends beyond the scope of issue #2542 that only addresses SIMD tests. Verify whether removing the PARLIO benchmark block was intentional and aligns with a separate issue, or if it should be restored to stay focused on the SIMD refactoring objective.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the main refactoring change: gating the runSimdTests() function behind a compile-time flag.
Linked Issues check ✅ Passed The PR implements all coding requirements from issue #2542: gating runSimdTests() behind FL_RUN_SIMD_TESTS_AT_BOOT, keeping the function unchanged, and preserving the RPC handler.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/2542-gate-runSimdTests-at-boot

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@zackees
zackees merged commit fe8120c into master May 31, 2026
5 of 6 checks passed
zackees added a commit that referenced this pull request May 31, 2026
…C-only) (#2624)

Follow-up to #2618. The SIMD validation suite, Wave8 expansion bench, and
PARLIO encode bench are now invoked exclusively via their RPC handlers
(`testSimd`, `wave8ExpandBenchmark`, `parlioEncodeBenchmark` — all
registered in AutoResearchRemote.cpp). Drop the `#ifdef
FL_RUN_SIMD_TESTS_AT_BOOT` / `FL_BENCH_WAVE8_AT_BOOT` /
`FL_BENCH_PARLIO_AT_BOOT` invocation blocks from AutoResearch.ino's
setup() — keeping these as opt-in "bridge" macros leaves scaffolding
that future edits quietly reactivate, defeating the move off the boot
path. Update the file-level doc comments in AutoResearchWave8Expand.h
and AutoResearchParlioEncode.h to reflect RPC-only invocation.

If RPC routing is broken on a platform (e.g. ESP32-P4 Serial misroute
fixed in #2620), the correct response is to fix the routing — not to
re-introduce a boot-time bridge.

Co-authored-by: Claude Opus 4.7 <[email protected]>
@zackees
zackees deleted the refactor/2542-gate-runSimdTests-at-boot branch August 21, 2026 19:16
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.

refactor(autoresearch): move runSimdTests() out of setup() — RPC-only invocation

1 participant