Skip to content

Make root vars more stable #142090

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2025
Merged

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Jun 5, 2025

Never resolve a ty/ct vid to a higher vid as its root. This should make the optimization in #141500 more "stable" when there are a lot of vars flying around.

r? @ghost

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jun 5, 2025
@compiler-errors
Copy link
Member Author

@bors2 try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Jun 5, 2025

⌛ Trying commit e1567df with merge 55fb0af

To cancel the try build, run the command @bors2 try cancel.

rust-bors bot added a commit that referenced this pull request Jun 5, 2025
Make root vars more stable

Never resolve a ty/ct vid to a higher vid as its root. This should make the optimization in #141500 more "stable" when there are a lot of vars flying around.

r? `@ghost`
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 5, 2025
@rust-bors
Copy link

rust-bors bot commented Jun 5, 2025

☀️ Try build successful (CI)
Build commit: 55fb0af (55fb0af4ed7d14a8bca0f3c87248c6c66fcde13b)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (55fb0af): comparison URL.

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

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

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

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.6% [0.6%, 0.6%] 2
Improvements ✅
(primary)
-0.1% [-0.1%, -0.1%] 1
Improvements ✅
(secondary)
-0.6% [-1.3%, -0.1%] 8
All ❌✅ (primary) -0.1% [-0.1%, -0.1%] 1

Max RSS (memory usage)

Results (primary -1.1%, secondary 1.8%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.5% [1.5%, 1.5%] 1
Regressions ❌
(secondary)
1.8% [1.1%, 2.5%] 2
Improvements ✅
(primary)
-2.4% [-4.1%, -0.7%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -1.1% [-4.1%, 1.5%] 3

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 750.971s -> 751.025s (0.01%)
Artifact size: 371.78 MiB -> 371.71 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 Jun 6, 2025
@compiler-errors
Copy link
Member Author

Let's try this again

@bors2 try @rust-timer queue

@rust-timer

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Jun 9, 2025
Make root vars more stable

Never resolve a ty/ct vid to a higher vid as its root. This should make the optimization in #141500 more "stable" when there are a lot of vars flying around.

r? `@ghost`
@rust-bors
Copy link

rust-bors bot commented Jun 9, 2025

⌛ Trying commit e1567df with merge 8c7ffa9

To cancel the try build, run the command @bors2 try cancel.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 9, 2025
@rust-bors
Copy link

rust-bors bot commented Jun 9, 2025

☀️ Try build successful (CI)
Build commit: 8c7ffa9 (8c7ffa9414d872a8693f2144760144310f152c7f)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (8c7ffa9): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

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

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.9% [-1.5%, -0.4%] 14
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 3.1%, secondary -5.8%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.1% [2.0%, 4.3%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-5.8% [-8.9%, -2.7%] 2
All ❌✅ (primary) 3.1% [2.0%, 4.3%] 2

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 751.176s -> 750.384s (-0.11%)
Artifact size: 372.27 MiB -> 372.21 MiB (-0.02%)

@rustbot rustbot removed S-waiting-on-perf Status: Waiting on a perf run to be completed. perf-regression Performance regression. labels Jun 9, 2025
@compiler-errors
Copy link
Member Author

I don't see why we shouldn't land this, since I kinda like the invariant that we always equate a two vars with the root being its lowest vid. But it's also basically useless today, so I could see us tabling this for the future too.

r? lcnr

@lcnr
Copy link
Contributor

lcnr commented Jun 10, 2025

it's still a minor performance improvements and I agree that this change is desirable regardless of perf.

It also feels better wrt to fudging and what not

@bors r+ rollup=never

@bors
Copy link
Collaborator

bors commented Jun 10, 2025

📌 Commit e1567df has been approved by lcnr

It is now in the queue for this repository.

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jun 10, 2025
@compiler-errors compiler-errors marked this pull request as ready for review June 10, 2025 17:48
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 10, 2025
@compiler-errors compiler-errors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 10, 2025
@bors
Copy link
Collaborator

bors commented Jun 11, 2025

⌛ Testing commit e1567df with merge 2b0274c...

@bors
Copy link
Collaborator

bors commented Jun 11, 2025

☀️ Test successful - checks-actions
Approved by: lcnr
Pushing 2b0274c to master...

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

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 1c04750 (parent) -> 2b0274c (this PR)

Test differences

No test diffs found

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 2b0274c71dba0e24370ebf65593da450e2e91868 --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: 7994.5s -> 6762.3s (-15.4%)
  2. mingw-check-tidy: 75.9s -> 66.6s (-12.2%)
  3. aarch64-gnu: 6304.3s -> 6799.1s (7.8%)
  4. mingw-check-1: 1835.7s -> 1968.4s (7.2%)
  5. x86_64-apple-1: 6861.4s -> 7286.4s (6.2%)
  6. armhf-gnu: 4779.0s -> 5021.3s (5.1%)
  7. dist-x86_64-musl: 7357.6s -> 7010.5s (-4.7%)
  8. dist-i686-mingw: 7754.7s -> 8114.6s (4.6%)
  9. i686-gnu-1: 7884.8s -> 8247.0s (4.6%)
  10. dist-loongarch64-musl: 4776.3s -> 4984.1s (4.4%)
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 (2b0274c): 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.1% [0.1%, 0.1%] 1
Regressions ❌
(secondary)
0.3% [0.3%, 0.3%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.9% [-1.2%, -0.4%] 9
All ❌✅ (primary) 0.1% [0.1%, 0.1%] 1

Max RSS (memory usage)

Results (primary -1.5%, 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)
6.6% [3.6%, 9.7%] 2
Improvements ✅
(primary)
-1.5% [-1.5%, -1.5%] 1
Improvements ✅
(secondary)
-0.9% [-0.9%, -0.9%] 1
All ❌✅ (primary) -1.5% [-1.5%, -1.5%] 1

Cycles

Results (secondary -2.7%)

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)
- - 0
Improvements ✅
(secondary)
-2.7% [-2.7%, -2.7%] 1
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 756.123s -> 754.155s (-0.26%)
Artifact size: 372.14 MiB -> 372.17 MiB (0.01%)

@rustbot rustbot added the perf-regression Performance regression. label Jun 11, 2025
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. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants