Generate the crossing animation instead of storing 2 KB of bitmaps - #119
Merged
Conversation
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. Reclaims 2,048 B of flash on an image that sits at 99.4% of the OTA cap. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HnTP6BdA9xjLR5hSWE9frb
Coverage — host-testable units📂 Overall coverage
📄 File coverage
|
Merged
5 tasks
TheAngryRaven
added a commit
that referenced
this pull request
Aug 3, 2026
…ster perf: generate the crossing animation instead of storing 2 KB of bitmaps (backport of #119)
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.
Summary
Reclaims 2,048 bytes of flash on an image currently sitting at 99.4% of the OTA cap.
The two "calculating" frames drawn while the timer is 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, with the two frames offset by one cell so alternating them scrolls sideways. Spending 2 KB of flash to express that is a bad trade, so they are now emitted by a new host-tested
crossing_patternunit and drawn with eightfillRect()calls.The bird splash is untouched — that's real artwork, not a pattern, and stays a bitmap.
Equivalence is proven, not assumed:
crossing_pattern_test.cpppins the original 2 KB as goldens, rasterizes the generated rectangles into a 1024-byte 1bpp buffer, andmemcmps all 128×64 pixels of both frames. If the geometry ever drifts, the test fails.One thing worth knowing, since it surprised me: the original bitmaps only ever lit the odd row bands — the top and third 16 px bands were entirely blank in both frames, so it's a two-row block strip rather than a full checkerboard. I reproduced that exactly rather than "fixing" it. If it was meant to be a full checkerboard, that's now a one-character change (
cy = 1; cy < rows; cy += 2→cy = 0; cy < rows; cy++with the phase folded in) plus a golden update — say the word.Type of change
How it was verified
ctest --test-dir tests/build) — 297 cases / 4,269 assertions, 0 failed, including the two golden byte-identity proofsclang-tidyclean — deferred to CIdisplay_pages.ino, so the new draw path is exercised there.Checklist
CHANGELOG.mdupdated under[Unreleased](if user-visible)ARCHITECTURE.md/CLAUDE.mdupdated (if a module or interface changed) — new pure-unit row,images.hdescriptiontests/Related issues
Follow-on from the flash-budget work in #116 / plan 0004 — every KB counts until the staging region goes away.
🤖 Generated with Claude Code
https://claude.ai/code/session_01HnTP6BdA9xjLR5hSWE9frb
Generated by Claude Code