Store glyph layers lazily and stream foreign imports - #164
Merged
Conversation
kostyafarber
force-pushed
the
agent/lazy-packed-glyph-layers
branch
from
July 30, 2026 15:50
e6f9863 to
23bc249
Compare
kostyafarber
commented
Jul 31, 2026
kostyafarber
commented
Jul 31, 2026
kostyafarber
commented
Jul 31, 2026
kostyafarber
commented
Jul 31, 2026
kostyafarber
commented
Jul 31, 2026
kostyafarber
commented
Jul 31, 2026
kostyafarber
commented
Jul 31, 2026
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
shift.glyph-layer.v1framing in Rust and TypeScript with strict validation, shared goldens, property coverage, and benchmarksnone | zstd.v1compressionmaxpglyph ID, preserve source TrueType quadratics, and derive stable positional contour/point IDs for equivalent compiled importsStorage contract
shift.glyph-layer.v1remains the immutable canonical inner payload. SQLite stores one complete independent layer as either raw canonical bytes or one dictionary-free Zstandard frame. Zstd level 1 is the current write policy; writers retain it only when smaller. Every row records the inner format, compression kind, exact stored and decoded lengths, and a 32-byte BLAKE3 of the canonical bytes.Reads bound stored and decoded sizes before allocation, reject truncated/trailing frames, require exact decoded length and hash, then run strict canonical decoding and cross-check directory/component facts. Mixed compressed/uncompressed rows and transitions are supported without touching unrelated layers.
Final architecture review
A second full
origin/main...HEADreview confirmed the crate boundaries and storage-validation ordering, then drove a focused cleanup:ShiftStore::load_glyph_layersthe single count/decoded-byte planner used by acquisition and full materializationReplacementIdentities, retain previous layers throughArc, and move validated sets into the final indexGlyphor deep layer cloneglyph_layers.name, join canonical glyph names, and preserve authored glyph order on renamepublic.defaultwas not listed firstThe remaining review nits—renaming the established public outline
CodecError, private TSHeadernaming, and tiny binary-helper deduplication—were deliberately left alone because their churn exceeds their correctness or boundary value.Scale evidence
Release profiles on a 12-thread Ryzen 5 5500U with eight Rayon workers. These are observational runs rather than CI timing gates.
Source Han Sans VF
Before in-place validated hydration, the same acquisition/eviction path took about 128 ms / 53.8 ms because it copied and synchronously dropped the complete 65,535-glyph font state.
Roboto Flex Designspace
Direct Roboto Flex UFO
Verification
cargo test --workspace --exclude shift-bridgecargo clippy --workspace --exclude shift-bridge --all-targets -- -D warningscargo clippy -p shift-bridge --all-targets -- -D warningscargo fmt --all -- --checktsc --noEmitpnpm format:checkandpnpm lint:checkpython3 scripts/context-drift-check.py(still reports the existing unrelated app-documentation errors)Commit hooks passed all applicable Rust checks. The unavailable worktree-local JS hooks were run manually against the main checkout's pinned tools without creating
node_modulessymlinks.Follow-ups
GlyphLayerplaceholders with a compact complete directory after the resident Slug grid work settles