Skip to content

perf(listview): Drop dead recycle visibility pass - #24529

Merged
MartinZikmund merged 2 commits into
masterfrom
dev/mazi/perf-virtualizing-visibilities
Oct 9, 2026
Merged

MartinZikmund merged 2 commits into
masterfrom
dev/mazi/perf-virtualizing-visibilities

Conversation

@MartinZikmund

@MartinZikmund MartinZikmund commented Sep 16, 2026 •

Copy link
Copy Markdown
Member

GitHub Issue: closes #24528

PR Type:

🔄 Refactoring (no functional changes, no api changes)

What changed? 🚀

VirtualizingPanelGenerator.UpdateVisibilities() walked the entire recycle pool once per layout cycle and wrote Visibility.Collapsed onto every cached container. Since 8fef29fc610 ("remove containers from the visual tree when recycled even if cached"), RecycleViewForItem() removes a recycled container from Panel.Children before caching it, so that write lands on a detached element and has no visual effect.

This removes the method and its single call site in VirtualizingPanelLayout.UpdateCompleted().

The pass predates the current architecture — its own doc comment explained that batching the toggles "significantly improves scrolling performance in WebAssembly", which was true when pooled containers stayed attached to the panel and Visibility drove real DOM visibility.

The paired Visibility = Visible assignment in TryDequeueCachedContainer() is kept deliberately. It runs once per dequeue rather than once per layout cycle, so it is not the cost here, and it still covers a container collapsed by an application or an ItemContainerStyle — removing it would be an actual behaviour change.

Measured impact 📊

Work removed (exact, deterministic). This is the honest measure for this change:

Metric Before After
Visibility DP writes over the pool, per layout cycle O(CacheLimit) 0
Pool walks (dictionary of stacks), per layout cycle 1 0

CacheLimit is roughly two viewports' worth of containers, clamped to [10, 1024] per template — about 30 in the benchmark list. UpdateCompleted() runs once per scroll step, so this is per scroll step, not per session.

Memory. Managed bytes allocated per scroll step on the UI thread (GC.GetAllocatedBytesForCurrentThread, median of 7 rounds), measured in alternating order — before, after, before, after — so that phase order cannot masquerade as an effect. 2,000-item ListView, 150 scroll steps per round:

Workload Before After Δ
Scroll step, no TextBlock in template 64,819.8 B 64,815.6 B −4.2 B (−0.006 %)
Scroll step, fixed text 154,189.0 B 154,183.4 B −5.6 B (−0.004 %)
Scroll step, two bound TextBlocks 134,605.7 B 134,536.1 B −70 B — within noise
Gen0 collections over 1,000 steps 11 11 unchanged

The first two workloads reproduce to ~2 B between passes, so their few-byte deltas are real but negligible. The bound-text workload's own run-to-run jitter is ±130 B, which is larger than its delta, so nothing is claimed there.

This is not an allocation win, and it is not presented as one. The write being removed lands on a detached element, so the expected allocation effect was approximately zero, and that is what the measurement shows. The case for the change is the removed work and the removed dead code, not the byte count.

CPU time is deliberately not reported. It is below this machine's measurement floor for a change of this size, and I can demonstrate that rather than assert it: with the same instrument (QueryThreadCycleTime on the UI thread), reversing the order of the two phases flipped the sign of the apparent result on a sibling change, and within a single phase the spread reached 97 % (2.81 M vs 5.55 M cycles/iter on the same workload, same build). Any timing column produced here would be measuring machine state, not the change. Wall-clock is worse and is not reported either.

Validation. Given_ListViewBase + Given_ItemsControl (Skia Desktop, net10.0-desktop) were run against this branch and against the unmodified base, and the results are identical. After the rebase onto master (01f8a9f195): 158 tests, 151 passed, 6 failed, 1 inconclusive, 11 skipped, identical per test on both sides. The 6 failures are therefore pre-existing on this base and unrelated to this change (fractional-pixel size asserts and a theme-colour assert). Built with UnoFastDevBuild dropped so analyzers and EnforceCodeStyleInBuild were active: 0 warnings, 0 errors.

Scope note: this shows no observable change across that suite. It is not a proof that the write is unreachable in every state — it is dead because pooled containers are unparented, and that is the invariant this relies on.

The branch previously carried copies of three prerequisite perf commits (#24519, #24523, #24525). They were dropped on rebase: #24519 is merged, and the other two are reviewed in their own PRs. The PR also fixes a dangling <see cref> in Given_DependencyObjectCollection that came in with #24519.

No new tests are added: this removes work that produces no observable effect, so there is no new behaviour to assert. The existing suites plus the baseline comparison are the evidence.

Measured with a headless Skia app (Uno.UI.Runtime.Skia.Headless) project-referencing the framework, with Fluent resources merged. Not BenchmarkDotNet — this repo has no BenchmarkDotNet harness, and the workload runs on the dispatcher thread, which is where the allocation counter is read.

Internal tracking: unoplatform/uno-private#2365 (list virtualization and scrolling audit, finding #2).

PR Checklist ✅

  • 🧪 Added Runtime tests, UI tests, or a manual test sample (for bug fixes / features, if applicable) — not applicable, see validation above
  • 📚 Docs have been added/updated following the documentation template (for bug fixes / features) — not applicable, no public behaviour or API change
  • 🖼️ Validated PR Screenshots Compare Test Run results — pending CI
  • ❗ Contains NO breaking changes
  • 👀 Reviewed 2 other open pull requests (optional but appreciated!)

🤖 Generated with Claude Code

https://claude.ai/code/session_012QzKQawubFcPPX9JSoZLkX

Copilot AI lite review requested due to automatic review settings September 16, 2026 14:20
@github-actions

github-actions Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 5m 5s —— View job


Review complete ✅

  • Gather context (diff, changed files, AGENTS.md rules)
  • Understand request (code review of PR perf(listview): Drop dead recycle visibility pass #24529)
  • Review core change: VirtualizingPanelGenerator/VirtualizingPanelLayout
  • Review the other changed files (DependencyObject/Boxes/Control/TextBlock/etc.)
  • Review new runtime tests
  • Post inline comments for findings
  • Post summary

Verdict: ship (1 minor/nit finding, non-blocking)

Findings by severity

  • Nit: 1 (dangling <see cref> in a new test's doc comment — posted inline)

Cross-cutting notes

  • This PR is actually 4 independent commits, not one: dfe25ee4 (index DO collections in Enter/Leave/theming walks), 4da17d69 (allocation-free resource-dictionary walker), 2ecd5a05 (box reuse on inherited-property/hit-test paths), and 1cb2c628 (the listview change the title/description actually describe). That's why the changed-files list includes DependencyObject.*, Boxes.cs, Control.cs, TextBlock.cs, etc. — they're unrelated to the stated "drop dead recycle visibility pass" change. Each commit is well-scoped and individually reasoned (each has its own commit message with rationale and measurements), so I reviewed all four, but the PR title/description only cover 1 of 4 — worth knowing when reading the diff, and worth splitting into separate PRs if that's still possible before merge.
  • The listview fix (1cb2c628) is a solid root-cause removal: verified by inspection that RecycleViewForItem (VirtualizingPanelGenerator.managed.cs:186-201) pushes the container to the cache and removes it from Panel.Children synchronously, before UpdateCompleted() ever calls the now-deleted UpdateVisibilities() — so the Visibility = Collapsed write was provably writing to a detached element. The paired Visibility = Visible reset in TryDequeueCachedContainer is correctly left in place. No new test is added (matches the "no observable behavior change" framing), which means correctness now silently depends on recycled containers always being detached — the PR body already acknowledges this as a scope limitation rather than a proof, so I'm not blocking on it, just flagging it as the one invariant a future change in this area should keep an eye on.
  • The other three commits (DO collection indexing, resource-dictionary walker, box reuse) each replace an iterator/boxing allocation with a struct-based equivalent and were traced through their call sites; the deferred-parent-read semantics in the new ResourceDictionaryWalker and the version-checked DependencyObjectItems walker both faithfully reproduce the original iterator's ordering/re-entrancy behavior. No correctness issues found. New runtime tests (Given_Style, Given_VisualTreeHelper, Given_DependencyObjectCollection) pin the specific behaviors each change relies on (implicit-style scope order, hit-test inheritance, themed-collection-item resolution).
  • No SOLID/DP/async/cross-platform/event-declaration issues found; no new analyzer-suppressions or #pragma growth; commit messages follow Conventional Commits.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved moderate findings remain around Android coverage, test cleanup, and collection replacement semantics.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Removes the obsolete ListView recycle visibility pass and adds allocation-focused optimizations across XAML resource, collection, traversal, and boxing paths.

Changes:

  • Removes the dead virtualization visibility sweep and call site.
  • Adds optimized walkers, enumeration, and cached boxed values.
  • Adds runtime coverage for styles, collections, and inherited hit-test behavior.
File summaries
File Summary
src/Uno.UI/UI/Xaml/UIElement.Pointers.Managed.cs Caches hit-test enum boxes.
src/Uno.UI/UI/Xaml/ResourceResolver.cs Uses the resource walker.
src/Uno.UI/UI/Xaml/Documents/InlineCollection.cs Exposes fast enumeration.
src/Uno.UI/UI/Xaml/DependencyObjectCollection.cs Adds indexed, versioned traversal.
src/Uno.UI/UI/Xaml/DependencyObject.Theming.cs Uses optimized traversal.
src/Uno.UI/UI/Xaml/DependencyObject.Store.cs Adds resource walking and typed disposal.
src/Uno.UI/UI/Xaml/DependencyObject.PropertySystem.mux.cs Uses optimized collection walks.
src/Uno.UI/UI/Xaml/DependencyObject.AncestorsDictionary.cs Reuses boxed booleans.
src/Uno.UI/UI/Xaml/Controls/TextBlock/TextBlock.cs Uses fast inline enumeration.
src/Uno.UI/UI/Xaml/Controls/ListViewBase/VirtualizingPanelLayout.managed.cs Removes the visibility-pass call.
src/Uno.UI/UI/Xaml/Controls/ListViewBase/VirtualizingPanelGenerator.managed.cs Removes the obsolete visibility pass.
src/Uno.UI/UI/Xaml/Controls/Control/Control.cs Reuses boxed disabled values.
src/Uno.UI/Helpers/Boxes.cs Provides shared boxed values.
src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml/Given_Style.cs Tests resource-scope ordering.
src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml/Given_DependencyObjectCollection.cs Tests themed collection traversal.
src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Media/Given_VisualTreeHelper.cs Tests inherited hit-test state.
Review details

Suppressed comments (5)

src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml/Given_DependencyObjectCollection.cs:99

  • This new <see cref="When_Theme_Changes_Then_Items_In_Collections_Are_Updated"/> target does not exist anywhere in the runtime-test sources, so the documentation points to a nonexistent test and may produce an unresolved-cref warning. Reference the re-entry test above or remove the cref.
	/// Same collections as <see cref="When_Theme_Changes_Then_Items_In_Collections_Are_Updated"/>, but
	/// resolved by the Enter walk when the subtree joins the tree with a theme already set.

src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml/Given_Style.cs:101

  • The description says that no new tests are added, but this hunk adds a new runtime test and the diff adds several more. Please update the PR description/checklist (or split unrelated work) so the stated scope and validation match the submitted changes.
		[TestMethod]
		[RunsOnUIThread]
#if __ANDROID__
		[Ignore("ContentControl implicit styles don't pass in CI on Android, as for When_ImplicitStyle")]
#endif
		public async Task When_ImplicitStyle_Nearest_Scope_Wins()

src/Uno.UI/UI/Xaml/DependencyObject.Store.cs:1584

  • This PR is described as a ListView-only dead-pass removal with no functional changes, but this hunk introduces a new resource traversal implementation; the same diff also changes collection enumeration and coercion paths. The listed ListView baseline tests cannot validate these changes. Please split the unrelated optimizations or update the PR scope and add validation for them.
		internal ResourceDictionaryWalker EnumerateResourceDictionaries(
			bool includeAppResources,
			FrameworkElement? resourceContextProvider = null,
			ResourceDictionary? containingDictionary = null)
			=> new(

src/Uno.UI/UI/Xaml/DependencyObjectCollection.cs:399

  • This custom fast path explicitly promises List<T>.Enumerator-style fail-fast behavior, but the added tests only cover theme values. There is no regression test that mutates a DependencyObjectCollection during an Enter/Leave or resource walk, so a missed mutation hook could silently change lifecycle behavior; add coverage for a mid-walk mutation and the resulting exception.
				// Same contract as List<T>.Enumerator: a collection modified mid-walk fails rather
				// than silently skipping or revisiting an item.
				if (_collection.ItemsVersion != _version)
				{
					throw new InvalidOperationException("Collection was modified; enumeration operation may not execute.");

src/Uno.UI/UI/Xaml/DependencyObjectCollection.cs:355

  • The diff adds a new collection/tree-walk implementation, resource-walker changes, boxing/coercion changes, and multiple runtime tests, while the PR description says it only removes the ListView visibility pass and adds no tests. The supplied ListView/ItemsControl validation does not exercise these additional changes; please split the unrelated work or update the description and add targeted validation.
	internal ref struct DependencyObjectItems
  • Files reviewed: 16/16 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 234033 found UI Test snapshots differences: skia-linux-screenshots: 57, skia-windows-screenshots: 2310, wasm: 11

Details
  • skia-linux-screenshots: 57 changed over 2348

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • Buttons.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ClipboardTests.png-dark
    • Examples.png-dark
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
    • DisplayInformation.png-dark
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • Focus_FocusVisual_Properties.png-dark
    • ImageIconPage.png-dark
    • ContextRequested.png-dark
    • ContextRequested.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
  • skia-windows-screenshots: 2310 changed over 2408

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AnimatedIconPage.png-dark
    • AppBarButtonWithIconTest.png
    • ApplicationViewSizing.png-dark
    • AppWindowFeatures.png-dark
    • AppWindowTitleBar Properties.png
    • Attributed_text_FontSize_Changing.png
    • AutoBorderStretchwithrightmargin.png-dark
    • AutomationProperties_AutomationId.png
    • AutoSuggestBox_BitmapIcon.png
    • AutoSuggestBox_Description.png-dark
    • BackGesture.png-dark
    • BackGesture.png
    • Basics.png-dark
    • Basics.png
    • BindableDrawerLayout_ChangePane.png-dark
    • BindableDrawerLayout_ChangePane.png
    • BitmapImage_vs_SvgImageSource.png-dark
    • BitmapImage_vs_SvgImageSource.png
    • BorderImageBrush.png-dark
    • BorderImageBrush.png
  • wasm: 11 changed over 1076

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • UITests.Shared.Microsoft_UI_Xaml_Controls.ExpanderTests.WinUIExpanderPage
    • UITests.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_NavigationProperties
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ListView.ListView_IsSelected
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewSelectedItems
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Minimal
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Ogg_Extension
    • SamplesApp.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_EnableDevTools
    • UITests.Uno_Web.Http.CookieManagerTests
    • UITests.Windows_UI_Xaml_Media_Animation.ColorAnimation_Background
    • UITests.Windows_UI_Xaml_Controls.CalendarView.CalendarView_Theming
    • Uno.UI.Samples.Content.UITests.WebView.WebView_AnchorNavigation

@morning4coffe-dev morning4coffe-dev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the exact current head. The removed recycle visibility pass is redundant with the existing container lifecycle and does not change observable ListView virtualization, selection, focus, or visibility behavior. No significant issue found.

Copilot AI review requested due to automatic review settings September 18, 2026 08:13
@MartinZikmund
MartinZikmund force-pushed the dev/mazi/perf-virtualizing-visibilities branch from 1cb2c62 to ce98ced Compare September 18, 2026 08:13
@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 2m 5s —— View job


Review complete ✅

  • Gather context (diff, changed files, AGENTS.md rules)
  • Understand current PR scope (re-checked after synchronize event)
  • Review core change: VirtualizingPanelGenerator/VirtualizingPanelLayout
  • Review the Given_DependencyObjectCollection.cs cref fix
  • Post inline comments for findings
  • Post summary

Verdict: ship (0 blocking findings, 1 informational note below)

What changed since the last review round

The branch is now exactly 2 commits ahead of master and matches the PR title/description 1:1 — the previously-flagged issue (this PR bundling 4 unrelated commits) is resolved; the DO-collection/resource-walker/boxing work is no longer part of this diff. The only two commits are:

  • ae4aa203 — the UpdateVisibilities() removal (the stated change).
  • ce98ceda — a one-line drive-by fix for the dangling <see cref> a prior review round flagged in Given_DependencyObjectCollection.cs:98 (now correctly points at When_Subtree_Reenters_Tree_Then_Items_In_Collections_Are_Updated, which exists at line 62). No other reference to the removed method remains anywhere in the repo.

Verified by inspection

  • RecycleViewForItem (VirtualizingPanelGenerator.managed.cs:186-205) pushes the container onto _itemContainerCache and removes it from Panel.Children synchronously, before TryDequeueCachedContainer ever resets Visibility = Visible on reuse (line 146). UpdateLayout (VirtualizingPanelLayout.managed.cs:461-480) calls UnfillLayout/FillLayout (which drive the recycling) before UpdateCompleted() — so by the time the deleted UpdateVisibilities() ran, every cached container for that cycle was already detached. The write it performed was provably a no-op. This is a genuine root-cause dead-code removal, not a guard-only change.

Cross-cutting note (informational, non-blocking)

The PR description's performance framing says UpdateCompleted() "runs once per scroll step," but UpdateLayout is invoked with isScroll: true from the scroll-consumption path (VirtualizingPanelLayout.managed.cs:312, :1409-1420), and UpdateCompleted() is only called if (!isScroll) (:477-480). So on the pure-scroll path, UpdateCompleted() — and therefore the now-removed UpdateVisibilities() — wasn't being invoked at all; it only ran on non-scroll layout passes (initial fill, resize, collection changes). This doesn't change the correctness of the removal (the write was dead either way), but it means the "per scroll step" benchmark framing describes a narrower/different code path than the one actually exercised during scrolling. Worth a quick amend to the PR body for accuracy, not a reason to hold the change.

No other issues found — no SOLID/DP/async/cross-platform/event-declaration concerns, no new warnings or suppressions, commit messages follow Conventional Commits, and the diff is now fully scoped to what the title describes.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved issues were identified that would block approval.

Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@MartinZikmund

Copy link
Copy Markdown
Member Author

🤖 Addressed PR comments up to this point

  • @morning4coffe-dev: "the removed recycle visibility pass is redundant with the container lifecycle; no significant issue" — Approval, no action needed. The PR's own commit is unchanged by the rebase; force-push may stale the approval.
  • @nventive-devops: "Automated UI snapshot diff report for build 234033..." — Automated report from the old head, not review feedback; a new CI run regenerates it for ce98ced, and the "Validated Screenshots Compare Test Run" checklist item stays pending.

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 234487 found UI Test snapshots differences: skia-linux-screenshots: 57, skia-windows-screenshots: 2310, wasm: 11

Details
  • skia-linux-screenshots: 57 changed over 2348

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Buttons.png-dark
    • Buttons.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ClipboardTests.png-dark
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • DisplayInformation.png-dark
    • ContextRequested.png-dark
    • ContextRequested.png
    • Focus_FocusVisual_Properties.png-dark
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • ImageIconPage.png-dark
    • Image_AnimatedWebP.png-dark
    • Image_AnimatedWebP.png
    • ListViewHeaderUpdate.png-dark
    • Examples.png-dark
  • skia-windows-screenshots: 2310 changed over 2408

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AndroidWindowInsets.png-dark
    • AppBarButtonTest.png
    • AppBar_KeyBoard.png-dark
    • ApplicationViewSizing.png
    • AppWindowFeatures.png
    • ArcSegment.png-dark
    • Attributed_text_FontSize_Changing.png-dark
    • AuthenticationBroker_Demo.png
    • AutoBorderStretchwithrightmargin.png
    • AutoBorderStretchwithtopmargin.png-dark
    • AutoSuggestBox_BitmapIcon.png-dark
    • AutoSuggestBox_BitmapIcon.png
    • BadgeNotificationTests.png-dark
    • BadgeNotificationTests.png
    • Basics.png-dark
    • Basics.png
    • BeginTime_MultipleAnimations.png-dark
    • BeginTime_MultipleAnimations.png
    • BitmapIcon_Sizing.png-dark
    • BitmapIcon_Sizing.png
  • wasm: 11 changed over 1076

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • UITests.Shared.Microsoft_UI_Xaml_Controls.ExpanderTests.WinUIExpanderPage
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewSelectedItems
    • UITests.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_NavigationProperties
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Minimal
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Ogg_Extension
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ListView.ListView_IsSelected
    • SamplesApp.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_EnableDevTools
    • UITests.Uno_Web.Http.CookieManagerTests
    • UITests.Windows_UI_Xaml_Media_Animation.ColorAnimation_Background
    • UITests.Windows_UI_Xaml_Controls.CalendarView.CalendarView_Theming
    • Uno.UI.Samples.Content.UITests.WebView.WebView_AnchorNavigation

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 234487 has failed on Uno.UI - CI.

@MartinZikmund
MartinZikmund force-pushed the dev/mazi/perf-virtualizing-visibilities branch from ce98ced to 9207078 Compare October 3, 2026 08:46
Copilot AI lite review requested due to automatic review settings October 3, 2026 08:46
@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 38s —— View job


Review complete ✅

  • Gather context (diff, changed files, AGENTS.md rules)
  • Review current PR scope (re-checked after synchronize event)
  • Review core change: VirtualizingPanelGenerator/VirtualizingPanelLayout
  • Review the Given_DependencyObjectCollection.cs cref fix
  • Post summary

Verdict: ship (0 findings — no new inline comments posted)

What changed since the last review round

No functional diff since the previous @claude pass — the branch is still exactly 2 commits ahead of origin/master, and the diff (+1/-19 over 3 files) is unchanged from what was already reviewed:

  • 2c91d484 — removes VirtualizingPanelGenerator.UpdateVisibilities() and its sole call site in VirtualizingPanelLayout.UpdateCompleted().
  • 9207078d — fixes the dangling <see cref> in Given_DependencyObjectCollection.cs:98, now correctly pointing at When_Subtree_Reenters_Tree_Then_Items_In_Collections_Are_Updated (verified to exist at line 62).

Verified by inspection

  • grep confirms zero remaining references to UpdateVisibilities anywhere in src/.
  • RecycleViewForItem (VirtualizingPanelGenerator.managed.cs:186–205) pushes the container onto _itemContainerCache and then removes it from Panel.Children synchronously (parent.Children.Remove(container)), before any later call could reach the deleted UpdateVisibilities(). TryDequeueCachedContainer (:133–152) resets Visibility = Visibility.Visible on reuse and is correctly left untouched — it runs once per dequeue, not once per layout cycle, and still covers a container collapsed by app code or an ItemContainerStyle. This confirms the removed write was provably dead, not just redundant.

Cross-cutting notes (non-blocking, carried over from the prior round — still accurate)

  • The PR is now fully scoped to its title/description (the earlier round's finding about 4 bundled commits is resolved and doesn't apply to this diff).
  • No new test is added, which is consistent with the "no observable behavior change" framing — correctness now rests on the invariant that recycled containers are always detached from Panel.Children before any future visibility-style pass would run. Worth keeping in mind for future changes in this area, not a blocker here.
  • No SOLID/DP/async/cross-platform/event-declaration issues, no new warnings/suppressions, commit messages follow Conventional Commits.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MartinZikmund and others added 2 commits October 9, 2026 14:21
UpdateVisibilities() collapsed every container in the recycle pool once per
layout cycle, but since 8fef29f a recycled container is removed from
Panel.Children before being cached, so the write lands on a detached element
and has no visual effect. Its doc comment describes batching toggles to help
WebAssembly scrolling, which dated from when pooled containers stayed attached
and Visibility drove DOM visibility.

The paired Visible assignment in TryDequeueCachedContainer is kept on purpose:
it runs once per dequeue rather than per layout cycle, and it still covers a
container collapsed by an app or an ItemContainerStyle.

Given_ListViewBase and Given_ItemsControl (169 tests, Skia Desktop) report an
identical result with and without this change, including the same 7 failures,
which are pre-existing on this base.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_012QzKQawubFcPPX9JSoZLkX
Copilot AI lite review requested due to automatic review settings October 9, 2026 12:23
@MartinZikmund
MartinZikmund force-pushed the dev/mazi/perf-virtualizing-visibilities branch from 9207078 to 9f398a2 Compare October 9, 2026 12:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 14s —— View job


Review complete ✅

Verdict: ship (0 blocking findings, 0 inline comments)

The diff is unchanged in substance since the last round: 2 commits, +1/−19 over 3 files.

  • Removes VirtualizingPanelGenerator.UpdateVisibilities() and its only call site in VirtualizingPanelLayout.UpdateCompleted().
  • Fixes the dangling <see cref> in Given_DependencyObjectCollection.cs. It now points at When_Subtree_Reenters_Tree_Then_Items_In_Collections_Are_Updated.

Checked by inspection (code review only; I did not build or run tests in this pass):

  • No references to UpdateVisibilities remain in any source file. The only grep hit is a binary match in aot.profile, which is a profile artifact and not source.
  • The paired Visibility = Visible reset in TryDequeueCachedContainer is correctly left in place.
  • The removal is dead-code removal, so it counts as a root-cause fix and not defensive hardening.

Notes (non-blocking):

  • Correctness depends on the invariant that recycled containers are detached from Panel.Children. A future change that keeps pooled containers attached would need to bring a visibility pass back.
  • The "per scroll step" framing in the PR body is probably inaccurate. A previous review round noted that UpdateCompleted() only runs when !isScroll. A small edit to the PR body would fix that. It does not affect the change itself.
  • The screenshot-diff reports from build 234487 are large (about 2,300 on Windows). They look unrelated to a no-op removal and are probably baseline or infrastructure noise, but confirm this on a fresh CI run before merging. The "Screenshots Compare" checklist item is still pending.

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 238522 found UI Test snapshots differences: skia-linux-screenshots: 118, skia-windows-screenshots: 1190

Details
  • skia-linux-screenshots: 118 changed over 2458

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • Buttons.png
    • CompositionEffectBrush.png-dark
    • CompositionEffectBrush.png
    • CompositionNineGridBrush_Source_Changes.png-dark
    • CompositionNineGridBrush_Source_Changes.png
    • ClipboardTests.png-dark
    • DynamicFont.png-dark
    • DynamicFont.png
    • DisplayInformation.png-dark
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • ImageBrushAlignmentXY.png-dark
    • ImageBrushAlignmentXY.png
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
  • skia-windows-screenshots: 1190 changed over 2474

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ApplicationViewSpanningRectsPage.png-dark
    • Attributed_text_Simple.png-dark
    • AutoBorderStretchwithleftmargin.png-dark
    • BackGesture.png-dark
    • BackGesture.png
    • BorderBottomwithmargins.png-dark
    • BorderBottomwithmargins.png
    • Button_IsEnabled_Automated.png-dark
    • Button_IsEnabled_Automated.png
    • CalendarDatePicker_Description.png-dark
    • CalendarDatePicker_Description.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ClippingWithOpacity.png-dark
    • ClippingWithOpacity.png
    • ComboBox_Popover.png-dark
    • ComboBox_Popover.png
    • ComboBox_ScrollViewer.png-dark
    • ComboBox_ScrollViewer.png
    • AnimatedIconPage.png-dark

@mergify

mergify Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@MartinZikmund
MartinZikmund merged commit f7a78d4 into master Oct 9, 2026
50 checks passed
@MartinZikmund
MartinZikmund deleted the dev/mazi/perf-virtualizing-visibilities branch October 9, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove the dead visibility pass over the ListView recycle pool

5 participants