Skip to content

perf(render-loop + theme): cache per-frame host delegates, drop per-frame atomics, cache theme-brush resolution (#660) - #751

Merged
Alexandre Zollinger Chohfi (azchohfi) merged 4 commits into
mainfrom
azchohfi-render-loop-theme-perf
Jun 30, 2026
Merged

Alexandre Zollinger Chohfi (azchohfi) merged 4 commits into
mainfrom
azchohfi-render-loop-theme-perf

Conversation

@azchohfi

@azchohfi Alexandre Zollinger Chohfi (azchohfi) commented Jun 29, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Part of the C#-vs-Rust runtime-perf effort (issue #660). Removes per-frame delegate/closure allocations and full-barrier atomics from the render-loop hosts (ReactorHost + ReactorHostControl), and caches the (key,theme)→Brush theme resolution.

Render loop

# Fix
#178 QueryCache.DispatcherPost: pass action.Invoke, drop the () => action() trampoline
#179 cache _rerenderAction instead of () => RequestRender() per render
#180 cache _renderLoopHandler (DispatcherQueueHandler) for TryEnqueue (both hosts)
#181 cache _requestRenderAction (RequestRender method group) for BeginRender + Reconcile
#182 ConsumeUpdatePending: Volatile.Read fast-path, atomic only when an update is pending
#183 AnimationAmbient.HasAny one-way sentinel gates the per-setState AsyncLocal walk
#185 _lastRenderMs: release Volatile.Write (single writer) (both hosts)
#186 report gate: integer ElapsedMilliseconds instead of per-frame Elapsed.TotalSeconds (both hosts)
#187 remove unconditional [embed:trace] Console.Error writes at window open

Theme resolution (#86)

Cache the (resourceKey, themeName) → Brush result (was recursing MergedDictionaries/XamlControlsResources on every resolve, per cell × per token × per render). Process-wide ConcurrentDictionary. Self-contained in Theme.cs — no BrushHelper/ThemeBinding/Reconciler coupling.

Invalidation completeness (review hardening):

  • Cleared on both axes in both hosts: Light↔Dark (ActualThemeChanged) and high-contrast/accent/palette (UISettings.ColorValuesChanged). ReactorHostControl previously wired only ActualThemeChanged; now also wires ColorValuesChanged (subscribe on theme-listener attach, unsubscribe in Dispose) so an embedded host with no ReactorApp doesn't keep stale brushes. The cache key includes themeName, so a Light↔Dark toggle also auto-misses independent of the event.
  • Caches only non-null resolutions — a cached null for an unknown key would go stale if a ResourceDictionary defining it is merged in after the first resolve (no theme-change event fires for a dict add). Unknown keys are rare; re-walking is the pre-cache cost and always correct.
  • Regression coverage: existing theme selftests pass with the cache active — StructuralSkip_ThemeRangeParity (ThemeRange_ForegroundReresolvedOnToggle: resolve themed brush → toggle theme → assert re-resolved), Issue522_CacheClear_StyleClearedDespiteCacheClear, Issue522_ThemeRef_CycleAcrossDifferentKeys, CoreCov_ThemeRefResolution.

Correctness

Render cadence, delegate semantics, and re-render coalescing unchanged. HasAny is one-way (any app that opens an Animations.Animate(...) transaction keeps the full AsyncLocal path). ConsumeUpdatePending's fast-path preserves at-most-once recovery. New AnimationAmbient.HasAny tests. Gates: core lib Release 0/0; Reactor.Tests 9915 / 0; theme selftests green.

Deferred (flagged to coordinator)

Draft for re-review + /perf.

@azchohfi

Copy link
Copy Markdown
Collaborator Author

/perf

@azchohfi Alexandre Zollinger Chohfi (azchohfi) changed the title perf(render-loop): cache per-frame host delegates + drop per-frame atomics (#660) perf(render-loop + theme): cache per-frame host delegates, drop per-frame atomics, cache theme-brush resolution (#660) Jun 29, 2026
@azchohfi

Copy link
Copy Markdown
Collaborator Author

/perf

@github-actions

github-actions Bot commented Jun 29, 2026 •

Copy link
Copy Markdown
Contributor

⚡ Reactor perf comparison

Workload: StressPerf.ReactorOptimized StocksGrid · --percent 50 --duration 10 · x64 Release · median of 12 paired runs (2 warmup dropped); Δ is the mean change with a 95% CI · PR head and main built and run interleaved on the same runner.

Regression vs main baseline

Metric main (baseline) This PR Δ (95% CI) Status
Renders/sec ↑ 2.95 2.96 -1.6% 95% CI [-6.2, +3.0] ≈ within noise
Avg Reconcile (ms) ↓ 120.3 119.6 -0.1% 95% CI [-3.4, +3.2] ≈ within noise
Avg Diff (ms) ↓ 107.9 107.5 -0.3% 95% CI [-4.0, +3.5] ≈ within noise
Avg Memory (MB) ↓ 287.1 286.5 -0.4% 95% CI [-1.0, +0.3] ≈ within noise

Low-mutation skip-floor (--percent 0)

At --percent 0 the workload mutates few cells per tick (always at least one), so reconcile/diff isolate the O(n) per-tick child skip-walk floor that higher mutation rates dilute — ChildReconciler re-walks every child each tick even when nothing moved. The closer --percent is to 0, the more this floor is the signal, so a structural-skip optimization shows up cleanly where the headline table above buries it. Δ is the mean paired change with a 95% CI.

Metric main (baseline) This PR Δ (95% CI) Status
Renders/sec ↑ 16.12 16.40 +1.4% 95% CI [-4.0, +6.8] ≈ within noise
Avg Reconcile (ms) ↓ 39.3 39.4 +0.9% 95% CI [-7.6, +9.5] ≈ within noise
Avg Diff (ms) ↓ 36.7 36.9 +0.6% 95% CI [-7.9, +9.1] ≈ within noise
Avg Memory (MB) ↓ 265.9 266.9 +0.3% 95% CI [0.0, +0.6] ≈ within noise

Allocation (Reactor) — lower is better

Metric main (baseline) This PR Δ (95% CI) Status
Alloc bytes/render ↓ 4882015 4902569 +0.1% 95% CI [-0.7, +0.8] ≈ within noise
Gen0 GC / 1k renders ↓ 206.90 200.22 -2.5% 95% CI [-6.4, +1.4] ≈ within noise

Keyed-list workload (StressPerf.KeyedList, --percent 50)

A separate macro workload: a ~500-row stably keyed list whose rows are reordered / inserted / removed each tick. Because every child carries a key, the child reconciler takes its keyed arm (ReconcileKeyed → ReconcileKeyedMiddle, the LIS-based minimal-move pass) instead of the positional re-walk the StocksGrid tables above measure — so this is the sensitive macro signal for keyed-diff work the positional cells can never reach. Same interleaved paired-Δ 95% CI as the headline table.

Metric main (baseline) This PR Δ (95% CI) Status
Renders/sec ↑ 20.26 20.50 +2.1% 95% CI [-0.7, +4.8] ≈ within noise
Avg Reconcile (ms) ↓ 15.5 15.7 0.0% 95% CI [-2.6, +2.6] ≈ within noise
Avg Diff (ms) ↓ 15.3 15.5 +0.2% 95% CI [-2.6, +3.0] ≈ within noise
Avg Memory (MB) ↓ 168.8 169.8 +0.5% 95% CI [-0.1, +1.1] ≈ within noise

Allocation (keyed-list) — lower is better

Metric main (baseline) This PR Δ (95% CI) Status
Alloc bytes/render ↓ 216917 214951 -0.7% 95% CI [-1.2, -0.2] ✅ improvement
Gen0 GC / 1k renders ↓ 13.92 14.05 +7.0% 95% CI [-7.4, +21.4] ≈ within noise

Flex/Yoga layout workload (StressPerf.Flex, --percent 50)

A separate macro workload: a deep nested, fully-realized (non-virtualized) flex tree (~2000 leaf cells) whose per-child flex inputs (grow / basis / width) are re-rolled on a --percent fraction of the leaves each tick, forcing a real Yoga measure/layout pass every frame while the unchanged leaves re-push identical inputs (the YogaNode setter-equality-guard / layout-cache-hit path). This drives the FlexPanel / Yoga LAYOUT engine — the sensitive macro signal for Yoga/Flex layout-engine allocation + memory work the positional StocksGrid and keyed-list legs can never reach. Same interleaved paired-Δ 95% CI as the headline table.

Reading this table: the reconcile / diff timing rows do not capture the deferred Yoga Measure/Arrange pass — it runs after the harness' OnRenderComplete phase hook, in FlexPanel.MeasureOverride/ArrangeOverride. Judge layout-engine wins primarily on the flex allocation table below (process-wide GC counters capture the whole run, layout pass included) and the renders-per-second figure. The working-set memory figure is informational only — too coarse to resolve inline-per-node-array gains at this node count.

Metric main (baseline) This PR Δ (95% CI) Status
Renders/sec ↑ 1.31 1.31 +1.3% 95% CI [-2.8, +5.3] ≈ within noise
Avg Reconcile (ms) ↓ 165.0 165.4 +0.7% 95% CI [-0.4, +1.9] ≈ within noise
Avg Diff (ms) ↓ 153.1 154.2 -0.4% 95% CI [-3.6, +2.9] ≈ within noise
Avg Memory (MB) ↓ 251.5 252.3 +0.5% 95% CI [-0.1, +1.1] ≈ within noise

Allocation (flex) — lower is better

Metric main (baseline) This PR Δ (95% CI) Status
Alloc bytes/render ↓ 8368563 8373129 +0.2% 95% CI [-0.5, +0.8] ≈ within noise
Gen0 GC / 1k renders ↓ 500.00 500.00 +0.5% 95% CI [-5.7, +6.7] ≈ within noise

DataGrid control workload (StressPerf.DataGrid, --percent 50)

A separate macro workload: the real DataGrid control (DataGridComponent) over a 30-column × 200-row IObservableDataSource whose cells are mutated on a --percent fraction each tick, forcing a full DataGridComponent.Render() every frame. This re-runs — unconditionally, regardless of whether sort/filter changed — the per-render array/LINQ rebuilds (#663/#669) and re-allocates the per-realized-cell/row .OnTapped/.OnPointerPressed closures (#671) that the StocksGrid, keyed-list and flex legs never reach. Same interleaved paired-Δ 95% CI as the headline table.

Reading this table: the DataGrid's re-render is async / dispatcher-debounced (DataChanged → LoadDataAsync → coalesced forceRender + a scroll-settle timer), so the reconcile / diff timing rows are noisier here and a render may be coalesced. Judge DataGrid allocation / delegate wins primarily on the DataGrid allocation table below (process-wide GC counters capture the whole run) and the renders-per-second figure. The working-set memory figure is informational only.

Metric main (baseline) This PR Δ (95% CI) Status
Renders/sec ↑ 5.34 5.31 -0.6% 95% CI [-2.4, +1.1] ≈ within noise
Avg Reconcile (ms) ↓ 84.6 85.5 +1.7% 95% CI [-0.8, +4.3] ≈ within noise
Avg Diff (ms) ↓ 84.6 85.4 +1.8% 95% CI [-0.8, +4.3] ≈ within noise
Avg Memory (MB) ↓ 251.6 250.7 -0.3% 95% CI [-1.4, +0.7] ≈ within noise

Allocation (datagrid) — lower is better

Metric main (baseline) This PR Δ (95% CI) Status
Alloc bytes/render ↓ 10065603 10089441 -0.1% 95% CI [-0.5, +0.4] ≈ within noise
Gen0 GC / 1k renders ↓ 148.15 145.45 -1.2% 95% CI [-3.6, +1.2] ≈ within noise

Reconciler micro-benchmarks (PerfBench.ControlModel)

Production --variant Reactor control-model path, ns-resolution and WinUI-undiluted (spec-047 M1–M13) — ↓ lower is better. Status tracks allocated bytes/op, the authoritative signal here; it is deterministic for structurally-fixed benches, while dispatcher / background-thread benches carry a small process-to-process offset, so a bench is flagged only when its 95% CI clears a ±3% minimum-effect band (real structural alloc changes are several percent to many-x). ns/op is shown for context but is not auto-flagged (its paired CI is rep-interleaved but the flag remains dormant pending a real-CI identical-binary band calibration). Δ is the mean paired change with a 95% CI.

Bench main ns/op Δ ns (95% CI) main B/op Δ alloc (95% CI) Status
M1 Mount_Leaf_NoCallback 121033.0 -1.9% 95% CI [-4.5, +0.6] 1140.9 0.0% 95% CI [0.0, 0.0] ≈ within noise
M2 Mount_Leaf_OneCallback 80995.5 -1.4% 95% CI [-8.5, +5.7] 3383.3 0.0% 95% CI [0.0, 0.0] ≈ within noise
M3 Mount_Leaf_ThreeCallbacks 194049.6 -0.6% 95% CI [-3.5, +2.3] 8759.9 -0.8% 95% CI [-1.9, +0.3] ≈ within noise
M4 Dispatch_Switch_Cold 92355.0 -2.0% 95% CI [-3.8, -0.2] 1767.8 0.0% 95% CI [0.0, 0.0] ≈ within noise
M5 Dispatch_Switch_Warm 94312.4 -2.5% 95% CI [-9.0, +4.0] 1765.4 +1.2% 95% CI [-0.9, +3.4] ≈ within noise
M6 Dispatch_ExternalType 80308.5 +1.6% 95% CI [-2.0, +5.2] 987.6 +2.2% 95% CI [-1.7, +6.0] ≈ within noise
M7 Update_NoChange 48991.1 +2.0% 95% CI [-2.7, +6.6] 452.1 -6.9% 95% CI [-16.9, +3.1] ≈ within noise
M8 Update_OneLeafChanged 34658.6 -0.3% 95% CI [-1.2, +0.6] 536.0 0.0% 95% CI [0.0, 0.0] ≈ within noise
M9 Update_AllChanged 3224498.4 +0.3% 95% CI [-0.6, +1.3] 184278.1 0.0% 95% CI [0.0, 0.0] ≈ within noise
M10 EventHandlerState_Alloc 61933.9 -1.8% 95% CI [-4.9, +1.2] 3100.3 0.0% 95% CI [-0.1, +0.1] ≈ within noise
M11 ModifierEHS_Frequency 39721.2 -0.9% 95% CI [-3.4, +1.7] 638.9 +0.2% 95% CI [-0.2, +0.5] ≈ within noise
M12 Pool_Rent_HotPath 96847.0 -1.0% 95% CI [-2.8, +0.8] 1099.9 0.0% 95% CI [0.0, 0.0] ≈ within noise
M13 Setters_Suppression_Scope 123.8 -0.7% 95% CI [-13.7, +12.4] 26.7 0.0% 95% CI [0.0, 0.0] ≈ within noise
M14 Dsl_Rebuild_Cascade 1662054.5 -1.1% 95% CI [-2.8, +0.5] 2231828.9 0.0% 95% CI [0.0, 0.0] ≈ within noise
C207 ChangeHandler_DpRead_Coalesce 1143.3 -3.2% 95% CI [-10.6, +4.3] 0.6 0.0% 95% CI [0.0, 0.0] ≈ within noise
OAlloc Optional_Element_Alloc 268.3 +0.6% 95% CI [-3.3, +4.5] 528.0 0.0% 95% CI [0.0, 0.0] ≈ within noise
OUpdate Optional_Reconciler_Update 12230.7 0.0% 95% CI [-1.3, +1.3] 2772.3 0.0% 95% CI [0.0, 0.0] ≈ within noise

Cross-framework reference (same StocksGrid workload)

Metric vanilla WinUI3¹ Rust windows-reactor² Reactor (this PR)
Renders/sec ↑ 3.45 5.45 2.96
Avg Reconcile (ms) ↓ n/a 20.9 119.6
Avg Diff (ms) ↓ n/a 18.7 107.5
Avg Memory (MB) ↓ 263.7 197.4 286.5

↑ higher is better · ↓ lower is better. Within noise = the 95% confidence interval of the paired Δ includes 0 (no change resolvable at this sample size); ✅ improvement / ⚠️ regression require the CI to exclude 0.
Allocation metrics (alloc bytes/render, Gen0 GC) are the sensitive signal for allocation-reduction work, where the mean-ms / memory figures are largely flat. They read n/a for a harness built from a revision that predates them (rebase the PR onto main to populate them).
Reconciler micro-benchmarks run PerfBench.ControlModel --variant Reactor (M1–M13) as a headless loop bracketed by per-thread alloc + GC counters — ns-resolution and free of WinUI render / working-set dilution, so they resolve Core/Reconciler allocation deltas the macro StocksGrid workload cannot. main and PR each link their own src/Reactor build and are rep-interleaved (a fresh alternated process per rep); Δ is the paired 95% CI over per-rep means. The Status column tracks allocated bytes/op (deterministic for identical code); ns/op is informational — its paired CI is now unbiased but the flag stays dormant pending a real-CI identical-binary band calibration.
¹ vanilla WinUI3 = StressPerf.Direct (imperative; no virtual-DOM, so it has no reconcile/diff phase — those cells read n/a). Measured live on this runner.
² Rust = test_reactor_perf from microsoft/windows-rs — a port of this harness (same StocksGrid, same --percent/--duration CLI). Built from source and measured live on this runner.
Absolute numbers are runner-dependent — trust the Δ vs main, not the absolute values. Memory (working set) is the noisiest metric.
Runner: CPU: AMD EPYC 9V74 80-Core Processor · 4 logical cores · 16 GB RAM · runner: GitHub Actions 1043303691.
Generated by .github/workflows/perf-compare.yml · PR be11ed8 vs main a1d094a · 2026-06-30T01:40:07Z · run log.

Console.Error.WriteLine(ex.ToString());
throw;
}
try { NativeShell.SetParent(_hwnd, 0); } catch { }
Console.Error.WriteLine(ex.ToString());
throw;
}
try { NativeShell.SetParent(_hwnd, 0); } catch { }
Console.Error.WriteLine(ex.ToString());
throw;
}
try { NativeShell.SetParent(_hwnd, 0); } catch { }
@azchohfi

Copy link
Copy Markdown
Collaborator Author

/perf

Alexandre Zollinger Chohfi (azchohfi) added a commit that referenced this pull request Jun 29, 2026
Two correctness hardenings on the (key,theme)->Brush cache:

1. Wire ReactorHostControl to UISettings.ColorValuesChanged (high-contrast /
   accent / palette) -> InvalidateResolutionCache, mirroring ReactorHost. Before,
   the embedded host only invalidated on ActualThemeChanged (Light/Dark), so an
   app using ReactorHostControl without a ReactorApp would keep stale brushes on a
   same-theme accent/high-contrast change. Subscribe on theme-listener attach,
   unsubscribe in Dispose.

2. Cache ONLY successful (non-null) resolutions. A cached null for an unknown key
   would go stale if a ResourceDictionary defining that key is merged in after the
   first resolve (a dictionary add raises no theme-change event). Unknown keys are
   rare; re-walking them is the same cost as pre-cache and always correct.

Invalidation now covers: Light<->Dark (ActualThemeChanged, both hosts — AND the
cache key includes the theme name so a toggle auto-misses) + accent/palette/
high-contrast (ColorValuesChanged, both hosts). Existing theme selftests pass with
the cache active, incl. StructuralSkip_ThemeRangeParity
(ThemeRange_ForegroundReresolvedOnToggle: resolve brush -> toggle theme -> assert
re-resolved) and Issue522_CacheClear_StyleClearedDespiteCacheClear. Full headless
suite 9915/0; build 0/0.

Co-authored-by: Copilot <[email protected]>
@azchohfi

Copy link
Copy Markdown
Collaborator Author

/perf

_uiSettings = new global::Windows.UI.ViewManagement.UISettings();
_uiSettings.ColorValuesChanged += OnColorValuesChanged;
}
catch { /* headless / no UISettings projection — nothing to invalidate */ }
…omics (#660)

Remove per-frame delegate/closure allocations and full-barrier atomics from the
render-loop hosts (ReactorHost + ReactorHostControl), which run at render/data-tick
frequency on the data-grid stress workload:

  #178 QueryCache.DispatcherPost: pass action.Invoke, drop the () => action() trampoline
  #179 cache _rerenderAction instead of () => RequestRender() every render
  #180 cache _renderLoopHandler (DispatcherQueueHandler) for TryEnqueue
  #181 cache _requestRenderAction (RequestRender method group) for BeginRender + Reconcile
  #182 HotReloadService.ConsumeUpdatePending: Volatile.Read fast-path, atomic only when pending
  #183 AnimationAmbient.HasAny sentinel gates the per-setState AsyncLocal walk
  #185 _lastRenderMs: Volatile.Write (single writer) instead of Interlocked.Exchange
  #186 report gate: integer ElapsedMilliseconds compare instead of Elapsed.TotalSeconds
  #187 remove unconditional [embed:trace] Console.Error writes at window open

Behavior preserved: identical render cadence, delegate semantics, and re-render
coalescing; HasAny is a one-way sentinel so any app that opens an Animations.Animate
transaction keeps the full AsyncLocal path. New AnimationAmbient.HasAny tests.

Deferred (flagged to coordinator): theme resolution cache (#85/#86) — #85's per-element
theme-name cache needs generation invalidation on localized RequestedTheme application
which lives in Reconciler.cs (sibling-owned), so it's a cross-boundary change; and theme
resolution can't be measured headlessly. #184 charting dirty-gate (chart-specific, secondary).

Co-authored-by: Copilot <[email protected]>
…change (#660 #86)

ThemeRef.Resolve recursed Application.Resources.MergedDictionaries (XamlControlsResources
and its nested dictionaries) on every resolve — per cell x per color token x per render on
the data-grid workload. Cache the deterministic (resourceKey, themeName) -> Brush result in
a process-wide ConcurrentDictionary and clear it from the hosts' theme-change handlers
(ActualThemeChanged + UISettings.ColorValuesChanged). Transient-null Application.Resources
(early startup) is not cached, so no poisoned null entry. Cached value mirrors the uncached
return exactly (including null for unknown keys); ThemeDictionary brushes are shared
instances, so returning the cached reference is identical behavior.

Self-contained in Theme.cs (no BrushHelper/ThemeBinding/Reconciler coupling). The per-element
theme-NAME cache (#85) is intentionally NOT here — it needs a generation bump where a localized
RequestedTheme is applied (Reconciler.cs, sibling-owned), which is a cross-ownership change
flagged to the coordinator.

Co-authored-by: Copilot <[email protected]>
Two correctness hardenings on the (key,theme)->Brush cache:

1. Wire ReactorHostControl to UISettings.ColorValuesChanged (high-contrast /
   accent / palette) -> InvalidateResolutionCache, mirroring ReactorHost. Before,
   the embedded host only invalidated on ActualThemeChanged (Light/Dark), so an
   app using ReactorHostControl without a ReactorApp would keep stale brushes on a
   same-theme accent/high-contrast change. Subscribe on theme-listener attach,
   unsubscribe in Dispose.

2. Cache ONLY successful (non-null) resolutions. A cached null for an unknown key
   would go stale if a ResourceDictionary defining that key is merged in after the
   first resolve (a dictionary add raises no theme-change event). Unknown keys are
   rare; re-walking them is the same cost as pre-cache and always correct.

Invalidation now covers: Light<->Dark (ActualThemeChanged, both hosts — AND the
cache key includes the theme name so a toggle auto-misses) + accent/palette/
high-contrast (ColorValuesChanged, both hosts). Existing theme selftests pass with
the cache active, incl. StructuralSkip_ThemeRangeParity
(ThemeRange_ForegroundReresolvedOnToggle: resolve brush -> toggle theme -> assert
re-resolved) and Issue522_CacheClear_StyleClearedDespiteCacheClear. Full headless
suite 9915/0; build 0/0.

Co-authored-by: Copilot <[email protected]>
…/H2)

Selftest fixtures pinning the two converged review findings (the code fixes
landed in 3fd38c4):

- Theme_BrushCacheNullMissNotCached (H2): resolve an unknown key → null (NOT
  cached) → merge a ResourceDictionary defining it → resolves to the brush. Guards
  against the cached-null poisoning a later-merged key (XamlIslandBootstrap /
  docking-embed late XamlControlsResources binding).
- Theme_BrushCacheInvalidationReResolves (H1 mechanism): resolve key→brushA
  (cached) → swap to brushB for the same (key,theme) → still brushA (stale) →
  ThemeRef.InvalidateResolutionCache() (what the hosts call on
  ColorValuesChanged/ActualThemeChanged) → re-resolves to brushB.

Both green. Validates the invalidation path the ReactorHostControl
ColorValuesChanged wiring (3fd38c4) depends on.

Co-authored-by: Copilot <[email protected]>
@azchohfi

Copy link
Copy Markdown
Collaborator Author

/perf

@azchohfi
Alexandre Zollinger Chohfi (azchohfi) marked this pull request as ready for review June 30, 2026 01:44
@azchohfi
Alexandre Zollinger Chohfi (azchohfi) merged commit 7fa5c61 into main Jun 30, 2026
18 checks passed
Alexandre Zollinger Chohfi (azchohfi) added a commit that referenced this pull request Jul 2, 2026
…olution (#679) (#778)

Adds the missing winapp-ui E2E tier guards for two behaviors that shipped via #751
but had no end-to-end tests:

(a) ListView OnItemClick "once-fire": ItemClick_OnceFire fixture +
    ItemClickInteractionTests deliver a real pointer click across re-renders and an
    items-array change, asserting the callback fires EXACTLY once with the correct
    index -- guarding the ListViewHandler once-subscribe contract against
    double-fire / double-subscription regressions.

(b) Host theme-change re-resolution: ThemeChange_ResourceOverrideReResolve fixture +
    HostThemeChangeTests toggle the real window-root RequestedTheme (no fixture
    setState) and assert a concrete ResourceOverride ThemeRef brush re-resolves,
    proving the shipped ActualThemeChanged -> RequestRender wiring (#86) works
    end-to-end. Uses a concrete ResourceOverride (not .Foreground(Theme.X), which
    self-heals natively via ThemeResource and would be vacuous).

Test infra: WinAppUi.ResolveWinAppExe honors an optional REACTOR_WINAPP_EXE override
so a machine whose winapp.exe app-execution-alias points at an older build lacking
the ui verb can pin a ui-capable winapp. No effect unless the var is set.

Test-only; no production Reactor code changed.

Co-authored-by: Copilot App <[email protected]>
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.

1 participant