Skip to content

Fix IdeCore benchmark build isolation - #84668

Merged
dibarbet merged 3 commits into
dotnet:mainfrom
dibarbet:dibarbet-fix-benchmark-build-isolation
Jul 29, 2026
Merged

Fix IdeCore benchmark build isolation#84668
dibarbet merged 3 commits into
dotnet:mainfrom
dibarbet:dibarbet-fix-benchmark-build-isolation

Conversation

@dibarbet

@dibarbet dibarbet commented Jul 29, 2026

Copy link
Copy Markdown
Member

Summary

  • prevent BenchmarkDotNet runner output properties from flowing into the Roslyn project-reference graph
  • return a nonzero exit code when BenchmarkDotNet reports build, validation, or execution failures
  • re-enable IdeCoreBenchmarks validation with a representative bounded Dry run

Test plan

  • dotnet build src\Tools\IdeCoreBenchmarks\IdeCoreBenchmarks.csproj -c Release -f net10.0 --no-restore --disable-build-servers
  • dotnet run --project src\Tools\IdeCoreBenchmarks\IdeCoreBenchmarks.csproj -c Release -f net10.0 --no-build --disable-build-servers -- --job Dry --filter=*SegmentedArrayBenchmarks_Indexer*
Microsoft Reviewers: Open in CodeFlow

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ce0cecc4-ebad-4080-898f-e63b5ecde88d
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

dibarbet and others added 2 commits July 29, 2026 11:09
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ce0cecc4-ebad-4080-898f-e63b5ecde88d
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ce0cecc4-ebad-4080-898f-e63b5ecde88d
@dibarbet
dibarbet marked this pull request as ready for review July 29, 2026 18:12
@dibarbet
dibarbet requested review from a team as code owners July 29, 2026 18:12
Copilot AI review requested due to automatic review settings July 29, 2026 18:12
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

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 tightens the benchmark validation story for IdeCoreBenchmarks by isolating BenchmarkDotNet’s build output properties from Roslyn’s project-reference graph, and by making benchmark runs fail the process when BenchmarkDotNet reports failures (so CI can reliably detect them).

Changes:

  • Updates IdeCoreBenchmarks runner startup to strip BenchmarkDotNet output-related MSBuild properties from project references and return a nonzero exit code on validation/build/execution failures.
  • Re-enables IdeCoreBenchmarks in eng/validate-benchmarks.ps1 using a bounded CI filter intended to exercise runner generation/build without running the whole suite.
  • Improves CI argument construction to support per-project --filter while keeping it as a single PowerShell argument.
Show a summary per file
File Description
src/Tools/IdeCoreBenchmarks/Program.cs Sets MSBuild global-properties removal env var to avoid cross-target output collisions; returns process exit code based on BenchmarkDotNet summaries.
eng/validate-benchmarks.ps1 Re-adds IdeCoreBenchmarks dry validation with a representative filter; allows per-entry CI filters.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 1

Comment on lines +58 to +63
var summaries = new BenchmarkSwitcher(typeof(Program).Assembly).Run(args);
return summaries.Any(summary =>
summary.HasCriticalValidationErrors ||
summary.Reports.Any(report => !report.BuildResult.IsBuildSuccess || !report.AllMeasurements.Any()))
? 1
: 0;
@dibarbet
dibarbet merged commit a1d9564 into dotnet:main Jul 29, 2026
28 checks passed
@dibarbet
dibarbet deleted the dibarbet-fix-benchmark-build-isolation branch July 29, 2026 20:54
jaredpar pushed a commit to jaredpar/roslyn that referenced this pull request Jul 30, 2026
## Summary
- prevent BenchmarkDotNet runner output properties from flowing into the
Roslyn project-reference graph
- return a nonzero exit code when BenchmarkDotNet reports build,
validation, or execution failures
- re-enable IdeCoreBenchmarks validation with a representative bounded
Dry run

## Test plan
- `dotnet build src\Tools\IdeCoreBenchmarks\IdeCoreBenchmarks.csproj -c
Release -f net10.0 --no-restore --disable-build-servers`
- `dotnet run --project
src\Tools\IdeCoreBenchmarks\IdeCoreBenchmarks.csproj -c Release -f
net10.0 --no-build --disable-build-servers -- --job Dry
--filter=*SegmentedArrayBenchmarks_Indexer*`
###### Microsoft Reviewers: [Open in
CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/dotnet/roslyn/pull/84668)

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ce0cecc4-ebad-4080-898f-e63b5ecde88d
@jjonescz jjonescz added this to the 18.11 milestone Aug 25, 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.

4 participants