Skip to content

fix(channels): cache all-ready only when every driver reported READY (#5381) - #5425

Merged
zackees merged 1 commit into
masterfrom
perf/5381-cache-error-state
Nov 22, 2026
Merged

zackees merged 1 commit into
masterfrom
perf/5381-cache-error-state

Conversation

@zackees

@zackees zackees commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #5424, from CodeRabbit's review there. Refs #5381, #5375.

DriverState(ERROR) has empty error text. poll() computed the all-ready cache from firstError plus the BUSY/DRAINING flags, so a text-less ERROR set mAllReady, and the next onBeginFrame() skipped polling the failed driver. The cache now requires every driver's result.state to be READY. The aggregate state poll() returns is unchanged.

Validation:

  • New test an ERROR without error text never seeds the all-ready cache #5381: RED on master in quick and --debug (manager.cpp:311: 1 == 2), GREEN after the fix in both.
  • bash lint passes.

Summary by CodeRabbit

  • Bug Fixes
    • Corrected channel readiness reporting so an error state is not mistaken for ready when its error message is empty.
    • Ensured readiness is polled again after an error, even if the channel later becomes ready.

…5381)

DriverState(ERROR) carries empty error text, so the all-ready cache added
in #5424 treated it as READY and the next onBeginFrame() skipped polling
the failed driver. Track the states directly.
@zackees
zackees enabled auto-merge November 22, 2026 10:55
@zackees

zackees commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@github-actions github-actions Bot added the sanitized Title, body and conversation screened; review text requires separate screening. label Nov 22, 2026
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Nov 22, 2026
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

Parsing warnings: 1

Validation error: Unrecognized key: "enabled" at "reviews.pre_merge_checks"
Configuration instructions

  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Walkthrough

ChannelManager now sets its all-ready cache only when every driver reports READY. A regression test checks that an ERROR state with empty error text does not cause the manager to reuse that cache.

Changes: Readiness cache correction

Layer / File(s) Summary
Poll readiness and regression test
src/fl/channels/manager.cpp.hpp, tests/unit/fl/channels/manager.cpp
poll now sets mAllReady based on whether every driver reports READY. The regression test checks that an ERROR state with empty error text does not seed the cache.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related issues

  • Issue 5381 concerns the all-ready cache behavior that this change corrects.

Possibly related PRs

Merge Risk: Minimal · up to 0e157

This fixes a cache bug where an ERROR with empty text could make the next frame skip polling a driver. A regression test covers it. No actionable merge risk remains.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@zackees
zackees added this pull request to the merge queue Nov 22, 2026
@github-actions github-actions Bot added sanitized Title, body and conversation screened; review text requires separate screening. and removed sanitized Title, body and conversation screened; review text requires separate screening. labels Nov 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Memory usage (this PR vs. its merge base)

Change in examples/Blink per target. The left number is this PR's image flash / attributed RAM in bytes; the colored delta is the change from the merge base (red ↑ is larger, green ↓ is smaller, Same is unchanged).

Target FLASH [bytes] RAM [bytes]
attiny85 2,460 (Same) 136 (Same)

@github-actions github-actions Bot added sanitized Title, body and conversation screened; review text requires separate screening. and removed sanitized Title, body and conversation screened; review text requires separate screening. labels Nov 22, 2026
Merged via the queue into master with commit e803fc7 Nov 22, 2026
132 of 133 checks passed
@zackees
zackees deleted the perf/5381-cache-error-state branch November 22, 2026 11:02
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Nov 22, 2026
@github-actions github-actions Bot added sanitized Title, body and conversation screened; review text requires separate screening. and removed sanitized Title, body and conversation screened; review text requires separate screening. labels Nov 22, 2026
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Action not completed

Pull request is closed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions github-actions Bot added sanitized Title, body and conversation screened; review text requires separate screening. and removed sanitized Title, body and conversation screened; review text requires separate screening. labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sanitized Title, body and conversation screened; review text requires separate screening.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant