You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ci(avr): check drawPolygon scene hashes on the avr8js Uno against host - #5340
Fixes#5324 (first slice: drawPolygon scene and kernel hashes on AVR vs host).
What
examples/Test/PolygonHashes.h: 8 scenes with exact Q16.16 vertices, rendered with both kernels (Exact and ABuffer) at the AVR tier (MAXN 8, CHUNK 16) on a 16x8 canvas in BLEND mode. Each canvas is hashed with FNV-1a and compared to a golden table. The scenes and the table are stored in PROGMEM.
examples/Test/Test.ino: runs the check in setup() on the ATmega328P and on AVR parts with 48 KB or more of flash. It prints polygon hashes match host, or polygon hash mismatch on a difference. The two kernels add about 24 KB, so the Uno is at 27 KB of 32 KB. A Leonardo's USB stack would not fit, so it is gated out.
tests/fl/gfx/draw_polygon.hpp: a host test renders the same scenes and pins the same golden table. If it passes on the host and the AVR check passes too, AVR output matches host output.
ci/runners/avr8js_runner.py: --halt-on-error now also matches polygon hash mismatch, and Test is only judged a success if the match marker is present.
This reuses the existing uno_avr8js_test path. No workflow files were changed.
Evidence
bash test --run uno Test: all 16 hashes match host, AVR8JS: 1 passed.
Exact: narrowing the column extent to int before the clamp fails at polygon scene 3 exact ... polygon hash mismatch.
ABuffer: doing ytop - 4*py in int fails at polygon scene 4 abuffer ... polygon hash mismatch.
bash lint passes, and bash test --cpp passes (371/371 unit, 96/96 examples). ci/tests/test_avr8js_runner.py passes.
Follow-ups (out of scope)
The uno_avr8js_test job runs only for ci-full, ci-test:avr8js or ci-platform:uno PRs and manual dispatch. Making it routine is a ci-labels policy decision.
Host builds use a 32-bit int, so 16-bit-int overflows in drawPolygon
(#5301) only show up on AVR. examples/Test now renders 8 scenes with
both kernels (Exact, ABuffer) at the AVR tier (MAXN 8, CHUNK 16) on a
16x8 canvas and compares FNV-1a hashes to a golden table in
examples/Test/PolygonHashes.h. A host test in draw_polygon.hpp pins the
same table, so an AVR match means AVR renders identically to the host.
The avr8js runner halts on "polygon hash mismatch" and requires the
"polygon hashes match host" marker for Test. The scenes target the #5301
paths: re-introducing the Exact column-extent narrowing fails scene 3,
and re-introducing the ABuffer ytop - 4*py int math fails scene 4.
The check is gated to the ATmega328P and 48 KB+ AVR parts (both kernels
add ~24 KB of flash).
Fixes#5324
CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.
Parsing warnings: 1
Validation error: Unrecognized key: "enabled" at "reviews.pre_merge_checks"
If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
No actionable comments were generated in the recent review.
Walkthrough
The Test sketch now compares polygon render hashes with host golden values on qualifying AVR targets. Host tests perform the same comparisons. The AVR8JS runner requires a success marker and rejects a mismatch marker.
Changes: Polygon Hash Regression Checks
Layer / File(s)
Summary
Polygon scenes, hashes, and host validation examples/Test/PolygonHashes.h, tests/fl/gfx/draw_polygon.hpp
Adds eight polygon scenes and golden hashes for the Exact and ABuffer kernels. The host test renders each scene with both kernels and checks the resulting hashes.
AVR sketch hash checks examples/Test/Test.ino
Enables hash checks for qualifying AVR targets. The sketch compares both kernel hashes for every scene and prints a success message only when all comparisons match.
The runner requires the hash success marker and rejects the mismatch marker. Tests cover missing hashes and mismatches, including a mismatch followed by a success marker.
sequenceDiagram
participant avr8js_runner
participant Test_ino as Test.ino
participant renderHash
avr8js_runner->>Test_ino: Run Test sketch
Test_ino->>renderHash: Render scene with selected kernel
renderHash-->>Test_ino: Return canvas hash
Test_ino-->>avr8js_runner: Print success or mismatch marker
avr8js_runner->>avr8js_runner: Evaluate output markers and exit code
Loading
Possibly related issues
FastLED/FastLED issue 5335 — The tracking issue lists the permanent AVR runtime regression check as open work; this change adds the drawPolygon hash-check portion described by the supplied context.
Merge Risk: Minimal · up to 26d62
This adds an AVR regression check for polygon drawing and makes the AVR8JS runner require the hash result. It only affects test and CI paths, with no production behavior change. Merge risk is minimal.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title names the main change: a drawPolygon scene-hash check on the avr8js Uno, compared against host golden hashes. The changeset adds the PolygonHashes fixture, the setup() check in Test.ino, the…
Linked Issues check
Directly linked issue #5324 asks for a permanent AVR runtime regression check that runs the drawPolygon scene and kernel harness and compares per-scene hashes with host output. The PR implements this …
Out of Scope Changes check
All changed files connect to the drawPolygon AVR-versus-host check. PolygonHashes.h holds the scenes, golden table, and render helpers. Test.ino wires the check into the AVR build. draw_polygon.hpp ru…
Full details: Title check
Explanation
The title names the main change: a drawPolygon scene-hash check on the avr8js Uno, compared against host golden hashes. The changeset adds the PolygonHashes fixture, the setup() check in Test.ino, the runner marker and mismatch handling, and the matching tests, so the title matches the primary change. The title is 70 characters and uses the conventional ci(avr): prefix. It is concise and specific. The title does not mention the runner's new polygon-hash error pattern, but it does not need to cover every detail.
Full details: Linked Issues check
Explanation
Directly linked issue #5324 asks for a permanent AVR runtime regression check that runs the drawPolygon scene and kernel harness and compares per-scene hashes with host output. The PR implements this for drawPolygon. examples/Test/PolygonHashes.h defines 8 Q16.16 scenes, renders each with the Exact and ABuffer kernels at the AVR tier (MAXN 8, CHUNK 16) on a 16x8 canvas in BLEND mode, hashes the canvas with FNV-1a, and compares against a PROGMEM golden table. examples/Test/Test.ino runs this in setup() on ATmega328P and on AVR parts with at least 48 KB flash, and prints a match or mismatch marker. tests/fl/gfx/draw_polygon.hpp pins the same golden table on the host. ci/runners/avr8js_runner.py treats polygon hash mismatch as a failure and requires the match marker. The PR description reports a local run with all 16 hashes matching (AVR8JS: 1 passed). This is a reported result, not verified in this review. The issue proposal also names other math-heavy paths. The PR states these are follow-ups (#5303, #5292) and does not cover them. Those paths remain open under #5324. The drawPolygon portion of the objective is met.
Full details: Out of Scope Changes check
Explanation
All changed files connect to the drawPolygon AVR-versus-host check. PolygonHashes.h holds the scenes, golden table, and render helpers. Test.ino wires the check into the AVR build. draw_polygon.hpp runs the same golden table on the host. avr8js_runner.py and test_avr8js_runner.py make the runner judge the new mismatch and match markers. The PR states that no workflow files changed and that CI routing changes are out of scope. No changed file was found to be unrelated to the linked issue. The Leonardo exclusion and flash gating in Test.ino are part of the same check and are documented in the PR description.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Fix failing CI checks
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Reviewing files that changed from the base of the PR and between 972deaa and 26d6277.
Files selected for processing: 5
ci/runners/avr8js_runner.py
ci/tests/test_avr8js_runner.py
examples/Test/PolygonHashes.h
examples/Test/Test.ino
tests/fl/gfx/draw_polygon.hpp
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 2 remain after this review.
github-actionsBot
added
sanitized
Title, body and conversation screened; review text requires separate screening.
and removed
sanitized
Title, body and conversation screened; review text requires separate screening.
labels
Nov 21, 2026
github-actionsBot
added
sanitized
Title, body and conversation screened; review text requires separate screening.
and removed
sanitized
Title, body and conversation screened; review text requires separate screening.
labels
Nov 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ci-test:avr8jsSelect FastLED board CI cellssanitizedTitle, body and conversation screened; review text requires separate screening.
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5324 (first slice: drawPolygon scene and kernel hashes on AVR vs host).
What
examples/Test/PolygonHashes.h: 8 scenes with exact Q16.16 vertices, rendered with both kernels (Exact and ABuffer) at the AVR tier (MAXN 8, CHUNK 16) on a 16x8 canvas in BLEND mode. Each canvas is hashed with FNV-1a and compared to a golden table. The scenes and the table are stored in PROGMEM.examples/Test/Test.ino: runs the check insetup()on the ATmega328P and on AVR parts with 48 KB or more of flash. It printspolygon hashes match host, orpolygon hash mismatchon a difference. The two kernels add about 24 KB, so the Uno is at 27 KB of 32 KB. A Leonardo's USB stack would not fit, so it is gated out.tests/fl/gfx/draw_polygon.hpp: a host test renders the same scenes and pins the same golden table. If it passes on the host and the AVR check passes too, AVR output matches host output.ci/runners/avr8js_runner.py:--halt-on-errornow also matchespolygon hash mismatch, and Test is only judged a success if the match marker is present.This reuses the existing
uno_avr8js_testpath. No workflow files were changed.Evidence
bash test --run uno Test: all 16 hashes match host,AVR8JS: 1 passed.src/, one at a time, and checked that the AVR run fails:intbefore the clamp fails atpolygon scene 3 exact ... polygon hash mismatch.ytop - 4*pyinintfails atpolygon scene 4 abuffer ... polygon hash mismatch.bash lintpasses, andbash test --cpppasses (371/371 unit, 96/96 examples).ci/tests/test_avr8js_runner.pypasses.Follow-ups (out of scope)
uno_avr8js_testjob runs only forci-full,ci-test:avr8jsorci-platform:unoPRs and manual dispatch. Making it routine is a ci-labels policy decision.Summary by CodeRabbit