You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Intermittent selftest failure: LT_OnMountUnmountBalanced (asserts LT_Unmounts_Exactly_30 + LT_NoLeak_MountsEqualUnmounts) in tests/Reactor.AppTests.Host/SelfTest/Fixtures/LifecycleTortureFixtures.cs. A generic lifecycle-torture fixture that mount/unmount-counts a TextBlock across rapid toggles.
Root cause (test-side race, not product code)
LT_Mounts_Exactly_30 passes (mounts == 30), but the final drive!(0) clear batch's OnUnmount callbacks have not all flushed when the unmount count is asserted → unmounts < 30 → assertion fails. The exactly-conserved unmount count is checked immediately after the clear batch rather than after a deterministic quiesce of the async OnUnmount dispatch.
gh run rerun 28200113984 --failed → Selftests PASSED (7m15s) on the same commit, zero code change → confirmed non-deterministic.
Not caused by perf: cache per-render arrays/LINQ in DataGrid #669: that branch touches only 3 DataGrid files (no AppTests.Host changes; only static readonly immutable arrays + pure methods). Every DataGrid fixture passed; the failing fixture doesn't use DataGrid. Fixture last modified by unrelated commit 222a299a.
Impact
False-red on the Selftests CI job that can hit any PR intermittently. Relevant right now because the perf-improvement fleet is about to go through an individual per-PR gh pr ready + CI + /perf GO cycle — a flake-induced red Selftests run during GO must not be mistaken for a real regression.
Suggested fix direction
Make the unmount-count assertion await a deterministic OnUnmount flush (drain/quiesce the dispatcher so all OnUnmount callbacks from the final drive!(0) clear batch have run) before asserting the conserved count — rather than asserting immediately after the clear batch. Alternatively add an explicit sync point that guarantees all OnUnmount callbacks completed.
Scope note
Not part of the /perf self-contained harness build fix (#677) — that is narrowly the StressPerf harness build, not selftest stability. Tracking this separately so it can be fixed independently / post-fleet.
Refs #669. Flagged by the Datagrid-allocs perf session.
Second independent occurrence — confirms this is cross-PR, not introduced by any one change.
PR perf: eliminate per-diff allocations in ChildReconciler + KeyedListDiff #657, commit 83599a0, Selftests run 28200086413: the same single fixture LT_OnMountUnmountBalanced failed (LT_Unmounts_Exactly_30 / LT_NoLeak_MountsEqualUnmounts; unmounts != 30). All other 16 checks passed. gh run rerun 28200086413 --failed then went green with zero code change.
That PR production delta is unrelated to lifecycle: a boolPool.Return clearArray flag in keyed-list-diff; both buffers self-clear before read, so counts cannot change. The fixture uses distinctly-keyed TextBlocks with no key overlap (pure remove+mount, never hits the docs(skills): split SKILL.md into root + on-demand sub-skills #30 skip path). Local run 6/6 pass on its HEAD.
Recurrence, one month on — now reproducing on the AOT leg specifically
This closed issue's failure mode has reappeared. Details and evidence in the issue that references this one; summary here so subscribers see it.
ecff5e5e / PR #770 fixed it by gating the asserts on await Harness.WaitFor(() => mounts == 30 && unmounts == 30), and that commit message correctly noted the outcome stays reachable when "WaitFor exhausts its passes". That is what is now happening.
New information versus June: on an identical commit (run 30613122631), the JIT Selftests job passed while AOT Selftestsfailed. A genuine missed-unmount defect would fail both; a too-tight timing budget fails the slower runtime.
Harness.WaitFor(Func<bool>, maxPasses = 25, perPassMs = 0) (Harness.cs:318) drains 25 render passes with zero wall-clock delay — a pass-count budget gating work that needs real time, which is why NativeAOT exhausts it where JIT does not. The harness already documents the escape hatch at Harness.cs:315.
Suggested: reopen and fix at the call site by raising maxPasses and/or passing a non-zero perPassMs. Keep the asserts exact at == 30 — #770 was right to protect that, and widening the budget must not become relaxing the assertion.
Forward pointer, since this thread currently has no link to where the recurrence is being tracked: #994 is the live issue.
That direction matters more than it looks. #994 references this issue, but nothing here referenced #994, so the link only worked if you arrived from the newer one. Anyone landing here — a closed issue whose most recent comment says "this came back" — had no route forward. This comment also puts a cross-reference event on #994, so the pair is now navigable from either end.
One invariant worth stating explicitly, given the consolidation recommendation on #994: right now #685 is CLOSED and #994 is OPEN, so the bug has exactly one open tracker. Closing #994 as a duplicate without reopening this issue first would leave it with none — a real, reproducing, unfixed failure with no open tracker and a resolved issue as its only trace. That is strictly worse than the duplicate, and it is the same false-alibi shape that made misfiling it under the watchdog umbrella harmful in the first place. Either outcome is fine as long as one of the two is open when the dust settles.
Activity
azchohfi commentedon Jun 26, 2026
Second independent occurrence — confirms this is cross-PR, not introduced by any one change.
LT_OnMountUnmountBalancedfailed (LT_Unmounts_Exactly_30/LT_NoLeak_MountsEqualUnmounts; unmounts != 30). All other 16 checks passed.gh run rerun 28200086413 --failedthen went green with zero code change.boolPool.ReturnclearArray flag in keyed-list-diff; both buffers self-clear before read, so counts cannot change. The fixture uses distinctly-keyed TextBlocks with no key overlap (pure remove+mount, never hits the docs(skills): split SKILL.md into root + on-demand sub-skills #30 skip path). Local run 6/6 pass on its HEAD.azchohfi commentedon Jul 31, 2026
Recurrence, one month on — now reproducing on the AOT leg specifically
This closed issue's failure mode has reappeared. Details and evidence in the issue that references this one; summary here so subscribers see it.
ecff5e5e/ PR #770 fixed it by gating the asserts onawait Harness.WaitFor(() => mounts == 30 && unmounts == 30), and that commit message correctly noted the outcome stays reachable when "WaitForexhausts its passes". That is what is now happening.New information versus June: on an identical commit (run
30613122631), the JITSelftestsjob passed whileAOT Selftestsfailed. A genuine missed-unmount defect would fail both; a too-tight timing budget fails the slower runtime.Harness.WaitFor(Func<bool>, maxPasses = 25, perPassMs = 0)(Harness.cs:318) drains 25 render passes with zero wall-clock delay — a pass-count budget gating work that needs real time, which is why NativeAOT exhausts it where JIT does not. The harness already documents the escape hatch atHarness.cs:315.Suggested: reopen and fix at the call site by raising
maxPassesand/or passing a non-zeroperPassMs. Keep the asserts exact at== 30— #770 was right to protect that, and widening the budget must not become relaxing the assertion.azchohfi commentedon Jul 31, 2026
Forward pointer, since this thread currently has no link to where the recurrence is being tracked: #994 is the live issue.
That direction matters more than it looks. #994 references this issue, but nothing here referenced #994, so the link only worked if you arrived from the newer one. Anyone landing here — a closed issue whose most recent comment says "this came back" — had no route forward. This comment also puts a cross-reference event on #994, so the pair is now navigable from either end.
One invariant worth stating explicitly, given the consolidation recommendation on #994: right now #685 is CLOSED and #994 is OPEN, so the bug has exactly one open tracker. Closing #994 as a duplicate without reopening this issue first would leave it with none — a real, reproducing, unfixed failure with no open tracker and a resolved issue as its only trace. That is strictly worse than the duplicate, and it is the same false-alibi shape that made misfiling it under the watchdog umbrella harmful in the first place. Either outcome is fine as long as one of the two is open when the dust settles.
test(selftest): replace fixed-delay assertion gates with WaitFor polling