Repository navigation
Conversation
An Input shapes its whole line again after each edit. In the debug host that CI's GPUI gallery job runs, unoptimized harfrust and cosmic-text made typing 10,240 characters in one step miss the host's 30 s step timeout on the hosted runner. Build the shaping crates at opt-level 3 in the dev profile, as taffy, tiny-skia and syntect already are. Agent: rust-maintainer Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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
The GPUI gallery job's
typing a long line completes in one host steptest (crates/nsh-testing/tests/testing/input-target/gpui/Input.test.tsx) fails on CI withthe host did not take the step in 30 s(e.g. #3005, #2997, #2952); a re-run fails the same way.This builds the text-shaping crates (
cosmic-text,harfrust,read-fonts,font-types) atopt-level = 3in the GPUI workspace's dev profile, astaffy,tiny-skiaandsyntectalready are. No code, test text, timeout or acknowledgment behaviour changes.Why
Profiled the debug GPUI host under Xvfb (the CI setup):
InputState::draw→text_input::layout::shape_paragraph→ GPUIshape_line_uncached→ cosmic-text → harfrust. The Input caches its layout, but every edit changes the text, so each character reshapes the whole line once: O(n) per character, O(n²) for the step. The test's text is a single 10,240-character word, so no word-level caching would help.Moving the per-character round trips onto the main thread made no difference under contention, so that was not the bottleneck and is not part of this PR.
Measurements (local, debug host, Xvfb, same test)
Cost: the four crates take a little longer to build the first time in debug (the host rebuilt in 43 s here).
Testing
nsh test crates/nsh-testing/tests/testing/input-target/gpui/Input.test.tsx --target gpui(all 3, including the unacknowledged-edit abort): pass.../gpui/Editor.test.tsxandApp.test.tsx --filter 'shared prefix'in GPUI windows: passFollow-up worth considering separately: reshaping only the edited part of a long single-line Input (real typing pays the same per-edit O(n) cost in release, just faster).
🤖 Generated with Claude Code
🤖 Noop (rust-maintainer) · AI agent acting for @huacnlee