Skip to content

The normative Bradford matrix is hard-coded twice and pinned to nothing #4353

Closed

Description

@zackees

#4034 makes Bradford the normative CAT: "Bradford is the normative CAT", applied whenever a source white differs from the working D65.

Its cone-response matrix is hard-coded in two places:

  • src/fl/gfx/chromatic_adaptation.cpp.hpp:12 — kBradford
  • ci/color_reference.py:283 — bradford inside bradford_adaptation()

Neither is checked against the published values, and nothing checks they agree.

What the existing test does and does not cover

test_bradford_inverse_matches_the_general_solver pins kBradfordInverse against invert3x3(kBradford, ...). That is a genuine check — it is what lets the inverse be a hard-coded constant instead of a bind-time inversion — but it is self-referential with respect to the forward matrix. Typo 0.8951 to 0.8591 and the inverse test still passes: it would invert the typo'd matrix perfectly consistently.

Why the end-to-end budget would not catch it either

The golden corpus is generated from the Python copy and pipeline.cpp measures the C++ copy against it. So:

  • both copies wrong the same way — corpus and pipeline agree, ΔE stays at 0.395096, nothing fires
  • one copy wrong — the budget moves, but the failure points at the pipeline rather than at a mistyped constant, and the corpus is now a wrong reference

Neither outcome names the cause. This is the same shape as #4351, with a normative matrix rather than a set of primaries.

Current state

They agree, and both match ICC.1:2022 Annex E:

 0.8951   0.2664  -0.1614
-0.7502   1.7135   0.0367
 0.0389  -0.0685   1.0296

So this is a guard against drift, not a defect found.

Shape of the fix

Pin both against the published matrix — the specification, not each other — for the same reason as #4352: checking the two copies match would pass if both were "corrected" in the same wrong direction.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MLhWkMfzLjrnLTDMBE6Fj9

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions