[APP-5825] Bypass layout cache for editor text - #15831
Open
warp-agent-staging[bot] wants to merge 8 commits into
Open
[APP-5825] Bypass layout cache for editor text#15831warp-agent-staging[bot] wants to merge 8 commits into
warp-agent-staging[bot] wants to merge 8 commits into
Conversation
Benchmark a stable 4,096-block EditDelta layout workload so cache contention changes can be measured on the same machine.\n\nCo-Authored-By: Warp Agent <agent@warp.dev>
Route rich-text editor layout directly through TextLayoutSystem while preserving BOM stripping and fallback font requests. Remove throwaway caches from document, placeholder, and ordered-list layout paths.\n\nCo-Authored-By: Warp Agent <agent@warp.dev>
Contributor
Author
|
This PR was generated with Warp. Comment |
Exercise missing-glyph fallback registration through layout_text_uncached, matching the document and ordered-list-number path.\n\nCo-Authored-By: Warp Agent <agent@warp.dev>
bnavetta
reviewed
Sep 5, 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.



Description
The rich-text editor now lays out modified document text directly through
TextLayoutSysteminstead of populating aLayoutCachethat is discarded after each parallel pass.RenderStatealready retains the resultingBlockItemframes and only lays out changed blocks, so those per-pass cache entries could not produce later hits.The uncached WarpUI API preserves leading-BOM removal and fallback-font requests. Placeholder lines whose frames are owned by render elements continue to use the persistent Presenter cache; the generic WarpUI Presenter cache remains unchanged.
Linked Issue
APP-5825
ready-to-specorready-to-implement. — This work is tracked in Linear rather than a GitHub issue.Testing
cargo nextest run --manifest-path /workspace/warp/Cargo.toml -p warp_editor— 501/501 passed on Linux.cargo nextest run -p warp_editor— 502/502 passed on macOS 26.3.1 arm64 atb5a760903871146b29831e690e393aca1407b590.cargo nextest run -p warp_editor -E 'test(=render::model::offset_map::tests::test_end_to_end)'— 1/1 passed on macOS using native text frames.cargo nextest run --manifest-path /workspace/warp/Cargo.toml -p warpui_core— 329 passed, 7 skipped.cargo clippy --manifest-path /workspace/warp/Cargo.toml -p warp_editor --all-targets -- -D warnings— passed.cargo clippy --manifest-path /workspace/warp/Cargo.toml -p warpui_core --all-targets -- -D warnings— passed.cargo check --manifest-path /workspace/warp/Cargo.toml -p warp_editor --bench text_layout_benchandcargo check --manifest-path /workspace/warp/Cargo.toml -p warpui_core— passed.cargo bench --manifest-path /workspace/warp/Cargo.toml -p warp_editor --bench text_layout_bench -- --quick— Linux test-backend smoke passed.cargo fmt --manifest-path /workspace/warp/Cargo.toml --package warp_editor --package warpui_coreandgit diff --check— passed.3af13a57e2af46a9c9745c65426b0054a43a79cc: run 33968691027 (in progress with no failures at the time of this update).Benchmark
Native CoreText
The benchmark sends 4,096 unique, long blocks through
EditDelta::layout_delta. Each block includes Latin ligature sequences, Arabic and Hebrew bidirectional runs, combining marks, Devanagari, Thai, and emoji/joiner sequences. It loads Menlo throughwarpui::platform::mac::FontDB, whileApp::testsupplies only the ancillaryAppContext; the measured text layout system is native CoreText.The benchmark initializes Rayon’s global pool at exactly six threads before
App::test, failing if any earlier use contaminated that setup. The 4,096 non-empty tasks flow through production’s bounded chunks of up to 64 tasks / 64 KiB and each chunk usesinto_par_iter(). Each backend performs one full untimedlayout_deltabefore Criterion starts, warming Rayon workers and shaping/font state. The same pool is reused without reset because every parallel iterator drains before returning and Rayon retains no per-layout cache.The published cached baseline commit
93ad14348c3c838e6058792ecce5f74faf289573onfactory/app-5825-coretext-cached-baselinecontains the exact workload, Rayon setup, warm-up call, and Criterion configuration while creating one freshLayoutCacheper invocation. The uncached run usedb5a760903871146b29831e690e393aca1407b590. A normalized source comparison is identical after removing only the cache import, construction, and constructor arguments.Both commits ran sequentially in the same clean checkout on macOS 26.3.1 arm64, Apple M4 Pro (Virtual), repo-pinned Rust 1.92.0, with 20 samples, a 2-second warm-up, and a 5-second requested measurement period.
RAYON_NUM_THREADSwas unset because the benchmark fixes the pool at six threads.cargo bench --quiet -p warp_editor --bench text_layout_bench -- 'editor_text_layout/core_text/layout_delta_4096_shaping_blocks_6_threads' --save-baseline cached-shapingcargo bench --quiet -p warp_editor --bench text_layout_bench -- 'editor_text_layout/core_text/layout_delta_4096_shaping_blocks_6_threads' --baseline cached-shapingp = 0.00 < 0.05(rounded display value).Test-backend microbenchmark
The
editor_text_layout/test_backend/layout_delta_4096_shaping_blocks_6_threadsgroup exercises the same parallel task/chunking and shaping-heavy input with WarpUI’s test font backend. Its Linux smoke run measured 1.493–1.564 ms and 903.50–946.51 Melem/s; the native CoreText comparison above is the production-representative measurement../script/run. — The requester explicitly scoped verification to benchmarks and automated tests; this change has no UI behavior change.Agent Mode
CHANGELOG-NONE