Conversation
…andling linebender#864 made append_atom_to_line no longer inline into break_next (it became an out-of-line call per atom), and added work to the fast path of LineBoxMetrics::add_text on every atom: an eager atom.characters() slice (with bounds check) and a data.runs[run_idx].has_mixed_style_atoms load. Instead, fold the flag into last_text: add_text_boxes resets last_text to a sentinel after adding an atom of a run with mixed-style atoms, so such runs never take the early return. The atom's characters are passed as a char range and only sliced on the slow path. Add a test where a mixed-style ligature follows an atom of the same run and first style.
|
I'll fix CI failures and address comments from users with write access that start with 'Devin'.
|
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.
LLM Contributions: Investigation, implementation, tests and this description (Devin).
Fixes a break-phase regression from linebender#864 ("Handle line heights changing within atoms"):
break_all_lines+alignon a ~250KB uniform-style English document went 3.27ms → 3.98ms (+22%,-align-all-functions=6builds).Cause
BreakerState::append_atom_to_linestopped inlining intobreak_nextand became an out-of-line call per atom (break_remainingshrank 0x12d8 → 0xcf8 bytes).LineBoxMetrics::add_textdid extra work per atom before thelast_textearly-return: an eageratom.characters()slice (its bounds check can't be sunk into the cold branch) and adata.runs[run_idx].has_mixed_style_atomsload.Fix
last_text:add_text_boxessets it toNO_LAST_TEXTafter adding an atom of a run with mixed-style atoms, so such runs never hit the early return. The fast path is again justlast_text == (item_idx, style_index).atom.char_range()and only sliceShapedText::characters()on the slow path.Break phase (min ms, 4 interleaved passes):
8af7c033.27–3.33, main 3.98–4.04, this PR 3.26–3.31 (one 3.46 outlier), identical layout output.Adds
line_height_change_inside_ligature_after_same_style_atom: a mixed-style ffi ligature preceded by an atom of the same run and first style still contributes the larger line height (fails without thelast_textreset). No snapshot changes.Note: the branch is based on upstream
linebender/parleymain (244351e), so it also carries linebender#867 and linebender#874, which this fork'smaindoesn't have yet.Changelog: None
Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/693202370f58452b98038b8e52b05219
Open in Devin Desktop: https://dioxus.staging.devinenterprise.com/desktop/session/693202370f58452b98038b8e52b05219?variant=devin-insiders
Requested by: @nicoburns