Repository navigation
fix(profile): repair bash profile, add a show() CPU-cost benchmark (#3765) - #3767
Merged
Merged
Conversation
…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]>
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
This was referenced Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two more #3765 items: repair the profiling harness, then use it to narrow the #2994 search.
1.
bash profilewas broken for every targetci/profile_runner.pybuilt with:but
test.pyhas no--buildflag. Because--buildis a unique prefix of--build-mode, argparse abbreviation-matching swallowed the real flag's value, so everybash profile <target>invocation died with:Dropping the invalid flag fixes it —
test.pybuilds the target either way.2. A
show()CPU-cost benchmarktests/profile/fastled_show.cppmeasures per-frame cost using #2994's exact geometry: 35-LED WS2812 on the legacyaddLedspath, 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
bash profile fastled_show— build, execute, parse, analyzebash lintexit 0,tyclean on the runnerStill open on #3765
show()duration comparison, 3.10.3 vs master (blocked by Orphaned mkdir install-locks deadlock after daemon crash; stale daemon endpoint survives 'daemon stop'; esptool provisioning failure kills daemon fbuild#1213)timingDriftTestreproducer — it has none, so it has never been runspinBudget(250 µs) when a deep yield costs a full 1000 µs tick#2994 has been reopened with the root-cause retraction posted for the reporter.
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
FastLED.show()performance and report frame timing statistics in readable or JSON formats.Documentation
Bug Fixes