render: move the glyph index into felis-render-core #172

Merged
natsukium merged 1 commit from render/core-glyph-index into main 2026-10-18 20:08:08 +09:00
Owner

Depends on #171 (its two commits come first here; review the last one).

Third of four PRs extracting the wgpu-free half of felis-render-wgpu into felis-render-core. No behavior change; the #170 golden fixtures pass untouched.

  • GlyphIndex (shape memo, rasterization, slot table, shelf atlas, recycle), GridWalker, ShapeFrame, GlyphSlot, AtlasView and the helpers they call (sizing_key_from, font_style_of, cluster_block_cols, GLYPH_ATLAS_SIDE) move to core; glyphs.rs follows as an 86% rename. A CPU backend keeps glyphs in a RAM atlas and drains the same PendingUploads the wgpu backend uploads, so the whole index belongs in core.
  • GlyphCache (textures, bind group, upload path) stays in wgpu as glyph_cache.rs, wrapping core's index.
  • GlyphSlot keeps normalized uv for now: the painter still writes slot coordinates straight into FgInstance; the switch to atlas pixels lands with the encoder in phase 4.
  • Cross-crate API made pub (overlay-cluster priming, GridWalker::walk, cluster_base_char, cluster_block_cols); ShapeFrame test constructors behind a core testing feature.
  • atlas and shape_memo benches move to core; unchanged within noise.

Verified: just check green locally; sol review PASS.

Depends on #171 (its two commits come first here; review the last one). Third of four PRs extracting the wgpu-free half of `felis-render-wgpu` into `felis-render-core`. No behavior change; the #170 golden fixtures pass untouched. - `GlyphIndex` (shape memo, rasterization, slot table, shelf atlas, recycle), `GridWalker`, `ShapeFrame`, `GlyphSlot`, `AtlasView` and the helpers they call (`sizing_key_from`, `font_style_of`, `cluster_block_cols`, `GLYPH_ATLAS_SIDE`) move to core; `glyphs.rs` follows as an 86% rename. A CPU backend keeps glyphs in a RAM atlas and drains the same `PendingUpload`s the wgpu backend uploads, so the whole index belongs in core. - `GlyphCache` (textures, bind group, upload path) stays in wgpu as `glyph_cache.rs`, wrapping core's index. - `GlyphSlot` keeps normalized uv for now: the painter still writes slot coordinates straight into `FgInstance`; the switch to atlas pixels lands with the encoder in phase 4. - Cross-crate API made `pub` (overlay-cluster priming, `GridWalker::walk`, `cluster_base_char`, `cluster_block_cols`); `ShapeFrame` test constructors behind a core `testing` feature. - `atlas` and `shape_memo` benches move to core; unchanged within noise. Verified: `just check` green locally; sol review PASS.
Half of felis-render-wgpu never names a wgpu type, yet a client that does
not use wgpu has to re-derive it, and the browser client's hand port of the
box-drawing rasterizer already lags the native one. A crate without wgpu
or winit is the seam a CPU backend and other clients can reuse instead.
The palette, box drawing, shelf atlas, selection, overlay and image-source
types move first, unchanged; the pinned instance bytes stay identical.

The no-wgpu/no-winit rule is a deny.toml wrappers entry rather than a
cargo-tree test inside the crate: such a test reaches above its own crate
root and would ship in the package once the crate is published.

Assisted-by: Claude Code
docs: describe what felis-render-core holds today
All checks were successful
fuzz / cargo fuzz nightly long-run (pull_request) Has been skipped
darwin / detect relevant changes (pull_request) Successful in 9s
darwin / darwin docs-only no-op (pull_request) Has been skipped
windows / detect relevant changes (pull_request) Successful in 10s
windows / windows docs-only no-op (pull_request) Has been skipped
bench / instruction-count regression gate (pull_request) Successful in 46s
fuzz / cargo fuzz smoke (per target) (pull_request) Successful in 50s
darwin / build felis (aarch64-darwin) (pull_request) Successful in 2m40s
pr / nix flake check (pull_request) Successful in 1m18s
windows / cargo nextest (Windows) (pull_request) Successful in 2m47s
windows / frontend smoke (Windows) (pull_request) Successful in 1m3s
pr / cargo build / clippy / test / deny (pull_request) Successful in 1m58s
pr / wire schema is compatible with the base (pull_request) Successful in 3s
pr / frontend smoke (x86_64-linux) (pull_request) Successful in 31s
windows / cargo clippy (Windows cross) (pull_request) Successful in 28s
203dbea197
The crate-boundary record claimed the core already spares a CPU
backend from re-deriving how a cell looks, but the cell painter is
still in felis-render-wgpu; name the pieces the core holds instead.

Assisted-by: Claude Code
render, shaping, docs: move the glyph index into felis-render-core
All checks were successful
fuzz / cargo fuzz nightly long-run (pull_request) Has been skipped
darwin / detect relevant changes (pull_request) Successful in 9s
darwin / darwin docs-only no-op (pull_request) Has been skipped
windows / detect relevant changes (pull_request) Successful in 10s
windows / windows docs-only no-op (pull_request) Has been skipped
bench / instruction-count regression gate (pull_request) Successful in 46s
fuzz / cargo fuzz smoke (per target) (pull_request) Successful in 51s
darwin / build felis (aarch64-darwin) (pull_request) Successful in 2m38s
windows / cargo nextest (Windows) (pull_request) Successful in 3m0s
pr / nix flake check (pull_request) Successful in 1m51s
windows / frontend smoke (Windows) (pull_request) Successful in 56s
pr / cargo build / clippy / test / deny (pull_request) Successful in 1m38s
pr / wire schema is compatible with the base (pull_request) Successful in 4s
pr / frontend smoke (x86_64-linux) (pull_request) Successful in 28s
windows / cargo clippy (Windows cross) (pull_request) Successful in 14s
6a1a169253
A backend without wgpu still needs the whole glyph index: shaping memo,
rasterization, slot table, shelf packing and recycling. A CPU backend
keeps its glyphs in an atlas image in RAM and drains the same pending
uploads into it that the wgpu backend writes into a texture, so the index
moves to the core whole and the only per-backend part is that drain loop.
GlyphCache stays in felis-render-wgpu as the texture and bind-group
wrapper around it; the module takes a new name so the moved file keeps
its history.

Glyph slots keep normalized uv for now: the painter still writes slot
coordinates straight into the fg instances, so switching to atlas pixels
waits for an encoder that divides by the atlas side.

Assisted-by: Claude Code
natsukium force-pushed render/core-glyph-index from 6a1a169253
All checks were successful
fuzz / cargo fuzz nightly long-run (pull_request) Has been skipped
darwin / detect relevant changes (pull_request) Successful in 9s
darwin / darwin docs-only no-op (pull_request) Has been skipped
windows / detect relevant changes (pull_request) Successful in 10s
windows / windows docs-only no-op (pull_request) Has been skipped
bench / instruction-count regression gate (pull_request) Successful in 46s
fuzz / cargo fuzz smoke (per target) (pull_request) Successful in 51s
darwin / build felis (aarch64-darwin) (pull_request) Successful in 2m38s
windows / cargo nextest (Windows) (pull_request) Successful in 3m0s
pr / nix flake check (pull_request) Successful in 1m51s
windows / frontend smoke (Windows) (pull_request) Successful in 56s
pr / cargo build / clippy / test / deny (pull_request) Successful in 1m38s
pr / wire schema is compatible with the base (pull_request) Successful in 4s
pr / frontend smoke (x86_64-linux) (pull_request) Successful in 28s
windows / cargo clippy (Windows cross) (pull_request) Successful in 14s
to 8f16927b85
All checks were successful
fuzz / cargo fuzz nightly long-run (pull_request) Has been skipped
darwin / detect relevant changes (pull_request) Successful in 9s
darwin / darwin docs-only no-op (pull_request) Has been skipped
darwin / build felis (aarch64-darwin) (pull_request) Successful in 1m11s
windows / detect relevant changes (pull_request) Successful in 8s
windows / windows docs-only no-op (pull_request) Has been skipped
bench / instruction-count regression gate (pull_request) Successful in 1m6s
fuzz / cargo fuzz smoke (per target) (pull_request) Successful in 50s
pr / nix flake check (pull_request) Successful in 8s
pr / cargo build / clippy / test / deny (pull_request) Successful in 1m33s
pr / wire schema is compatible with the base (pull_request) Successful in 3s
pr / frontend smoke (x86_64-linux) (pull_request) Successful in 40s
windows / cargo clippy (Windows cross) (pull_request) Successful in 14s
windows / cargo nextest (Windows) (pull_request) Successful in 2m49s
windows / frontend smoke (Windows) (pull_request) Successful in 1m2s
2026-10-18 19:49:15 +09:00
Compare
natsukium deleted branch render/core-glyph-index 2026-10-18 20:08:08 +09:00
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
felis-terminal/felis!172
No description provided.