Repository navigation
Conversation
Co-Authored-By: Staging-Devin AI <166158716+staging-devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Staging-Devin AI <166158716+staging-devin-ai-integration[bot]@users.noreply.github.com>
Contributor
|
I'll fix CI failures and address comments from users with write access that start with 'Devin'.
|
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
On
main, the browser-layout-benchreal/wikipedialeaf_10pctrelayout step (every 10th leaf +1px, one incrementalresolve()) gives boxes that differ from a fresh layout of the serialised DOM (775 differing elements). Two independent layout-cache bugs cause it:Same-BFC children cached without their float context.
LayoutBlockContainer::compute_block_child_layoutwrapped same-BFC child layout incompute_cached_layout, but the mutableBlockContext(floats placed so far, and floats the child itself contributes) isn't part ofLayoutInput/the cache key. A cache hit therefore skipped replaying the child's floats into the shared context and reused a layout computed against a different float environment. E.g.<div><div style="float:right;height:200px"></div></div><div style="overflow:hidden">…</div>: changing the second div's width left the float wrapper cached, the float was never re-placed andbodycame out 0px tall instead of 200px.Fix: bypass (and clear) the cache for a same-BFC child when the context can affect it or it can affect the context:
subtree_contains_floatsis memoised per layout pass and is O(1) for inline roots without inline boxes (floats inside an inline formatting context are inline boxes). Block children keep the conservativehas_floats()because negative margins can bring them above their parent.Atomic inline measurements lost baselines and moved children. Inline layout sized atomic inlines with the caller's
run_mode, so underComputeSizeTaffy's cache returnedLayoutOutput::from_outer_size(no baselines) on a hit, while a recompute had baselines → different line geometry between incremental and fresh layout. Also the inline-box placement loop ran duringComputeSize, overwriting child positions that a later parentPerformLayoutcache hit then didn't restore (wikipedia navboxthinline-block at y=5 vs 17).Fix: atomic inline children are always laid out with
RunMode::PerformLayout(baselines needed), and inline-box positions are only written duringPerformLayout.Tests
incremental_oracle.rs:cached_same_bfc_child_replays_floats,cached_inline_root_moves_below_floats,cached_atomic_inline_measurement_preserves_baselines— each fails without its fix.blitz-runner --checkon wikipedia, text/paragraphs/1000, flex/wide/1000: every step matches full restyle and fresh parse (rustdoc's pre-existing round-trip difference is unchanged).Performance
main
ebacd68vs this PR9f8d36b, separate release builds, pinned to one core, 10 interleaved process pairs (ABAB) × 5 iters = 50 samples per cell. Layout phase of the timedresolve(), ms, median [p25–p75]; bold = IQRs don't overlap.The cost is in small incremental relayouts: about +2 ms on wikipedia
leaf_1(+42% of totalresolve(), 4.8 → 6.8 ms) and about +2 ms layout onleaf_10pct(+3% of totalresolve(), which is dominated by style); paragraphsleaf_1is about +60 µs. Other steps are within noise. Most likely this comes from the conservative cache bypass (float-adjacent same-BFC subtrees laid out uncached, plus the per-pass float-subtree walk). The phase timer rounds ≥10 ms values to whole ms.Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/48e12aa27062474cb1529350310c9c58
Open in Devin Desktop: https://dioxus.staging.devinenterprise.com/desktop/session/48e12aa27062474cb1529350310c9c58?variant=devin-insiders