Repository navigation
test(color): state the rgbww two-white premise as "needs", not "lights" (#4357) - #4358
Conversation
…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
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe 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. ChangesRGBWW corpus validation
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to 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)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 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 |
Closes #4357. Fixes a red
master, introduced by my own #4340 earlier today.test_the_corpus_never_lights_both_whitesfails onmasterwith1 != 0. Bisected to999304d25c(#4340): the source-profile pass it added grew each corpus device from 57 vectors to 76, and one of the new plain-rgbwwvectors lights both whites. It passes at999304d25c^.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 reaches0.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:best_single_whitethat always succeeds, which is precisely the degenerate result this test most needs to notice;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 ("Everyrgbwwvector is reachable with one white or none") and is corrected there too.Verification
Stubbed
best_single_whiteto always succeed and confirmed this test fails on its own under that mutation — so the measurement is live, not vacuous.bash test --py --cleangreen (the plain--pyrun reported a valid fingerprint cache and skipped everything despite the edit, so the clean run is the real one).bash lintclean.Test-only; no
src/change.🤖 Generated with Claude Code
https://claude.ai/code/session_01MLhWkMfzLjrnLTDMBE6Fj9
Summary by CodeRabbit