Repository navigation
Description
Implementation tracker: #4034 — Color pipeline: final implementation tracker. See that issue for the consolidated decisions and implementation phases #4035–#4044. This issue remains the original specification reference.
Context
FastLED's current RGB output path is not an end-to-end color-managed pipeline. CRGB::computeAdjustment() combines brightness, setCorrection(), and temperature into three 8-bit multipliers; PixelController::loadAndScaleRGB() applies them to 8-bit source channels before chipset encoding. TypicalLEDStrip is a single empirical ratio (CRGB(255, 176, 240)) shared across chipsets. This is useful as a visual starting point, but it is not a source-profile transform, a measured emitter-gamut transform, an electro-optical transfer function, or a quantified color-accuracy guarantee.
The repository already contains valuable pieces:
src/fl/gfx/colorimetric_response.hhas CIE xyY/XYZ primitives, source-primary matrix construction,EmitterProfile,RgbColorimetricCache, andsolve_rgb_colorimetric().- RGBW colorimetric work supports named input gamuts and measured diode profiles.
src/fl/gfx/gamma_lut.hprovides 8-bit-to-8-bit and 8-bit-to-16-bit gamma LUTs.- APA102HD/SK9822HD use the global-current field plus RGB bytes to retain more effective low-light precision; HD108 and UCS7604 perform 8-to-16-bit gamma expansion in their encoders.
ColorBoostdocuments the severe loss caused by applying gamma as RGB8 -> gamma -> RGB8, while Pride/HUE16-style effects retain a 16-bit hue accumulator and quantize only at conversion/output.- The canonical ledmapper
.fledv1 spec now declares RGB8 color metadata, but FastLED's local mirror/parser does not yet carry or honor it.
The FastLED datasheet corpus also shows that one correction ratio is unlikely to describe all LEDs:
| Integrated LED | Datasheet full-drive/test-current intensity R:G:B |
|---|---|
| WS2812B | approximately 1.00 : 1.70 : 0.47 |
| SK6812 | approximately 1.00 : 2.18 : 1.00 |
| WS2815 (15 mA) | approximately 1.00 : 3.19 : 0.61 |
| GS8208 (10 mA) | approximately 1.00 : 2.89 : 0.62 |
| APA102C | approximately 1.00 : 0.78 : 0.25 |
These are photopic luminous-intensity ratios, not complete calibration profiles. Most PDFs omit spectral power distributions, angular flux integration, code-to-light curves, temperature behavior, and production-bin distributions. Red also typically has a much lower forward voltage than green/blue, so colorimetric luminance and electrical power must remain separate models.
Datasheet catalog: https://fastled.github.io/datasheets/
Problem
We need full color-accurate reproduction from a declared source color space to a declared physical emitter profile while minimizing gamut loss, hue/luminance error, and quantization loss across 8-bit and high-bit-depth chipsets.
The conceptual pipeline must distinguish:
encoded source samples
-> decode source transfer function into linear light
-> source RGB primaries/white -> XYZ
-> gamut map / solve XYZ -> physical LED emitter drives
-> apply measured per-channel LED response compensation
-> apply brightness/power policy without changing solved chromaticity
-> quantize/dither into the chipset's native encoding
Today those stages are conflated or missing. Performing correction as RGB8 -> RGB8 destroys precision before gamma and chipset encoding. Gamma on three independently quantized RGB8 channels can collapse dark colors, shift hue, and reduce neutral-axis resolution. Conversely, expanding RGB8 source values into a wider linear working representation before matrix/profile operations lets correction, gamut mapping, and brightness share one rounding boundary at final output.
Proposal
Research and design a universal, profile-driven FastLED color pipeline, then implement it in independently mergeable phases.
1. Characterize current accuracy and chipset variation
Build a reproducible dataset from FastLED/datasheets for integrated RGB/RGBW parts. For every usable part, record:
- emitter dominant/peak wavelength or CIE xy;
- per-channel luminous intensity/flux and test current;
- forward voltage and channel current;
- PWM/code depth, global-current fields, and documented code-to-duty behavior;
- temperature curves, bin ranges, and spectral/response curves when present;
- whether the part contains emitters or is only a driver for external LEDs.
Do not manufacture precision the PDFs do not support. Mark values as typical/min/max, inferred, or measured. Group parts statistically to determine whether one or a small number of profiles is defensible, and quantify inter-chipset and bin variance.
Evaluate TypicalLEDStrip, Typical8mmPixel, and uncorrected output against each derived profile. Report neutral-axis error, primary/secondary error, luminance error, and a perceptual metric such as Delta E 2000 over a documented test set. Datasheet-derived estimates must be labeled separately from spectrometer/colorimeter measurements.
2. Define source and emitter profiles
Add an explicit source profile independent of the output chipset:
- primaries (
xyor equivalent); - reference white;
- transfer function/EOTF (
Linearinitially for ordinary buffers, plus named functions needed by media); - optional named spaces such as sRGB/Rec.709, Display-P3, Rec.2020, and custom primaries.
Ordinary FastLED source buffers default to linear semantics for the first version, as requested. Video loaded from .fled obtains its source profile and transfer function from the container. The canonical ledmapper .fled specification is authoritative; FastLED's mirrored spec, builder, parser, and video consumer must implement the same contract.
.fled source-color contract
The canonical ledmapper v1 spec already defines the initial metadata shape, and FastLED's local mirror is currently stale. Adopt this exact minimum declaration for newly produced rgb8 video:
{
"video": {
"fps": 60,
"color": {
"primaries": "bt709",
"transfer": "srgb",
"matrix": "rgb",
"range": "full"
}
}
}The fields are independent and must not be collapsed into a single ambiguous "BT.709" label:
primaries: "bt709"means the BT.709/sRGB primary chromaticities with D65 white. sRGB and BT.709 share these primaries and white point.transfer: "srgb"means the piecewise sRGB transfer function. It does not mean the BT.709 camera OETF and must not be approximated as an unnamed power-law gamma.matrix: "rgb"means the payload contains direct RGB components; it is the identity/no-matrix case in standard video metadata terminology. No YCbCr-to-RGB conversion applies. The field is redundant with the currentrgb8pixel format but keeps the color description self-contained and leaves room for future YCbCr pixel formats, which must declare their matrix coefficients explicitly (for example BT.709 or BT.2020 non-constant-luminance).range: "full"means all codes represent image values. For 8-bit RGB,0is black and255is full channel/white. The alternative"limited"(video/legal/studio/TV range) uses nominal 8-bit RGB/luma black at16and white at235; conventional YCbCr chroma uses16..240centered at128. Higher-bit limited RGB/luma scales exactly to64..940at 10-bit and256..3760at 12-bit. A consumer expands limited range to normalized component values before transfer-function decoding and color-space conversion. Current.fledrgb8producers emit"full"; limited is reserved for explicitly labeled future/imported payloads.rgb8remains display-encoded data. A producer must not put linear-light samples inrgb8while labeling or implying sRGB. A future linear or higher-precision payload gets a distinctpixel_formatvalue.
Missing metadata/default: when video.color is absent in a legacy .fled, or when an older reader exposes no profile, interpret the payload as the exact tuple { primaries: bt709, transfer: srgb, matrix: rgb, range: full }. This preserves the historical display-encoded RGB8 behavior. Do not describe this default merely as "BT.709," since that leaves the transfer function unresolved. Missing individual keys inherit the corresponding value from this tuple. Unknown explicit values must produce a clear unsupported-profile diagnostic rather than silently falling back.
"none" is not a valid transfer-function value because it is ambiguous. Producers with genuinely linear-light samples must declare transfer: "linear" and use a pixel format whose semantics permit linear data; ordinary non-video FastLED buffers continue to use the separately documented default-linear API contract.
The profile schema must remain extensible beyond the initial tuple. Research and standardize:
- named primaries at least for
bt709,display-p3, andbt2020; - named transfers at least for
linear,srgb,bt709, PQ/ST 2084, and HLG when their payload formats are supported; - a custom-primary form carrying red/green/blue CIE xy coordinates plus white xy;
- a parameterized transfer form only if a named standard cannot describe the source;
- deterministic validation, canonical serialization, and rejection behavior.
Prefer names aligned with the canonical ledmapper schema and established media terminology. If CICP identifiers are introduced, define an unambiguous mapping between their numeric values and the JSON names. Color metadata describes the encoded payload independently of LED layout, output chipset, and emitter profile.
Extend/refine EmitterProfile so an output channel can describe:
- physical emitter chromaticities and relative peak
Y; - optional per-channel code-to-light response/LUT;
- native code depth and special encoding facilities;
- calibration provenance and reference operating conditions;
- a separate electrical power profile rather than treating
Yas watts.
Profiles must be selectable per physical channel/strip. A chipset enum may provide a conservative default only where the integrated LED package is actually fixed; driver-only chipsets require a user/fixture emitter profile.
3. Use one high-precision linear working pipeline
Promote input samples before any lossy correction. The reference path should resemble:
The normative pipeline is:
RGB8 + source color space
-> decode directly to RGB16 linear
-> RGB16 linear LED correction
-> chipset-aware final encoding
RGB8 + source color space -> RGB16 linear is one semantic conversion: normalize the encoded RGB8 samples and apply the source profile's inverse transfer function while producing 16-bit linear-light channels. There is no intermediate RGB8 linear buffer and no RGB8-to-RGB8 correction step.
The LED-correction stage consumes RGB16 linear and retains wide precision while applying source-primary/white conversion, the LED emitter profile, gamut handling, brightness, and device-response compensation. Only the final chipset encoder may reduce this result to RGB8 or map it into a native higher-precision/global-current wire representation.
Widening does not claim to recreate source information absent from RGB8; its purpose is to preserve the precision generated by transfer decoding and prevent additional correction/gamma rounding loss. All subsequent calculations use sufficiently wide accumulators and round once at the final chipset boundary.
Specify numeric formats and overflow/rounding rules. At minimum, compare a float64 host reference against the RGB16/fixed-point embedded implementation. Intermediate precision must be justified by measured maximum color and luminance error.
Keep the current zero-cost/default path available on tiny MCUs. Color management should tree-shake when unused, and profiles/LUTs must respect platform memory tiers.
4. Minimize gamut, hue, and luminance loss
A plain inverse 3x3 matrix followed by negative clipping/max normalization is not sufficient for all out-of-gamut colors. Research and specify a deterministic gamut-mapping objective that:
- exactly preserves in-gamut colors within the numeric error budget;
- preserves neutral colors and the configured white point;
- minimizes perceptual hue error for out-of-gamut colors;
- makes the luminance-versus-chroma tradeoff explicit;
- avoids discontinuities during animation;
- supports a fast matrix path and an optional LUT/optimized path with measured error bounds.
Compare at least clipping, max-component normalization, chroma compression in a perceptual space, and constrained non-negative optimization. Pick the smallest algorithm that meets the accuracy target on embedded hardware.
5. Make gamma and quantization chipset-aware
Treat these as distinct concepts:
- source decoding EOTF/OETF;
- physical LED code-to-light response compensation;
- perceptual brightness shaping used intentionally for 8-bit appearance;
- chipset-native current/global-brightness encoding;
- temporal/spatial dithering.
Research WS2812-class 8-bit behavior specifically. Compare independent RGB gamma, luminance/value-only shaping, HUE16/HSV-domain strategies, colorBoost(), and linear-light dithering. Measure hue and neutral-axis error at dark levels rather than judging only smoothness.
For 8-bit wire formats, quantize once at the final boundary and use dithering/error diffusion where it improves time-averaged accuracy. For APA102/SK9822 global-current modes and native 16-bit parts, jointly choose current/brightness and channel codes to maximize effective resolution without introducing hue shifts. Do not apply a second correction or gamma stage after the device solve.
6. Integrate once, before chipset emission
The normal RGB, RGBW, and RGBWW paths should consume the same typed color pipeline and then hand final device-drive values to topology-specific encoders. Avoid duplicating color science inside individual drivers. Chipset encoders may own only genuinely chipset-specific quantization/current encoding.
Preserve the legacy .setCorrection(CRGB) API as an explicitly documented compatibility/fast mode. It must not silently stack with a colorimetric profile unless the order and semantics are defined.
Acceptance criteria
- RED -> GREEN evidence starts with focused tests demonstrating current profile/transfer omission, early RGB8 quantization loss, and at least one hue/neutral-axis regression from independent 8-bit gamma.
- A checked-in research report catalogs every relevant integrated-LED datasheet in
FastLED/datasheets, distinguishes driver-only parts, and quantifies whether profiles cluster or require per-part defaults. - The report quantifies the accuracy of
TypicalLEDStrip,Typical8mmPixel, andUncorrectedColorusing documented assumptions and perceptual/luminance metrics; datasheet estimates and instrument measurements are reported separately. - At least a representative WS2812B/SK6812-class strip and one SPI/high-bit-depth strip are measured with a colorimeter or spectrometer across primaries, secondaries, neutral ramp, low codes, full scale, and operating temperature. Static datasheet analysis alone cannot close the implementation phase.
- Source-profile types cover linear/custom primaries and named media spaces without coupling source semantics to chipset selection.
- The canonical
.fledspec, producer, FastLED mirror/parser, and video playback carry and honorvideo.color; tests prove the absent-metadata default is{bt709 primaries, sRGB transfer, RGB matrix, full range}, linear payloads are never mislabeled asrgb8, and unknown explicit profiles are rejected clearly. - A float64 host reference produces golden vectors for source decode, XYZ conversion, gamut mapping, emitter solve, response compensation, and final quantization.
- The embedded wide-precision implementation stays within a documented Delta E/luminance error budget versus the reference across a dense RGB corpus, ramps, ColorChecker-like samples, and out-of-gamut boundaries.
- Tests prove the normative
RGB8 + source color space -> RGB16 linear -> RGB16 LED correction -> final chipset encodingpath has no intermediate RGB8 correction/linear buffer and only one final quantization boundary; the legacy RGB8 correction path is retained only as an explicit compatibility mode. - In-gamut vectors preserve chromaticity; neutral ramps remain neutral; out-of-gamut mapping is continuous and meets the selected hue/luminance objective.
- WS2812-class tests cover low-level gamma/value/HUE16 strategies and temporal dithering, reporting effective luminance steps, hue error, neutral error, and flicker constraints.
- APA102/SK9822 HD and native 16-bit encoders consume wide pipeline output without an intermediate RGB8 correction round-trip; tests verify monotonic output and improved low-light resolution.
- Brightness and power limiting operate without changing solved chromaticity except where an explicitly documented constraint makes that impossible; electrical power uses a separate per-channel model.
- Default legacy output remains byte-identical when color management is not enabled.
- TINY-tier builds add no per-controller state and do not pull in float/colorimetric solver symbols; bloat and throughput budgets are recorded for representative AVR, SAMD51, ESP32, and high-throughput parallel output.
- Full C++ tests and representative hardware validation turn green after implementation.
Decisions
- Track research, profile schema, reference algorithm, and phased implementation in one umbrella issue. Their interfaces are inseparable, while implementation PRs can still land independently.
- Default ordinary source buffers to linear for the first version. This follows the requested API contract and avoids silently treating existing artistic FastLED values as sRGB; named/nonlinear media must declare a source profile.
- Make
.fledauthoritative for video source color metadata. The container is self-describing and its producer already owns video metadata; hard-coding video assumptions in FastLED would repeat the current ambiguity. - Use XYZ as the device-independent interchange, with perceptual spaces allowed for gamut mapping/error measurement. Existing FastLED colorimetric primitives already use CIE xyY/XYZ, reducing duplicated machinery.
- Keep colorimetric accuracy separate from power efficiency. Datasheet
mcd/Yvalues are photometric and cannot serve as electrical power coefficients. - Require measured hardware evidence before declaring profiles accurate. Datasheets prove large channel variation but generally do not contain enough spectral and response data for a calibrated production profile.
- Quantize only at the chipset boundary. This directly addresses the known RGB8 -> gamma/correction -> RGB8 loss and lets each encoder use its native precision.
- Retain legacy correction as an opt-in fast/compatibility path. Existing sketches and tiny platforms must not pay for or silently change behavior due to the new pipeline.
Open questions
- What accuracy target should close the first implementation: e.g. median/max Delta E 2000 and luminance error under controlled viewing conditions?
- Which calibration instrument and test fixture become the reproducible FastLED reference, and where should measured profile artifacts live?
- Should the first embedded gamut mapper optimize in CIE Lab/LCh, OKLab/OKLCh, or use a precomputed LUT generated by a higher-quality host optimizer?
- Which new
pixel_formatvalues should represent linear RGB16 and other high-precision payloads? The existingrgb8meaning and its absent-metadata compatibility default remain display-encoded BT.709-primary/sRGB-transfer RGB.
Related issues
- feat(colorimetric): split shared response layer and design RGB solve entrypoint #3242 / feat(colorimetric): per-strip variant<RGBW_MODE, ColorimetricMode> config + drop FASTLED_RGBW_COLORIMETRIC gate + extract shared response layer #3255: shared colorimetric response layer and RGB solve design; useful foundation, but no complete profiled precision-preserving RGB output integration.
- [meta] RGB/RGBW/RGBCCT colorimetric path — consolidated tracker #3422: prior consolidated RGB/RGBW/RGBCCT colorimetric tracker.
- bug(rgbw): kRGBWColorimetric* skips source-RGB → LED-XYZ conversion — solver has no target white point #2705: source-RGB to LED-XYZ conversion and target-white semantics.
- Apply a curve for color correction? #909: nonlinear/curve-based color correction request.
- Power management doesn't take color/temp correction into account #697: correction-aware power management; related data, separate model.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTriage
Activity
zackees commentedon Aug 24, 2026
Audit of this spec
I audited the proposal against the codebase at
2f909ce0f2(branch tip of master's lineage), verifying every factual claim about existing code and then reviewing the design itself. Summary: the codebase claims are accurate (details at the bottom), the overall direction — one wide linear working domain, profiles decoupled from chipsets, a single late quantization boundary, measured evidence before accuracy claims — is sound and well-phased. But the spec contains several significant design bugs and internal contradictions that should be fixed before any implementation phase starts, because they sit at exactly the interfaces this umbrella issue is supposed to pin down.Significant issues (ranked by consequence)
1. The APA102 hardware model is wrong: the 5-bit field is not "global current" on APA102 — HIGH
The spec repeatedly calls the APA102/SK9822 5-bit field a "global-current field" / "global-current modes" and §5 proposes to "jointly choose current/brightness and channel codes." That model is correct for SK9822 (which implements the field as current gain) but wrong for genuine APA102, where the field drives a second, much slower PWM stage (hundreds of Hz, per cpldcpu's widely cited analysis) layered on top of the ~19 kHz channel PWM. The two behaviors have opposite tradeoffs for a color-accuracy pipeline:
The current codebase makes no distinction either:
APA102ControllerHDandSK9822ControllerHDare the same template with the samekFiveBitGammaCorrectionMode_BitShiftmode, differing only in default SPI speed (src/fl/chipsets/apa102.h), and all identifiers say "brightness," not "current."apa102fix.mdeven records that the field's semantics were explicitly uncertain ("It's not clear what scale brightness is, or how it is to be applied") and that visible stepping was observed on the HD ramp. The spec should (a) stop calling it a current field generically, (b) require per-chip 5-bit semantics in the emitter/chipset model, and (c) add a flicker constraint to the APA102 joint-solve objective — §5 already imposes one for temporal dithering, so the hook exists.2. "RGB16 linear" as the normative working format can't hold what the pipeline needs to put in it — HIGH
Two distinct problems with making
RGB16 linearthe normative intermediate:(a) Signedness / out-of-gamut headroom. The stage ordering is decode → source-primaries→XYZ → gamut map → emitter solve. Any wide-gamut source (Display-P3, BT.2020 — both explicitly in scope) converted toward a narrower LED gamut produces negative pre-gamut-mapping components; the 3×3 matrices involved have negative coefficients. An unsigned u16-per-channel buffer cannot represent those intermediates, so either the working format needs specified signed headroom (e.g. s1.15/s16.16 with defined clamping) or the pipeline must stay in XYZ until after gamut mapping and only then land in bounded RGB16. "Sufficiently wide accumulators" is mentioned, but the normative format name is what implementers will build to — pin down signedness, headroom, and where the format boundary sits relative to gamut mapping.
(b) PQ/HLG incompatibility. §2 proposes PQ/ST 2084 and HLG as named transfers "when their payload formats are supported," but a 16-bit linear integer domain cannot faithfully carry PQ-decoded content: PQ spans ~10⁵:1 of absolute luminance precisely because linear integer coding of that range is hopeless; decoding PQ into normalized linear u16 crushes everything below ~1% peak into a handful of codes. Either scope the normative RGB16-linear path to SDR transfers (linear/sRGB/BT.709) and require a different (float or log/wider) working domain before HDR transfers are admitted, or drop PQ/HLG from the schema roadmap until that domain exists. Right now the spec's normative pipeline and its schema roadmap contradict each other.
3. "Quantize once at the final boundary" is self-contradictory as an acceptance criterion — MEDIUM/HIGH
The decode step
RGB8 + source space -> RGB16 linearis itself a quantization boundary: the inverse-sRGB result is not exactly representable in 16 bits, and every subsequent matrix stage that stores back to RGB16 rounds again. So the acceptance criterion "only one final quantization boundary" is untestable as literally worded — any real fixed-point implementation has at least two rounding events, and possibly one per stored stage. The intent (no intermediate RGB8, no correction before widening) is right and testable; restate the criterion in the form the spec already uses elsewhere: "the embedded path stays within a documented ΔE/luminance budget versus the float64 reference," plus a structural test that no intermediate buffer is 8-bit. Note also that 16-bit linear is only marginal at the dark end even for sRGB: code 1 decodes to ≈3.04e-4, i.e. ~20 u16 codes, and brightness scaling in the linear domain eats that headroom fast (at 1/32 brightness the bottom several sRGB codes collapse). The error budget must be specified inclusive of the brightness/power stage, not just the identity-brightness path.4.
rgb8+transfer: "linear"is simultaneously forbidden and implied legal — MEDIUMThe
.fledcontract says both:rgb8remains display-encoded data. A producer must not put linear-light samples inrgb8…" andtransfer: \"linear\"and use a pixel format whose semantics permit linear data"…while
linearis listed as a named transfer in the same schema that today has exactly one pixel format (rgb8). So is{pixel_format: rgb8, transfer: linear}a validation error or not? The acceptance criterion "linear payloads are never mislabeled asrgb8" suggests yes, but nothing states the parser-side rule. Make it explicit: the validator rejectstransfer: linear(and PQ/HLG) whenpixel_format == rgb8, with the diagnostic contract from the unknown-profile rule. Otherwise every producer/consumer pair will resolve the ambiguity differently — the exact failure mode this metadata exists to prevent.5. The missing-key inheritance rule is a time bomb for future YCbCr — MEDIUM
"Missing individual keys inherit the corresponding value from this tuple" is safe for
rgb8but wrong as a general rule: a future YCbCrpixel_formatwhose envelope omitsmatrixwould inheritmatrix: "rgb"— an invalid, silently wrong interpretation of chroma-subsampled data. Scope the inheritance default torgb8(or more precisely: to pixel formats whose default tuple is defined), and requirematrix/rangeto be explicit for any non-RGB pixel format, rejected otherwise. Similarly, consider rejectingrange: "limited"forrgb8in v1 instead of implementing expansion — limited-range RGB inside an LED container is a pure footgun with no current producer, and the spec's own text says limited is "reserved for explicitly labeled future/imported payloads."6. The absent-metadata default quietly changes playback behavior once color management honors it — MEDIUM
"When
video.coloris absent … interpret the payload as{bt709, srgb, rgb, full}. This preserves the historical display-encoded RGB8 behavior." It preserves the historical labeling, but not the historical output: today's player pushesrgb8bytes straight through the legacy path, whereas once the pipeline honors the sRGB default, the same legacy file plays through an sRGB decode → colorimetric solve and produces different light. That may be the right call — but it is a behavior change for existing files, and it diverges from the "ordinary buffers default to linear" decision two sections earlier (same bytes, opposite default transfer, depending on whether they arrived via.fledor via aCRGBbuffer). The spec should state explicitly: (a) legacy.fledfiles change appearance when color management is enabled, and that is intended; (b) the byte-identical guarantee applies only when color management is disabled; (c) why video and buffers get opposite transfer defaults (there is a defensible answer — video is authored display-referred, buffers are authored against FastLED's linear-ish PWM — but it needs to be written down, because it will be the single most-asked question).7. No chromatic adaptation transform is specified — the root cause of #2705, again — MEDIUM
The pipeline names source white and "configured white point" preservation, but never specifies the adaptation transform between the source white (e.g. D65) and the emitter/target white when they differ — Bradford, CAT02/CAT16, or bare von Kries XYZ scaling give visibly different results. #2705 was exactly this class of omission (solver had no target white point semantics). Since XYZ is the declared interchange, the CAT choice is part of the interchange contract, not an implementation detail. Name one (Bradford is the boring correct default) and put it in the golden-vector set.
8. The effects/palette layer has no contract with the source profile — MEDIUM
"Source profile" is defined per buffer, but FastLED buffers are mostly generated, not loaded:
CHSV→CRGB, palettes,blend/nblend,fadeToBlackBy, gradient fills all do arithmetic directly in the buffer domain. Under the linear default that arithmetic is linear-light math (consistent with today). But the moment a user declares a buffer sRGB — or mixes.fledsRGB video with generated overlays — every lerp/blend changes meaning, and compositing sRGB-tagged content with linear-tagged content is undefined. The spec needs one paragraph: effect/palette math is defined in the buffer's declared space; blending across differently-tagged sources is (v1) unsupported / (later) done in the linear working space; palettes carry no profile of their own. Without this, "source profile" is only well-defined for video playback, which is the minority use case.9. Instrumentation: a tristimulus colorimeter is not sufficient for narrowband LED primaries — MEDIUM
The hardware-measurement acceptance criterion says "colorimeter or spectrometer." For narrowband emitters, filter-based tristimulus colorimeters have well-known observer-mismatch errors of several ΔE on saturated primaries unless corrected with a per-source spectral calibration matrix. Since the whole point of the measurement gate is to validate primary chromaticities and low-code behavior, the criterion should require a spectroradiometer (or a colorimeter with a spectral correction derived from one for that exact device class) for primary/secondary measurements; a plain colorimeter is acceptable only for neutral-ramp/luminance tracking. Otherwise the measured "ground truth" can carry more chromaticity error than the datasheet estimates it's supposed to replace. This resolves half of the open "which calibration instrument" question — the constraint is knowable now.
10. Temperature is collected but never enters the pipeline — MEDIUM/LOW
§1 collects temperature curves and the measurement criterion spans "operating temperature," but the pipeline has no temperature input stage and profiles have only "reference operating conditions." Red (AlInGaP) emitters lose luminous flux with temperature much faster than InGaN green/blue, so a static profile's white point drifts as a strip self-heats — this is one of the largest real-world accuracy effects the spec measures but cannot correct. Two honest options: (a) declare accuracy claims valid only at the profile's reference temperature and record the measured drift as documentation, or (b) add an optional scalar temperature knob to
EmitterProfile. Either is fine; silently measuring drift the pipeline can't act on, inside an implementation-gating criterion, is not — it makes the gate unclosable or meaningless depending on the reader.11. Per-pixel solve cost: the existing NNLS must not end up in the hot path — LOW (but say it now)
The existing
nnls3insrc/fl/gfx/colorimetric_response.his an iterative projected-gradient solve (fixed step, float32). Fine for cache/profile construction; catastrophic if any implementer puts it per-pixel to handle out-of-gamut colors, especially on the "high-throughput parallel output" targets the bloat criterion names. §4 already allows a LUT path — strengthen it to a requirement: the per-pixel path is matrix + clamp/compress (+ optional LUT), and iterative optimization is restricted to profile-build time on the host or at setup. Also relevant: the entire existing colorimetric stack is float32, so the "TINY tier pulls in no float symbols" criterion implies a full fixed-point re-implementation of cache build and solve, which is a real phase of work the phase list should name rather than inherit implicitly.12. ΔE metric needs its normalization defined; the gamut mapper should avoid CIELAB blue hue lines — LOW
ΔE2000 numbers are meaningless without stating the white reference and the absolute→relative luminance normalization for an emissive device — define both in the report template, or every phase will normalize differently and the budgets won't compare. Separately, for the gamut-mapping objective specifically: CIELAB's blue hue lines bend (the classic blue→purple shift under chroma compression), and saturated narrowband LED blue is exactly where the mapper will operate hardest. That's a concrete argument for doing hue-preserving compression in OKLab/OKLCh (or with hue-corrected Lab) — worth resolving the open question in that direction now rather than leaving it fully open.
Smaller notes
.fledmirror is further behind than "stale" implies.src/fl/fled/FLED_FORMAT.mddeclares onlyvideo.fps; color metadata isn't even on its growth roadmap, the parser (src/fl/fled/detail/parser.cpp.hpp) extracts nothing color-related, and consumers read onlyvideo.fpsandmap. The canonical ledmapper spec's side of the claim isn't verifiable from this repo — the sync task should start by confirming what the canonical spec actually says today.TypicalLEDStripis anLEDColorCorrectionenumerator (0xFFB0F0), not aCRGBliteral (src/color.h) — the value in the issue text is right; just a nit if the text gets reused in docs.src/fl/chipsets/encoders/ucs7604.hgates it; 8-bit mode does no gamma) — the "HD108 and UCS7604 perform 8-to-16-bit gamma expansion" sentence should carry that qualifier, since §5's "no second gamma stage after the device solve" rule needs to know exactly which encoder modes already embed one.src/fl/gfx/colorimetric_response.hstill says the RGB solve "lands in PR 3" a few lines above the landedsolve_rgb_colorimetric()— trivial cleanup for whichever phase touches that file first.Claim verification (what I checked)
All load-bearing codebase claims in the issue are accurate:
colorimetric_response.hcontains the xyY/XYZ primitives,build_source_matrix,EmitterProfile,RgbColorimetricCache, andsolve_rgb_colorimetric()(float32 throughout);gamma_lut.hhas both 8→8 and 8→16 LUT machinery;CRGB::computeAdjustment()(src/crgb.cpp.hpp) is exactly three 8-bit multipliers (correction × temperature × scale ÷ 2¹⁶) applied viascale8inPixelController::loadAndScale*; the RGBW work has named input gamuts (Rec.709/Rec.2020/DCI-P3) and a measured SK6812 default profile;colorBoost()documents the RGB8→gamma→RGB8 decimation; Pride2015 keeps 16-bit hue/brightness accumulators and quantizes at output; and the colorimetric stack and the 8-bitcomputeAdjustmentstack are indeed two disjoint pipelines today — the solver is not wired into the per-pixel path, which is the gap this issue exists to close.Overall: strong spec, right decomposition, and the acceptance criteria are unusually testable for a design issue. Fixing items 1–8 is cheap now (they're wording/contract changes) and expensive later (they're the interfaces every phase builds against).
zackees commentedon Aug 25, 2026
Round 2: additional open questions
Second-round review of the spec plus the audit above. These are questions that appear in neither the issue's Open-questions section nor audit items 1–12, but that sit on interfaces the implementation phases will build against. A follow-up issue with proposed final resolutions for all open questions (the original four, audit items 1–12, and Q1–Q7 below) will be filed and linked here.
Q1. Where do profiles attach in the public API, and what happens to the legacy setters?
The spec says profiles are "selectable per physical channel/strip" but never names the API surface.
ChannelOptions(src/fl/channels/config.h) already carries per-channel correction, temperature, dither, and RGBW settings, and repo convention puts per-channel binding onFastLED.add<>()/Channel::create<>()and global knobs onCFastLED— no barefl::set_*free functions. Which of {source profile, emitter profile, gamut policy, pipeline enable} are per-channel vs global? And the legacy mapping needs a rule, not just "must not silently stack": what doessetCorrection()/setTemperature()do on a profile-managed channel — error, ignored-with-warning, or clears the profile? DoessetTemperature()map onto the pipeline's white-point adaptation, or is it dead in profile mode?Q2. Execution model: streaming transform in
show()or an RGB16 intermediate framebuffer?Per-pixel streaming through the existing
PixelControlleriteration costs no RAM but constrains dithering (error diffusion needs neighbor state) and forces the transform into the latency-sensitive encode path, including parallel multi-lane outputs. A separate RGB16 working framebuffer costs +6 bytes/pixel — ~60 KB at 10k LEDs — which the "respect platform memory tiers" line does not decide. Which model is normative, is it tiered by platform, and how does it interact with async/double-bufferedshow()?Q3. RGBW/RGBWW is an underdetermined solve — which metamerism/W-allocation policy?
With 4+ emitters, infinitely many drive vectors reach the same XYZ target. §4's gamut objective is written for 3 primaries and §6 says RGBW consumes "the same typed pipeline," but nothing declares the W-allocation policy (max-W for efficiency, max-RGB, spectral preference), whether it is per-profile configurable, or whether the white channel's output participates in the gamut volume the mapper targets. The existing RGBW colorimetric work has machinery here; the spec should say which policy is normative and how it composes with gamut mapping.
Q4.
setBrightness(u8)and the power limiter: what is the semantic mapping into linear light?Audit item 3 covers the precision cost of linear-domain brightness; the semantics are still open. Is
setBrightness(128)defined as half linear flux (photometrically matching today's behavior, since legacyscale8on codes feeding linear-in-code PWM is already a flux scale), or something perceptual? AndsetMaxPowerInMilliWattscurrently computes an 8-bit brightness clamp — in the new pipeline does power limiting emit a linear-domain scalar composed with brightness at the (chromaticity-preserving) brightness/power stage, and is that the only insertion point?Q5. Dither ownership: pipeline dithering vs the existing
BINARY_DITHERFastLED already has controller-level temporal dithering (
setDither(BINARY_DITHER)). Does pipeline-owned dithering replace it, compose with it, or are they mutually exclusive per channel? Error diffusion additionally needs per-pixel state — what is the RAM budget per tier, and does the TINY-tier "no per-controller state" criterion categorically exclude it there?Q6.
.fledforward compatibility: new file, old parserThe spec defines the absent-metadata default for old files on new readers. The reverse is unaddressed: an old parser encountering a new file with
video.colorwill silently ignore it and play with the legacy interpretation. Is that accepted (color metadata is always advisory forrgb8), or does a producer need a way to mark color metadata as mandatory — via a container version bump, a required-features field, or by gating on a newpixel_formatthat old parsers already reject?Q7. The hardware-measurement gate cannot run in CI — what closes it, and what reopens it?
Spectroradiometer measurements are one-shot lab work. Is the acceptance criterion closed by a checked-in measurement report (instrument model/serial, date, fixture geometry, operating temperature, raw data), with CI validating only schema and golden vectors? And what triggers re-measurement — a new part, a new bin, or an observed validation drift beyond the error budget?
Sharpening (not new): profile artifact format, not just location
Original open question 2 asks where measured profile artifacts live; it should also ask in what form — a versioned JSON profile schema with provenance fields (instrument, conditions, bin) that host tooling and firmware share one parser for, so measured profiles are interchangeable rather than per-experiment CSV dumps.
zackees commentedon Aug 25, 2026
Final-resolution decision record filed as #4033 — it resolves the four original open questions (A1–A4), adopts audit items 1–12 with amendments (B1–B12), and answers round-2 questions Q1–Q7 (C1–C7).
zackees commentedon Aug 25, 2026
Implementation tracking has moved to #4034 (final implementation tracker with phase sub-issues #4035–#4044). This issue and the #4033 decision record are now frozen references — the tracker's decision digest is the single consolidated source.
feat(color): float64 host reference, golden corpus, and RED baseline (#…