Skip to content

Migrate ApplyCssScopes to IMultiThreadableTask#54705

Merged
jankratochvilcz merged 2 commits into
dotnet:mainfrom
jankratochvilcz:mt/migrate-applycssscopes
Jun 18, 2026
Merged

Migrate ApplyCssScopes to IMultiThreadableTask#54705
jankratochvilcz merged 2 commits into
dotnet:mainfrom
jankratochvilcz:mt/migrate-applycssscopes

Conversation

@jankratochvilcz

@jankratochvilcz jankratochvilcz commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Migrates ApplyCssScopes (src/StaticWebAssetsSdk/Tasks/ScopedCss/ApplyCssScopes.cs) to multi-threadable by adding [MSBuildMultiThreadableTask].

Fixes dotnet/msbuild#14033

Perfstar regression (14d, Windows, paired MT vs non-MT, p50 sum across iterations)

Target non-MT (ms) MT (ms) Δ (ms) Δ (%)
ResolveCssScopes 116 5,134 +5,018 +4,326 %

Changes

  • [MSBuildMultiThreadableTask] on the concrete class. No IMultiThreadableTask plumbing needed — the task body matches scoped CSS items to inputs purely in memory; Environment.NewLine is the only Environment.* reference and is a string constant.

Compatibility sins audit (per migration skill)

24/24 dimensions clean — attribute-only opt-in.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

@jankratochvilcz

Copy link
Copy Markdown
Contributor Author

No decoy-style unit test added — not viable here

This is an attribute-only opt-in. A decoy-CWD test of the form used for GenerateStaticWebAssetsManifest / MergeConfigurationProperties is not meaningful: the task body contains no File.*, Directory.*, Path.GetFullPath, Environment.* (except Environment.NewLine, a string constant), or Process.* calls whose behavior could diverge under a different process CWD. There is therefore no observable runtime behavior the migration could regress for the decoy test to catch — the attribute purely toggles whether MSBuild wraps the task in a TaskHost, which a unit test cannot exercise.

@jankratochvilcz jankratochvilcz marked this pull request as ready for review June 16, 2026 17:11
Copilot AI review requested due to automatic review settings June 16, 2026 17:11

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.

Pull request overview

This PR opts ApplyCssScopes into MSBuild’s multi-threadable task execution by annotating it with [MSBuildMultiThreadableTask], aligning it with MSBuild’s parallel task execution requirements and addressing the regression described in msbuild#14033.

Changes:

  • Add [MSBuildMultiThreadableTask] to ApplyCssScopes.

@jankratochvilcz jankratochvilcz enabled auto-merge (squash) June 17, 2026 08:12
@jankratochvilcz

Copy link
Copy Markdown
Contributor Author

/azp run dotnet-sdk-public-ci

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@jankratochvilcz

Copy link
Copy Markdown
Contributor Author

/azp run dotnet-sdk-public-ci

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Marks the task with [MSBuildMultiThreadableTask] so MSBuild's multithreaded mode skips the per-task TaskHost wrapper. The task body matches scoped CSS to inputs purely in memory, so attribute-only opt-in is sufficient per the migration skill.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jankratochvilcz jankratochvilcz force-pushed the mt/migrate-applycssscopes branch from 2f86107 to ebf8d62 Compare June 17, 2026 08:51
@jankratochvilcz

Copy link
Copy Markdown
Contributor Author

/azp run dotnet-sdk-public-ci

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@jankratochvilcz

Copy link
Copy Markdown
Contributor Author

/azp run dotnet-sdk-public-ci

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@jankratochvilcz jankratochvilcz merged commit d857913 into dotnet:main Jun 18, 2026
25 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview6 milestone Jun 23, 2026
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.

[Multithreaded] Migrate ApplyCssScopes in SDK

3 participants