Skip to content

docs(fled): separate "mandatory" from "absent" for rgb16_linear (#4156 R10) - #4272

Merged
zackees merged 1 commit into
masterfrom
docs/4156-r10-mandatory-vs-absent
Sep 10, 2026
Merged

zackees merged 1 commit into
masterfrom
docs/4156-r10-mandatory-vs-absent

Conversation

@zackees

@zackees zackees commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

Refs #4156 (R10).

R10 was the last of the three findings the triage left unchecked. Two of its three parts have been overtaken by the tree; one is real.

Resolved already — the fallback policy

R10 read the landed mirror as permitting fallback on unresolvable advisory RGB metadata, against #4034's strict-by-default requirement. FLED_FORMAT.md now says the opposite of what R10 read:

Producers and validation tooling always take the strict reading. resolveVideoColor() reports every violation. FastLED playback is strict by default; an application may explicitly select best-effort only for advisory rgb8 color metadata, and that path emits a warning.

That is #4034's contract verbatim, including the explicit opt-in.

Resolved already — dark output on rejection

On playback rejection, explicitly transmit/clear dark output; merely skipping show() can leave the preceding LED frame latched.

Video::draw(now, leds) writes CRGB::Black across the whole span when an error is recorded, before returning false. Nothing is left latched.

Real, and fixed — the contradiction

The format table gives rgb16_linear a default tuple, defaultVideoColor() implements it, and a test pins it. Three screens down, the forward-compatibility section said the format is "meaningless without its declaration". Both cannot be true.

R10's own resolution says which way to settle it — "Keep the already implemented linear16 default tuple if absence is intended, and rewrite the contradictory prose" — so the prose now separates the two states the old wording ran together:

  • Absent is resolvable. The pixel-format value has already pinned linear-light samples, and BT.709 at full range is the rest of the historical reading. declared is false on that result, so a consumer can still tell an inherited tuple from an author's claim.
  • Unresolvable is a refusal. Where an unrecognized name on rgb8 may fall back to the default tuple with a diagnostic, the same name on rgb16_linear may not. That is what "mandatory" means here — it is about fallback, not about absence.

The declared == false flag is the entire distinction, so it is now asserted for rgb16_linear rather than only for rgb8, alongside a case checking that the refusal half still refuses.

Not addressed

R10 also asks for identical contract fixtures in ledmapper. That is the other repo's half and is not something this PR can land.

Verification

  • bash test --cpp — 299/299 unit, 84/84 examples
  • bash lint — 0 errors
  • Mutation-tested: marking the inherited tuple as declared, and dropping the rgb16_linear recognition, each fail

🤖 Generated with Claude Code

https://claude.ai/code/session_01MLhWkMfzLjrnLTDMBE6Fj9

Summary by CodeRabbit

  • Documentation

    • Clarified forward-compatibility behavior for rgb16_linear color declarations.
    • Documented that absent color declarations use the default tuple without marking it as explicitly declared.
    • Clarified that unrecognized color names are rejected rather than silently falling back to defaults.
  • Tests

    • Added coverage for inherited default color values.
    • Added coverage confirming invalid color names are refused while empty declarations remain valid.

…R10)

R10 was the last of the three findings the triage left unchecked. Two of its
three parts have been overtaken; one is real and is fixed here.

**Resolved already — the fallback policy.** R10 read the landed mirror as
permitting fallback on unresolvable advisory RGB metadata against #4034's
strict-by-default requirement. `FLED_FORMAT.md` now says the opposite of what
R10 read: "FastLED playback is strict by default; an application may
explicitly select best-effort only for advisory `rgb8` color metadata, and
that path emits a warning." That is #4034's contract verbatim.

**Resolved already — dark output on rejection.** R10 warned that "merely
skipping `show()` can leave the preceding LED frame latched". `Video::draw`
writes `CRGB::Black` across the whole span when an error is recorded, before
returning false. Nothing is left latched.

**Real, and fixed — the contradiction.** The format table gives
`rgb16_linear` a default tuple, `defaultVideoColor()` implements it, and a
test pins it. The forward-compatibility section three screens down said the
format is "meaningless without its declaration". Both cannot be true.

R10's own resolution says which way to settle it: keep the default tuple,
rewrite the prose. So the prose now separates the two states the old wording
ran together. **Absent** is resolvable -- the pixel-format value has already
pinned linear-light samples, and BT.709 at full range is the rest of the
historical reading -- and `declared` is false on that result, so a consumer
can still tell an inherited tuple from an author's claim. **Unresolvable** is
a refusal: where an unrecognized name on `rgb8` may fall back with a
diagnostic, the same name on `rgb16_linear` may not. That is what "mandatory"
means here, and it is about fallback rather than about absence.

The `declared == false` flag is the whole distinction, so it is now asserted
for `rgb16_linear` rather than only for `rgb8`, alongside a case that the
refusal half still refuses.

Not addressed: R10 also asks for identical contract fixtures in ledmapper.
That is the other repo's half and is not something this PR can land.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01MLhWkMfzLjrnLTDMBE6Fj9
@coderabbitai

coderabbitai Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 0c9e221a-172f-44b6-9147-c14452f0a38a

📥 Commits

Reviewing files that changed from the base of the PR and between 569b70f and 0192403.

📒 Files selected for processing (2)
  • src/fl/fled/FLED_FORMAT.md
  • tests/fl/fled/fled_color.cpp

Included review availability: Your plan provides up to 8 included reviews per hour; 4 remain after this review.


📝 Walkthrough

Walkthrough

The FLED format documentation now distinguishes absent video.color declarations from unresolvable declarations for rgb16_linear. Tests verify inherited defaults, the declared flag, refusal of unknown primaries, and successful resolution of an empty envelope.

Changes

FLED color resolution

Layer / File(s) Summary
Color resolution contract and tests
src/fl/fled/FLED_FORMAT.md, tests/fl/fled/fled_color.cpp
The specification documents that absent video.color inherits the rgb16_linear default with declared == false. Unknown primaries values return a non-Ok status, while an empty envelope resolves successfully. Tests cover these rules.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 01924

This change clarifies the FLED color-resolution contract and adds coverage for inherited defaults and invalid declarations. No current merge-blocking risk is identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: the documentation and tests distinguish mandatory handling from absent metadata for rgb16_linear.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/4156-r10-mandatory-vs-absent

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.

@zackees
zackees merged commit 19deac6 into master Sep 10, 2026
22 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 docs/4156-r10-mandatory-vs-absent branch November 5, 2026 05:52
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