Skip to content

test(ci): check that a linked TINY binary carries no float or solver symbols (#4043) - #4390

Merged
zackees merged 1 commit into
masterfrom
test/4043-tiny-links-no-float
Sep 12, 2026
Merged

zackees merged 1 commit into
masterfrom
test/4043-tiny-links-no-float

Conversation

@zackees

@zackees zackees commented Sep 12, 2026 •

Copy link
Copy Markdown
Member

Closes P9's (#4043) stated open half. Part of #4034.

ci/tests/test_no_float_per_pixel.py checks the source-level precondition and is explicit that it does not check what P9 actually promises:

What this does NOT claim: that a linked TINY binary contains no float symbols. That is a link-time property needing bash bloat on a real target, and it remains P9's open half.

Measured

Built Blink for ATtiny85 — 512 B of SRAM, so FL_IS_AVR_ATTINY_TINY_MEMORY holds, FL_PLATFORM_HAS_TINY_MEMORY is 1 and FL_COLOR_PROFILE_RUNTIME is 0 — and read its symbol table with avr-nm:

  • 0 soft-float helpers (__addsf3, __mulsf3, __fixsfsi, …)
  • 0 colour-pipeline solver symbols (nnls, gamut, oklab, bradford, white_allocation, device_solve, colorimetric)
  • 22 FastLED symbols, including CPixelLEDController<...>::show

The soft-float list is what makes this worth having. An ATtiny has no FPU, so any float arithmetic that survives to link time arrives as a call to one of those helpers — their absence is an observation about the linked image, not a restatement of the source rule the sibling test already covers.

Why it skips rather than builds

Following test_elf.py, which does the same for its UNO build. The ATtiny build wants the AVR toolchain and ~40 s, and ci/tests now runs on every pull request (#4360), so building there would be the wrong trade. bash compile attiny85 --examples Blink produces the ELF and this reads it.

The vacuity guard

An absence test fails by having nothing present, so nothing forbidden present either. test_the_build_actually_contains_fastled runs first and asserts FastLED and CPixelLEDController are in the table.

Verified by mutation: adding a known-present symbol to each forbidden list fails the matching case and only that case.

bash lint clean; bash test --py --clean clean.

Test-only; no src/ change.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MLhWkMfzLjrnLTDMBE6Fj9

Summary by CodeRabbit

  • Tests
    • Added automated validation for ATtiny85 builds to ensure floating-point and colour-pipeline solver symbols are absent.
    • Tests verify required LED controller symbols are present in the firmware symbol table.
    • Validation is skipped when the firmware or symbol inspection tool is unavailable.

…symbols (#4043)

P9's stated open half, and `test_no_float_per_pixel.py` says so in as many
words:

    What this does NOT claim: that a linked TINY binary contains no float
    symbols. That is a link-time property needing `bash bloat` on a real
    target, and it remains P9's open half.

Built Blink for ATtiny85 -- 512 B of SRAM, so `FL_IS_AVR_ATTINY_TINY_MEMORY`
holds, `FL_PLATFORM_HAS_TINY_MEMORY` is 1 and `FL_COLOR_PROFILE_RUNTIME` is 0
-- and read its symbol table. Neither avr-gcc's soft-float helpers nor any
colour-pipeline solver symbol is present. This checks that.

The soft-float list is the useful part. An ATtiny has no FPU, so float
arithmetic surviving to link arrives as a call to `__addsf3` and friends;
their absence is a real observation rather than a restatement of the
source-level rule the sibling test already covers.

Skipped rather than built, following `test_elf.py`: the build wants the AVR
toolchain and ~40 s, which does not belong in a suite that now runs on every
pull request. `bash compile attiny85 --examples Blink` produces the ELF and
this reads it.

Also asserts the build contains `FastLED` and `CPixelLEDController` first --
that is how an absence test goes wrong, with nothing present so nothing
forbidden present either. Verified by adding a known-present symbol to each
forbidden list, which fails the matching case.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01MLhWkMfzLjrnLTDMBE6Fj9
@zackees
zackees merged commit 532b5e3 into master Sep 12, 2026
25 checks passed
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Sep 12, 2026
@coderabbitai

coderabbitai Bot commented Sep 12, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: a0cae391-ce8b-4a30-8726-b39dc6f28dc3

📥 Commits

Reviewing files that changed from the base of the PR and between 89f8a92 and 307e5c7.

📒 Files selected for processing (1)
  • ci/tests/test_tiny_links_no_float.py

📝 Walkthrough

Walkthrough

The pull request adds a test module that inspects the ATtiny85 ELF with avr-nm. It verifies required FastLED symbols and rejects linked soft-float helpers and colour-pipeline solver symbols.

Changes

ATtiny85 link checks

Layer / File(s) Summary
Symbol contract definitions
ci/tests/test_tiny_links_no_float.py
Defines the ATtiny85 ELF path and the required and prohibited symbol lists.
ELF inspection and assertions
ci/tests/test_tiny_links_no_float.py
Locates avr-nm, skips unavailable environments, reads the ELF symbol table, and validates FastLED, soft-float, and solver symbols.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/4043-tiny-links-no-float

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.

@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Sep 12, 2026
zackees added a commit that referenced this pull request Sep 12, 2026
…#4043) (#4401)

P9 asks for the TINY tier's link-time property -- no float, no solver
symbols -- to be verified by symbol-level inspection. The test for it has
existed since #4390 and has never executed a single assertion.

It reads an ATtiny85 ELF and skips when the build is absent, following
`test_elf.py`. Nothing ever built an ATtiny85 before it ran: `pytest
ci/tests` collects it in a job with no AVR build, so it skips there, and
the two attiny85 workflows never invoke it. A deliverable asserted by a
test that always skips is not asserted.

`check_attiny85.yml` already builds attiny85 Blink to check its size, and
that job is where the ELF is. The test now runs there, immediately after
the Blink build and before the Apa102 one, with FL_REQUIRE_TINY_ELF=1.

That variable is the point of the change as much as the wiring is. Without
it the first thing to move the ELF would return this file to passing
vacuously and nothing would say so -- the same failure being fixed,
reintroduced. With it set, a missing build fails and names what it
searched.

Only the unmodified job: the sibling compiles with FASTLED_NO_FORCE_INLINE,
whose link-time symbol set is a separate question this does not answer.
Every other board using the template is unaffected -- the step is guarded
on board and on empty extra_args, and attiny85 has one such caller.

The hardcoded ELF path is gone too. `ci/compiled_size.py` documents two
fbuild layouts and two build roots; the test pinned one spelling of one of
them, so the other produced a silent skip. It now globs both roots and
takes the newest match, the rule `ci/bloat.py` settled on in #4386.

Verified locally, all four states: ELF present passes with and without the
variable; ELF absent skips without it and fails with it; and the
alternate `<env>/release` layout is found where the old path was not.

Known limit, stated rather than implied: both attiny85 workflows trigger
on push to master, not on pull_request, so this catches a regression one
merge after it lands rather than blocking it. Making it a PR gate means
paying for an AVR build on every PR, which is a cost decision for the
maintainer, not something to slip in here.


Claude-Session: https://claude.ai/code/session_01MLhWkMfzLjrnLTDMBE6Fj9

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
@zackees
zackees deleted the test/4043-tiny-links-no-float branch November 5, 2026 05:53
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