Experiment with trusted cache population and MT consumption - #10834
Experiment with trusted cache population and MT consumption#10834Jan Provazník (JanProvaznik) wants to merge 6 commits into
Conversation
Keep trusted cache population process-based with file-access reporting while PR consumers use multithreaded MSBuild without Detours reporting. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Draft experiment separating trusted cache population from multithreaded, read-only PR consumption.
Changes:
- Forces process-based MSBuild for trusted cache seeding.
- Enables
-mtand disables file-access reporting for PR cache consumption. - Documents the design and pending MSBuild prerequisites.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
azure-pipelines.yml |
Configures distinct seed and consumer execution modes. |
docs/dev-guide.md |
Documents cache commands, constraints, and upstream blockers. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Document that read-only cache misses still execute under multithreaded MSBuild while remaining unable to publish remotely. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Treat every nonzero experimental cache exit as inconclusive because multithreaded task routing can produce failures that the authoritative process-based Arcade build will not reproduce. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Clarify that only a fully successful cache path suppresses the authoritative Arcade build. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Maintainer help needed for the trusted end-to-end cache validation: please create a branch inside The TestFX branch builds immutable A direct push to |
Build the pinned full-framework MSBuild prototype without cache credentials, verify its amd64 bootstrap, and inject it into trusted seed and read-only multithreaded consumer graph builds with a safe Arcade fallback. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Avoid mutating job-wide PATH so the authoritative Arcade fallback continues to use the normally pinned Visual Studio toolchain. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Experiment status
This is a draft experiment, not a merge-ready rollout. It explores the operational split discussed in #10726: trusted
mainbuilds populate MSBuildCache with process nodes, while PR builds consume it read-only with MSBuild's experimental multithreaded mode.Design
mainpopulationeng\common\msbuild.ps1 -msbuildMultiThreaded:$false ... TestFx.slnx /restore /graph /m /reportfileaccesses /t:Build .../p:MSBuildCacheRemoteCacheIsReadOnly=falseeng\common\msbuild.ps1 -msbuildMultiThreaded:$true ... TestFx.slnx /restore /graph /m /t:Build .../p:MSBuildCacheRemoteCacheIsReadOnly=truePopulation remains process-based because Detours attribution assumes at most one active project per node/process. PR consumption deliberately omits
/reportfileaccesses; hits materialize outputs, while misses execute under-mtbut cannot publish remotely.Every nonzero experimental cache-build exit runs the authoritative process-based Arcade fallback. MT changes task routing, so even a source-shaped error can be experiment-specific and must not suppress that fallback.
Patched MSBuild
The repository's pinned SDK does not contain the required engine fixes. Each eligible Windows cache job therefore:
dotnet/msbuild@16e184d749654ec43bf92c67ae4a9bcca2225401(draft PR #14871).System.AccessToken.artifacts\bin\bootstrap\net472\MSBuild\Current\Bin\amd64\MSBuild.exe(18.12.0.42801in local validation)._BuildToolPathandMSBUILD_EXE_PATH.The job-wide
PATHis not modified, so fallback and later validation retain the normal Visual Studio toolchain. If the source build or version check fails, the cache step is skipped and Arcade runs normally. Using the same prototype for seed and consumer avoids engine differences obscuring cache measurements.Security model
refs/heads/maincan populate remotely.System.AccessToken; they run Arcade fallback.CacheClient.logand the OAuth-bearing cache environment remain excluded from published artifacts.Cache identity and expected behavior
The experiment reuses the existing Azure Pipeline Cache backend and plugin knobs:
testfx-v1-Debugandtestfx-v1-Releaseuniverses.NUGET_PACKAGES=$(Build.SourcesDirectory)\.packages\stays aligned between seed and consumer.MSBuildCacheIdenticalDuplicateOutputPatterns=\**retains writable copy materialization.Expected behavior:
mainseed, unchanged nodes hit and materialize under-mt.mainseeds with the same prototype and configuration.Required MSBuild fixes
FileAccessDataacross TaskHost deserialization./reportfileaccessesis absent.-mtplus/reportfileaccessesactionably. The underlying Detours attribution model remains incompatible with in-process MT, so population stays process-based.TestFX-specific blockers and constraints
READ; direct origin push returns HTTP 403. A TestFX maintainer must push current HEADece35e7f3to amicrosoft/testfxbranch for credentialed non-fork validation.PATH.Build.projdiscovers projects too late for cache interception; the graph pass must invokeTestFx.slnxdirectly, followed by Arcade sign/pack withNoBuild=true.Measurements needed
For Debug and Release, collect:
Validation and live iterations
18.12.0.42801.System.PullRequest.IsFork=True; authoritative fallback passed on Windows Release/Debug, app-model, Linux, and macOS.eng\validate-affected-tests.ps1,eng\classify-build-change.ps1 -SelfTest, andgit diff --check.The remaining E2E step is a maintainer-owned, non-fork draft run. The fork gate must not be weakened or manually bypassed.
Rollback and exit criteria
Proceed only when a trusted run shows stable read-only hits, no TaskHost/file-access failure, no write attempt, correct outputs/tests, and measurable benefit. Roll back by removing the patched-engine step, consumer
-msbuildMultiThreaded:$true, and restoring/reportfileaccesseson process-based consumption. Exit if hit rate is too low, overhead erases benefit, fallback is nontrivial, correctness differs, credentials cannot be safely scoped, or the upstream attribution model changes.