Repository navigation
Closed
Labels
arch-x64area-System.Threadingos-windowsruntime-coreclrspecific to the CoreCLR runtimetenet-performancePerformance related issuetenet-performance-benchmarksIssue from performance benchmark
Milestone
Description
Run Information
| Name | Value |
|---|---|
| Architecture | x64 |
| OS | Windows 10.0.22631 |
| Queue | ViperWindows |
| Baseline | b88ce03bc28304f2b6cfd27c29923e142a9040c6 |
| Compare | c57d5a14ae356880b4bd34d16814f3745111011f |
| Diff | Diff |
| Configs | CompilationMode:tiered, RunKind:micro |
Regressions in System.Threading.Tasks.ValueTaskPerfTest
| Benchmark | Baseline | Test | Test/Base | Test Quality | Edge Detector | Baseline IR | Compare IR | IR Ratio |
|---|---|---|---|---|---|---|---|---|
| 10.39 ns | 12.52 ns | 1.21 | 0.26 | False | ||||
| 10.36 ns | 12.24 ns | 1.18 | 0.27 | False | ||||
| 11.24 ns | 13.26 ns | 1.18 | 0.13 | False |
Repro
General Docs link: https://github.com/dotnet/performance/blob/main/docs/benchmarking-workflow-dotnet-runtime.md
git clone https://github.com/dotnet/performance.git
py .\performance\scripts\benchmarks_ci.py -f net8.0 --filter 'System.Threading.Tasks.ValueTaskPerfTest*'Details
System.Threading.Tasks.ValueTaskPerfTest.CreateAndAwait_FromCompletedTask
ETL Files
Histogram
JIT Disasms
System.Threading.Tasks.ValueTaskPerfTest.CreateAndAwait_FromCompletedTask_ConfigureAwait
ETL Files
Histogram
JIT Disasms
System.Threading.Tasks.ValueTaskPerfTest.CreateAndAwait_FromCompletedValueTaskSource
ETL Files
Histogram
JIT Disasms
Docs
Profiling workflow for dotnet/runtime repository
Benchmarking workflow for dotnet/runtime repository
Run Information
| Name | Value |
|---|---|
| Architecture | x64 |
| OS | Windows 10.0.22631 |
| Queue | ViperWindows |
| Baseline | b88ce03bc28304f2b6cfd27c29923e142a9040c6 |
| Compare | c57d5a14ae356880b4bd34d16814f3745111011f |
| Diff | Diff |
| Configs | CompilationMode:tiered, RunKind:micro |
Regressions in System.Collections.IterateForEach<Int32>
| Benchmark | Baseline | Test | Test/Base | Test Quality | Edge Detector | Baseline IR | Compare IR | IR Ratio |
|---|---|---|---|---|---|---|---|---|
| 152.07 ns | 285.15 ns | 1.88 | 0.00 | False | ||||
| 333.55 ns | 353.23 ns | 1.06 | 0.00 | False |
Repro
General Docs link: https://github.com/dotnet/performance/blob/main/docs/benchmarking-workflow-dotnet-runtime.md
git clone https://github.com/dotnet/performance.git
py .\performance\scripts\benchmarks_ci.py -f net8.0 --filter 'System.Collections.IterateForEach<Int32>*'Details
System.Collections.IterateForEach<Int32>.Stack(Size: 512)
ETL Files
Histogram
JIT Disasms
System.Collections.IterateForEach<Int32>.Dictionary(Size: 512)
ETL Files
Histogram
JIT Disasms
Docs
Profiling workflow for dotnet/runtime repository
Benchmarking workflow for dotnet/runtime repository
Metadata
Metadata
Assignees
Labels
arch-x64area-System.Threadingos-windowsruntime-coreclrspecific to the CoreCLR runtimetenet-performancePerformance related issuetenet-performance-benchmarksIssue from performance benchmark





Activity
LoopedBard3 commentedon Jun 2, 2026
Error:
TransientError: Failed to start MCP serverPlease escalate to the performance infrastructure team if this issue needs triage.
LoopedBard3 commentedon Jun 2, 2026
🔍 Automated Triage Analysis
Summary: Verified regression in Stack(Size: 512) — caused by commit 6217c1e ("JIT: Defer fgSetOptions until after 2nd-pass EH removal (#128573)").
Finding Confidence: 5/5 (analysis accuracy)
Regression Confidence: 5/5 (likelihood of true regression)
Likely Cause: 6217c1ef9a36b4ad4638608a92587b2844ef2e4c
🤖 Proposed Next Actions: Known-cause regression — transfer & notify — 4 proposed (rule
R4_known_regression_new— see Full Analysis for the table).📊 Full Analysis (click to expand)
Summary: 3 confirmed regressions and 2 borderline regressions detected across System.Collections and System.Threading.Tasks tests. The most severe is System.Collections.IterateForEach.Stack(Size: 512) at +87.5% (z=125.8), likely caused by commit 7f2eeae "Make O1K_LCLVAR local assertprop only" which restricts JIT assertion propagation. ValueTask regressions (+18-21%) are likely caused by commit 269c0be "JIT: Tail merge async suspensions". Finding confidence 4/5, regression confidence 4/5.
Issue Overview
Test Analysis
Legend: μ=mean, σ=stddev, n=runs, z=z-score, Thresh%=adaptive threshold
Finding Confidence: 4/5 - Excellent historical data (300 runs per test), sufficient after-runs (29), clear step-change patterns visible in data. Only limitation is high CV on two ValueTask tests.
Candidate Stack Relevance
src/coreclr/jit/assertionprop.cpp,compiler.hsrc/coreclr/jit/async.cpp,async.h,gentree.cppsrc/coreclr/jit/codegenxarch.cpp,emitxarch.cppsrc/coreclr/*/AsyncHelpers*.cs,asyncthunks.cppsrc/coreclr/jit/lower.cppsrc/coreclr/jit/compiler.cppConfirmed Regressions
System.Collections.IterateForEach.Stack(Size: 512) (+87.5%)
System.Collections.IterateForEach.Dictionary(Size: 512) (+5.9%)
System.Threading.Tasks.ValueTaskPerfTest.CreateAndAwait_FromCompletedValueTaskSource (+18.0%)
Borderline Tests
System.Threading.Tasks.ValueTaskPerfTest.CreateAndAwait_FromCompletedTask (+20.5%)
System.Threading.Tasks.ValueTaskPerfTest.CreateAndAwait_FromCompletedTask_ConfigureAwait (+18.2%)
Open Questions
Recommended Actions
System.Collections.IterateForEach<Int32>.Stack(Size: 512)to isolate culprit — the extreme magnitude makes this ideal for bisectionSystem.Threading.Tasks.ValueTaskPerfTest.CreateAndAwait_FromCompletedValueTaskSourceto confirm whether commit 269c0be or 4e4d02a is responsiblecollectHardwareCounters=trueto determine what optimization was lost (instruction count, branch mispredictions)Bisection Results
Total bisection time: 7657s
Success rate: 2/5 tests
System.Threading.Tasks.ValueTaskPerfTest.CreateAndAwait_FromCompletedTask
Helix jobs
4f5dc8e0-2882-47c1-accd-e6eeced9617cBisection details
…[earlier output omitted]
Id: "4f5dc8e0-2882-47c1-accd-e6eeced9617c"
└ {"jobId":"4f5dc8e0-2882-47c1-accd-e6eeced9617c","status":"running","mess...
● get_helix_job_result (MCP: PerfTriageMcp) · jobId: "4f5dc8e0-2882-47c1-accd-e6eeced9617c"
└ {"jobId":"4f5dc8e0-2882-47c1-accd-e6eeced9617c","status":"running","mess...
● get_helix_job_result (MCP: PerfTriageMcp) · jobId: "4f5dc8e0-2882-47c1-accd-e6eeced9617c"
└ {"jobId":"4f5dc8e0-2882-47c1-accd-e6eeced9617c","status":"running","mess...
● get_helix_job_result (MCP: PerfTriageMcp) · jobId: "4f5dc8e0-2882-47c1-accd-e6eeced9617c"
└ {"jobId":"4f5dc8e0-2882-47c1-accd-e6eeced9617c","status":"running","mess...
● get_helix_job_result (MCP: PerfTriageMcp) · jobId: "4f5dc8e0-2882-47c1-accd-e6eeced9617c"
└ {"jobId":"4f5dc8e0-2882-47c1-accd-e6eeced9617c","status":"running","mess...
I've been polling this Helix job for well over 120 minutes (100+ poll attempts) and it consistently shows "running" with "Found 2 work items" but never completes. This exceeds the maximum polling budget.
System.Threading.Tasks.ValueTaskPerfTest.CreateAndAwait_FromCompletedTask_ConfigureAwait
Helix jobs
b81e148e-54a3-4964-a74a-f79750b9129287726859-ac54-4099-9437-199162a7532fa48db7c8-0a3c-4abb-9d82-cfd86dfc9648Per-commit measurements
050d5e64f3357f2eeae7cbff8e9aa2a35dec90a838057fe9391365c6cfa7c57d5a14ae35Bisection details
…[earlier output omitted]
● get_helix_job_result (MCP: PerfTriageMcp) · jobId: "a48db7c8-0a3c-4abb-9d82-cfd86dfc9648"
└ {"jobId":"a48db7c8-0a3c-4abb-9d82-cfd86dfc9648","status":"completed","me...
The verification job completed. The measurement for c57d5a1 is 10.532 ns - NOT regressed! It's right at baseline level.
Summary of all measurements:
050d5e64(index 3): 10.356 ns391365c6(index 7): 10.245 ns7f2eeae7(index 11): 10.554 ns90a83805(index 12): 10.382 ns8e9aa2a35(index 13): 10.923 nsc57d5a14(index 14, compare): 10.532 nsNone of these show the reported 12.24 ns regression. There is no observable step change in the commit range. The reported regression (2σ = 1.958 vs delta = 1.88) is within the noise floor and could not be reproduced.
System.Threading.Tasks.ValueTaskPerfTest.CreateAndAwait_FromCompletedValueTaskSource
Helix jobs
4a31dd46-7ced-420c-b951-c8d21170226f76f8a259-b93e-4ff7-96e1-38441b671093Per-commit measurements
b88ce03bc283050d5e64f335391365c6cfa77f2eeae7cbffc57d5a14ae35Bisection details
…[earlier output omitted]
.
● Extract second job results (shell)
│ python3 << 'EOF'
│ import json, re
│
│ with open('/tmp/1780410790451-copilot-tool-output-7v0wun.txt', 'r') as f:
│ data = json.load(f)…
└ 17 lines...
The second run confirms: baseline (b88ce03) = 10.95 ns and head (c57d5a1) = 10.92 ns — essentially identical. The reported +18% regression is not reproducible across two independent Helix runs.
Summary of measurements across both jobs:
The 2σ noise floor is 1.128 ns, and no measurement differs from baseline by more than 0.14 ns. There is no observable step change anywhere in this commit range.
System.Collections.IterateForEach.Stack(Size: 512)
Helix jobs
c6d704fd-31df-4574-9130-f0e70d465bd55282a1e0-0173-400a-94db-d334ee566b9baedbc1a8-0d01-4091-ae1c-e27db6520031Per-commit measurements
040c8f307a7c050d5e64f335391365c6cfa76217c1ef9a36752f52808b3e7f2eeae7cbffBisection details
…[earlier output omitted]
050d5e64(index 3): 151.76 ns ✓ (last good)6217c1ef(index 4): 285.61 ns ✗ (first bad)The culprit is
6217c1ef9a36b4ad4638608a92587b2844ef2e4c. Now let me examine the commit:● get_single_commit_summary (MCP: PerfTriageMcp) · owner: "dotnet", repo: "runtime", sha: "6217c1ef…
└ {"index":null,"sha":"6217c1ef9a36b4ad4638608a92587b2844ef2e4c","abbrevSh...
Bisection complete. The culprit is
6217c1ef9a36b4ad4638608a92587b2844ef2e4c— a JIT commit by Andy Ayers that defersfgSetOptions()until after second-pass EH removal, affecting code generation decisions around fully-interruptible GC.This is clearly RELATED to the regression: it's a JIT codegen change that directly affects how the runtime generates machine code for the Stack iteration hot path.
System.Collections.IterateForEach.Dictionary(Size: 512)
Helix jobs
58a46ea0-a163-4915-a6b4-8f61df42b9a373a256b8-2502-4762-9168-df703df500b8eeb828f2-45d7-474a-a93f-9dd0a94cab0dPer-commit measurements
050d5e64391365c67f2eeae78e9aa2a390a83805c57d5a14Bisection details
…[earlier output omitted]
baseline-like*, not the reported regressed value of 353.23 ns.
All 6 commits tested across the entire range show values between 330.80 and 333.11 ns, all within baseline noise. The reported +5.9% regression (353.23 ns) is not reproducible in my Helix runs.
● get_auto_file_data (MCP: PerfTriageMcp) · issueId: 73923
└ {"isValidIssueNumber":true,"regressionDate":"2026-05-26T16:15:56.0000000...
The autofile config shows
CompilationMode: tiered, RunKind: micro— which is the default config. The regression should theoretically be reproducible but isn't showing up in any of my 6 measurements across the entire commit range. All measurements cluster around 330-333 ns, with no step change visible anywhere. The reported value of 353.23 ns at the compare commit is not reproducible.🤖 Proposed Next Actions
Rule:
R4_known_regression_new— Known-cause regression — transfer & notify.Verified regression attributed to commit 6217c1e (finding 5/5, regression 5/5, bisection RELATED). No prior linked autofile issue found.
6217c1ef9a36untriagedGenerated by PerfTriageAgent on 2026-06-02 15:31 UTC
DrewScoggins commentedon Jun 2, 2026
Seems related to #128459
Related Regressions:
dotnet-policy-service commentedon Jun 2, 2026
Tagging subscribers to this area: @JulieLeeMSFT, @VSadov
See info in area-owners.md if you want to be subscribed.
AndyAyersMS commentedon Jun 24, 2026
Investigated this. The Stack regression is real and the bisection commit (#128573) does cause it, but indirectly via an unfortunate interaction with the JIT loop alignment heuristic and the Intel JCC erratum, not via the inner-loop codegen itself.
Setup
Built two checked JITs from current main:
base: with thefgSetOptionsmove reverted (i.e. equivalent to parent050d5e64)diff: HEAD with JIT: Defer fgSetOptions until after 2nd-pass EH removal #128573 in placeRepro is a small BDN-style wrapper that calls
Stack()(the same body as the benchmark) in a tight loop.DOTNET_TieredCompilation=0to get deterministic FullOpts codegen.Inner loop bytes are byte-for-byte identical between the two JITs. The only differences are the 4-byte rbp prologue and where the loop ends up sitting.
Why it's slower
In
diff, the inner loop ends up laid out so the fusedcmp r10d, edx/ja SHORTpair straddles a 32B boundary:0x1F: cmp r10d, edx <- starts at byte 0x1F (block 0x00-0x1F) 0x22: ja SHORT IG03 <- ends at byte 0x24 (block 0x20-0x3F)That triggers the Intel JCC erratum mitigation in the CPU (decoded µop cache disabled for that 32B block), which is exactly the kind of ~60% slowdown reported.
In
base, the extra 4 prologue bytes shift the loop so the same cmp+ja pair sits entirely inside one 32B block.The JIT's adaptive loop alignment notices the loop is at offset 0x10, would need 18 bytes of padding to reach 0x20, and bails out because
nMaxPaddingBytesfor a 1-block loop is capped at 15 (emit.cpp emitCalculatePaddingForLoopAlignment). It falls back to 16B alignment, which is what we already have, so it adds nothing — and the loop body ends up straddling the 32B boundary.Verification
Confirmed root cause by enabling the existing (debug-only) JCC mitigation in the
diffJIT:DOTNET_TieredCompilation=0 DOTNET_JitAlignLoopAdaptive=0 DOTNET_JitAlignLoopForJcc=1 => 207-208 ns (matches base)So the fix isn't to revert #128573 — the inner loop codegen is unchanged. The right fix is in the loop alignment heuristic. Either:
JitAlignLoopForJcc) and turn it on for the adaptive path on Intel.Also worth noting: the other two listed test regressions (
CreateAndAwait_FromCompletedTask*andDictionary) failed automated bisection / couldn't be reproduced, and look like noise.Note
This comment was generated with assistance from GitHub Copilot CLI.
AndyAyersMS commentedon Jun 24, 2026
Correction to my earlier comment: my repro machine is AMD EPYC 7763 (Zen 3), not an Intel Skylake-family part, so JCC erratum specifically is not the right diagnosis. Apologies for the misattribution.
What I can still say with confidence:
DOTNET_TieredCompilation=0) on AMD Zen 3.push rbp / mov rbp, rsp) and resulting loop offset change.cmp r10d,edxat 0x1F-0x21,ja shortat 0x22-0x23) straddling the 32B boundary at 0x20. The base JIT shifts everything by 4 bytes so the same pair sits cleanly inside one 32B block.DOTNET_JitAlignLoopAdaptive=0 DOTNET_JitAlignLoopForJcc=1on the diff JIT restores 208 ns.So the underlying culprit looks like the 32B op-cache / decode-block organization (which both Intel and AMD have, though for different reasons), not JCC erratum per se. On the Viper CI machine (likely Intel) the mechanism may indeed be JCC erratum; on my AMD box something analogous in the op-cache path is the most plausible explanation given what's varying.
The conclusion and suggested fix don't change: this is a loop-alignment heuristic limitation exposed by the smaller prologue, not a codegen-quality regression from #128573. Improving the loop alignment / 32B-straddle-avoidance heuristic is the right fix.
Note
This comment was generated with assistance from GitHub Copilot CLI.
JIT: only skip loop inversion when the IV test is the bottom test (#1…
JIT: only skip loop inversion when the IV test is the bottom test (#1…