Skip to content

Export only overhead Actual iterations in PerfLabExporter - #5369

Open
LoopedBard3 wants to merge 1 commit into
dotnet:mainfrom
LoopedBard3:loopedbard3-verify-overhead-storage-ordering
Open

LoopedBard3 wants to merge 1 commit into
dotnet:mainfrom
LoopedBard3:loopedbard3-verify-overhead-storage-ordering

Conversation

@LoopedBard3

Copy link
Copy Markdown
Member

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: 5ee791861b9c71634dc76d423db2df9d3780f407

Dimension Assessment Rationale
Change confidence 8.5/10 ↑ One-line filter change; BenchmarkDotNet.Extensions builds with 0 warnings/errors on SDK 12.0.100-alpha.1.26527.106.
↑ Against the saved Viper report, the new filter selects exactly the 20 OverheadActual values in order.
↓ No lab run or unit test exercises the exporter end to end.
↓ Downstream consumers of the Overhead invocation array will see fewer values per run.
Diagnosis confidence 9.5/10 ↑ All 29 values matched index-for-index across console, full BDN report, perf-lab report and Kusto for one Viper run.
Evidence fit 8/10 ↑ Explains warmup values (e.g. a 6.19 ns/op first warmup) mixed into the stored overhead array.
↓ Verified on one benchmark/run; warmup counts vary per benchmark.

Summary

The Overhead invocation counter in PerfLabExporter selected result.IsOverhead() && result.IterationStage != Jitting, so it included both OverheadWarmup and OverheadActual. The query sorted only by LaunchIndex, IterationIndex. Both stages start their index at 1, so warmup and actual values were interleaved in the exported array.

This change keeps only IterationMode.Overhead with IterationStage.Actual. Those are the overhead measurements that BenchmarkDotNet subtracts to get Result. The counter name and all other counters stay the same.

Evidence (Viper WASM, r2r_composite)

  • ADO build 3148908 (dotnet-runtime-perf 20261129.4), Helix job 98583ffc-f641-4f6f-817b-ec7c512cdfa6, work item wasm.x64.micro.net12.0.Partition12 (Pass), queue Ubuntu.2204.Amd64.Viper.Perf, PERFLAB_EVALUATE_OVERHEAD=1.
  • Exporter revision 94e617d1f (current main). BDN 0.16.0-nightly.20261029.662.
  • Test System.Runtime.Intrinsics.Tests.Perf_Vector128Of<UInt32>.InequalityOperatorBenchmark, launch 1/1: 9 OverheadWarmup + 20 OverheadActual. All 29 normalized values are distinct.
  • The console and full BDN report run them as W1..W9, A1..A20.
  • The perf-lab report and the Kusto Measurements.TestCounterResults store them as W1, A1, W2, A2, …, W9, A9, A10, …, A20. All 29 values match index-for-index after normalizing ns/op.
Stored index Source ns/op
0 Warmup 1 6.1917
1 Actual 1 0.0755
2 Warmup 2 0.0713
17 Actual 9 0.0751
18 Actual 10 0.0798

After this change, the array for this test would contain only A1..A20.

Validation

  • dotnet build src\harness\BenchmarkDotNet.Extensions\BenchmarkDotNet.Extensions.csproj -c Release: passed (0 warnings, 0 errors).
  • No lab jobs were queued.

The Overhead invocation counter previously included OverheadWarmup measurements and,
because measurements were ordered only by launch and iteration index, interleaved
warmup and actual values. Restrict it to IterationMode.Overhead with
IterationStage.Actual, matching what BenchmarkDotNet subtracts for Result.

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

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.

🟢 Approval recommended

There are no active review issues for the change excluding warmup measurements from the overhead export.

No open issues 🎉

What changed in this PR

This PR corrects the benchmark harness’s Overhead invocation export by including only actual overhead measurements, preventing warmup values from being interleaved with them.

Changes:

  • Filters overhead measurements to IterationMode.Overhead and IterationStage.Actual.
  • Preserves launch/iteration ordering, the counter name, and all other counters.
File Description
src/​harness/​BenchmarkDotNet.Extensions/​PerfLabExporter.cs Restricts exported overhead values to actual iterations, excluding warmup measurements.

Review effort: Balanced

@LoopedBard3
LoopedBard3 marked this pull request as ready for review November 30, 2026 19:54
@LoopedBard3 LoopedBard3 self-assigned this Nov 30, 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.

2 participants