Skip to content

CI validation: CJK atlas fix (mirror of stablyai/orca#13765) - #1

Closed
tonite31 wants to merge 1 commit into
mainfrom
fix/webgl-atlas-cjk-freeze
Closed

tonite31 wants to merge 1 commit into
mainfrom
fix/webgl-atlas-cjk-freeze

Conversation

@tonite31

Copy link
Copy Markdown
Owner

Fork-internal PR to run the pr.yml check matrix before the upstream PR leaves draft. Not for merge.

A pane rendering Hangul would garble mid-screen and stay that way until an
unrelated window resize repaired it.

The WebGL renderer caches rasterized glyphs in fixed-size atlas pages, and the
GPU can bind only so many at once. ASCII fills one page; a CJK viewport needs
hundreds of double-width glyphs keyed by character *and* color, so it hits the
page limit and forces a merge that renumbers every cached glyph. WebglRenderer
rebuilds the model when that happens, up to 32 times per frame — but each rebuild
rasterizes again and can trip another merge, so a CJK viewport never converges.
The loop then gives up and paints a model half-built against page indexes the
last merge invalidated. Nothing marks those rows dirty again, so the garble
persists until a resize forces a full rebuild.

- Request another frame when the retry budget is exhausted, capped at 4
  consecutive frames so an oversubscribed atlas cannot spin the render loop.
- Raise the atlas page size to 1024px: 4x the glyphs per page, so a CJK viewport
  fits the texture budget and the merge path stays cold.

Also add CJK entries to the terminal font chain. Every font in it was Latin-only,
so Hangul fell to a proportional system face whose advance is not two cells wide
and drifted out of the grid. Coding faces with exact dual-width metrics come
first, then platform defaults native-before-foreign, each listed under both its
English and localized family name — a CJK-locale OS registers these faces under
the localized name only. The chain moves to lib/terminal-font-family.ts, which
folds in the second, already-drifted copy the pane defaults carried.
@tonite31 tonite31 closed this Aug 11, 2026
@tonite31 tonite31 reopened this Aug 11, 2026
@tonite31 tonite31 closed this Aug 11, 2026
@tonite31 tonite31 reopened this Aug 11, 2026
@tonite31

Copy link
Copy Markdown
Owner Author

CI validation complete: full matrix green (45 checks; only the fork-irrelevant community-PR labeler failed for lack of upstream secrets). Upstream PR stablyai#13765 is now ready for review.

@tonite31 tonite31 closed this Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant