Skip to content

[Perf] Share PropertyChanged handlers between compiled bindings of an object - #40903

Draft
simonrozsival wants to merge 8 commits into
mainfrom
simonrozsival-shared-propertychanged-subscriptions
Draft

simonrozsival wants to merge 8 commits into
mainfrom
simonrozsival-shared-propertychanged-subscriptions

Conversation

@simonrozsival

Copy link
Copy Markdown
Member

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: da8e79326c24a5005427517a4fb698867980c4a7

Dimension Assessment Rationale
Change confidence 7/10 ↑ Controls.Core.UnitTests (7,971 tests) and Controls.Xaml.UnitTests (1,655 tests) pass with 0 failures on a local merge with main 18ccee2.
↑ 22 new test cases cover sharing, order, re-entrancy, a failed registration, collected bindings and objects, and other threads; 17 of them fail on main's engine.
↑ The scroll benchmark allocates exactly 2,736 B less per row on Android and 3,480 B less on Mac Catalyst.
↓ Handlers run in a different order when bindings share one (documented and tested).
↓ Moving a single binding between objects measured about 2–3% slower on the host, up to +7.5%, near the harness's resolution.
↓ Concurrency is covered by one stress test; no device tests, UI tests or CI results yet.

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Target Branch

This PR is for Initial base
New features, API changes, or .NET 12 work (including .NET 12 fixes) main
.NET 11 servicing fixes net11, for review
Older servicing, release integration, infrastructure, or documentation The branch designated for that work

For .NET 11 fixes, only a maintainer retargets the approved PR to the active
inflight lane and merges it after CI validates that final base. Do not merge
individual fixes directly into net11; agents must not retarget or merge.

Description of Change

This is a draft because the design needs the binding owners' agreement before review. It changes the order in which PropertyChanged handlers run when bindings share one (documented and tested below). Also, moving a single binding between objects measured about 2–3% slower on the host (up to +7.5% in one case), which is close to what the harness can resolve.

Problem

Each compiled binding (TypedBinding) adds its own PropertyChanged handler to every INotifyPropertyChanged object on its path. The bindings of an item template all observe the item. So when a CollectionView recycles a row, every binding removes its handler from the old item and adds one to the new item. Each add or remove copies the event's invocation list, so a rebind costs time and memory in proportion to the square of the number of bindings per object.

The rows of the CollectionView scroll benchmark below have 13 compiled bindings. On Android, this churn (TypedBindingSubscriptions.TryDetach and Listener.Attach) accounts for 13% of the bytes that the UI thread allocates, and Delegate.RemoveImpl for 2.5% of its exclusive CPU time.

Change

In TypedBindingListeners.cs, the listeners of an object share one handler that notifies each of them:

  • The first listener of an object adds its own handler, as before. Its thread remembers it in a list of the 16 shared subscriptions and listeners it used most recently.
  • The next listener of the object finds it there and registers a SharedSubscription: one handler that notifies its listeners in the order they joined. Later listeners of the object join it. The first listener keeps its own handler on that object, and shares from the next object it observes.
  • A listener whose object no other listener observed adds its own handler from then on, without looking. So an object with a single binding keeps today's path. Value types, which every walk boxes again, always use their own handler.
  • The last listener to leave removes the shared handler. Each thread pools up to 8 freed subscriptions and reuses them, together with their weak reference.
  • A listener in a shared subscription doesn't allocate a delegate or a weak reference of its own.

A rebind of the benchmark's row now removes and adds one shared handler on the item, plus one for the nested Owner path, instead of 14 each. A view model that 1,000 bindings observe has 2 handlers instead of 1,000.

What's preserved

  • Property names are filtered per listener: null or empty means all properties, and indexer names match as before.
  • Re-entrancy: a binding removed during a notification isn't notified by it, and a binding added during a notification is notified by the next one. User code can move a row to another item during a notification, so that the freed subscription is reused for that item. The running notification then stops, so the moved bindings aren't notified by it.
  • Memory: as today, the object references the handler, the handler its listeners, and each listener its binding only weakly. The listeners of a collected binding leave through its finalizer or on the next notification, and the last one removes the shared handler. The thread's list references objects only weakly, so it doesn't keep them alive.
  • Threads and dispatching: notifications still go through the binding's dispatcher check (DispatchIfRequired). Only the thread that registered a shared subscription adds listeners to it. Any thread, including the finalizer thread, removes them, under a lock.
  • Event accessors that throw: the next walk retries, as today. No listener joins a shared handler whose registration threw.

Behavior changes

  • Order: bindings that share a handler are notified in the order they joined, at the position of the shared handler among the object's handlers. The first binding of an object keeps its own position. So if other code adds a PropertyChanged handler between the second and the third compiled binding of an object, the third and later bindings now run before that handler instead of after it. BindingsThatShareAHandlerAreNotifiedInOrderAtItsPosition documents this, and the existing GeneratedAliasedBroadcastPreservesEventOrdering passes unchanged.
  • Handler count: an object that several compiled bindings observe has fewer PropertyChanged handlers. Code that inspects the invocation list can observe this.
  • Limit: if a thread observes more than about 16 other objects between two bindings of the same object, the bindings don't find each other. Each then adds its own handler, as today.

Results

Measured against main bd40bc6, which this branch starts from. #40849 wasn't merged yet, and the combination wasn't measured. The device builds were made from d1d1fda0b6, which has the same tree as this PR's commit (0d2644433f) with an earlier commit message. SDK 12.0.100-alpha.1.26523.103, CoreCLR.

CollectionView scroll benchmark (source, pushed for reference and not part of this PR): a CollectionView of 1,000 items is scrolled programmatically on every frame. Its rows have 13 compiled bindings: strings, numbers, a DateTime, an enum, a Color, a nested path, StringFormats, converters and a two-way binding. Each build ran in 8 interleaved launches of 5 warm passes. The table shows medians of the launches, and the median paired difference with its 95% sign-test interval. Allocations, GC and JIT counts are exact per build.

  • Android: emulator (pixel_6 AVD with the android-35;google_apis;arm64-v8a image, 4 cores, 4 GB), Android 15, on an Apple M5 Max.
  • Mac Catalyst: Apple M5 Max, macOS 26.7.3.
UI thread Android, main Android, this PR Mac Catalyst, main Mac Catalyst, this PR
Allocated per row, warm passes 20,009 B 17,273 B (−2,736 B, −13.7%) 29,207 B 25,726 B (−3,480 B, −11.9%)
Allocated per row, cold pass 21,469 B 18,750 B (−12.7%) 49,717 B 46,972 B (−5.5%)
Gen0 GCs per pass 2 2 1 0
Rebind per row 176.5 µs 158.8 µs; −6.1 µs [−51.5, +17.8] 610.1 µs 594.0 µs; −4.1 µs [−55.3, +39.7]
CPU time per row 1,193.7 µs 1,143.0 µs; +39.4 µs [−211.4, +141.1] 2,915.9 µs 2,867.2 µs; −15.2 µs [−285.4, +308.9]
  • None of the timing differences is significant; the emulator resolves only changes of about 20%.
  • On Mac Catalyst, the GC pause per pass drops from 2.6 ms to 0.
  • On Android, the UI thread JITs 14 more methods for the new code at startup (7,033 → 7,047) and 5 more in the first pass (54 → 59). JIT time doesn't change significantly (+11 ms [−110, +239] at startup).
  • Mac Catalyst JITs the same 196 methods.

Host microbenchmarks: TypedBindingDepthBenchmarker and TypedBindingIntermediateBenchmarker from src/Core/tests/Benchmarks, and the benchmark branch's CollectionViewRecyclingBenchmarker, which rebinds one row of the scroll benchmark's template without platform views. Release builds of main and this PR run in one process, each in its own AssemblyLoadContext, alternating every round. Each run has 60 rounds of 20 ms; the table shows the median of the per-round ratios, with its 95% sign-test interval in the first two rows. Apple M5 Max, macOS 26.7.3, load average 25–40. Two runs:

Case Time, run 1 Time, run 2 Allocated per operation
CollectionViewRecycling.Rebind −8.5% [−13.1, −0.2] 4,839 → 2,103 B (−56.5%)
CollectionViewRecycling.CreateAndBind −2.0% [−13.4, +6.3] 89,270 → 88,001 B
CreateApplyAndRemove, depth 1, 3, 7 (generated) −7.5%, −1.9%, −18.7% −4.0%, −4.6%, −16.8% 800 → 728, 1,296 → 1,080, 2,288 → 1,784 B
CreateApplyAndRemove, depth 1, 3, 7 (legacy) −3.8%, −10.3%, −12.1% −1.6%, −13.1%, −12.1% 816 → 744, 1,408 → 1,192, 2,592 → 2,088 B
LeafUpdate, depth 1, 3, 7 (both shapes) −5.4% to +0.9% −5.3% to +0.3% 0 → 0
ContextSwap, depth 1, 3, 7 (generated) +3.2%, +1.7%, +2.7% −1.8%, +1.9%, +2.1% 40 → 40
ContextSwap, depth 1, 3, 7 (legacy) +4.8%, −0.9%, +5.3% +2.8%, +1.9%, +7.5% 40 → 40
IntermediateReplace, depth 2, 7 (generated) −0.2%, +1.9% +0.1%, +2.9% 0 → 0
IntermediateReplace, depth 2, 7 (legacy) −1.6%, +3.3% +0.5%, +2.3% 0 → 0
  • CreateApplyAndRemove applies a second binding to objects that another binding already observes, so its listeners share a handler. That saves 72 B per path object: they allocate no delegate or weak reference of their own, and each listener is 16 B larger.
  • ContextSwap and IntermediateReplace move a single binding between objects. Its listeners keep their own handlers, behind a few more checks than today.
    • 10 of the 12 ContextSwap estimates are positive (median +2.4%), and 3 of the 12 intervals exclude zero (+3.2%, +4.8%, +7.5%). IntermediateReplace at depth 7 is +1.9% to +3.3%.
    • A run with main in both slots gave ContextSwap differences from −8.7% to +1.0%, and 3 of its 6 intervals excluded zero. So single intervals understate the uncertainty, but a cost of about 2–3% on these paths is plausible.
    • A possible follow-up is to fold those checks into one.
  • LeafUpdate, a notification through a binding's own handler, is unchanged.
Raw host results

base and cand are medians of the rounds; paired is the median of the per-round ratios, with its 95% interval.

Run 1: main (base) vs this PR (cand)
LeafUpdate Depth=1 Kind=Generated base 24.5 ns cand 24.6 ns paired: -0.5% [-3.7%, 2.8%] B/op 0 -> 0
ContextSwap Depth=1 Kind=Generated base 94.0 ns cand 93.2 ns paired: 3.2% [0.6%, 5.1%] B/op 40 -> 40
CreateApplyAndRemove Depth=1 Kind=Generated base 429.1 ns cand 388.8 ns paired: -7.5% [-13.1%, -2.0%] B/op 800 -> 728
LeafUpdate Depth=3 Kind=Generated base 39.4 ns cand 38.1 ns paired: -2.5% [-6.7%, 3.3%] B/op 0 -> 0
ContextSwap Depth=3 Kind=Generated base 132.1 ns cand 133.6 ns paired: 1.7% [-1.4%, 7.9%] B/op 40 -> 40
CreateApplyAndRemove Depth=3 Kind=Generated base 604.9 ns cand 608.1 ns paired: -1.9% [-5.1%, 2.4%] B/op 1296 -> 1080
LeafUpdate Depth=7 Kind=Generated base 49.7 ns cand 53.4 ns paired: 0.9% [-0.7%, 6.3%] B/op 0 -> 0
ContextSwap Depth=7 Kind=Generated base 186.9 ns cand 189.8 ns paired: 2.7% [-0.2%, 6.4%] B/op 40 -> 40
CreateApplyAndRemove Depth=7 Kind=Generated base 1086.3 ns cand 893.3 ns paired: -18.7% [-20.7%, -13.8%] B/op 2288 -> 1784
IntermediateReplace Depth=2 Kind=Generated base 82.3 ns cand 82.3 ns paired: -0.2% [-1.6%, 1.4%] B/op 0 -> 0
IntermediateReplace Depth=7 Kind=Generated base 130.5 ns cand 134.9 ns paired: 1.9% [0.5%, 4.0%] B/op 0 -> 0
LeafUpdate Depth=1 Kind=Legacy base 33.9 ns cand 34.4 ns paired: 0.1% [-3.0%, 1.4%] B/op 0 -> 0
ContextSwap Depth=1 Kind=Legacy base 98.4 ns cand 106.0 ns paired: 4.8% [0.7%, 10.6%] B/op 40 -> 40
CreateApplyAndRemove Depth=1 Kind=Legacy base 528.4 ns cand 505.6 ns paired: -3.8% [-14.6%, 8.6%] B/op 816 -> 744
LeafUpdate Depth=3 Kind=Legacy base 43.8 ns cand 41.9 ns paired: -2.8% [-9.0%, 4.3%] B/op 0 -> 0
ContextSwap Depth=3 Kind=Legacy base 143.2 ns cand 140.4 ns paired: -0.9% [-6.6%, 2.3%] B/op 40 -> 40
CreateApplyAndRemove Depth=3 Kind=Legacy base 816.1 ns cand 734.9 ns paired: -10.3% [-16.3%, -4.5%] B/op 1408 -> 1192
LeafUpdate Depth=7 Kind=Legacy base 61.5 ns cand 58.7 ns paired: -5.4% [-14.0%, 0.2%] B/op 0 -> 0
ContextSwap Depth=7 Kind=Legacy base 229.2 ns cand 233.6 ns paired: 5.3% [-0.3%, 8.1%] B/op 40 -> 40
CreateApplyAndRemove Depth=7 Kind=Legacy base 1338.0 ns cand 1191.5 ns paired: -12.1% [-16.5%, -9.0%] B/op 2592 -> 2088
IntermediateReplace Depth=2 Kind=Legacy base 52.5 ns cand 52.6 ns paired: -1.6% [-7.0%, 2.0%] B/op 0 -> 0
IntermediateReplace Depth=7 Kind=Legacy base 163.8 ns cand 174.4 ns paired: 3.3% [-0.8%, 10.5%] B/op 0 -> 0
CollectionViewRecycling.Rebind base 4829.4 ns cand 4239.2 ns paired: -8.5% [-13.1%, -0.2%] B/op 4839 -> 2103
CollectionViewRecycling.CreateAndBind base 118861.2 ns cand 118646.7 ns paired: -2.0% [-13.4%, 6.3%] B/op 89270 -> 88001

Run 2: main (base) vs this PR (cand), TypedBinding cases
LeafUpdate Depth=1 Kind=Generated base 25.2 ns cand 24.9 ns paired: -0.4% [-6.3%, 3.7%] B/op 0 -> 0
ContextSwap Depth=1 Kind=Generated base 82.9 ns cand 79.6 ns paired: -1.8% [-3.4%, -0.2%] B/op 40 -> 40
CreateApplyAndRemove Depth=1 Kind=Generated base 334.8 ns cand 322.1 ns paired: -4.0% [-9.4%, -1.4%] B/op 800 -> 728
LeafUpdate Depth=3 Kind=Generated base 31.2 ns cand 31.0 ns paired: -1.9% [-3.4%, -0.7%] B/op 0 -> 0
ContextSwap Depth=3 Kind=Generated base 125.5 ns cand 127.0 ns paired: 1.9% [-1.7%, 3.9%] B/op 40 -> 40
CreateApplyAndRemove Depth=3 Kind=Generated base 549.5 ns cand 523.6 ns paired: -4.6% [-7.5%, -2.8%] B/op 1296 -> 1080
LeafUpdate Depth=7 Kind=Generated base 46.0 ns cand 45.1 ns paired: -1.7% [-7.2%, 3.2%] B/op 0 -> 0
ContextSwap Depth=7 Kind=Generated base 175.2 ns cand 178.5 ns paired: 2.1% [-0.7%, 4.2%] B/op 40 -> 40
CreateApplyAndRemove Depth=7 Kind=Generated base 949.6 ns cand 796.9 ns paired: -16.8% [-18.8%, -14.5%] B/op 2288 -> 1784
IntermediateReplace Depth=2 Kind=Generated base 44.0 ns cand 44.5 ns paired: 0.1% [-1.5%, 2.2%] B/op 0 -> 0
IntermediateReplace Depth=7 Kind=Generated base 133.1 ns cand 139.9 ns paired: 2.9% [-1.3%, 5.5%] B/op 0 -> 0
LeafUpdate Depth=1 Kind=Legacy base 33.8 ns cand 33.2 ns paired: -0.4% [-4.1%, 2.3%] B/op 0 -> 0
ContextSwap Depth=1 Kind=Legacy base 95.8 ns cand 102.8 ns paired: 2.8% [-0.8%, 6.7%] B/op 40 -> 40
CreateApplyAndRemove Depth=1 Kind=Legacy base 350.9 ns cand 352.8 ns paired: -1.6% [-7.3%, 0.0%] B/op 816 -> 744
LeafUpdate Depth=3 Kind=Legacy base 37.4 ns cand 35.9 ns paired: -5.3% [-7.3%, -0.7%] B/op 0 -> 0
ContextSwap Depth=3 Kind=Legacy base 121.0 ns cand 124.0 ns paired: 1.9% [-0.2%, 4.2%] B/op 40 -> 40
CreateApplyAndRemove Depth=3 Kind=Legacy base 631.5 ns cand 534.7 ns paired: -13.1% [-16.4%, -10.5%] B/op 1408 -> 1192
LeafUpdate Depth=7 Kind=Legacy base 45.8 ns cand 45.9 ns paired: 0.3% [-3.5%, 1.9%] B/op 0 -> 0
ContextSwap Depth=7 Kind=Legacy base 190.0 ns cand 204.0 ns paired: 7.5% [3.4%, 10.5%] B/op 40 -> 40
CreateApplyAndRemove Depth=7 Kind=Legacy base 1132.6 ns cand 979.2 ns paired: -12.1% [-16.0%, -9.4%] B/op 2592 -> 2088
IntermediateReplace Depth=2 Kind=Legacy base 49.6 ns cand 49.8 ns paired: 0.5% [-2.0%, 4.9%] B/op 0 -> 0
IntermediateReplace Depth=7 Kind=Legacy base 136.5 ns cand 143.2 ns paired: 2.3% [0.0%, 5.9%] B/op 0 -> 0

A/A: main in both slots
ContextSwap Depth=1 Kind=Generated base 132.0 ns cand 110.5 ns paired: 0.5% [-4.2%, 5.7%] B/op 40 -> 40
ContextSwap Depth=3 Kind=Generated base 128.2 ns cand 129.8 ns paired: 1.0% [-3.1%, 4.0%] B/op 40 -> 40
ContextSwap Depth=7 Kind=Generated base 223.4 ns cand 208.9 ns paired: -2.7% [-6.8%, -0.1%] B/op 40 -> 40
ContextSwap Depth=1 Kind=Legacy base 116.1 ns cand 112.6 ns paired: -1.0% [-4.4%, 7.7%] B/op 40 -> 40
ContextSwap Depth=3 Kind=Legacy base 150.2 ns cand 144.8 ns paired: -4.1% [-6.8%, -2.1%] B/op 40 -> 40
ContextSwap Depth=7 Kind=Legacy base 255.0 ns cand 230.6 ns paired: -8.7% [-12.9%, -5.7%] B/op 40 -> 40

Tests

I merged this branch into main 18ccee2 locally (not pushed) and built each test project with ./.dotnet/dotnet build <project> -c Debug -p:MauiPlatforms= -p:IncludePreviousTfms=false:

  • artifacts/bin/Controls.Core.UnitTests/Debug/net12.0/Microsoft.Maui.Controls.Core.UnitTests --progress off: 7,971 total, 7,941 passed, 30 skipped, 0 failed.
  • artifacts/bin/Controls.Xaml.UnitTests/Debug/net12.0/Microsoft.Maui.Controls.Xaml.UnitTests --progress off: 1,655 total, 1,652 passed, 3 skipped, 0 failed.

On this branch, before main moved on:

New cases in TypedBindingCompatibilityTests, each for both binding shapes (Legacy, Subscriber) unless noted:

  • Sharing: BindingsOfAnObjectShareOneHandler, ManyBindingsOfAnObjectShareItsHandler (one shape), BindingsOfObjectsObservedInTurnsAreEachNotifiedOnce.
  • Order: BindingsThatShareAHandlerAreNotifiedInOrderAtItsPosition.
  • Re-entrancy: BindingRemovedDuringANotificationIsNotNotifiedByIt, BindingAddedDuringANotificationIsNotifiedByTheNextOne, BindingsMovedToAnotherObjectDuringANotificationAreNotNotifiedByIt.
  • Failed registration: BindingDoesNotJoinASharedHandlerThatFailedToRegister.
  • GC and leaks: SharedHandlerIsRemovedAfterItsLastBindingIsCollected, NotificationRemovesTheListenersOfCollectedBindings, ObjectIsCollectableAfterItsBindingsStopObservingIt.
  • Threads: SharedHandlerWorksWithOtherThreads (one shape).

Not run: device tests, UI tests, SourceGen unit tests, the scroll benchmark on iOS and Windows, and CI.

Issues Fixed

None; there's no issue for this. Related:

Let AI finish this PR

  • Let the MAUI agent address review feedback and fix remaining issues on this PR. Maintainers still decide whether it is merged. For PRs from forks, keep "Allow edits by maintainers" on so the agent can push to your branch; otherwise it opens a follow-up PR that keeps your commits.

Every compiled binding (TypedBinding) added its own PropertyChanged handler to
each object on its path. The bindings of an item template all observe the
item, so a recycled row removed and added one handler per binding on every
rebind. Each add or remove copies the invocation list of the event, so the
cost grows with the square of the number of bindings per object. In the
CollectionView scroll benchmark (13 compiled bindings per row) this churn was
13% of the bytes that the UI thread allocates on Android.

Listeners of the same object now share one handler that fans out to them:

- The first listener of an object adds its own handler, as before, and the
  thread remembers it in a short list of the objects it observed last
  (16 entries).
- The next listener of that object registers a shared subscription, which the
  later ones join. The first listener keeps its own handler on that object,
  and shares from the next object it observes on.
- A listener whose object no other listener observed keeps adding its own
  handler without looking, so an object with one binding costs what it did.
  Value types, which every walk boxes again, always use their own handler.
- The last listener to leave removes the shared handler. A freed subscription
  is pooled by its thread and reused, with its weak reference.

A recycled row now moves one handler per object instead of one per binding.

Preserved behavior:

- Property names are filtered per listener: null or empty means all
  properties, and indexer names match as before.
- A binding removed during a notification isn't notified by it. A binding
  added during a notification is notified by the next one. Bindings moved to
  another object during a notification aren't notified by it.
- Memory: the object references the shared handler, the handler its listeners,
  and each listener its binding only weakly, as before. The listeners of a
  collected binding leave through its finalizer or on the next notification,
  and the last one removes the handler.
- Dispatching is unchanged. Only the thread that registered a shared
  subscription adds listeners to it; any thread, including the finalizer
  thread, removes them, under a lock.
- When the event accessor throws, the next walk retries, as before.

Ordering: the bindings that share a handler are notified in the order in which
they joined, at the position of the shared handler. So the third and later
bindings of an object now run before a non-binding handler that was added
between the second and the third binding. The first binding keeps its own
position.

When a thread observes more objects between two bindings of an object than it
remembers, the bindings don't find each other, and each adds its own handler,
as before.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

This comment has been minimized.

@kubaflo

This comment has been minimized.

@kubaflo

This comment has been minimized.

@github-actions github-actions Bot 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.

Expert Review — 3 findings · ⚠️ 1 breaking change

Reviewed commit da8e793.

Warning

Existing apps would look or behave differently without opting in. See the Behavioral Change Disclosure findings at:

See inline comments for details.

@github-actions

This comment has been minimized.

@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/autopilot-running MAUI Autopilot loop is running; remove this label to stop it label Dec 1, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot added the s/autopilot-fixing MAUI Autopilot: fixing review findings or failing tests (GPT-6.2 Sol vs MAI Code 2) label Dec 1, 2026
github-actions Bot and others added 3 commits December 1, 2026 01:18
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added s/autopilot-reviewing MAUI Autopilot: MAUI expert review in progress and removed s/autopilot-fixing MAUI Autopilot: fixing review findings or failing tests (GPT-6.2 Sol vs MAI Code 2) labels Dec 1, 2026

@github-actions github-actions Bot 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.

Expert Review — 1 finding

Reviewed commit 38847d2.

See inline comments for details.

@github-actions github-actions Bot added s/autopilot-fixing MAUI Autopilot: fixing review findings or failing tests (GPT-6.2 Sol vs MAI Code 2) and removed s/autopilot-reviewing MAUI Autopilot: MAUI expert review in progress labels Dec 1, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added s/autopilot-reviewing MAUI Autopilot: MAUI expert review in progress s/autopilot-retrying maui-expert-autopilot: retrying a step that failed once and removed s/autopilot-fixing MAUI Autopilot: fixing review findings or failing tests (GPT-6.2 Sol vs MAI Code 2) labels Dec 1, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot 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.

Expert Review — 1 finding

Reviewed commit 170a19b.

See inline comments for details.

@github-actions github-actions Bot added s/autopilot-fixing MAUI Autopilot: fixing review findings or failing tests (GPT-6.2 Sol vs MAI Code 2) and removed s/autopilot-retrying maui-expert-autopilot: retrying a step that failed once s/autopilot-reviewing MAUI Autopilot: MAUI expert review in progress labels Dec 1, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added s/autopilot-reviewing MAUI Autopilot: MAUI expert review in progress and removed s/autopilot-fixing MAUI Autopilot: fixing review findings or failing tests (GPT-6.2 Sol vs MAI Code 2) labels Dec 1, 2026

@github-actions github-actions Bot 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.

Expert Review — 1 finding

Reviewed commit 52464bc.

See inline comments for details.

@github-actions github-actions Bot added s/autopilot-fixing MAUI Autopilot: fixing review findings or failing tests (GPT-6.2 Sol vs MAI Code 2) and removed s/autopilot-reviewing MAUI Autopilot: MAUI expert review in progress labels Dec 1, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added s/autopilot-reviewing MAUI Autopilot: MAUI expert review in progress and removed s/autopilot-fixing MAUI Autopilot: fixing review findings or failing tests (GPT-6.2 Sol vs MAI Code 2) labels Dec 1, 2026

@github-actions github-actions Bot 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.

Expert Review — 1 finding

Reviewed commit cf52e4b.

See inline comments for details.

@github-actions github-actions Bot added s/autopilot-fixing MAUI Autopilot: fixing review findings or failing tests (GPT-6.2 Sol vs MAI Code 2) and removed s/autopilot-reviewing MAUI Autopilot: MAUI expert review in progress labels Dec 1, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added s/autopilot-reviewing MAUI Autopilot: MAUI expert review in progress and removed s/autopilot-fixing MAUI Autopilot: fixing review findings or failing tests (GPT-6.2 Sol vs MAI Code 2) labels Dec 1, 2026

@github-actions github-actions Bot 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.

Expert Review — No more findings

Reviewed commit 147e7f8.

@github-actions github-actions Bot added s/autopilot-testing MAUI Autopilot: relevant UI/device tests are being selected or run and removed s/autopilot-reviewing MAUI Autopilot: MAUI expert review in progress labels Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Selected Tests

Result NOT QUEUED Platforms Android, iOS, MacCatalyst, Windows Tests all UI, 56 device Commit 147e7f81


🧪 Test selection — click to expand
Suite Result Selected Build
UI tests ❌ not queued all 77 categories —
Device tests ❌ not queued 56 of 105 units —
🧪 UI tests — the full suite on every platform

❌ Could not queue maui-pr-uitests: Azure Pipelines did not start maui-pr-uitests for the dispatch branch run-tests/pr40903-46586116315 within 10 minutes. Comment /review run-tests again, or use /azp run maui-pr-uitests for the full suite.

GPT-6.2 Sol: Compiled-binding listeners now share PropertyChanged handlers, so run CollectionView and CarouselView UI tests on all four platforms.
MAI Code 2: Cross-platform compiled-binding listener sharing changes behavior for bindings across the Controls UI surface; run the complete UI suite on all platforms and all Controls device tests.

🧪 Running — 77 categories on Android, iOS, MacCatalyst, Windows

The complete maui-pr-uitests suite runs on every platform (same as /azp run).

🧪 Device tests — Controls.Accessibility, Controls.Animations, Controls.Application, Controls.Behavior +52 on Android, iOS, MacCatalyst, Windows

❌ Could not queue maui-pr-devicetests: Azure Pipelines did not start maui-pr-devicetests for the dispatch branch run-devicetests/pr40903-46586116315 within 10 minutes. Comment /review run-tests again, or use /azp run maui-pr-devicetests for the full suite.

GPT-6.2 Sol: Run targeted Controls device tests for item-template rebinding and listener lifetime on all four platforms.
MAI Code 2: Run all Controls device-test categories on every platform because shared compiled-binding subscriptions affect controls broadly, without expanding to unrelated Core, Graphics, or Essentials projects.

🧪 Running — 56 categories on Android, iOS, MacCatalyst, Windows

Platform Categories
Android Controls.Accessibility, Controls.Animations, Controls.Application, Controls.Behavior, Controls.Border, Controls.BoxView, Controls.Button, Controls.CarouselView, Controls.CheckBox, Controls.CollectionView, Controls.Compatibility, Controls.ContentView, Controls.DatePicker, Controls.Dispatcher, Controls.Editor, Controls.Element, Controls.Entry, Controls.FlexLayout, Controls.FlyoutPage, Controls.Frame, Controls.Gesture, Controls.HybridWebView, Controls.Image, Controls.Label, Controls.Layout, Controls.Lifecycle, Controls.Map, Controls.Mapper, Controls.Memory, Controls.MenuFlyout, Controls.Modal, Controls.NavigationPage, Controls.Page, Controls.PageTransitions, Controls.Path, Controls.Picker, Controls.RadioButton, Controls.RefreshView, Controls.ScrollView, Controls.SearchBar, Controls.Shape, Controls.Shell, Controls.Slider, Controls.SwipeView, Controls.Switch, Controls.TabbedPage, Controls.TemplatedView, Controls.TextInput, Controls.Toolbar, Controls.View, Controls.VisualElement, Controls.VisualElementTree, Controls.WebView, Controls.Window, Controls.WindowOverlay, Controls.Xaml
iOS Controls.Accessibility, Controls.Animations, Controls.Application, Controls.Behavior, Controls.Border, Controls.BoxView, Controls.Button, Controls.CarouselView, Controls.CheckBox, Controls.CollectionView, Controls.Compatibility, Controls.ContentView, Controls.DatePicker, Controls.Dispatcher, Controls.Editor, Controls.Element, Controls.Entry, Controls.FlexLayout, Controls.FlyoutPage, Controls.Frame, Controls.Gesture, Controls.HybridWebView, Controls.Image, Controls.Label, Controls.Layout, Controls.Lifecycle, Controls.Map, Controls.Mapper, Controls.Memory, Controls.MenuFlyout, Controls.Modal, Controls.NavigationPage, Controls.Page, Controls.PageTransitions, Controls.Path, Controls.Picker, Controls.RadioButton, Controls.RefreshView, Controls.ScrollView, Controls.SearchBar, Controls.Shape, Controls.Shell, Controls.Slider, Controls.SwipeView, Controls.Switch, Controls.TabbedPage, Controls.TemplatedView, Controls.TextInput, Controls.Toolbar, Controls.View, Controls.VisualElement, Controls.VisualElementTree, Controls.WebView, Controls.Window, Controls.WindowOverlay, Controls.Xaml
MacCatalyst Controls.Accessibility, Controls.Animations, Controls.Application, Controls.Behavior, Controls.Border, Controls.BoxView, Controls.Button, Controls.CarouselView, Controls.CheckBox, Controls.CollectionView, Controls.Compatibility, Controls.ContentView, Controls.DatePicker, Controls.Dispatcher, Controls.Editor, Controls.Element, Controls.Entry, Controls.FlexLayout, Controls.FlyoutPage, Controls.Frame, Controls.Gesture, Controls.HybridWebView, Controls.Image, Controls.Label, Controls.Layout, Controls.Lifecycle, Controls.Map, Controls.Mapper, Controls.Memory, Controls.MenuFlyout, Controls.Modal, Controls.NavigationPage, Controls.Page, Controls.PageTransitions, Controls.Path, Controls.Picker, Controls.RadioButton, Controls.RefreshView, Controls.ScrollView, Controls.SearchBar, Controls.Shape, Controls.Shell, Controls.Slider, Controls.SwipeView, Controls.Switch, Controls.TabbedPage, Controls.TemplatedView, Controls.TextInput, Controls.Toolbar, Controls.View, Controls.VisualElement, Controls.VisualElementTree, Controls.WebView, Controls.Window, Controls.WindowOverlay, Controls.Xaml
Windows Controls.Accessibility, Controls.Animations, Controls.Application, Controls.Behavior, Controls.Border, Controls.BoxView, Controls.Button, Controls.CarouselView, Controls.CheckBox, Controls.CollectionView, Controls.Compatibility, Controls.ContentView, Controls.DatePicker, Controls.Dispatcher, Controls.Editor, Controls.Element, Controls.Entry, Controls.FlexLayout, Controls.FlyoutPage, Controls.Frame, Controls.Gesture, Controls.HybridWebView, Controls.Image, Controls.Label, Controls.Layout, Controls.Lifecycle, Controls.Map, Controls.Mapper, Controls.Memory, Controls.MenuFlyout, Controls.Modal, Controls.NavigationPage, Controls.Page, Controls.PageTransitions, Controls.Path, Controls.Picker, Controls.RadioButton, Controls.RefreshView, Controls.ScrollView, Controls.SearchBar, Controls.Shape, Controls.Shell, Controls.Slider, Controls.SwipeView, Controls.Switch, Controls.TabbedPage, Controls.TemplatedView, Controls.TextInput, Controls.Toolbar, Controls.View, Controls.VisualElement, Controls.VisualElementTree, Controls.WebView, Controls.Window, Controls.WindowOverlay, Controls.Xaml
⏭️ Skipped — what neither suite runs

Device tests — 49 categories, 0 platforms

Categories not run: Core.ActivityIndicator, Core.Animation, Core.Application, Core.Border, Core.BoxView, Core.Button, Core.CheckBox, Core.ContentView, Core.DatePicker, Core.Dispatcher, Core.Editor, Core.Element, Core.Entry, Core.FlowDirection, Core.FlyoutView, Core.Fonts, Core.Formatting, Core.Graphics, Core.GraphicsView, Core.Image, Core.ImageButton, Core.ImageSource, Core.IndicatorView, Core.Label, Core.Layout, Core.Lifecycle, Core.MauiContext, Core.Memory, Core.NavigationPage, Core.Page, Core.Picker, Core.ProgressBar, Core.RadioButton, Core.RefreshView, Core.ScrollView, Core.SearchBar, Core.ShapeView, Core.Slider, Core.Stepper, Core.SwipeView, Core.Switch, Core.TimePicker, Core.View, Core.WebView, Core.Window, Core.WindowOverlay, Graphics, Essentials, BlazorWebView

Each skipped platform and project is listed as a maui-pr-devicetests (skipped) … status on this commit. Use /azp run maui-pr-devicetests for the full suite.

🤖 Why these tests — AI rationale (GPT-6.2 Sol + MAI Code 2)

UI tests

Each model chose independently; every test that runs was selected by at least one of them.

Platform GPT-6.2 Sol MAI Code 2
Android CollectionView1, CollectionView2, CollectionView3, CollectionView4, CollectionView5, CollectionView6, CollectionView7, CarouselView all categories
iOS CollectionView1, CollectionView2, CollectionView3, CollectionView4, CollectionView5, CollectionView6, CollectionView7, CarouselView all categories
MacCatalyst CollectionView1, CollectionView2, CollectionView3, CollectionView4, CollectionView5, CollectionView6, CollectionView7, CarouselView all categories
Windows CollectionView1, CollectionView2, CollectionView3, CollectionView4, CollectionView5, CollectionView6, CollectionView7, CarouselView all categories

GPT-6.2 Sol — Compiled-binding listeners now share PropertyChanged handlers, so run CollectionView and CarouselView UI tests on all four platforms.

  • TypedBindingListeners.cs changes notification and detach behavior when CollectionView rows rebind.
  • CarouselView item templates also change binding contexts as items are reused.
  • No base handler, layout, or build changes warrant a full run.

MAI Code 2 — Cross-platform compiled-binding listener sharing changes behavior for bindings across the Controls UI surface; run the complete UI suite on all platforms and all Controls device tests.

  • TypedBindingListeners.cs is shared Controls binding infrastructure used by compiled bindings across controls, templates, and platforms, so platform-specific narrowing is not safe.
  • Handler sharing changes notification ordering, attachment/detachment, re-entrancy, and lifetime behavior; that is a broad UI behavior change warranting a complete UI run.
  • The compatibility document changes only the switch contract and does not widen the implementation scope.
  • The changed tests are unit tests and have no UI test category hints; CollectionView is the motivating performance case, not the only affected consumer.

Device tests

Each model chose independently; every test that runs was selected by at least one of them.

Platform GPT-6.2 Sol MAI Code 2
Android Controls.CollectionView, Controls.CarouselView, Controls.Memory Controls.Accessibility, Controls.Animations, Controls.Application, Controls.Behavior, Controls.Border, Controls.BoxView, Controls.Button, Controls.CarouselView, Controls.CheckBox, Controls.CollectionView, Controls.Compatibility, Controls.ContentView, Controls.DatePicker, Controls.Dispatcher, Controls.Editor, Controls.Element, Controls.Entry, Controls.FlexLayout, Controls.FlyoutPage, Controls.Frame, Controls.Gesture, Controls.HybridWebView, Controls.Image, Controls.Label, Controls.Layout, Controls.Lifecycle, Controls.Map, Controls.Mapper, Controls.Memory, Controls.MenuFlyout, Controls.Modal, Controls.NavigationPage, Controls.Page, Controls.PageTransitions, Controls.Path, Controls.Picker, Controls.RadioButton, Controls.RefreshView, Controls.ScrollView, Controls.SearchBar, Controls.Shape, Controls.Shell, Controls.Slider, Controls.SwipeView, Controls.Switch, Controls.TabbedPage, Controls.TemplatedView, Controls.TextInput, Controls.Toolbar, Controls.View, Controls.VisualElement, Controls.VisualElementTree, Controls.WebView, Controls.Window, Controls.WindowOverlay, Controls.Xaml
iOS Controls.CollectionView, Controls.CarouselView, Controls.Memory Controls.Accessibility, Controls.Animations, Controls.Application, Controls.Behavior, Controls.Border, Controls.BoxView, Controls.Button, Controls.CarouselView, Controls.CheckBox, Controls.CollectionView, Controls.Compatibility, Controls.ContentView, Controls.DatePicker, Controls.Dispatcher, Controls.Editor, Controls.Element, Controls.Entry, Controls.FlexLayout, Controls.FlyoutPage, Controls.Frame, Controls.Gesture, Controls.HybridWebView, Controls.Image, Controls.Label, Controls.Layout, Controls.Lifecycle, Controls.Map, Controls.Mapper, Controls.Memory, Controls.MenuFlyout, Controls.Modal, Controls.NavigationPage, Controls.Page, Controls.PageTransitions, Controls.Path, Controls.Picker, Controls.RadioButton, Controls.RefreshView, Controls.ScrollView, Controls.SearchBar, Controls.Shape, Controls.Shell, Controls.Slider, Controls.SwipeView, Controls.Switch, Controls.TabbedPage, Controls.TemplatedView, Controls.TextInput, Controls.Toolbar, Controls.View, Controls.VisualElement, Controls.VisualElementTree, Controls.WebView, Controls.Window, Controls.WindowOverlay, Controls.Xaml
MacCatalyst Controls.CollectionView, Controls.CarouselView, Controls.Memory Controls.Accessibility, Controls.Animations, Controls.Application, Controls.Behavior, Controls.Border, Controls.BoxView, Controls.Button, Controls.CarouselView, Controls.CheckBox, Controls.CollectionView, Controls.Compatibility, Controls.ContentView, Controls.DatePicker, Controls.Dispatcher, Controls.Editor, Controls.Element, Controls.Entry, Controls.FlexLayout, Controls.FlyoutPage, Controls.Frame, Controls.Gesture, Controls.HybridWebView, Controls.Image, Controls.Label, Controls.Layout, Controls.Lifecycle, Controls.Map, Controls.Mapper, Controls.Memory, Controls.MenuFlyout, Controls.Modal, Controls.NavigationPage, Controls.Page, Controls.PageTransitions, Controls.Path, Controls.Picker, Controls.RadioButton, Controls.RefreshView, Controls.ScrollView, Controls.SearchBar, Controls.Shape, Controls.Shell, Controls.Slider, Controls.SwipeView, Controls.Switch, Controls.TabbedPage, Controls.TemplatedView, Controls.TextInput, Controls.Toolbar, Controls.View, Controls.VisualElement, Controls.VisualElementTree, Controls.WebView, Controls.Window, Controls.WindowOverlay, Controls.Xaml
Windows Controls.CollectionView, Controls.CarouselView, Controls.Memory Controls.Accessibility, Controls.Animations, Controls.Application, Controls.Behavior, Controls.Border, Controls.BoxView, Controls.Button, Controls.CarouselView, Controls.CheckBox, Controls.CollectionView, Controls.Compatibility, Controls.ContentView, Controls.DatePicker, Controls.Dispatcher, Controls.Editor, Controls.Element, Controls.Entry, Controls.FlexLayout, Controls.FlyoutPage, Controls.Frame, Controls.Gesture, Controls.HybridWebView, Controls.Image, Controls.Label, Controls.Layout, Controls.Lifecycle, Controls.Map, Controls.Mapper, Controls.Memory, Controls.MenuFlyout, Controls.Modal, Controls.NavigationPage, Controls.Page, Controls.PageTransitions, Controls.Path, Controls.Picker, Controls.RadioButton, Controls.RefreshView, Controls.ScrollView, Controls.SearchBar, Controls.Shape, Controls.Shell, Controls.Slider, Controls.SwipeView, Controls.Switch, Controls.TabbedPage, Controls.TemplatedView, Controls.TextInput, Controls.Toolbar, Controls.View, Controls.VisualElement, Controls.VisualElementTree, Controls.WebView, Controls.Window, Controls.WindowOverlay, Controls.Xaml

GPT-6.2 Sol — Run targeted Controls device tests for item-template rebinding and listener lifetime on all four platforms.

  • CollectionView and CarouselView exercise binding-context changes in item templates.
  • Controls.Memory covers retention risks from the new shared weak subscriptions.
  • No Core handler or XAML compiler changes; omit their suites.

MAI Code 2 — Run all Controls device-test categories on every platform because shared compiled-binding subscriptions affect controls broadly, without expanding to unrelated Core, Graphics, or Essentials projects.

  • TypedBindingListeners.cs is cross-platform Controls infrastructure, so binding and lifecycle behavior can affect every Controls category on all four platforms.
  • The Controls umbrella covers binding consumers plus relevant CollectionView and memory/lifecycle scenarios.
  • Core handlers, Graphics, Essentials, and BlazorWebView are unchanged; a device full run would add unrelated projects.

Generated by /review run-tests. A targeted run is a fast signal, not full-suite certification.

@github-actions github-actions Bot added s/autopilot-waiting-for-maintainer-review MAUI Autopilot finished: expert review clean and tests passed; waiting for maintainer review and removed s/autopilot-running MAUI Autopilot loop is running; remove this label to stop it s/autopilot-testing MAUI Autopilot: relevant UI/device tests are being selected or run labels Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

MAUI Autopilot — Ready for maintainer review

Results
Expert review No more findings on 147e7f8
Tests ⚠️ Could not run; re-run /review run-tests when CI is available
Review threads 7 resolved

This branch was previously deployed

1 inactive (outdated) deployment
copilot-pat-pool — da8e7932 Deployed Nov 30, 2026 by simonrozsival via conclusion #3551
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

s/autopilot-waiting-for-maintainer-review MAUI Autopilot finished: expert review clean and tests passed; waiting for maintainer review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants