Skip to content

test(color): state the rgbww two-white premise as "needs", not "lights" (#4357) - #4358

Merged
zackees merged 1 commit into
masterfrom
fix/rgbww-two-white-premise
Sep 11, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/rgbww-two-white-premise

Conversation

@zackees

@zackees zackees commented Sep 11, 2026 •

Copy link
Copy Markdown
Member

Closes #4357. Fixes a red master, introduced by my own #4340 earlier today.

test_the_corpus_never_lights_both_whites fails on master with 1 != 0. Bisected to 999304d25c (#4340): the source-profile pass it added grew each corpus device from 57 vectors to 76, and one of the new plain-rgbww vectors lights both whites. It passes at 999304d25c^.

Why not just relax the count

Because the premise the test records genuinely became false, and relaxing the assertion would have hidden that. The test exists to say that agreement with a one-white-at-a-time reduction over this device proves nothing, since no vector needs a second white. Measured against the checked-in corpus, the new vector does need one — the reference's two whites total 0.879408, and the best single white reaches 0.850005.

"Lights both" was also the wrong proxy from the start: the reference may split a total across two usable whites without needing either. That count could have gone false while the premise held — and here it stayed true right up until the premise broke.

What this does

States the thing itself, through best_single_white, and makes it two-sided:

  • at least one such vector — an upper bound alone is satisfied by a best_single_white that always succeeds, which is precisely the degenerate result this test most needs to notice;
  • fewer than a tenth of the white-using vectors — keeping the trap recorded. 1 of 34 discriminates, which cannot separate a correct two-white allocation from one that merely fills the first white first. That is why rgbww_two_white (19 of 76 needing both) was added in test(color): corpus vectors that need both white emitters (P7, #4198) #4237.

The same stale claim sat in TestTwoWhiteCorpusVectors's class docstring ("Every rgbww vector is reachable with one white or none") and is corrected there too.

Verification

Stubbed best_single_white to always succeed and confirmed this test fails on its own under that mutation — so the measurement is live, not vacuous. bash test --py --clean green (the plain --py run reported a valid fingerprint cache and skipped everything despite the edit, so the clean run is the real one). bash lint clean.

Test-only; no src/ change.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MLhWkMfzLjrnLTDMBE6Fj9

Summary by CodeRabbit

  • Tests
    • Updated color-rendering validation for RGBWW devices.
    • Added coverage confirming that white output is used across the corpus and that a limited number of color vectors may require both white channels.
    • Refined expectations to better reflect the behavior of devices with two white emitters.

…s" (#4357)

`test_the_corpus_never_lights_both_whites` fails on master. Bisected to
999304d (#4340), mine, merged earlier today: the source-profile pass it
added grew each corpus device from 57 vectors to 76, and one of the new plain
`rgbww` vectors lights both whites.

Relaxing the count would have papered over a premise that actually became
false. The test exists to record that agreement with a one-white-at-a-time
reduction over this device says nothing, because no vector needs a second
white. Measured against the checked-in corpus, the new vector does need one:
the reference's two whites total 0.879408 and the best single white reaches
0.850005.

"Lights both" was also the wrong proxy from the start. The reference may split
a total across two usable whites without needing either, so that count could
have gone false while the premise held -- and, as here, could have held while
the premise broke.

So this states the thing itself, through `best_single_white`, and makes it
two-sided. The lower bound keeps the measurement live: an upper bound alone is
satisfied by a `best_single_white` that always succeeds, which is the
degenerate result the test most needs to notice. The upper bound keeps the
trap recorded -- 1 of 34 white-using vectors discriminates, which cannot
separate a correct two-white allocation from one that fills the first white
first, and is why `rgbww_two_white` exists.

Verified by stubbing `best_single_white` to always succeed and confirming this
test fails on its own.

The same stale claim was in `TestTwoWhiteCorpusVectors`'s docstring; corrected
there too.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01MLhWkMfzLjrnLTDMBE6Fj9
@coderabbitai

coderabbitai Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

Review Change StackReview 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: Advanced

Run ID: f7ef8e9f-8631-4b41-80b6-f7cb3ecaef76

📥 Commits

Reviewing files that changed from the base of the PR and between 5c64369 and ef05f15.

📒 Files selected for processing (1)
  • ci/tests/test_color_rgbw_study.py

Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

The RGBWW corpus test now checks whether vectors require both white emitters instead of checking whether both emitters receive nonzero drives. The related class documentation reflects the updated corpus behavior.

Changes

RGBWW corpus validation

Layer / File(s) Summary
White-emitter reachability test
ci/tests/test_color_rgbw_study.py
The test counts vectors that use white and vectors for which the best single white cannot reach the reference total. It requires at least one vector requiring both whites and limits such vectors to fewer than one tenth of white-using vectors. The class docstring states that one of 76 vectors is not reachable with one white.

Priority: ➖ Normal

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

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to ef05f

The corpus test now verifies the intended two-white reachability behavior without leaving an actionable merge risk.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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 describes the main change: updating the RGBWW color test to measure whether vectors need both white emitters rather than merely light both emitters.
Linked Issues check ✅ Passed The changes satisfy the coding requirements in [#4357]. The test now measures whether each white-using rgbww vector needs both whites by comparing the reference white total with best_single_white.…
Out of Scope Changes check ✅ Passed The diff is limited to the linked RGBWW corpus test and its related class docstring. The test changes and documentation correction directly support [#4357]. No unrelated source or behavior changes are…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/rgbww-two-white-premise

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.

@zackees
zackees merged commit 167b3ec into master Sep 11, 2026
27 checks passed
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Sep 11, 2026
@zackees
zackees deleted the fix/rgbww-two-white-premise branch November 5, 2026 05:53
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.

test(ci): rgbww two-white premise is false on master, and the test checks the wrong proxy

1 participant