Skip to content

test(gfx): R7's neutral-axis question, measured — and the override that reaches nothing - #4317

Merged
zackees merged 1 commit into
masterfrom
test/4156-r7-neutral-axis
Sep 10, 2026
Merged

zackees merged 1 commit into
masterfrom
test/4156-r7-neutral-axis

Conversation

@zackees

@zackees zackees commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

#4156 R7, one of the three least-discussed findings (4 mentions). Stacked on #4316 —
merge that one first; retargeting a stack past its base is how #4313 got swallowed.

R7's stated failure does not arise

It says standard Oklab assumes D65 with white Y = 1, and that feeding "arbitrary
warm/profile-white XYZ directly into those matrices does not make the target neutral axis
zero-chroma".

The mapper never feeds it profile white. kGamutD65Q16 is a compile-time D65, and the
brightest-neutral walk, the neutral cap and the chroma ray are all anchored to it. Worst
OKLab chroma over a twenty-step neutral ramp:

device blue worst neutral chroma
(0.150, 0.060) — D65-ish 6.5e-05
(0.180, 0.100) — warm-ish 6.3e-05
(0.220, 0.160) — warmer 6.5e-05

Flat across the three, which is what a mapping space independent of the device white looks
like. The figures are Q16 rounding.

The first version of this case proved nothing

It ramped only inside the hull, where the mapper hands a neutral straight back — so it
was measuring the solve, not the mapping space. Moving kGamutD65Q16 to a warm white
passed it.

The ramp now runs past the device's brightest neutral, where the walk-down actually runs
and the mapping white is load-bearing. The same mutation now takes the neutral chroma to
0.02 and fails.

R7's other half is live, in a form it did not name

It asks for "target-white overrides" that preserve the neutral axis. setTargetWhite
exists, validates its input, stores it, and is carried through Channel — three cases
already check that plumbing.

Nothing outside those accessors reads it. The only reference in src/ beyond
options.h is another accessor in channel.h, and the mapper's neutral is a constexpr
no override can move. So the setter is settable and inert — where setColorProfile was
before P6 wired it.

Recorded rather than left to be discovered, because a setter returning true is a promise.
When someone wires it, the new case fails and its comment says what to re-measure.

Test-only. 304/304 unit + 84/84 examples, bash lint clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MLhWkMfzLjrnLTDMBE6Fj9

Summary by CodeRabbit

  • Tests
    • Added coverage confirming target-white settings are stored correctly and invalid values are rejected.
    • Added coverage verifying target-white overrides do not currently affect rendered output.
    • Added gamut-mapping tests to ensure neutral requests remain neutral across devices with different white points.

@coderabbitai

coderabbitai Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 9937f142-8040-4379-8de8-821dc4e9926f

📥 Commits

Reviewing files that changed from the base of the PR and between f42ffa4 and 8f71dd4.

📒 Files selected for processing (2)
  • tests/fl/channels/color_profile.cpp
  • tests/fl/gfx/gamut_map.cpp

📝 Walkthrough

Walkthrough

The changes add tests for ChannelOptions target-white behavior and neutral gamut mapping across device profiles with different blue primaries.

Changes

Color pipeline tests

Layer / File(s) Summary
Target-white handling
tests/fl/channels/color_profile.cpp
Tests valid and invalid target-white values. Confirms that storing a target white does not change the bound emitter profile.
Neutral gamut mapping
tests/fl/gfx/gamut_map.cpp
Tests neutral D65 ramps across three device profiles. Re-rendered results must remain below the specified OKLab chroma threshold for 60 samples.

Estimated code review effort: 3 (Moderate) | ~20 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/4156-r7-neutral-axis

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.

…at reaches nothing

#4156 R7 is one of the three least-discussed findings. It says standard
Oklab assumes D65 with white Y = 1, and that "feeding arbitrary
warm/profile-white XYZ directly into those matrices does not make the target
neutral axis zero-chroma".

**That failure does not arise, because the mapper never feeds it profile
white.** `kGamutD65Q16` is a compile-time D65, and the brightest-neutral
walk, the neutral cap and the chroma ray are all anchored to it. Worst OKLab
chroma over a twenty-step neutral ramp: 6.5e-05, 6.3e-05, 6.5e-05 for
device blues at (0.150, 0.060), (0.180, 0.100) and (0.220, 0.160). Flat
across the three, which is what a mapping space independent of the device
white looks like.

The ramp runs *past* the device's brightest neutral deliberately. Inside the
hull the mapper hands a neutral straight back, so the first version of this
case was measuring the solve -- and moving `kGamutD65Q16` to a warm white
passed it. Above the cap the walk-down runs and the mapping white is
load-bearing: the same mutation takes the chroma to 0.02.

**R7's other half is live, in a form it did not name.** It asks for
"target-white overrides" that preserve the neutral axis. `setTargetWhite`
exists, validates, stores, and is carried through `Channel` -- three cases
already check that plumbing. Nothing outside those accessors reads it, and
the mapper's neutral is a constant no override can move. So the setter is
settable and inert, which is where `setColorProfile` was before P6 wired it.

That is recorded rather than left to be discovered, because a setter
returning true is a promise. When someone wires it the new case fails, and
its comment says what to re-measure.

304/304 unit + 84/84 examples, `bash lint` clean. Test-only.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01MLhWkMfzLjrnLTDMBE6Fj9
@zackees
zackees force-pushed the test/4156-r7-neutral-axis branch from 6315a4e to 8f71dd4 Compare September 10, 2026 20:02
@zackees
zackees merged commit 5254c05 into master Sep 10, 2026
3 of 4 checks passed
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Sep 10, 2026
@zackees
zackees deleted the test/4156-r7-neutral-axis 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