Skip to content

fix(profile): repair bash profile, add a show() CPU-cost benchmark (#3765) - #3767

Merged
zackees merged 1 commit into
masterfrom
fix/3765-show-profile
Jul 29, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/3765-show-profile

Conversation

@zackees

@zackees zackees commented Jul 29, 2026 •

Copy link
Copy Markdown
Member

Two more #3765 items: repair the profiling harness, then use it to narrow the #2994 search.

1. bash profile was broken for every target

ci/profile_runner.py built with:

test.py <name> --cpp --build --build-mode <mode>

but test.py has no --build flag. Because --build is a unique prefix of --build-mode, argparse abbreviation-matching swallowed the real flag's value, so every bash profile <target> invocation died with:

test.py: error: argument --build-mode: expected one argument

Dropping the invalid flag fixes it — test.py builds the target either way.

2. A show() CPU-cost benchmark

tests/profile/fastled_show.cpp measures per-frame cost using #2994's exact geometry: 35-LED WS2812 on the legacy addLeds path, with the refresh throttle explicitly disabled so it cannot contaminate the number.

First result: ~1.7–2.3 µs/frame on a desktop host.

That is three orders of magnitude below the 268–1012 µs of per-step excess #2994 reports. Useful evidence in itself: whatever regressed between 3.10.3 and master is almost certainly not in the CPU-side dispatch path — EngineEvents, the three-pass controller walk, dithering/scaling, or the #2428 channels dispatch.

What it deliberately does not cover

The header says this loudly, because the limit matters more than the number. The host driver is a stub, so wire time, DMA, and per-frame encoding / bit transposition are all excluded. A regression living in the encoder or in a driver wait loop will not appear here.

So this narrows the search — it does not localize the cause. The remaining suspects are exactly the ones this cannot see, which is why #3765 still needs the on-device measurement.

Verification

  • benchmark runs end-to-end via bash profile fastled_show — build, execute, parse, analyze
  • 357/357 host tests
  • bash lint exit 0, ty clean on the runner

Still open on #3765

#2994 has been reopened with the root-cause retraction posted for the reporter.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added a profiling utility to measure FastLED.show() performance and report frame timing statistics in readable or JSON formats.
  • Documentation

    • Updated symbol analysis guidance to cover all detected platforms and symbols.
    • Improved formatting and examples across CI and fingerprint documentation.
  • Bug Fixes

    • Corrected the profiling build invocation to use supported command-line options and avoid argument parsing issues.

…3765)

`bash profile <target>` has been broken for every target. profile_runner.py
built with:

    test.py <name> --cpp --build --build-mode <mode>

but test.py has no `--build` flag. Because "--build" is a unique prefix of
"--build-mode", argparse abbreviation-matching consumed the real flag's
value, and every invocation died with:

    test.py: error: argument --build-mode: expected one argument

Dropping the invalid flag fixes it; test.py builds the target either way.

Also adds tests/profile/fastled_show.cpp, a per-frame CPU-cost benchmark
for FastLED.show() using #2994's exact geometry (35-LED WS2812 on the
legacy addLeds path, throttle disabled so it cannot contaminate the
number).

First result: ~1.7-2.3 us/frame on a desktop host. That is three orders of
magnitude below the 268-1012 us of per-step excess #2994 reports, which is
useful evidence in itself -- whatever regressed between 3.10.3 and master
is almost certainly NOT in the CPU-side dispatch path (EngineEvents, the
three-pass controller walk, dithering/scaling, channels dispatch).

The benchmark's header is explicit about what it does NOT cover, because
that limit matters more than the number: the host driver is a stub, so
wire time, DMA, and per-frame encoding/bit-transposition are all excluded.
A regression living in the encoder or in a driver wait loop will not show
up here. This narrows the search; it does not localize the cause.

Verified: benchmark runs end-to-end through `bash profile fastled_show`
(build, execute, parse, analyze), 357/357 host tests, bash lint exit 0,
ty clean on the runner.

Refs #3765, #2994

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

coderabbitai Bot commented Jul 29, 2026 •

Copy link
Copy Markdown

Review Change Stack

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b0d8ca71-25e5-4f92-99eb-552baf93da87

📥 Commits

Reviewing files that changed from the base of the PR and between dd7b552 and 8835336.

📒 Files selected for processing (6)
  • ci/SYMBOL_ANALYSIS.md
  • ci/docker_utils/avr8js/README.md
  • ci/fingerprint/README.md
  • ci/profile_runner.py
  • ci/util/FINGERPRINT.md
  • tests/profile/fastled_show.cpp
 _____________________________________________________________________________________________
< Use the power of command shells. Use the shell when graphical user interfaces don't cut it. >
 ---------------------------------------------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ 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 fix/3765-show-profile

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.

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