Skip to content

test(color): measure the wide path's monotonicity and low-light resolution (#4042) - #4388

Merged
zackees merged 1 commit into
masterfrom
test/4042-wide-monotonic
Sep 12, 2026
Merged

zackees merged 1 commit into
masterfrom
test/4042-wide-monotonic

Conversation

@zackees

@zackees zackees commented Sep 12, 2026

Copy link
Copy Markdown
Member

Part of #4034 P8 (#4042). Closes out the "monotonic; low-light resolution" half of the criterion whose first clause #4368 and #4387 implemented.

Measured

All 256 source codes through the UCS7604-16 path, managed and unbound side by side:

managed unbound
monotonicity violations 0 0
distinct levels, bottom 32 codes 32 28
distinct levels, all 256 codes 256 252

Both paths are monotonic — a rising source code never lowers the emitted value — so the wide path did not buy precision at the cost of ordering. Where they part company is resolution: the gamma LUT collapses four pairs in the bottom 32 codes, so four inputs that differ produce bytes that do not.

One thing the numbers invite you to get wrong

256 against 252 is not "more reachable levels". An 8-bit CRGB can only ask for 256 things and still can. What changed is that none of them are discarded on the way out. Turning a 16-bit wire into more than 256 levels needs a wide source — .fled rgb16_linear — and this is the half that stops throwing them away before it gets there. The test says so, because the figure would otherwise read as a bigger claim than it is.

Verification

The counts are measured rather than assumed — I swept first and wrote the assertions from the result. Two mutations fail them: narrowing the managed drive to 8 bits and widening it again, and disabling the wide branch outright (which makes managed identical to unbound, so the 32 becomes 28).

bash lint clean; 305/305 unit, 84/84 examples.

Test-only; no src/ change.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MLhWkMfzLjrnLTDMBE6Fj9

…ution (#4042)

P8 owns "native 16-bit encoders consume wide output; monotonic; low-light
resolution". #4368 and #4387 did the first clause for UCS7604-16 and HD108;
nothing measured the other two.

Swept all 256 source codes through the UCS7604-16 path, managed and unbound
side by side. Both are monotonic -- a rising source code never lowers the
emitted value, zero violations either way -- so the wide path did not buy that
at the cost of ordering.

Where they part company is resolution. In the bottom 32 codes the managed path
keeps all 32 distinguishable; the gamma LUT collapses four pairs, so 28. Across
the full range, 256 against 252.

Worth stating plainly in the test, because the number invites a wrong reading:
this is not more *reachable* levels. An 8-bit CRGB can only ask for 256 things,
and it still can. It is that none of them are discarded on the way out. Turning
the 16-bit wire into more than 256 levels needs a wide source -- .fled
rgb16_linear -- and this is the half that stops throwing them away first.

The counts are measured, not assumed. Narrowing the managed drive to 8 bits and
widening it again fails these, as does disabling the wide branch.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01MLhWkMfzLjrnLTDMBE6Fj9
@zackees
zackees merged commit b3396f6 into master Sep 12, 2026
4 checks passed
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Sep 12, 2026
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Sep 12, 2026
@zackees
zackees deleted the test/4042-wide-monotonic 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.

1 participant