Repository navigation
perf(composition): Thread damage clip as bounds, not paths (6.7) - #24789
Conversation
|
Claude finished @MartinZikmund's task in 4m 16s —— View job Review: perf(composition) — Thread damage clip as bounds, not pathsVerdict: ship — 2 nits, no blockers.
Overall assessmentThe change is correct and clean. Swapping Correctness checksClip accumulation ( Empty-clip short-circuit ( Old-location damage ( Removed
Findings (2 nits, 0 blockers)
Validation evidence
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24789/wasm-skia-net9/index.html |
|
The build 235991 did not find any UI Test snapshots differences. |
|
|
Every visual on every scroll frame intersected its accumulated clip as an SKPath, and under a rounded ancestor clip (any Fluent Button) its damage contribution went through an exact path region: a stroke outset, a path intersect and a DamageRegion.Union boolean. Damage only needs bounds, so thread a root-space rect through the render walk and contribute rects, matching master (74afcfc, dbb62a5). The rect is a superset of the exact region, so this only widens damage. ItemsRepeater grid of 2837 Fluent Buttons, 12 x 60 scroll steps, UI-thread render time: 2374 ms -> 338 ms (6.5.237: 157 ms). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01AzHtsXz33DcziPre7h3b9f
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01AzHtsXz33DcziPre7h3b9f
87cff29 to
facb7a7
Compare
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Improves Skia compositor performance during scrolling by threading clip bounds (rects) through the render walk instead of performing per-visual clip path booleans, and updates damage computation accordingly.
Changes:
- Switch render traversal from
SKPathclip propagation toSKRectclip-bounds propagation. - Simplify damage region computation to rect-only unioning based on clip bounds.
- Add a runtime test ensuring moved visuals under rounded clips damage both old and new areas without over-damaging untouched regions.
| File | Description |
|---|---|
| src/Uno.UI.RuntimeTests/Tests/Windows_UI_Composition/Given_Visual_Damage.cs | Adds a regression test for damage correctness when moving under a rounded ancestor clip. |
| src/Uno.UI.Composition/Composition/Visual.skia.cs | Replaces per-visual clip path intersection with rect-bounds intersection during render traversal. |
| src/Uno.UI.Composition/Composition/Visual.Damage.skia.cs | Converts damage calculation to rect-only based on clip bounds; removes content-path caching and path boolean operations. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
|
Claude finished @MartinZikmund's task in 3m 3s —— View job Review: perf(composition) — Thread damage clip as bounds, not paths (6.7)Verdict: ship — 1 actionable nit.
Overall assessmentThe change is correct and well-scoped. Swapping Correctness checksClip accumulation ( Empty-clip short-circuit ( Old-location damage (
Inline findingOne finding posted inline — CS1998 on the new test method ( The two nits from the previous review round ( |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24789/wasm-skia-net9/index.html |
|
The build 237185 did not find any UI Test snapshots differences. |
|
|
morning4coffe-dev
left a comment
There was a problem hiding this comment.
Verified: the rect-only damage path matches master 74afcfc and dbb62a5. The clip is threaded as an SKRect through Visual.Render, TryGetPaintDamageRegion uses clip bounds only, and the rect is a superset of the exact region. Clip bounds are used only for damage, and canvas.ClipPath is unchanged, so drawing is not affected. The new rounded-clip test checks both the vacated and newly covered areas.
Findings, ranked:
- Incomplete port relative to the 6.8 backport (#24788). Master 485d370 ("drop dead own-content-path build on paint") removes the per-paint content path build. This PR drops the _ownContentPath field but keeps the producers. BorderVisual.skia.cs Paint still ends with
return BuildOwnContentPath();, ShapeVisual.skia.cs does the same, and Visual.skia.cs discards the result (visual.Paint(session);). Every repaint of a Border or Shape still rebuilds an SKPath that nothing reads. #24788 changes those returns tonulland deletes BuildOwnContentPath and _ownContentPathBuffer. Please port the same change so 6.7 matches 6.8 and the measured win is not partly spent on dead work. - The PR body says the per-visual content path is "dropped". That is true of the damage path only, and is misleading until item 1 is fixed.
- Informational, not a regression: current master's TryGetPaintDamageRegion also outsets the clip rect for antialiasing (clipRect = OutsetForAntialiasing(clipRect)). This port does not. Pre-PR 6.7 rect clips behaved the same way, so this is faithful to 74afcfc but not to current master. Worth a follow-up decision.
Validation: code review and master comparison only. I did not build or run tests. The runtime results in the PR body are the author's.
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
Keeps both new damage tests in Given_Visual_Damage.cs: uno#24793's SKCanvasVisual test and this PR's rounded-clip test, in the same order as servicing/6.8. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Claude finished @agneszitte's task in 3m 55s —— View job Review: perf(composition) — Thread damage clip as bounds, not paths (6.7)Verdict: fix-first — 1 CI-blocking error, 1 nit, 1 incomplete-port note.
Overall assessmentThe core change is correct and well-scoped. Threading Findings1 — CI-blocking (CS1998) →
2 — Nit (stale doc) → The 3 — Incomplete port (out-of-diff, not blocking this merge) As noted by Validation evidence
|
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |

GitHub Issue: closes #23984
PR Type:
🐞 Bugfix (performance regression)
What changed? 🚀
#24582 backported part of #23986 to 6.7. Scroll frames still ran path booleans for every visual, because the clip was threaded through the render walk as an
SKPath:Visual.Renderintersected each visual's accumulated clip withSKPath.Op.Button), the clip isn't a rect. Each moved visual's damage then went through a stroke outset, a path intersect and aDamageRegion.Unionpath boolean.Damage only uses clip bounds, so this threads a root-space
SKRectthrough the walk and hasTryGetPaintDamageRegioncontribute rects only. It ports the intent of master's 74afcfc and dbb62a5 to theSKPath-based compositor on this branch. The rect is always a superset of the exact region, so damage can only widen, never miss.The old exact branch also stored each visual's content path; that field is dropped. Clip caching from #24230 was measured too and is under 3% of the frame here, so it isn't part of this fix. The mergify backports of #24230 (#24697/#24698) were closed.
Measurements 📊
ItemsRepeater+UniformGridLayout, 2,837 FluentButtontiles,ChangeViewin 60 steps of 40 px, repeated 12 times. Skia Win32 at 250%.dotnet-tracedotnet-sampled-thread-timeon the UI thread:Managed allocation is unchanged (~1.1 MB per 60 steps, no Gen0 GCs); this is CPU only. The remaining gap is mostly Win32 accessibility (#24784, separate PR) and layout.
PR Checklist ✅
Screenshots Compare Test Runresults.Validation
Given_Visual_Damage3/3, including the newWhen_Visual_Moves_Under_Rounded_Clip_Then_Old_And_New_Areas_Are_Damaged. A composition/Border/ScrollViewer/ItemsRepeater/RenderTargetBitmap sweep passed apart from 4Given_ScrollViewerlayout asserts that fail only at non-100% display scale (175 vs 175.2); those are pre-existing and unrelated.Uno.UI.Composition.Skiabuilt withoutUnoFastDevBuild, so analyzers ran.🤖 Generated with Claude Code
https://claude.ai/code/session_01AzHtsXz33DcziPre7h3b9f