Skip to content

Color pipeline P5: float64 host reference, golden vectors, RED baseline #4039

Closed

Description

@zackees

Phase P5 of the color pipeline implementation (see parent issue). Independently mergeable; host-side only.

Scope

The float64 host reference implementation, the golden-vector corpus, and the RED baseline — the yardstick every later phase is measured against.

  • Float64 reference for every stage: source decode (sRGB piecewise, named transfers), primaries→XYZ with Bradford CAT (B7), OKLCh hue-preserving gamut mapping (A3), emitter solve, response compensation, brightness/power scalar, final quantization.
  • Golden vectors: dense in-gamut RGB corpus, neutral ramps, low codes, ColorChecker-like samples, out-of-gamut boundary set; serialized per stage so embedded phases can bisect failures.
  • ΔE2000 harness with the A1 normalization baked in (relative colorimetry, profile white at full drive, dark surround) so all phases report comparable numbers.
  • RED baseline (feat(color): design a profiled high-precision color-accurate output pipeline #4032's first acceptance criterion): focused tests demonstrating, against this harness, (a) the current path's profile/transfer omission, (b) early RGB8 correction quantization loss, (c) at least one hue/neutral-axis regression from independent 8-bit gamma. These stay checked in as the before/after evidence P6–P8 turn GREEN.

Decisions implemented

A1 (budgets + normalization), A3 (reference objective), B7, B12. The reference also encodes B2's stage ordering so signedness/headroom questions are answerable by inspection.

Acceptance criteria owned

  • RED→GREEN baseline: profile/transfer omission, RGB8 quantization loss, independent-gamma hue regression.
  • Float64 host reference golden vectors.

Dependencies

P2 (type/name alignment for profiles referenced by vectors); otherwise standalone.

Deliverables

Host reference (test-tree code, not shipped in src/ hot path), golden-vector data, ΔE harness, RED baseline tests, report template with the A1 metric definitions.

Activity

  1. moved this from Triage to Done in FastLED Trackeron Sep 6, 2026
  2. zackees commented on Sep 6, 2026

    @zackees
    MemberAuthor

    Delivered in #4166 (a8cd774f3e).

    Acceptance criteria

    criterion where
    Float64 host reference golden vectors ci/color_reference.py + ci/golden/color-reference-v1.json (192 vectors, serialized per stage)
    RED→GREEN baseline: profile/transfer omission legacy reads an sRGB code as a direct drive — 128/255 = 0.502 vs decoded < 0.22
    RED→GREEN baseline: RGB8 quantization loss scale8 at brightness 64 takes code 1 → 0 (src/lib8tion.h)
    RED→GREEN baseline: independent-gamma regression applyGamma_video(CRGB, gammaR, gammaG, gammaB) — neutral (128,128,128) → (56,64,49), chroma 2e-08 → 0.027; and (200,120,60) shifts 16.9° OKLCh hue under a single shared exponent

    Deliverables

    • Host reference — ci/color_reference.py, test-tree only, nothing in src/
    • Golden-vector data — per-stage, with a validator that recomputes each named stage against the committed record (max_stage_abs_error: 0.0, max_delta_e2000: 0.0)
    • ΔE harness — delta_e2000, now validated against ten published Sharma/Wu/Dalal pairs
    • RED baseline tests — the three above, each modelling deployed behaviour with its provenance rather than an idealised strawman
    • Report template with A1 metric definitions — docs/color-reference-method.md, fixing the normalization (relative colorimetry, profile white at full drive, dark surround, Bradford) and both budget tables

    Two things worth carrying forward

    A CIEDE2000 bug was found and fixed during review. R_C was computed from the raw chroma mean rather than C̄′, the G-adjusted mean. The two agree at high chroma (G→0) and low chroma (R_C→0), disagreeing only in the blue band around C ≈ 15–25 — which is why it was not obvious. Published Sharma pair (61.2901, 3.7196, −5.3901) vs (61.4292, 2.2480, −4.9620) returned 1.873634 against a reference of 1.8731. Now fixed and locked by a regression pair sited in the discriminating band.

    Two A1 halves are deliberately not supplied yet, and the doc says so rather than leaving them silently absent:

    Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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