Skip to content

refactor(examples): rename AutoResearchRemote bind*Methods by what they test (System/Driver/Pin/Math/Network/Async/Benchmark) - #3191

Merged
zackees merged 1 commit into
masterfrom
refactor/binders-semantic-names
Jun 16, 2026
Merged

zackees merged 1 commit into
masterfrom
refactor/binders-semantic-names

Conversation

@zackees

@zackees zackees commented Jun 16, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #3187 / #3188 / #3189. Old names mixed implementation (FlexIO is Teensy-only) and vague labels (Basic, Coroutine). Renaming each binder to describe what it tests, not how the implementation is structured.

Old New Rationale
bindBasicMethods bindSystemMethods device control (status/ping/debug)
bindFlexioMethods bindDriverMethods LED driver tests (FlexIO is just one platform's impl)
bindGpioMethods bindPinMethods pin API; GPIO is the implementation
bindBenchmarkMethods bindMathMethods SIMD/animartrix/wave kernels
bindAsyncNetMethods bindNetworkMethods wireless/network stack (WiFi/OTA/BLE/codec)
bindCoroutineMethods bindAsyncMethods concurrency primitives (coroutine + promise)
bindPerfMethods bindBenchmarkMethods perfProbe + wave2dPerf are perf benchmarks

Note the swap of the BenchmarkMethods name: old bindBenchmarkMethods (SIMD/animartrix/wave) renamed to bindMathMethods; old bindPerfMethods (perfProbe*) renamed to bindBenchmarkMethods — the framework probes are the actual benchmarks.

Files renamed via git mv (history preserved):

  • BasicMethods.cpp → SystemMethods.cpp
  • FlexioMethods.cpp → DriverMethods.cpp
  • GpioMethods.cpp → PinMethods.cpp
  • BenchmarkMethods.cpp → MathMethods.cpp
  • AsyncNetMethods.cpp → NetworkMethods.cpp
  • CoroutineMethods.cpp → AsyncMethods.cpp
  • PerfMethods.cpp → BenchmarkMethods.cpp

The drivers rename in particular addresses the issue called out in the spec: "FlexIO methods, that's teensy level stuff right? Maybe we just call it bind drivers and let the platform level stuff happen in the details." Per-binding #if FL_IS_TEENSY_4X guards already gate platform specifics inside each driver-test body — no platform leakage at the file boundary.

File-comment headers also rewritten to describe the category (stable) rather than enumerate every RPC (drifts as RPCs come/go).

Verified: bash compile wasm --examples AutoResearch — success (59.89 s total).

Generated with Claude Code.

Summary by CodeRabbit

  • Refactor

    • Reorganized AutoResearch example RPC method bindings into more granular categories: system, driver, pin, math, network, async, and benchmark for improved code organization and clarity.
    • Consolidated performance benchmarking logic with enhanced instrumentation and wave performance metrics.
  • New Features

    • Added comprehensive math and SIMD compute RPC capabilities including validation tests and micro-benchmarks for hardware acceleration.

…ey test

Follow-up to #3187/#3188/#3189. Old names were partly implementation-named
(FlexIO is Teensy-only), partly vague (Basic, Coroutine). Renaming so each
group describes WHAT the RPCs exercise.

Rename map:
  bindBasicMethods     → bindSystemMethods      // status, ping, debug, help
  bindFlexioMethods    → bindDriverMethods      // LED driver tests (FlexIO today)
  bindGpioMethods      → bindPinMethods         // pin config (GPIO is impl)
  bindBenchmarkMethods → bindMathMethods        // SIMD/animartrix/wave/parlio
  bindAsyncNetMethods  → bindNetworkMethods     // WiFi/OTA/BLE/codec/testAsync
  bindCoroutineMethods → bindAsyncMethods       // coroutine + promise primitives
  bindPerfMethods      → bindBenchmarkMethods   // perfProbe* + wave2dPerf

Files renamed (git mv preserves history):
  BasicMethods.cpp     → SystemMethods.cpp
  FlexioMethods.cpp    → DriverMethods.cpp
  GpioMethods.cpp      → PinMethods.cpp
  BenchmarkMethods.cpp → MathMethods.cpp
  AsyncNetMethods.cpp  → NetworkMethods.cpp
  CoroutineMethods.cpp → AsyncMethods.cpp
  PerfMethods.cpp      → BenchmarkMethods.cpp  (swap: was PerfMethods, takes
                                                BenchmarkMethods name now)

Header file-comments rewritten to describe the *category* rather than
enumerate every RPC — categories are stable, RPC lists drift.

Driver bin's comment notes the platform-specificity intent: today it
holds Teensy 4.x FlexIO RX validation; future platform-specific driver
tests for other MCUs land in the same bin, gated by per-binding #if
guards rather than file-level partitioning.

Verified: bash compile wasm --examples AutoResearch — success
(library 40.03 s, sketch 2.89 s, link 6.05 s, total 59.89 s).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Jun 16, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1a13e6c4-a17d-479b-a53d-1575fa2b5747

📥 Commits

Reviewing files that changed from the base of the PR and between 9b9fa4a and 5dc19b5.

📒 Files selected for processing (10)
  • examples/AutoResearch/AutoResearchRemote.cpp
  • examples/AutoResearch/AutoResearchRemote.h
  • examples/AutoResearch/AutoResearchRemoteAsyncMethods.cpp
  • examples/AutoResearch/AutoResearchRemoteBenchmarkMethods.cpp
  • examples/AutoResearch/AutoResearchRemoteDriverMethods.cpp
  • examples/AutoResearch/AutoResearchRemoteMathMethods.cpp
  • examples/AutoResearch/AutoResearchRemoteNetworkMethods.cpp
  • examples/AutoResearch/AutoResearchRemotePerfMethods.cpp
  • examples/AutoResearch/AutoResearchRemotePinMethods.cpp
  • examples/AutoResearch/AutoResearchRemoteSystemMethods.cpp

📝 Walkthrough

Walkthrough

The AutoResearch example's RPC binding helpers are reorganized from six old groups (basic/flexio/gpio/asyncNet/coroutine/perf) into seven new groups (system/driver/pin/math/network/async/benchmark). Five files are renamed-only, AutoResearchRemotePerfMethods.cpp is deleted with its content folded into AutoResearchRemoteBenchmarkMethods.cpp, and a new AutoResearchRemoteMathMethods.cpp adds six SIMD/Perlin/Wave8/PARLIO RPC endpoints.

Changes

AutoResearch RPC Binding Reorganization

Layer / File(s) Summary
Class declaration and registerFunctions() wiring
examples/AutoResearch/AutoResearchRemote.h, examples/AutoResearch/AutoResearchRemote.cpp
Replaces six old private binding method declarations with seven new ones (bindSystemMethods, bindDriverMethods, bindPinMethods, bindMathMethods, bindNetworkMethods, bindAsyncMethods, bindBenchmarkMethods) and updates registerFunctions() to call them in that order.
Rename-only binding entrypoints
examples/AutoResearch/AutoResearchRemoteSystemMethods.cpp, ...DriverMethods.cpp, ...PinMethods.cpp, ...NetworkMethods.cpp, ...AsyncMethods.cpp
Renames bindBasicMethods→bindSystemMethods, bindFlexioMethods→bindDriverMethods, bindGpioMethods→bindPinMethods, bindAsyncNetMethods→bindNetworkMethods, bindCoroutineMethods→bindAsyncMethods; file-level comments updated to match new grouping names; RPC bodies unchanged.
Benchmark methods consolidation
examples/AutoResearch/AutoResearchRemoteBenchmarkMethods.cpp, examples/AutoResearch/AutoResearchRemotePerfMethods.cpp
Deletes AutoResearchRemotePerfMethods.cpp and its bindPerfMethods. Replaces old benchmark RPC set inside bindBenchmarkMethods with perfProbeMemcpy, perfProbeNop, perfProbeRepeat sanity probes (JSON-configurable, timing/variance checked) and an updated wave2dPerf binding routing to runWavePerf/runWavePerfLoadsOnly.
New bindMathMethods: SIMD, Perlin, Wave8, PARLIO
examples/AutoResearch/AutoResearchRemoteMathMethods.cpp
New file behind a low-memory compile guard. Registers testSimd (SIMD correctness suite), testSimdBenchmark (per-type multiply timing), animartrixPerlinBench (float vs i16 Perlin timing with speedup ratio), wave8ExpandBenchmark (expand/transpose timing), parlioStreamValidate (multi-field streaming validation with per-iteration timing arrays and counters), and parlioEncodeBenchmark (encode throughput with per-frame estimates).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

Possibly related PRs

  • FastLED/FastLED#2847: Overlaps directly — both touch animartrixPerlinBench RPC wiring in the AutoResearch remote, with this PR repositioning it under bindMathMethods.
  • FastLED/FastLED#3118: Both PRs involve perfProbeMemcpy, perfProbeNop, perfProbeRepeat and wave2dPerf AutoResearch RPC endpoints; this PR reorganizes where those bindings are registered.
  • FastLED/FastLED#3120: Both PRs share the perfProbeRepeat and wave2dPerf RPC implementations delegating to fl::wave_perf::* helpers.

Poem

🐇 Hop hop, the bindings align,
No more "basic" — "system" is fine!
Math and drivers, async and pin,
Each in its folder, neat discipline.
The old PerfMethods file? Gone away—
Benchmark absorbed it, hooray hooray! ✨

✨ 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/binders-semantic-names

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.

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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant