Skip to content

C5's one-time fallback warning was never implemented, and cannot currently be tested #4333

Closed

Description

@zackees

#4034 C5 specifies four things for a channel that asks for colour management and does not get it:

Driver-only chipsets with no profile fall back to the legacy path with: one-time warning, queryable isColorManaged(), fallback flag in channel events/telemetry, and opt-in global strict mode that upgrades fallback to a hard error.

Three are present:

item state
queryable isColorManaged() fixed in #4329 — it was a hardcoded false
fallback flag in events/telemetry ChannelEvents::onColorProfileFallback, fired at channel.cpp.hpp:241 and :420, with a test
opt-in strict mode FastLED.setColorManagementStrict(), with tests
one-time warning absent

reconcileColorProfile() sets mColorProfileFallback = true and the callers fire the event. There is no FL_WARN anywhere on that path — grep FL_WARN src/fl/channels/channel.cpp.hpp returns the UCS7604 RGBWW note, three showPixels/draw-list messages, and nothing about profiles.

So a sketch whose profile fails to bind falls back to the legacy path silently unless it has subscribed to the event. The event is the machine-readable half; C5 lists the warning separately because it is the half a human sees without writing code.

Why I have not just added it

FL_WARN output is not observable from a test. There is no capture hook in fl/log/log.h, and tests/fl/channels/channel.cpp says so where it works around the same problem:

Verification is behavioural — the project log macros don't have a capture hook today, so each test asserts the enqueue did NOT land.

So a one-line FL_WARN_F here would be unverifiable: nothing could show it fires, that it fires once, or that it stops firing if the condition is later fixed. That is worth naming on its own, because it is the mechanism by which warnings like this go missing and stay missing — this one has been absent since C5 was written and nothing failed.

Two ways forward, in the order I would take them

  1. A log capture hook for tests. Small, unblocks this and every future warning contract, and would let the existing warnProfileCleared / LegacyClearedByProfile behaviour be checked as text rather than only as an event. Its absence is why setColorProfile() silently discards mGamma and mDitherMode: the warning checks two of the four fields it clears #4331's fix could only be verified through the event surface.
  2. Add the warning, verified by inspection, and accept that "one-time" is unenforced until (1) exists.

Doing (2) without (1) adds a fourth C5 item that nothing holds in place, which is how the first three ended up in three different states.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MLhWkMfzLjrnLTDMBE6Fj9

Activity

  1. zackees commented on Sep 10, 2026

    @zackees
    MemberAuthor

    Correction: the capture hook exists, one layer below where I looked

    I wrote that a warning here would be unverifiable because "there is no capture hook in fl/log/log.h". That is true of log.h and false of the codebase.

    fl/stl/cstdio.h has:

    using print_handler_t = fl::function<void(const char*)>;
    void inject_print_handler(const print_handler_t& handler) FL_NO_EXCEPT;
    void clear_print_handler() FL_NO_EXCEPT;

    and fl::print/println route through it (cstdio.cpp.hpp:84). Both log_emit and log_emit_f end at fl::println(...), so every FL_WARN is capturable today. tests/fl/stl/cstdio.cpp already installs handlers this way.

    I searched log.h for the hook, did not find it there, and stopped — the same mistake in shape as #4326, where I looked for a guard at the wrong layer and concluded it was missing. Twice now, so it is worth naming as a habit rather than an accident: absence at the layer I searched is not absence.

    What that changes

    Both proposals in this issue collapse into one. There is nothing to build first — the warning can be added and verified as text, which is what I said could not be done. Doing that now.

    The wider point in the issue survives and is arguably sharpened: C5's four items ended up in four different states, and the one with no test is the one that was never written. The tool to test it was there the whole time.

  2. moved this from Triage to Done in FastLED Trackeron Sep 11, 2026
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