perf(vapor): ship the GB font as 1bpp and expand it at upload - #393
Open
lfkdsk wants to merge 1 commit into
Open
perf(vapor): ship the GB font as 1bpp and expand it at upload#393lfkdsk wants to merge 1 commit into
lfkdsk wants to merge 1 commit into
Conversation
lfkdsk
force-pushed
the
fleet/vapor-gb-font-1bpp
branch
2 times, most recently
from
September 8, 2026 21:18
10de1bc to
6544217
Compare
The DMG bakes two glyph styles (ink shade 3 on paper 0, and its inverse) into 2 x 95 x 16 B of 2bpp interleaved tile data, but those 3040 B hold no bit FONT8's 760 B does not: shade 3 sets both planes and shade 0 clears both, so every row is `bits, bits`, and style 1 is style 0 complemented. Emit the 1bpp bitmap for gb, as esp32 and playdate already did, and let upload_font reconstruct both styles while writing VRAM. todo.gb used bytes 11383 -> 9140 (-2243, -19.7%); sdcc _CODE 9335 -> 7092 B, _DATA unchanged. The bytes reaching VRAM do not change. vapor/tests/gb-font.test.ts boots a real ROM in libmgba and compares all 3040 B at 0x8010 against a reference expansion derived from FONT8 alone; it was written and passed against the unmodified base first. Parity misses both runtime bit-flip mutations -- the GB rig reads background-map tile indices, never tile pixels -- so this test, not parity, guards the change.
lfkdsk
force-pushed
the
fleet/vapor-gb-font-1bpp
branch
from
September 8, 2026 21:20
6544217 to
e22f4bb
Compare
Contributor
Author
|
Rebased onto current |
lfkdsk
marked this pull request as ready for review
September 8, 2026 23:07
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.
What
Same treatment as the GBA font, for the Game Boy target: emit
vp_font_tilesas 1bpp and expand it into tile RAM at upload instead of shipping the expanded table in ROM.Measured
todo.gboccupancy_CODE_DATA5 builds per side. The saving is entirely ROM
_CODE: the table shrinks 3040 → 760 B, the expansion loop costs 37 B, and no state RAM is traded.Correctness
todo.gbin libmgba, reads tile data at0x8010off the bus, and matches a reference expansion derived fromFONT8alone. It passed on the unmodified base first, so it is a real oracle.gb-fonttests.todo.gbaandtodo.neskeep their baseline hashes.bun test vapor/tests/: 76 pass / 0 fail (was 71), including four-way parity.Provenance
Autonomous fleet run: Scout-measured candidate (report on the fork branch
lfkdsk/pocketjs:fleet/scout-artifact-size), Builder implementation, one cross-family review that independently rebuilt and re-ran the mutations.🤖 Generated with Claude Code