Skip to content

Conversation

jackh726
Copy link
Member

@jackh726 jackh726 commented Sep 28, 2025

See #t-types/trait-system-refactor > perf `async-closures/post-mono-higher-ranked-hang.rs` for context

Things compile and tests pass, but not sure if this actually solves the perf issue (edit: it does). Opening up this to do a perf (and maybe crater) run.

r? lcnr

@rustbot rustbot added PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Sep 28, 2025
@rust-log-analyzer

This comment has been minimized.

@jackh726
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Sep 29, 2025
Split Bound index into Canonical and Bound
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 29, 2025
@rust-bors
Copy link

rust-bors bot commented Sep 29, 2025

☀️ Try build successful (CI)
Build commit: 76676ec (76676ec14f76a781cb896ff6bc288cdebd16598d, parent: f957826bff7a68b267ce75b1ea56352aed0cca0a)

@rust-timer

This comment has been minimized.

@rust-cloud-vms rust-cloud-vms bot force-pushed the split-canonical-bound branch from 3d24484 to 1372123 Compare September 29, 2025 04:30
@rustbot rustbot added the T-clippy Relevant to the Clippy team. label Sep 29, 2025
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (76676ec): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.2% [0.1%, 0.3%] 9
Regressions ❌
(secondary)
0.2% [0.2%, 0.3%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.3% [-0.6%, -0.2%] 6
All ❌✅ (primary) 0.2% [0.1%, 0.3%] 9

Max RSS (memory usage)

Results (primary -0.5%, secondary -4.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.8% [0.9%, 3.3%] 3
Improvements ✅
(primary)
-0.5% [-0.5%, -0.5%] 1
Improvements ✅
(secondary)
-6.0% [-11.2%, -1.2%] 9
All ❌✅ (primary) -0.5% [-0.5%, -0.5%] 1

Cycles

Results (primary 2.3%, secondary -1.6%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.3% [2.3%, 2.3%] 1
Regressions ❌
(secondary)
4.1% [4.1%, 4.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.8% [-4.8%, -1.1%] 5
All ❌✅ (primary) 2.3% [2.3%, 2.3%] 1

Binary size

Results (primary 0.0%, secondary 0.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.0% [0.0%, 0.1%] 65
Regressions ❌
(secondary)
0.0% [0.0%, 0.2%] 43
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [0.0%, 0.1%] 65

Bootstrap: 470.189s -> 470.608s (0.09%)
Artifact size: 387.63 MiB -> 387.72 MiB (0.02%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Sep 29, 2025
@lcnr
Copy link
Contributor

lcnr commented Sep 29, 2025

gotta say, I do not understand perf xd, I was so sure this would have a bigger perf impact on the new solver 😄

@jackh726 jackh726 marked this pull request as ready for review September 29, 2025 18:01
@rustbot
Copy link
Collaborator

rustbot commented Sep 29, 2025

Some changes occurred in compiler/rustc_sanitizers

cc @rcvalle

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

This PR changes rustc_public

cc @oli-obk, @celinval, @ouz-a

HIR ty lowering was modified

cc @fmease

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 29, 2025
@jackh726
Copy link
Member Author

@bors2 try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Sep 29, 2025
Split Bound index into Canonical and Bound
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 29, 2025
Copy link
Contributor

@lcnr lcnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some nits, then r=me

I don't think this needs a crater run 😁

View changes since this review


let anon_bound_tys = (0..NUM_PREINTERNED_ANON_BOUND_TYS_I)
.map(|i| {
(0..NUM_PREINTERNED_ANON_BOUND_TYS_V)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please either check it yourself or leave a fixme here: we sohuld not have fr fewer bound tys/regions/consts so we could preintern fewer of them

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a comment to NUM_PREINTERNED_ANON_BOUND_TYS_V, let me know your thoughts. tl;dr 90% 0 vars, 9% 1, usually not more than 3-5. But, given that it's heap allocated, I don't know what reducing it from 20 actually buys us.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah 🤔 20 is low enough to not really matter

i though we had like 400 of them (for regions at least) and i would expect to pretty much never have that many bound vars

assert!(
!predicate
.trait_ref
.has_type_flags(TypeFlags::HAS_CANONICAL_BOUND | TypeFlags::HAS_TY_BOUND)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how does this assert work? It would ICE for for<T> fn(T). I guess that doesn't exist yet (if ever)🤔

@lcnr
Copy link
Contributor

lcnr commented Sep 29, 2025

can you add a next-solver revision to the previously very slow test

@rust-bors
Copy link

rust-bors bot commented Sep 29, 2025

☀️ Try build successful (CI)
Build commit: f13b256 (f13b2569c4e269069c2a885e5834791a031a8bc0, parent: dc2c3564d273cf8ccce32dc4f47eaa27063bceb9)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f13b256): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.2% [0.1%, 0.3%] 5
Regressions ❌
(secondary)
0.2% [0.2%, 0.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.3% [-0.6%, -0.2%] 5
All ❌✅ (primary) 0.2% [0.1%, 0.3%] 5

Max RSS (memory usage)

Results (primary -3.7%, secondary -4.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.8% [1.1%, 2.7%] 3
Improvements ✅
(primary)
-3.7% [-3.7%, -3.7%] 1
Improvements ✅
(secondary)
-6.1% [-11.3%, -1.2%] 9
All ❌✅ (primary) -3.7% [-3.7%, -3.7%] 1

Cycles

Results (secondary 0.3%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.5% [2.8%, 4.3%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.9% [-4.7%, -1.4%] 3
All ❌✅ (primary) - - 0

Binary size

Results (primary 0.0%, secondary 0.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.0% [0.0%, 0.1%] 65
Regressions ❌
(secondary)
0.0% [0.0%, 0.2%] 43
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [0.0%, 0.1%] 65

Bootstrap: 470.099s -> 472.362s (0.48%)
Artifact size: 387.67 MiB -> 387.70 MiB (0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 29, 2025
@jackh726 jackh726 force-pushed the split-canonical-bound branch from f0434cc to 050d60f Compare September 30, 2025 07:18
@rust-log-analyzer

This comment has been minimized.

Copy link
Contributor

@lcnr lcnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me after you fix CI :3

View changes since this review

@jackh726 jackh726 force-pushed the split-canonical-bound branch from 050d60f to d1bbd39 Compare September 30, 2025 16:58
@jackh726
Copy link
Member Author

@bors r=lcnr

@bors
Copy link
Collaborator

bors commented Sep 30, 2025

📌 Commit d1bbd39 has been approved by lcnr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 30, 2025
@bors
Copy link
Collaborator

bors commented Oct 2, 2025

⌛ Testing commit d1bbd39 with merge 4b9c62b...

@bors
Copy link
Collaborator

bors commented Oct 2, 2025

☀️ Test successful - checks-actions
Approved by: lcnr
Pushing 4b9c62b to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 2, 2025
@bors bors merged commit 4b9c62b into rust-lang:master Oct 2, 2025
11 checks passed
@rustbot rustbot added this to the 1.92.0 milestone Oct 2, 2025
Copy link
Contributor

github-actions bot commented Oct 2, 2025

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 42b384e (parent) -> 4b9c62b (this PR)

Test differences

Show 48 test diffs

Stage 1

  • [ui] tests/ui/async-await/async-closures/post-mono-higher-ranked-hang.rs: pass -> [missing] (J0)
  • [ui] tests/ui/async-await/async-closures/post-mono-higher-ranked-hang.rs#current: [missing] -> pass (J0)
  • [ui] tests/ui/async-await/async-closures/post-mono-higher-ranked-hang.rs#next: [missing] -> pass (J0)

Stage 2

  • [ui] tests/ui/async-await/async-closures/post-mono-higher-ranked-hang.rs: pass -> [missing] (J1)
  • [ui] tests/ui/async-await/async-closures/post-mono-higher-ranked-hang.rs#current: [missing] -> pass (J1)
  • [ui] tests/ui/async-await/async-closures/post-mono-higher-ranked-hang.rs#next: [missing] -> pass (J1)

Additionally, 42 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 4b9c62b4da3e17cee99d3d2052f1c576b188e2a8 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-apple-various: 4295.3s -> 3621.4s (-15.7%)
  2. x86_64-gnu-llvm-20: 2413.1s -> 2749.3s (13.9%)
  3. x86_64-rust-for-linux: 2701.2s -> 3033.8s (12.3%)
  4. dist-aarch64-apple: 7751.7s -> 6884.4s (-11.2%)
  5. dist-ohos-aarch64: 4587.6s -> 4075.3s (-11.2%)
  6. dist-aarch64-msvc: 6621.4s -> 5909.4s (-10.8%)
  7. dist-x86_64-apple: 7064.5s -> 7770.4s (10.0%)
  8. x86_64-gnu: 6346.3s -> 6911.3s (8.9%)
  9. x86_64-gnu-llvm-20-3: 6010.8s -> 6474.0s (7.7%)
  10. aarch64-msvc-1: 7163.9s -> 6623.8s (-7.5%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (4b9c62b): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.2% [0.1%, 0.4%] 7
Regressions ❌
(secondary)
0.1% [0.1%, 0.2%] 11
Improvements ✅
(primary)
-1.0% [-2.8%, -0.1%] 4
Improvements ✅
(secondary)
-0.3% [-1.1%, -0.0%] 11
All ❌✅ (primary) -0.3% [-2.8%, 0.4%] 11

Max RSS (memory usage)

Results (primary -0.8%, secondary -4.5%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.6% [0.6%, 0.6%] 1
Regressions ❌
(secondary)
1.2% [1.2%, 1.2%] 1
Improvements ✅
(primary)
-0.9% [-1.4%, -0.6%] 9
Improvements ✅
(secondary)
-4.9% [-11.2%, -1.2%] 13
All ❌✅ (primary) -0.8% [-1.4%, 0.6%] 10

Cycles

Results (primary -2.8%, secondary -2.2%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.8% [-2.8%, -2.8%] 1
Improvements ✅
(secondary)
-2.2% [-3.3%, -1.1%] 6
All ❌✅ (primary) -2.8% [-2.8%, -2.8%] 1

Binary size

Results (primary 0.0%, secondary 0.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.0% [0.0%, 0.1%] 70
Regressions ❌
(secondary)
0.0% [0.0%, 0.2%] 43
Improvements ✅
(primary)
-1.1% [-1.1%, -1.1%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [-1.1%, 0.1%] 71

Bootstrap: 471.941s -> 471.25s (-0.15%)
Artifact size: 387.76 MiB -> 387.76 MiB (-0.00%)

@jackh726 jackh726 deleted the split-canonical-bound branch October 2, 2025 13:23
@panstromek
Copy link
Contributor

perf triage:

Improvements outweigh regressions, but some of those improvements are noise (clap-derive and syn). Main regressions match pre-merge results, so I assume this was deemed acceptable as a part of work on new solver, but I don't see any explicit justification.

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Oct 6, 2025
flip1995 pushed a commit to flip1995/rust that referenced this pull request Oct 6, 2025
Split Bound index into Canonical and Bound

See [#t-types/trait-system-refactor > perf &rust-lang#96;async-closures/post-mono-higher-ranked-hang.rs&rust-lang#96;](https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/perf.20.60async-closures.2Fpost-mono-higher-ranked-hang.2Ers.60/with/541535613) for context

Things compile and tests pass, but not sure if this actually solves the perf issue (edit: it does). Opening up this to do a perf (and maybe crater) run.

r? lcnr
@jackh726
Copy link
Member Author

jackh726 commented Oct 6, 2025

@panstromek

Perf here is somewhat irrelevant, since this change fixes a hang with the next solver that isn't covered by the test suite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants