Repository navigation
Reduce MTP startup work and service-resolution allocations by @thomhurst in #12069 (backport to rel/4.5) - #12086
Merged
Amaury Levé (Evangelink) merged 2 commits intoOct 26, 2026
Conversation
Amaury Levé (Evangelink)
approved these changes
Oct 26, 2026
Amaury Levé (Evangelink)
enabled auto-merge (squash)
October 26, 2026 12:57
Adapt the no-controller fast path to the release lifecycle without main-only run-completion handlers. Cover empty and disabled controller configurations while preserving factory evaluation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Amaury Levé (Evangelink)
disabled auto-merge
October 26, 2026 14:52
Amaury Levé (Evangelink)
merged commit Oct 26, 2026
4bffad0
into
microsoft:rel/4.5
4 of 8 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Release-applicable backport of #12069 to
rel/4.5, sourced from merge commit92cbd59de751ca7ce5a44974073c30badeee93f5. This preserves the command-line option index optimization, cached internal-extension types, direct first-match service resolution, lazy missing-service diagnostics, and the no-controller configuration fast path.The original backport head
06f71daed6fd1aa568ba3a509adfe9e9f1b520bbalready contained real source changes, but also committed merge-conflict markers and a main-only run-completion handler block. Repair commit4c0d2967377fd3e2aa37484bce8af38442eb6c25removes that incompatible block and adapts the fast path to the existing release controller/reporting lifecycle. It does not introduce run-completion handler APIs or import the separate build-date optimization in #12085.Controller factories and enablement checks still execute before deciding whether a controller is required. Enabled registrations retain their ordering, custom launchers still force process restart, and service selection, internal visibility, case-insensitive option matching, duplicate failures, and missing-service exception type/message remain unchanged. Two additional release-specific tests cover empty controller configuration and disabled environment/lifetime/data-consumer/launcher factories, including their evaluation and lack of service registration.
Revision-bound validation
Base:
d15f90a1218299d67e9d2c35395f58bf052c9854. Windows x64, repository-bootstrapped SDK12.0.100-alpha.1.26480.103, Release configuration, test runtime9.0.20. Direct MSBuild commands used-m:2 -nr:false.TestHostControllersManager.cs.changes.patchin the PR diff.The baseline uses the four touched production files exported verbatim with
git archivefrom the base commit; their extracted Git blob IDs were verified. A temporaryCustomBeforeMicrosoftCommonTargetshook substituted only those files during the baseline platform build. The baseline DLL was saved, the repaired host built, and the same retained test assembly run once with each platform DLL. Both TRX files confirm the new controller cases and the preserved first-match/internal-visibility/missing-diagnostic cases passed.Retained test-assembly SHA-256:
24879C79B57E9BB9D7AFD0159E0031D7DBDE3B51448360BBADC3883BE4DF3A67.Commands from the repository root:
The direct host command was executed with each selected DLL. The baseline run used
--report-trx-filename baseline.trx --results-directory .\artifacts\backport-12086\results\baseline; the repaired run used the following command. Both exited 0 with 653 passed:Binlogs, exported baseline sources, saved baseline/repaired DLLs, and both TRX files are retained locally under
artifacts\backport-12086.Limitations
The repository build script bootstrapped the pinned SDK/workloads, but its nested
eng\common\dotnet-install.cmdruntime-install step could not resolve legacypowershellon this host; the inner toolset build failed, despite the wrapper returning exit 0. The successful compilation commands above therefore use the bootstrapped local SDK directly. The required pinned test runtime was installed successfully usingeng\common\dotnet-install.ps1 -runtime dotnet -version 9.0.20 -dotnetPath <worktree>\.dotnet -architecture x64.Execution coverage is the focused net9.0 selection, not the full suite or acceptance tests; net8.0 and netstandard2.0 were compiled, not executed. No new performance measurements are claimed for this release branch. Unrelated conflict markers in
src\Platform\Microsoft.Testing.Extensions.PackagedApp\InternalAPI\InternalAPI.Unshipped.txtare already present in the base revision and are unchanged by this PR; full-repository CI can still encounter that inherited release-base problem. CI for the repair commit has not been awaited./cc Amaury Levé (@Evangelink) Tom Longhurst (@thomhurst)