Repository navigation
fix(ml): retained paint compatible with C2/C4 subtree walk - #231
Merged
Merged
Conversation
lui_retained was written against the pre-C2 paint API (resolve_in, paint_node_body, ordered_children, node_shown) that #207 C2 and #217 C4 replaced with the shared Lui_paint.walk. Re-plumb the fragment cache onto the same decisions the walk makes — geometry/clip threading via a new Lui_paint.frame_of, dead-clip culling via Lui_paint.clip_dead, chrome and clip brackets via paint_enter/paint_leave, ghost traversal via paint_ghost_enter — so retained and full paint produce identical scenes by construction. Popup handling now mirrors the deferred drain: popup-kind roots promote too, and each subtree's sub_pops lists only the next drain level so popups nested inside popups surface level-by-level in forest order. Invalidation gaps the journal replay missed: - seg_dirty flags outlive the per-frame worklist on culled branches; a fresh mark on one never re-entered pend_segs, so stale pieces kept emitting through a parent's memoized Sub. - Reparenting changes every descendant's inherited context (foreground, inverse-surface background), but only the moved child was repainted; InsertChild/RemoveChild now repaint the subtree, and foreground / tooltip-background prop changes mark their readers. - Child-list mutations can flip a sibling's last-sibling chrome without touching the node itself; was_last tracking repaints both sides of the flip. Correctness fixes outside the cache: - The geometry-translation fast path assumed every absolute coordinate in cached ops tracks the node box; the modal scrim fills the viewport and must never translate. New Lui_paint.viewport_anchored gates the path. - Lui_store RemoveChild's defensive scan cleared c.parent even when the child was not in the named list, leaving it dual-membershipped (root + live list) — the seed of sib-list cycles and hangs. The random differential test now mutates across 14 op kinds — z-index, nested popups, scroll/overflow clips, offscreen placement, display:contents, reparents, prop removal — and asserts scene equality with a full paint every frame. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
lui_paint walk: keep clip_dead helper and frame_of, plus the M3 mounted-window kids; retained vlist rekids passes store.
tiensonqin
added a commit
that referenced
this pull request
Oct 13, 2026
body: adopt frame_of; keep mounted/spatial child dispatch.
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.
Fixes lui_retained after #224 landed on top of C2/C4 (walk incompatibility / diff loop).