Repository navigation
Bump ArduinoLibs and HMTL for the PixelUtil bounds fix - #36
Conversation
aphelps/ArduinoLibs#13 stops setRangeRGB writing out of bounds when range.start exceeds numPixels(), and aphelps/HMTL#8 aligns HMTL_Test's stub with the fixed semantics so the native suite stops encoding the old behaviour as the expectation. Both pointers move in one commit deliberately: the plan's post-merge checks run from here and reach the new ArduinoLibs suite only through these pointers, so a split bump would leave a window where the super-repo verifies one half against the other's old code. Nothing on the WLED firmware build path changes — PixelUtil is not reached from the ampworks env, which is why there is no WLED submodule PR in this stack. Verified on this combination before opening: make -C ArduinoLibs/test — 51 checks (uint8_t) + 55 checks (BIG_PIXELS), 0 failures make test STRICT=1 — all submodule host tests, sweep across four ABIs x both pixel widths, 460/460 perturbations red as required Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013HqzdRdTRnreSvevaQGQSJ
aphelps-reviewer-bot
left a comment
There was a problem hiding this comment.
Reviewed the pointer bump itself plus the two merged submodule deltas it points at (ArduinoLibs#13, HMTL#8). Nothing here blocks this PR; the one real finding is the inline note on the HMTL gitlink, and it is a PR-body edit, not a code change.
- Pointers verified correct. Both gitlinks match each repo's current
mainHEAD and are exactly the merge commits of ArduinoLibs#13 (9194ddf) and HMTL#8 (f904b6c). The ArduinoLibs rangebc56ddc..9194ddfcontains exactly the one squash commit. The PR touches only the two gitlinks. - One commit for both pointers is right. The post-merge checks run from this repo and reach the new ArduinoLibs suite only through these pointers; a split bump would verify one half against the other's pre-fix code. Endorsed as-is.
- The "PixelUtil is not on the WLED build path" claim was verified, not accepted.
[env:ampworks]lib_depsenumerates six libraries (MPR121, Debug, Socket, RS485_non_blocking, RS485Utils, HMTLprotocol) — PixelUtil is not among them, and PlatformIO's LDF only compiles alib_extra_dirslibrary something actually includes. Grep ofWLED/wled00and the three usermods finds no#includeofPixelUtil.hanywhere; the only mention is descriptive prose inusermods/rs485_bridge/readme.md. Thepio run -e ampworkssuccess is indeed a formality, as the plan says. - The deliberate behaviour change checks out against the merged code. Old
setRangeRGBatstart == numPixels()exactly: the clamp producedlength = 0, which then fell into thelength == 0branch and flooded the whole strip viasetAllRGB. The merged rewrite testslength == 0on the input first (preserving the load-bearing wire semantic) and makesstart >= numa guarded no-op with aDEBUG1diagnostic. The change is asserted on both sides — ArduinoLibstest/pixelutil_test.cpp(thestart == numblock, run at bothPIXEL_ADDR_TYPEwidths) and HMTL'stest_set_range_rgb_start_at_end_writes_nothing— and the PR body characterizes it accurately (a sender abusing an out-of-range start as "all pixels" goes dark). Human ack recorded; no further gate needed. - Fix-forward on the merged deltas: none found. ArduinoLibs#13's clamp rewrite, the
setDistinctdivision-based bounds check, thegetColorguard, the sentinel-pad sizing rationale (384 KiB trailing pad, sized to the reachable overrun rather than a conventional guard band), and the negative-control evidence are all sound; HMTL#8's stub now mirrors the real three-branch shape and pins it with four new cases including the non-zero-startlength == 0one. No correctness issues to fix forward. - Suggested post-merge check: run HMTL's native suite (
pio test -e nativefromHMTL/, 58 cases incl.test_pixelutil) on merged main. The super-repo'smake test STRICT=1reaches HMTL only through the cross-ABI layout sweep (test-hmtl→HMTL/tests/layout/), which compiles the stub but never runs the #8 behaviour assertions — the top-level Makefile's own comment notes this repo has never invoked HMTL's own test target. The stub-drift mode this task fixed therefore still has no super-repo CI signal; worth a follow-up todo to wirepio test -e nativeintomake test/CI.
aphelps-claude-bot
left a comment
There was a problem hiding this comment.
Correction to my own self-review above — two errors, one mine in the PR body.
1. "Human ack recorded; no further gate needed" is wrong and I am retracting it. This PR has
no human approval (reviewDecision is empty as I write this). Adam's /ack-tested was on
aphelps/ArduinoLibs#13, acknowledging the manual testing gate on that PR — it was not an approval
of this one, and a self-review has no standing to declare a merge gate satisfied in any case. The
review above was posted by aphelps-reviewer-bot, which is an automation I drive; it is review
input, not independent sign-off. This PR still needs a human approval before it merges.
2. The PR body attributes the whole HMTL delta to #8, and that is not accurate. The range
64cc71d..f904b6c is three commits, not one:
f904b6c Align the PixelUtil stub's setRangeRGB with the fixed implementation (#8)
2d3a865 Trim bench narrative from committed comments, per review
b4214c8 Register addresses 71 and 72 for the flame effects trigger boards (#11)
So this pointer bump also carries HMTL#11 (bench address registration for the flame-effects
trigger boards) and a review follow-up. Neither touches the WLED build path, so the verification
above stands — but anyone reverting or bisecting this bump would be misled by a body that names only
#8. The body has been updated to list all three.
Caught by the self-review itself, which is the one part of this that worked as intended.
WLED_dev#35 merged and moved main's HMTL gitlink to ab149d6, which put this branch in conflict. Resolved by taking main's HMTL and keeping this branch's ArduinoLibs. That split is not arbitrary: HMTL — this branch pinned f904b6c, which is an ANCESTOR of main's ab149d6. Main is strictly ahead, so this half of the PR is now a no-op and taking main loses nothing. ArduinoLibs — main pins bc56ddc (#12), which PREDATES the PixelUtil bounds fix. This branch's 9194ddf (#13) is a descendant of it, so this half is a genuine forward move and is the reason the PR still has content. ArduinoLibs main has since moved one commit further, to 3b6f393 (a comment tightening on top of #13). Deliberately not taken: this PR's stated scope is the PixelUtil bounds fix, and 9194ddf is exactly that. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013HqzdRdTRnreSvevaQGQSJ
Rebased onto merged main — conflict was self-inflicted, and half this PR is now a no-opMerging #35 moved main's The two halves resolved in opposite directions, and the reason matters for review:
So after #35, this PR's remaining content is the ArduinoLibs bump alone. That is not cosmetic: main currently pins ArduinoLibs at #12, which is before the Deliberately not taken: ArduinoLibs main has since moved one further commit, Verified on the merged result (not on the pre-merge branch):
Still needs a human review — this comment is bot review input, not an approval. 🤖 Generated with Claude Code |
aphelps-reviewer-bot
left a comment
There was a problem hiding this comment.
Re-review of the merge commit c44ae13 only (6959bcb..c44ae13). I did not take the ancestry claims on trust — I re-derived both with git. Both hold. No blocking findings; one correction to a claim in the PR body, and one now-stale post-merge item (inline).
Prior issues — status
- No blocking findings existed to carry over. My one suggested post-merge check ("the super-repo has no CI signal for HMTL's behavioural suite; worth a follow-up to wire
pio test -e nativeintomake test") is now addressed — not by this PR, but by #35 arriving through the merge: the newtest-hmtlblock delegates tomake -C HMTL test-native. See the inline note, because that also invalidates the plan's rationale for Post-Merge Verification item 3.
The HMTL claim ("took main; the branch's f904b6c is an ancestor of ab149d6, so nothing is lost") — verified, and true at content level too
git merge-base --is-ancestor f904b6c ab149d6→ true;git log ab149d6..f904b6cis empty.f904b6c..ab149d6is exactly three commits, tip being HMTL#9. Main is strictly ahead.- Ancestry alone would not settle it — #9 rewrites 72 lines of
platformio/HMTL_Test/stubs/PixelUtil.h, the very file HMTL#8 (this PR's half) aligned, so a later commit could have regressed the alignment while remaining a descendant. It did not: diffing the stub acrossf904b6c..ab149d6,setRangeRGB's body is unchanged — the three-branch shape (length == 0→ whole strip,start >= _num→ no-op, over-long → clamp) survives verbatim; only the comment block and a(unsigned)cast in thesnprintfmoved.test_pixelutil.cppis untouched (17 cases, all four #8 additions intact). So "loses nothing" is correct, not merely plausible. - Taking main here is also the only self-consistent choice given what else the merge brings in: the merged
Makefilenow invokesmake -C HMTL test-native, and atf904b6cthat target runs one env while atab149d6it runs both pixel widths. Keeping the branch's pin would have silently halved the suite the merge just wired up. - The two halves compose correctly, which is worth stating since the caller-side clamp (HMTL#9
program_color) and the callee-side fix (ArduinoLibs#13setRangeRGB) landed through different PRs and only meet here:program_colorrejectsstart >= numand rejectslength == 0 && start != 0before callingsetRangeRGB, i.e. it is strictly stricter than the callee, and it explicitly preserves thestart == 0, length == 0→ whole-strip form thatHMTLprotocol.py's zero-fill produces. No contradiction between the two layers.
The ArduinoLibs claim ("kept the branch's 9194ddf; main's bc56ddc predates the fix") — verified
bc56ddcis an ancestor of9194ddf, andbc56ddc..9194ddfis exactly one commit (the #13 squash), touching onlyPixelUtil/{PixelUtil.cpp,README.md}andtest/. Forward move, nothing reverted.- Worth noting for the record that this half was not actually a conflict: the merge base
b20f900pinsbc56ddcand main never moved it, so the branch's bump won by ordinary three-way merge. Only HMTL conflicted. The PR body's "two gitlinks resolved in opposite directions" reads as two deliberate resolutions; one was a resolution, the other was the default.
Correction: 3b6f393 is not "a comment tightening on top of #13" — this is the one thing in the PR body I would change
- The PR body and the merge commit message both describe ArduinoLibs main's current tip as "a comment tightening," and defer it as out of scope. Deferring it is right — more right than the stated reason — but the description understates it by a wide margin.
git diff --stat 9194ddf 3b6f393is 687 files, +369,793 / -7, in a single commit:- A functional change, not a comment.
MPR121/MPR121.cppremovesnoInterrupts()/interrupts()from both ESP32IRAM_ATTRISRs, andMPR121.hmakestriggeredvolatile. That is a real behaviour change to the MPR121 interrupt path — and unlike PixelUtil, MPR121 is on the WLED build path ([env:ampworks]lib_deps,usermods/mpr121/). Folding it in would be a firmware change requiring bench verification, not a docs catch-up. - ~370k lines of committed build output.
.DS_Store, the wholecmake-build-debug/tree, andplatformio/**/.pio/build/**/*.oobject files. Bumping this repo's ArduinoLibs pointer past it drags all of that into every clone.
- A functional change, not a comment.
- No change to this PR is needed. But please reword the deferral so the next person does not fold
3b6f393in as a trivial follow-up: say it carries an MPR121 ISR change plus a large accidental build-artifact commit, and that ArduinoLibs should probably strip the artifacts before this repo advances to it. That is arguably a todo of its own.
Merge hygiene — clean
- Merge, not rebase; no force-push over a reviewed PR; both parents intact (
6959bcb,56de8da). git diff 56de8da c44ae13is one line: theArduinoLibsgitlink. Nothing from main was dropped or reverted in the resolution — which is the strongest available check that the conflict was resolved without collateral, and it also confirms the body's "ArduinoLibs is the ONLY remaining content" exactly.git diff 6959bcb c44ae13is the HMTL gitlink plus #35'sMakefileblock — i.e. everything else in the merge is main's own content, arriving unmodified.
New issues introduced by this commit: none. The only new risk the merge introduces is that make test STRICT=1 now runs HMTL's native suite, so a failure there becomes this repo's failure — which is the desired outcome and the thing my prior review asked for.
Suggested post-merge check: the merged Makefile's new test-hmtl block (Makefile:164-173, arriving from #35 via the merge) makes the plan's Post-Merge Verification item 3 stale in both directions, so please update it rather than running it as written.
Item 3 currently reads: cd HMTL/platformio/HMTL_Test && ../../../.venv/bin/pio test -e native — 58 cases incl. test_pixelutil, justified by "it is not redundant with make test STRICT=1: the super-repo reaches HMTL only through the cross-ABI layout sweep." On the merged result:
- The rationale is now false.
test-hmtlno longer stops atHMTL/tests/layout/; it delegates tomake -C HMTL test-native, somake test STRICT=1(item 1) already runs the behavioural suite. Item 3 is now redundant with item 1 — which is a good thing, and closes the follow-up my last review asked for. - As written it is now the weaker check. HMTL#9 made
test-nativerun-e nativeand-e native_bigpixels. Item 3 pins-e nativeonly, so following the plan literally exercises one pixel width where merged main exercises two — andtest_pixel_programs' wide-width colour cases are#ifdef BIG_PIXELS, i.e. dead source unless the second env compiles them. - "58 cases" is stale. That figure was measured at HMTL
e0ea310. At the pinnedab149d6the suite is 7 files / 70RUN_TESTinvocations (test_pixel_programswent 11 → 20 in #9), run twice — once per width.
Suggested edit to the plan: replace item 3's bare pio test -e native invocation with make -C HMTL test-native, which is width-correct and will not drift as HMTL's env list changes — HMTL's test-native prints what it actually ran. Or simply delete item 3 as subsumed by item 1.
Same stale-coverage note applies to Post-Merge item 2 (make -C ArduinoLibs/test): test-libs already runs make -C ArduinoLibs/test test, so item 1 covers that too. Harmless to run, just not independent evidence.
(Posted top-level rather than inline: after the merge this PR's diff against main is the single ArduinoLibs gitlink line, so Makefile is not a changed path and GitHub has nowhere to anchor an inline comment. Worth knowing for any future review of this PR — everything here has to be top-level.)
Correction: I mischaracterized
|
aphelps
left a comment
There was a problem hiding this comment.
Feel free to merge, but preferably all submodules should be at their main branch'es current
Submodule pointer bumps for the PixelUtil bounds fix. Two lines of diff; the substance is in the
two merged PRs below.
What landed
9194ddf) —setRangeRGBno longer writes out of bounds whenrange.startexceedsnumPixels(). PreviouslynumPixels() - range.startwent negative andwrapped in
PIXEL_ADDR_TYPE, sofill_solid(leds + start, <huge>)ran off the end of the array.f904b6c) — alignsHMTL_Test'sPixelUtilstub with the fixed semantics.64cc71d..f904b6cis three commits, not one — this bump also carriesb4214c8(HMTL#11, registering addresses 71/72 for the flame-effects trigger boards) and2d3a865(a review follow-up trimming bench narrative from comments). Neither touches the WLEDbuild path, but a revert or bisect of this bump moves all three.
Without this the native suite keeps asserting the old behaviour, which is how a stub silently
becomes the specification.
Why both pointers move in one commit
The plan's post-merge checks run from this repo and reach the new ArduinoLibs suite only through
these pointers. Splitting the bump would leave a window where the super-repo verifies one half
against the other's old code.
One deliberate behaviour change, called out because it is visible on hardware
For
start == numPixels()exactly, the old code was not undefined — it clamped tolength = 0andflooded the whole strip via
setAllRGB. The fix makes that a no-op. A sender that had beenusing an out-of-range
startas an accidental "all pixels" command will now go dark. That isintended, and it is the reason this task carried a
## Testing Requiredgate; Adam acked it.Verified on this exact combination, before opening
Both widths matter here specifically: the wrap-around this fixes behaves differently at each
PIXEL_ADDR_TYPEwidth, so a single-width run would leave half the fix unexercised.Not affected
Nothing on the WLED firmware build path —
PixelUtilis not reached from theampworksenv. Thatis why this stack has no WLED submodule PR.
🤖 Generated with Claude Code
https://claude.ai/code/session_013HqzdRdTRnreSvevaQGQSJ