Skip to content

[net11.0][Testing] Correct device-test fixtures and Helix MSIX deployment - #39536

Closed
kubaflo wants to merge 5 commits into
net11.0from
kubaflo-net11-gc-fixture-port
Closed

kubaflo wants to merge 5 commits into
net11.0from
kubaflo-net11-gc-fixture-port

Conversation

@kubaflo

@kubaflo kubaflo commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

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!

Description of Change

User-directed consolidation of the test-fixture and disposable Helix deployment fixes, targeting net11.0. This is the existing GC port PR expanded with only the selected non-product fixes from #39569, #39571, #39572, and #39573. The current target 7b0ea7800db3f3faccbaecb665d32b7c61eaf932 was integrated by a normal merge; no rebase, amended commits, or force push.

Exactly six paths; no product-source diff, dependency changes, or pipeline YAML changes:

Component / source Changed path Source commit
GC lifetime fixture / #39529 src/Core/tests/DeviceTests/AssertionExtensionsTests.cs f11b88966f41d38b723863d8e40c5e67ea93044f (retained port 495b473347)
Android picker recovery fixture / #39569 src/Essentials/test/DeviceTests/Tests/Android/MediaPickerRecovery_Tests.cs 9a12d346983139149a781615e9c100dcfe51da45
Android native-Shell Window fixture / #39571 src/Controls/tests/DeviceTests/Elements/Shell/ShellHandlerSubclasses.Android.cs 0f554a80b700e67ed1f3fbb2b117bf5cfe1eb8d0
Apple grouped CollectionView fixture / #39572 src/Controls/tests/DeviceTests/Elements/CollectionView/CollectionViewTests.iOS.cs 73ca647cc0d3c12ad726a9ec00696ed18a3d57f7
Helix Windows deployment / #39573 eng/devices/run-windows-devicetests.cmd 7673773370d3c142e0c89545f72feda4479babf1
Deployment documentation / #39573 .github/docs/maui-ci-facts.md same two-file source commit

All six resulting file blobs are identical to the selected sources. Their original authors, messages, and attribution/evidence are preserved; each added fix commit records its source SHA. The aggregate diff is 98 insertions / 21 deletions against the integrated net11.0 target. No validation/control branches or unrelated GA history are imported.

Product fixes remain separate and are not included, even partially: #39568 (XAML plus its regression tests), #39570 (HybridWebView), #39574 (Navigation plus its tests), and #39577 (ViewHandler/WrapperView plus its tests). Their regression tests are not extracted into this PR. The GA PR #39529 and release/11.0.1xx remain unchanged. Original assertions, existing skips, native runtime checks, and test oracles are preserved; no sleeps, relaxed tolerances, retries, or skip policies are added. These are not all characterized as flaky tests, and this consolidation does not claim green CI.

GC fixture: mechanism and retained prior evidence

The original net11.0 port was based on 216c8045cbfa9d6a00f44ec2dad574ca1b9ec13e and copied only the fixture patch from f11b88966f41d38b723863d8e40c5e67ea93044f in #39529. No GA packaging/dependency/base history was imported.

The old EarlierReferenceCollectedDuringLaterWait fixture leaves its later weak target unrooted during the earlier target's bounded collection wait. The later target can already be dead when its getter releases the earlier target; forcing GC inside that getter also competes with the getter's own liveness temporaries. The helper may then perform no collection after the release frame returns.

Retain the same actual later target until its first real IsAlive snapshot. Snapshot earlier/later liveness in a non-inlined release frame, clear both roots, and let the unchanged helper perform its existing asynchronous collection after that frame returns. Retain the earlier-alive and final-death assertions, and add the later-alive assertion. Subsequent checks still use actual weak liveness.

GC component scope: one file, src/Core/tests/DeviceTests/AssertionExtensionsTests.cs, 25 insertions/13 deletions. File contents and stable patch ID remain identical to #39529 (132ef9846b52df6bf59b7fb29c1317a5c24d31cc and 9ce1ab8e4693455de9cabc29865d0ec25bbad81d). #39094's shared-helper aggregation fix is already on net11.0 and remains unchanged. The GC change adds no sleeps, tolerance/retry/limit changes, skips, pipeline/dependency changes, product changes, or unrelated Mac UI work. Target source/history, open net11.0 PR file lists, and recent merged GC/fixture changes were checked for an equivalent port before publishing; none was found.

Prior GC-only target-branch validation — original head 495b473347, not combined-head execution

Private copy of the pinned SDK 11.0.100-rtm.26514.118 (product 11.0.100), target Android workload 37.2.15, .NET 11.0.0 Mono, task-owned headless API33 ARM64 emulator. Android's resolved AndroidNETSdkVersion was checked as 37.2.15; this is not a rerun using GA's older 37.2.13 workload. Global SDKs/workloads and original GA evidence/scripts were not modified.

A private harness compiles the unchanged target test source and verbatim target GC helper methods with real xUnit 2.9.3 assertions; only Category metadata is shimmed. Each arm has three independent process runs, each executing all nine cases 20 times. Loaded libmonosgen-2.0.so positively verifies Mono in every process.

Control Result in each of three runs
Immutable net11.0 baseline + current helper 141 pass / 39 fail; exact useWaitForGC:true fails 20/20
Ported fixture + current helper 180 pass / 0 fail
Fixture reverted to immutable target baseline 141 pass / 39 fail
Ported fixture restored 180 pass / 0 fail
Ported fixture + pre-#39094 helper 140 pass / 40 fail; both regression variants fail 20/20

All seven retained/null/empty safety cases pass in every arm. The stale-helper negative control confirms that the fixture correction does not mask the original aggregation regression.

The full repository Core.DeviceTests Android Mono application also built using this checkout and target dependencies, with the existing runner's temporary exact-class module-initializer injection. Three fresh XHarness runs each produced a unique actual xUnit XML containing exactly 9 distinct AssertionExtensionsTests cases: 9 passed / 0 failed / 0 skipped / 0 errors, including both regression variants and both retained-reference orderings. Assembly counts were independently reconciled with all nine records; this is not inferred from XHarness exit zero. No harness/filter file is committed.

Commands/results (E is this port's preserved local validation artifact directory; the copied scripts contain only port-local paths):

E="$HOME/.copilot/session-state/c33a22b9-b10e-4231-9b6e-2cf2ef8bc415/files"
DOTNET="$E/dotnet-net11/dotnet"

"$DOTNET" build Microsoft.Maui.BuildTasks.slnf -c Release \
  -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false \
  -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false \
  -p:IncludeTizenTargetFrameworks=false -p:TreatWarningsAsErrors=false \
  -bl:"$E/net11-buildtasks.binlog" --nologo -v:q
# Passed: 0 errors; 3 existing Gradle source/target-8 warnings.

"$DOTNET" build src/Core/tests/DeviceTests/Core.DeviceTests.csproj \
  -c Release -f net11.0-android -r android-arm64 \
  -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false \
  -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false \
  -p:IncludeTizenTargetFrameworks=false -p:TreatWarningsAsErrors=false \
  -p:UseMonoRuntime=true -p:_DisableCheckForUnsupportedMonoMobileRuntime=true \
  -p:RunAOTCompilation=false -p:EmbedAssembliesIntoApk=true -p:AndroidPackageFormat=apk \
  -p:CustomAfterMicrosoftCSharpTargets="$E/MauiCopilotClassFilter.targets" \
  -p:MauiCopilotClassFilterSourcePath="$E/MauiCopilotClassFilter.g.cs" \
  -p:MauiCopilotClassFilterTargetProject=TestUtils.DeviceTests.Runners \
  -bl:"$E/net11-core-native-build.binlog" --nologo -v:q
# Passed: 0 errors; 4 existing MAUI1001/CS8632 warnings.

python3 "$E/prepare-gc-harness.py"
python3 "$E/run-android-gc-controls.py"
# Passed: all five expected-result controls, 3 process runs per arm, counts above.
# Every arm is rebuilt before installation; baseline/revert never edit repository source.

python3 "$E/run-native-class.py"
# Passed: 3 fresh XHarness processes; actual XML 9/9 pass each, exact class/count checks.
# Each process runs:
# "$DOTNET" xharness android test \
#   --app artifacts/bin/Core.DeviceTests/Release/net11.0-android/android-arm64/com.microsoft.maui.core.devicetests-Signed.apk \
#   --package-name com.microsoft.maui.core.devicetests --device-id emulator-5684 \
#   --output-directory "$E/net11-core-isolated-$repeat" --timeout 00:05:00 \
#   --arg TestFilter=Category=Memory --arg "results-file-name=net11-core-isolated-$repeat.xml"

"$DOTNET" format Microsoft.Maui.sln --no-restore --exclude Templates/src \
  --exclude-diagnostics CA1822 --include src/Core/tests/DeviceTests/AssertionExtensionsTests.cs \
  --verbosity quiet
# Passed; patch remains identical to #39529.
git diff --check
# Passed.

Historical hosted net11 CI investigation — original GC-only head 495b473347a058caee083866a564d6c3c1dc5c8d, merge 82aa6339f5bf89b026ba97591042dc2962cea56d

The checks are genuinely red, but the changed GC fixture passes wherever it executed. Device build 1644557 has all nine AssertionExtensionsTests passing in each of eight actual Core XML sets: Android Mono/CoreCLR; iOS Mono/CoreCLR on both queues; Catalyst osx.15; Windows unpackaged. Android Mono full-Core XML has 3,079 total / 3,007 passed / 0 failed / 72 skipped / 0 errors. Exact-base device build 1643729 fails the precise EarlierReferenceCollectedDuringLaterWait(useWaitForGC: True) case; this PR passes it and every retained/null/empty safety case.

Every one of the device build's 49 failing execution instances / 16 distinct cases also fails in its corresponding configuration on exact net11.0 base 216c8045. Test identity, exception, normalized message and stack all match; 45 raw messages are byte-identical and four differ only in generated file URIs or FrameLayout IDs. Failure groups are Android HybridWebView/Window/MediaPicker recovery, iOS/Catalyst Navigation renderer expectations and CollectionView constructor cases, and Windows unpackaged Label wrapper assertions. Nine original Helix jobs and all 62 expected app items were inventoried; all 57 available app XMLs per build were reconciled. These are real pre-existing assertions, not a shared infrastructure/monitor failure or a reason to weaken this fixture.

Four Windows packaged apps fail before tests with Add-AppxPackage 0x80073D02 while WindowsAppRuntime.2 resources are held by WebExperience; exact base has the same four deployment failures on different workers. Catalyst osx.26 Core has no files/XML after Azure's 60-minute submission-job cancellation (-1234), with the same base pattern. No passing/executed GC coverage is claimed for Windows packaged Core or Catalyst osx.26 Core. No device retry or source change was made.

Main build 1644556 has a genuine XNameAreTrimmed(inflator: Runtime) XAML failure (Assert.NotNull, Maui27121.xaml.cs:30) in all four macOS/Windows Debug/Release configurations. All four corresponding full consoles on exact-base main build 1643728 fail identically. The Helix monitor correctly reports these failures; it was not retried or bypassed.

Windows Pack independently failed before packing/tests when cmdline-tools;13.0 was rejected with Error on ZipFile unknown archive; a same-head Windows Release peer actually installed and listed that exact package successfully. A single diagnostic Pack-only failed-job retry was admitted with forceRetryAllJobs=false, preserving macOS Pack and the genuine failed unit monitor on attempt 1. No retry policy was added to source and no blanket unit/device rerun was started. Its provisioning-recovery outcome is tracked in the PR's investigation comment; it cannot make the whole PR green while the proven pre-existing net11.0 assertions remain.

Inherited GA evidence, not net11-branch certification: #39529 records its own five-arm Android37.2.13 controls, native-class repeats, successful main build 1644138 and device build 1644140, and hosted Android x64 Mono full-Core XML (3,065 total / 2,993 pass / 0 fail / 72 skip; all nine fixture cases pass). Those results belong to the GA head, not this PR. The hosted net11 evidence and remaining failures above are separate; no aggregate hosted net11 success is claimed.

GC evidence limits: the local controls above cover Android ARM64 Mono and the exact fixture class; the original-head hosted evidence covers the eight executed Core configurations above, not the two without execution evidence. These prior runs were not repeated on the combined head. No local MacCatalyst, XCTest, desktop UI automation, or screen takeover. No claim of global flake elimination, unrelated product-leak repair, or green CI.

Android picker recovery fixture — #39569

Five successful incoming file:// picker cases supplied paths inside the receiving app's protected private cache. FileSystemUtils.TryGetValidatedPhysicalPath deliberately rejects those paths, even when readable. Preserve that production validation from #38127. Create canonical external-cache input files only for the successful incoming file-URI cases, track and delete those fixture-owned inputs, and leave private capture/content-URI fixtures and every original result/path/state assertion unchanged.

The added Accepted_Pick_Private_File_Uri_Is_Rejected_Without_Deleting_Source control requires rejection, cleared active state, no recovered result, and an intact private source file. No product validation is relaxed.

Prior per-fix native evidence, not combined-head execution: full recovery and Android filesystem classes, headless API33 ARM64, pinned SDK 11.0.100 / Android 37.2.15, with real Mono/CoreCLR payloads verified. Each row has three fresh process runs:

Source fixture state Runtime Actual XML per run
Original baseline Mono 82 pass / 5 fail / 0 skip, 87 total
Corrected inputs plus private-URI control Mono 88 pass / 0 fail / 0 skip
Successful inputs reverted, new control retained Mono 83 pass / same 5 fail / 0 skip
Corrected inputs restored Mono 88 pass / 0 fail / 0 skip
Original successful inputs, new control retained CoreCLR 83 pass / same 5 fail / 0 skip
Corrected inputs CoreCLR 88 pass / 0 fail / 0 skip

All 18 original XMLs reconcile exact class/case identity, theory rows, counts and zero fixture errors. The original 81 recovery plus six filesystem cases become 88 with the new negative control. Source #39569 retains its exact native build/execution commands and full evidence. This is Android API33 ARM64 direct callback/recovery coverage, not real external camera/picker launches, other Android APIs, other platforms, or a full-suite claim.

Android native-Shell Window fixture — #39571

WindowHandlerTests.SetupBuilder replaces the base setup but omitted its existing ReentrantFlyoutPage / ReentrantFlyoutViewHandler mapping. The inherited construction-reentry test therefore selected an ordinary Flyout handler, never invoked OnCreatingPlatformView, and timed out waiting for the replacement root. Add just the omitted registration. Preserve native Shell registrations, the reentry trigger, all original root/toolbar/disconnection/attachment assertions, and the original timeout.

Prior per-fix native evidence, not combined-head execution: full repository Controls APKs, API33 ARM64, SDK 11.0.100 / Android 37.2.15; exact derived WindowHandlerTests class. For each of Mono and CoreCLR, baseline/fixed/reinstalled-baseline/reinstalled-fixed arms each ran three times. Every original XML has exactly 33 distinct cases, no skips/errors: baseline and revert 32 pass / 1 exact timeout, fix and restore 33 pass / 0 fail. All 24 fresh PIDs and 792 case records reconcile; the other 32 cases pass throughout. Unchanged base WindowTests passed 33/33 separately, not used as a proxy for the derived failure. Source #39571 preserves exact commands, immutable baseline APKs, raw logs/XML and runtime checks. No new emulator run is attributed to consolidation.

Grouped CollectionView constructor contract — #39572

Propagate DynamicallyAccessedMembers(PublicConstructors) onto VerifyGroupedCollectionViewEmptyViewTracksGroups<THandler> so its generic AddHandler<CollectionView,THandler>() registration retains the handler constructor contract. Original exact-base pre-link/deployed binaries showed legacy Items.CollectionViewHandler retaining its type but losing both public constructors; activation threw CtorNotLocated before empty/group assertions. The modern Items2 handler retained its constructors.

Both legacy/modern facts, inherited navigation-handler fixture executions, normal DI activation, and every original native empty-view/group assertion remain. No product handler, test skip, delay, or oracle is changed.

Prior limited local native evidence, not supported-Xcode combined-head certification: pinned SDK 11.0.100, iOS workload 27.0.12230, Mono 11.0.0, task-owned headless iPhone 11 Pro / iOS18.5. The source owner had Xcode26.6, not required Xcode27, and used the documented ValidateXcodeVersion=false compatibility override plus standard non-WAE builds; existing warnings remained visible. Native executables linked libmonosgen-2.0.dylib.

Source arm, independently rebuilt Three original XMLs per arm Legacy public constructors
Baseline 72 pass / 2 fail / 8 existing skips, 82 total 0
Annotation applied 74 pass / 0 fail / 8 existing skips, 82 total 2
Annotation removed 72 pass / same 2 fail / same 8 skips 0
Annotation restored 74 pass / 0 fail / same 8 skips 2

All 12 XMLs / 984 class-pair records / 48 target records and constructor metadata were reconciled. Both legacy cases fail identically in baseline/revert and pass all original assertions in candidate/restore; both modern cases always pass, none of the four target records is skipped. Source #39572 retains the exact commands and raw XML hashes.

Its supported-host baseline-only device build 1645782, pinned to unchanged target 7b0ea780, produced full CollectionView-category XML on both queues with 83 total / 73 pass / 2 fail / 8 skip / 0 errors; the two legacy ctor failures reproduce, both modern facts pass. Seven excluded stages were actually skipped. This is not hosted candidate-green evidence. The local green is not Xcode27 candidate certification, CoreCLR/Catalyst validation, or full-category candidate coverage.

Disposable Helix Windows deployment — #39573

Set ForceApplicationShutdown=true in the existing single Add-AppxPackage parameter splat. Microsoft's documented contract covers processes using the package or its dependencies, unlike target-only shutdown. Keep it scoped to disposable Helix workers; local windows.cake deployment is unchanged. Dependency architecture selection, certificate handling, terminating errors/nonzero failures, Appx diagnostics, cleanup and test execution remain. No broad process killing, sleep, retry, deferred registration or pipeline changes.

This is the exact two-file #39573 patch, itself the focused port of #39498; no GA history or #39549 setup-retry work is imported. The CI-facts update records the disposable-worker boundary.

Prior per-fix hosted evidence, not combined-head results: Windows-only device build 1645745 used source head 7673773370d3c142e0c89545f72feda4479babf1 / target 7b0ea780, with seven non-Windows stages skipped. All five packaged apps installed and executed; all 52 packaged launcher invocations exited zero. The original 112 XMLs (ten aggregates plus 102 source/category files) reconcile source/aggregate multisets and declarations. Packaged results:

Suite Passed Failed Skipped
Controls 971 3 pre-existing Label assertions 33
Core 2,033 0 111
Essentials 312 0 14
Graphics 33 0 0
BlazorWebView 40 0 4
Total 3,389 3 162

Unpackaged suites separately had the same totals; not used as a proxy for packaged execution. All three Label identities/messages/exceptions match original exact-base unpackaged XML. No original baseline packaged assertions can be inferred because those routes failed deployment before tests. #39577's separate product fix addresses the Label mechanism and remains excluded.

No 0x80073D02, missing-result, crash or timeout signature appeared in that source run, but successful deployment on different workers does not prove the original WebExperience lock was present, that Windows terminated that exact process, or that the flag was necessary in that run. No forced-lock experiment or full-suite-green claim. Original pre-test failures and unavailable coverage remain part of the historical evidence, not erased by later successful execution.

Actual combined-head checks and remaining limits

On combined head 63ef2602a7b7350595f10236097056991a55550e, against integrated target 7b0ea7800db3f3faccbaecb665d32b7c61eaf932, the following checks were run. They are build/compile/format/syntax checks only: none is combined-head native execution or a repeat of the source causal controls.

E="$HOME/.copilot/session-state/c33a22b9-b10e-4231-9b6e-2cf2ef8bc415/files"
export DOTNET_ROOT="$E/dotnet-net11"
export PATH="$DOTNET_ROOT:$PATH"
# Read-only pinned SDK 11.0.100-rtm.26514.118, Android workload 37.2.15.
# No SDK/package/target-framework version overrides.

dotnet build Microsoft.Maui.BuildTasks.slnf -c Release \
  -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false \
  -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false \
  -p:IncludeTizenTargetFrameworks=false -p:TreatWarningsAsErrors=false \
  -bl:"$E/consolidated-buildtasks.binlog" --nologo -v:q
# Passed: 0 warnings / 0 errors.

for project in src/Core/tests/DeviceTests/Core.DeviceTests.csproj \
  src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj \
  src/Essentials/test/DeviceTests/Essentials.DeviceTests.csproj; do
  name=$(basename "$project" .csproj)
  dotnet build "$project" -t:Compile -c Release -f net11.0-android \
    -p:RuntimeIdentifierOverride=android-arm64 \
    -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false \
    -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false \
    -p:IncludeTizenTargetFrameworks=false -p:TreatWarningsAsErrors=false \
    -p:UseMonoRuntime=true -p:_DisableCheckForUnsupportedMonoMobileRuntime=true \
    -p:RunAOTCompilation=false -bl:"$E/consolidated-$name-compile.binlog" \
    --nologo -v:q
done
# All three passed with 0 errors.
# Core: 3 existing MAUI1001/CS8632 warnings.
# Controls: 2 existing MAUI1001/xUnit2031 warnings.
# Essentials: 1 existing MAUI1001 warning.
# Compile only, not APK packaging, device tests or Apple compilation.

dotnet format Microsoft.Maui.sln --no-restore --exclude Templates/src \
  --exclude-diagnostics CA1822 --include \
  src/Core/tests/DeviceTests/AssertionExtensionsTests.cs \
  src/Essentials/test/DeviceTests/Tests/Android/MediaPickerRecovery_Tests.cs \
  src/Controls/tests/DeviceTests/Elements/Shell/ShellHandlerSubclasses.Android.cs \
  src/Controls/tests/DeviceTests/Elements/CollectionView/CollectionViewTests.iOS.cs \
  --verify-no-changes --verbosity quiet
# Passed, no source changes.

git diff --check 7b0ea7800db3f3faccbaecb665d32b7c61eaf932...HEAD
# Passed.

The actual embedded installation PowerShell was extracted and parsed with the existing #39573 syntax check:

pwsh -NoLogo -NoProfile -Command - <<'PS'
$ErrorActionPreference = 'Stop'
$text = Get-Content -Raw 'eng/devices/run-windows-devicetests.cmd'
$match = [regex]::Match($text, '(?m)^    powershell -NoProfile -Command \^\r?\n(?<body>(?:        ".*\r?\n)+)')
if (-not $match.Success) { throw 'Packaged installation PowerShell block was not found' }
$code = ($match.Groups['body'].Value -split '\r?\n' | Where-Object { $_.Trim() } | ForEach-Object { ($_ -replace '^\s*"', '' -replace '"(?: \^)?$', '') -replace '\\"', '"' }) -join "`n"
$tokens = $null
$parseErrors = $null
$null = [System.Management.Automation.Language.Parser]::ParseInput($code, [ref]$tokens, [ref]$parseErrors)
if ($parseErrors.Count -ne 0) { $parseErrors | Format-List; throw "$($parseErrors.Count) PowerShell syntax errors" }
Write-Output $code
Write-Output 'Embedded packaged-installation PowerShell: zero syntax errors'
PS
# Passed: zero syntax errors. No pipeline/configuration tests added or run.

Exact selected-source blob comparisons are empty for all six paths. The five component stable patch IDs are unchanged: GC 9ce1ab8e4693455de9cabc29865d0ec25bbad81d; picker 827e8c61149331f217828896e5472e8451327ad0; Window 7c6f60004d0301644f632111f55e2287d2a23119; CollectionView 7516fc4bc239efe75d013a330d411af13655cc75; deployment/docs 4d1a2fe75762a55516e43db58a4a33e107d78962. pr-finalize found no blocking combined-code findings and verified the title/body/six-path diff.

Still separate/unresolved: #39568's XAML failure, #39570's HybridWebView cleanup, #39574's Navigation behavior, and #39577's Windows wrapper identity/child cleanup are not fixed here. The original osx.26 Catalyst Core cancellation remains unverified execution. Earlier Windows packaged pre-test gaps are not relabeled as passes. The additional nine Essentials iOS CoreCLR CA1416 errors in build 1645823 and Windows Resizetizer SVG cleanup IOException in builds 1645789/1645874 are outside this six-path scope. The analyzer/compiler difference and the locked-file holding process have not been established; neither is dismissed as infrastructure/flaky, suppressed, or retried here.

CI boundary: prior per-fix native/hosted results above belong to their recorded heads, not this aggregate. Fresh automatic checks for the combined head are tracked separately in the check suite; no combined-head hosted success is claimed. No standalone native queue, watcher, retry, local Apple UI/XCTest/screen takeover, product PR edit, or change to the parent-owned investigation comment was made for consolidation.

Issues Fixed

Fixes #39464 (Helix Windows packaged dependency lock).

Also fixes the test-fixture baseline failures identified in this PR's original investigation: GC lifetime orchestration (equivalent to #39529; prior helper correction #39094), five Android file-URI recovery success inputs, the omitted reentrant Window-handler fixture registration, and grouped CollectionView constructor preservation. Consolidated source PRs: #39569, #39571, #39572, #39573. Product PRs #39568, #39570, #39574, #39577 remain separate.

Copilot AI balanced review requested due to automatic review settings October 21, 2026 22:29
@kubaflo
kubaflo temporarily deployed to copilot-pat-pool October 21, 2026 22:29 — with GitHub Actions Inactive
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 39536

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 39536"

@azure-pipelines

This comment has been minimized.

@kubaflo

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

@kubaflo
kubaflo temporarily deployed to copilot-pat-pool October 21, 2026 22:31 — with GitHub Actions Inactive
@kubaflo
kubaflo temporarily deployed to copilot-pat-pool October 21, 2026 22:33 — with GitHub Actions Inactive
@kubaflo
kubaflo temporarily deployed to copilot-pat-pool October 21, 2026 22:34 — with GitHub Actions Inactive
@kubaflo
kubaflo temporarily deployed to copilot-pat-pool October 21, 2026 22:35 — with GitHub Actions Inactive

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.

🔵 Needs a closer look

No blocking code defects were identified, but runtime-sensitive GC behavior warrants human review with independently verified current-head CI results.

No open issues 🎉

What changed in this PR

Ports the test-only fixture correction from #39529 to net11.0, stabilizing Mono GC regression coverage while preserving the shared-helper fix from #39094.

Changes:

  • Keeps the later weak-reference target rooted until its first actual liveness snapshot.
  • Releases both roots in a non-inlined method, leaving collection to the unchanged asynchronous helper.
  • Adds a later-target liveness assertion while preserving earlier-alive and final-death checks.
File Description
src/​Core/​tests/​DeviceTests/​AssertionExtensionsTests.cs Corrects fixture target lifetimes and strengthens liveness assertions without changing shared helpers or product code.

Review effort: Balanced

@kubaflo

kubaflo commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor Author

CI failure attribution

The checks are genuinely red, but the changed GC fixture passes wherever it executed. Every observed failing test assertion also fails on the exact net11.0 base. These are not all infrastructure failures, and rerunning the entire pipeline would not fix the known baseline failures.

Final main-run status, rechecked from the raw Azure timeline: main build 1644556 completed at 2026-10-22 12:04:21Z with 30/31 jobs successful, including 22/22 integration jobs successful. Its one failed job is the unit-test Helix monitor reporting the genuine XNameAreTrimmed(Runtime) baseline failure below. A red aggregate check does not mean every test failed.

PR head: 495b473347a058caee083866a564d6c3c1dc5c8d; tested merge: 82aa6339f5bf89b026ba97591042dc2962cea56d; exact base: 216c8045cbfa9d6a00f44ec2dad574ca1b9ec13e.

Pipeline / job Actual result Attribution
Main / Helix unit monitor XNameAreTrimmed(Runtime) fails in all four configurations Identical assertion on exact base
Main / Windows Pack Command-line-tools archive rejected before packing Same-head Windows peer installs the exact package
Device / executed assertions 49 failures, 16 distinct cases All 49 match the corresponding exact-base cases
Device / Windows packaged Four deployments fail before tests Same base MSIX dependency lock
Device / Catalyst osx.26 Core Canceled; no XML or logs Same base cancellation pattern; execution unverified

The GC fix itself

Device build 1644557 has all nine AssertionExtensionsTests passing in each of eight actual Core XML result sets: Android Mono/CoreCLR, iOS Mono/CoreCLR on both queues, Catalyst osx.15, and Windows unpackaged.

Android Mono full-Core results are 3,079 total / 3,007 passed / 0 failed / 72 skipped / 0 errors. Exact-base device build 1643729 fails the precise EarlierReferenceCollectedDuringLaterWait(useWaitForGC: True) case; this PR passes it along with the retained-reference and invalid-input safety cases. This is hosted target-branch evidence, not inherited GA evidence.

Windows packaged Core and Catalyst osx.26 Core did not produce execution evidence. They are not counted as passing.

Main CI: a real XAML baseline failure, not a broken reporter

Main build 1644556 fails Microsoft.Maui.Controls.Xaml.UnitTests.Maui27121.Tests.XNameAreTrimmed(inflator: Runtime) with Assert.NotNull() Failure: Value is null, at Maui27121.xaml.cs:30, in macOS/Windows Debug and Release.

The actual macOS Debug XML has 2,155 total / 2,146 passed / 1 failed / 8 skipped / 0 errors. All four original full consoles contain this same sole failure. All four matching consoles on exact-base main build 1643728 have the same case, assertion, and source location. The monitor correctly reports the failed work items; it is not a transport/upload problem. It has not been retried or bypassed.

Device CI: genuine pre-existing assertions

All nine original Helix jobs were correlated from this build's own submission logs. Both PR and exact-base builds contain 62 expected app work items plus nine administrative items; 57 app XML sets per build are available and have reconciled declaration/record counts.

All 49 failing execution instances / 16 distinct cases match the exact base by test identity, exception type, normalized message, and identical stack. Forty-five raw messages are byte-identical; four differ only in generated file URIs or FrameLayout instance IDs. Original messages are preserved.

Failure groups:

  • Android: HybridWebView clipping-container assertion, Window root-replacement timeout, and five MediaPicker recovery cases.
  • iOS: four Navigation renderer-expectation cases; Mono also has both grouped CollectionView empty-view constructor cases.
  • Windows unpackaged: three Label wrapper/reconnection Assert.Same cases.
  • Catalyst: the same two CollectionView and four Navigation cases on each queue.

These failures are not introduced by the one-file GC fixture patch. They are not labeled flaky or hidden by assertion changes/skips.

Missing execution and provisioning

Four Windows packaged apps fail Add-AppxPackage with 0x80073D02, while installing Microsoft.WindowsAppRuntime.2.msix; MicrosoftWindows.Client.WebExperience holds dependency resources open. The same four packaged deployment failures occur on exact base across different workers. There is no test XML from these items.

The Catalyst submission reaches its Azure 60-minute job limit while waiting for osx.26. Its Core work item ends with -1234, no files, and no established test execution; exact base has the same pattern on a different machine. The broad dotnet/dnceng#3008 cancellation match is not evidence that the genuine Controls assertions are infrastructure.

Windows Pack independently fails before packing/tests when cmdline-tools;13.0 returns Error on ZipFile unknown archive. The same-head Windows Release provisioning log explicitly installs and lists that exact package successfully. One diagnostic Pack-only failed-job retry was admitted with forceRetryAllJobs=false; macOS Pack and the genuine failed unit monitor remain on attempt 1. This retries the job, not test assertions, and adds no retry policy to source.

Windows Pack completed/succeeded on that single scoped retry at 2026-10-22 10:17:59Z, on the unchanged PR head and merge SHA. Its actual attempt-2 provisioning log explicitly installs and lists cmdline-tools;13.0; the common-package task had completed/succeeded at 10:04:12Z. A fresh raw Azure timeline verifies all seven originally successful jobs remain successful on attempt 1. The genuine failed unit monitor also remains unchanged on attempt 1.

The observation-only Pack watch has ended. There is no further retry, device/unit blanket rerun, source change, approval, merge, or check bypass. The full main run has completed with 30 successful jobs and the one genuine failed unit monitor. The PR is not green: the proven pre-existing XAML and device assertions above remain unresolved.

Separate baseline remediation

The GC patch in this PR remains unchanged. Eight separately validated baseline
fixes are now published:

Failure family Separate fix Verified evidence
XAML raw-name lookup #39568 Causal controls; hosted Runtime case passes all four configurations
Five MediaPicker file-URI fixtures #39569 Mono/CoreCLR causal controls plus private-path rejection and content-URI guards
HybridWebView disconnect parenting #39570 Native six-case causal controls; broader Hybrid category has zero failures
Derived Window reentrant fixture mapping #39571 Mono/CoreCLR 33-case causal controls; all 32 sibling cases remain passing
CollectionView fixture constructor trimming #39572 Native iOS Mono four-arm controls, three fresh processes per arm; original legacy/modern facts and eight existing skips preserved
Windows packaged dependency lock #39573 Exact GA #39498 port; all five packaged apps installed/launched, with complete reconciled XML
Navigation handler routing and interactive-pop policy #39574 Native Mono four-arm controls; supported CoreCLR build 1645892 has all 64 exact target records passing across both queues
Windows wrapper identity and native-child cleanup #39577 Native fixed/reverted/restored controls; original three and two new cleanup cases pass in final packaged and unpackaged Controls XML

Each of the seven assertion fixes was reproduced, corrected, reverted to failure,
and restored to passing without weakening the original assertions. These PRs are
independent of the GC patch; their existence does not turn this historical run
green or establish that every remaining baseline failure is fixed.

The CollectionView fix propagates the generic handler's existing
PublicConstructors trimming contract. Its linked legacy constructors change
from zero to two with the annotation; removing it restores the same two
CtorNotLocated failures. Across all 12 native runs, the same 82 class-pair
records reconcile: baseline/revert each have 72 pass / 2 fail / 8 existing skips;
candidate/restore each have 74 pass / 0 fail / 8 existing skips, with zero errors.
This is limited local evidence: iOS 18.5 Mono, pinned SDK 11.0.100 and iOS
27.0.12230, Xcode 26.6 with documented ValidateXcodeVersion=false and standard
non-WAE builds. It is not supported-Xcode 27 hosted, CoreCLR, or Catalyst
certification. The separate supported-host baseline 1645782 has now completed:
its Mono build succeeded and both iOS queues produced CollectionView category
XML with 83 total / 73 passed / 2 legacy CtorNotLocated failures / 8 skipped /
0 errors. Both modern facts passed. These are baseline results, not hosted
candidate validation.

The MSIX port applies ForceApplicationShutdown to the disposable Helix
runner's existing package installation, covering dependency processes as well as
the target app. Its Windows-only build 1645745 executed all five packaged apps,
including the four originally blocked routes; all 52 packaged launcher
invocations exited zero. All 112 source/aggregate XML files across ten packaged
and unpackaged apps reconcile. Each configuration has 3,389 passed / 3 failed /
162 skipped: only the same three original Label wrapper assertions remain.
This proves deployment/execution coverage, not that the original
WebExperience lock was present on the new workers or that the flag was necessary
in that particular successful run. No forced-lock experiment or whole-suite
green result is claimed.

The navigation fix corrects both the fixture's legacy-renderer assumption and
the modern handler's missing back-policy check. It evaluates the policy once,
reuses an admitted gesture's result for the navbar callback, and clears that
decision at lifecycle/stack boundaries. Supported CoreCLR build 1645892 has
1,256 General records per queue, zero failures/errors, and all 32 selected
original/native-button/reset cases passing per queue. It tested base b039b2b4,
not 7b0ea780; neither touched file differs between those bases. The separate
current-base Essentials analyzer build failure below remains explicit. The reset
control invokes native DidShow; it is not certification of a physical canceled
swipe.

The Windows wrapper fix preserves the Windows-owned wrapper slot without
retaining its disconnected native child. It also truly clears the Child
backing reference and old clip while preserving normal non-Windows/external
container cleanup. With identical tests, native runs 1645793 / 1645893 / 1645933
give fixed / product-only reverted / restored Label-category results of
44 pass / 0 fail / 2 existing skips, then 39 pass / 5 fail / 2 skips, then
44 pass / 0 fail / 2 skips. The negative control restores all three original
Assert.Same failures plus both new parent/child cleanup failures.

Final restored packaged Controls also installed and executed those five exact
cases successfully. Both packaged and unpackaged Controls have 976 pass /
0 fail / 33 skips; unpackaged Core has 2,033 pass / 0 fail / 111 skips, all with
zero errors. The other four packaged apps in that run fail before tests with
the separately addressed MSIX lock, so the pipeline is still red and no
execution coverage is claimed for those four items.

All originally assigned baseline families now have focused fix PRs. They remain
independent review/merge units; their existence does not certify a combined
merged tree or make the historical GC checks green. No unvalidated product
change is added to this GC PR, and existing failing results are retained rather
than hidden by broad retries.

Post-publication checks also exposed two additional unresolved families, not
part of the original 49 device assertion instances. Build 1645823 fails its iOS
CoreCLR compilation with nine Essentials CA1416 errors; identical inherited
source has compiled successfully in earlier runs, but the differing compiler /
analyzer execution has not been established. Builds 1645789 and 1645874 each
have one Windows Resizetizer SVG-test cleanup IOException from deleting a
locked temporary file (actual XML: 795 total / 792 passed / 1 failed / 2 skipped /
0 errors). The holding process or handle has not been measured. Neither family
is dismissed as infrastructure or "flaky"; no analyzer suppression, ignored
cleanup failure, retry policy, or speculative fix was added.

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.

🔵 Needs a closer look

Combined-head native execution and current CI outcomes remain independently unverified across the affected platforms, requiring final human review.

No open issues 🎉

Review effort: Balanced

@github-actions github-actions Bot removed the s/agent-review-in-progress AI review is currently running for this PR label Oct 23, 2026
@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Oct 23, 2026
@kubaflo

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

@kubaflo

kubaflo commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

/rebase

kubaflo and others added 5 commits October 23, 2026 14:21
Port only the fixture correction from #39529 (f11b889) to net11.0. Retain the later weak target through its first liveness snapshot, release both roots in a non-inlined frame, and preserve the unchanged helper collection and original safety assertions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c33a22b9-b10e-4231-9b6e-2cf2ef8bc415
Use canonical external-cache inputs only for incoming file-URI picker recovery success cases. Keep private capture/content fixtures and production validation unchanged, clean up owned external inputs, and assert private picker URI rejection preserves its source.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4e45178d-49ea-4de1-85ae-905502e5811e
Cherry-picked-from: 9a12d34
Copilot-Session: c33a22b9-b10e-4231-9b6e-2cf2ef8bc415
Match the base WindowTests registration so the inherited construction-reentry test actually invokes its replacement callback in WindowHandlerTests.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 73b5ca16-6343-4a5e-bb44-eaa12e175e88
Cherry-picked-from: 0f554a8
Copilot-Session: c33a22b9-b10e-4231-9b6e-2cf2ef8bc415
Propagate the public-constructor trimming contract through the generic empty-view fixture helper so both legacy and Items2 handler registrations remain activatable.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 88507d92-22fd-466c-86de-65cf187bf15b
Cherry-picked-from: 73ca647
Copilot-Session: c33a22b9-b10e-4231-9b6e-2cf2ef8bc415
Port the runner shutdown flag and CI facts from #39498 without importing GA history. Keep dependency-process shutdown limited to disposable Helix workers.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7c8b0ad3-c2a6-4fef-bd2a-0a06d36b7505
Cherry-picked-from: 7673773
Copilot-Session: c33a22b9-b10e-4231-9b6e-2cf2ef8bc415
@github-actions
github-actions Bot force-pushed the kubaflo-net11-gc-fixture-port branch from 63ef260 to c45f78a Compare October 23, 2026 14:21
Copilot AI balanced review requested due to automatic review settings October 23, 2026 14:21

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.

🔵 Needs a closer look

Combined-head native execution remains unverified for the runtime-sensitive fixtures and Windows dependency-process shutdown, warranting human sign-off.

No open issues 🎉

Review effort: Balanced

@kubaflo

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

s/agent-review-in-progress AI review is currently running for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants