perf: generate the crossing animation instead of storing 2 KB of bitmaps (backport of #119) - #123
Merged
Merged
Conversation
Backport of b16c42e from the beta channel (PR #119). The two 'calculating' frames were hand-stored 1 KB PROGMEM bitmaps, but decoding them shows both are pure block patterns: eight 16x16 px cells confined to the odd 16 px row bands, with the two frames offset by one cell so alternating them scrolls sideways. Storing 2048 bytes of flash to say that is a bad trade. They are now emitted by the new host-tested crossing_pattern unit and drawn with fillRect(). Equivalence is proven, not assumed: the original 2 KB is pinned as goldens in crossing_pattern_test.cpp, which rasterizes the generated rectangles and memcmps all 128x64 pixels of both frames. The bird splash is untouched - it is real artwork, not a pattern. Applied by hand rather than by cherry-pick: display_pages.ino, images.h and CLAUDE.md are CRLF on master and LF on BETA, so a straight pick conflicts on the whole file. images.h was confirmed identical to BETA's modulo line endings before taking its post-change content; the display_pages.ino and CLAUDE.md hunks were applied in place so master keeps its CRLF. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HnTP6BdA9xjLR5hSWE9frb
Coverage — host-testable units📂 Overall coverage
📄 File coverage
|
7 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Backport of
b16c42e(#119) from the beta channel to master — 2,048 B of flash, isolated code, already proven on beta.What
The two "calculating" frames shown while inside a crossing zone were hand-stored 1 KB PROGMEM bitmaps. Decoding them shows both are pure block patterns: eight 16×16 px cells confined to the odd 16 px row bands, the two frames offset by one cell so alternating them scrolls sideways. 2,048 bytes of flash to say that is a bad trade.
They're now emitted by the host-tested
crossing_patternunit and drawn withfillRect(). The bird splash is untouched — that's real artwork, not a pattern, and after this it's the only bitmap left inimages.h.Equivalence is proven, not assumed
tests/crossing_pattern_test.cpppins the original 2 KB as goldens, rasterizes the generated rectangles into a framebuffer, andmemcmps all 128×64 pixels of both frames. What shows on the device is unchanged.Note on how this was applied
Not a straight cherry-pick.
display_pages.ino,images.handCLAUDE.mdare CRLF on master and LF on BETA, sogit cherry-pickconflicts on the entire file for each of them.Applied by hand instead:
images.h— verified byte-identical between master and BETA-pre-change modulo line endings first, then took BETA's post-change content converted back to CRLF.display_pages.ino,CLAUDE.md— the individual hunks applied in place, so master keeps its CRLF. (CLAUDE.mdneeded a different anchor row anyway: master has nosprint_selectentry.)crossing_pattern.{h,cpp},tests/crossing_pattern_test.cpp, and the two CMake one-liners came across unchanged.Diff is 9 files / +339 / −139, with no whole-file line-ending churn.
Test plan
cmake -S tests -B build && cmake --build build— 271 cases / 4,192 assertions, all pass on masterframeRectscases specifically: 5 passed / 167 assertions, including both byte-identical golden comparisonsimage_data_calculating1/2outside comments and the test goldenscrossing_pattern.cppadded to bothtests/CMakeLists.txtandBirdsEye/sim/CMakeLists.txt(the sim compilesdisplay_pages.ino, so omitting it would be an undefined symbol at link)Generated by Claude Code