applib/text_layout: pre-load glyph bitmaps in RTL rendering path#1547
Draft
pebble-aibot wants to merge 1 commit into
Draft
applib/text_layout: pre-load glyph bitmaps in RTL rendering path#1547pebble-aibot wants to merge 1 commit into
pebble-aibot wants to merge 1 commit into
Conversation
The BiDi (RTL) rendering path in walk_line() calls render_glyph() without first pre-loading glyph bitmaps into the font cache. Unlike the standard LTR path — which calls text_resources_get_glyph() before the visitor callback so that render_glyph() hits a warm cache — the RTL path lets render_glyph() trigger the full flash I/O call chain (text_resources_get_glyph → prv_load_glyph_bitmap → sys_resource_load_range) from deep in the stack. Combined with the 256 bytes of RTL shaping/reversal buffers already on the stack, this makes the RTL rendering path significantly more stack-hungry than the LTR path and contributes to KernelMain stack overflows during notification text rendering (FIRM-2575 crash family). Add text_resources_get_glyph() pre-load calls before every render_glyph() in the BiDi rendering block — for RTL segments, LTR segments within mixed text, and the trailing suffix glyph — matching the pattern the standard path already uses. Fixes FIRM-2643 Fixes FIRM-2575 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Pebble AI Bot <pebbleaibot@repebble.com>
Member
|
@pebble-aibot please, open a PR from a branch in your fork |
Collaborator
|
I think it only works in linear not in github |
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
walk_line()was missing glyph bitmap pre-loading beforerender_glyph()calls, unlike the standard LTR path which pre-loads viatext_resources_get_glyph()to ensure cache hitstext_resources_get_glyph → prv_load_glyph_bitmap → sys_resource_load_range) from deep in the stack, on top of 256 bytes of RTL shaping/reversal buffers already allocated on the stacktext_resources_get_glyph()pre-load calls before everyrender_glyph()in the BiDi rendering block — for RTL segments, LTR segments within mixed text, and the trailing suffix glyphFixes FIRM-2643
Fixes FIRM-2575
Test plan
🤖 Generated with Claude Code