Skip to content

Shallow resolve ty and const vars to their root vars#151380

Merged
rust-bors[bot] merged 4 commits intorust-lang:mainfrom
ShoyuVanilla:shallow-resolve-to-root-var
Feb 15, 2026
Merged

Shallow resolve ty and const vars to their root vars#151380
rust-bors[bot] merged 4 commits intorust-lang:mainfrom
ShoyuVanilla:shallow-resolve-to-root-var

Conversation

@ShoyuVanilla
Copy link
Copy Markdown
Member

Continuation of #147193

@rustbot rustbot added 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. labels Jan 19, 2026
@ShoyuVanilla
Copy link
Copy Markdown
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jan 19, 2026
…try>

Shallow resolve ty and const vars to their root vars
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 19, 2026
@BoxyUwU BoxyUwU self-assigned this Jan 19, 2026
@rust-log-analyzer

This comment has been minimized.

@ShoyuVanilla ShoyuVanilla force-pushed the shallow-resolve-to-root-var branch from 5519c04 to be5754c Compare January 19, 2026 19:39
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Jan 19, 2026

☀️ Try build successful (CI)
Build commit: 8a10486 (8a10486cfa2f32b8142c983ae52fa13439478769, parent: d940e56841ddcc05671ead99290e35ff2e98369f)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (8a10486): 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.4% [0.2%, 0.9%] 32
Regressions ❌
(secondary)
0.7% [0.2%, 2.2%] 26
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.2% [-6.0%, -0.1%] 45
All ❌✅ (primary) 0.4% [0.2%, 0.9%] 32

Max RSS (memory usage)

Results (primary 0.9%, secondary 1.1%)

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.2%, 2.4%] 2
Regressions ❌
(secondary)
4.0% [4.0%, 4.0%] 1
Improvements ✅
(primary)
-1.9% [-1.9%, -1.9%] 1
Improvements ✅
(secondary)
-1.7% [-1.7%, -1.7%] 1
All ❌✅ (primary) 0.9% [-1.9%, 2.4%] 3

Cycles

Results (primary 2.5%, secondary -2.5%)

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

mean range count
Regressions ❌
(primary)
2.5% [2.3%, 2.7%] 2
Regressions ❌
(secondary)
4.6% [4.6%, 4.6%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.4% [-4.1%, -2.8%] 8
All ❌✅ (primary) 2.5% [2.3%, 2.7%] 2

Binary size

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

Bootstrap: 473.058s -> 475.232s (0.46%)
Artifact size: 383.29 MiB -> 383.28 MiB (-0.00%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jan 19, 2026
@ShoyuVanilla ShoyuVanilla marked this pull request as ready for review January 20, 2026 03:06
@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 Jan 20, 2026
@lcnr
Copy link
Copy Markdown
Contributor

lcnr commented Jan 20, 2026

Looking at this again, I remember something I would have liked to try which is more involved.

Instead of manually resolving to the root, we already do this in ena inside of the probe anyways

https://github.com/rust-lang/ena/blob/8e88541a49fa248e15aeb138e404ac5415e862ed/src/unify/mod.rs#L570

So we could add a variant of probe to ena which returns both the root key, and the value for that key, and then if the value is still unknown, we've only had to fetch the root once. Right now we have to do it twice. I think that should avoid all the perf regressions

@lcnr
Copy link
Copy Markdown
Contributor

lcnr commented Jan 20, 2026

r? lcnr

@rustbot rustbot assigned lcnr and unassigned BoxyUwU Jan 20, 2026
@lcnr lcnr added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 20, 2026
@ShoyuVanilla ShoyuVanilla force-pushed the shallow-resolve-to-root-var branch from be5754c to eafdf75 Compare January 20, 2026 17:00
@rustbot rustbot added A-tidy Area: The tidy tool T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Jan 20, 2026
@rustbot

This comment has been minimized.

@ShoyuVanilla
Copy link
Copy Markdown
Member Author

@bors try @rust-timer queue

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Feb 11, 2026

📌 Commit 8062bee has been approved by lcnr

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Feb 11, 2026
@lcnr
Copy link
Copy Markdown
Contributor

lcnr commented Feb 11, 2026

@bors rollup=never

@rust-bors

This comment has been minimized.

@rust-bors rust-bors Bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 15, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Feb 15, 2026

☀️ Test successful - CI
Approved by: lcnr
Duration: 3h 15m 23s
Pushing 75b9d89 to main...

@rust-bors rust-bors Bot merged commit 75b9d89 into rust-lang:main Feb 15, 2026
12 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Feb 15, 2026
@ShoyuVanilla ShoyuVanilla deleted the shallow-resolve-to-root-var branch February 15, 2026 06:20
@github-actions
Copy link
Copy Markdown
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 7bee525 (parent) -> 75b9d89 (this PR)

Test differences

Show 6 test diffs

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

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 75b9d89c68a4a92758349272aa4e35a8eb7a6708 --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. pr-check-1: 27m 48s -> 34m 47s (+25.1%)
  2. dist-apple-various: 2h 20m -> 1h 51m (-20.3%)
  3. armhf-gnu: 1h 17m -> 1h 31m (+17.2%)
  4. x86_64-gnu-aux: 2h 3m -> 2h 23m (+16.5%)
  5. x86_64-gnu-llvm-20-2: 1h 27m -> 1h 41m (+16.4%)
  6. x86_64-rust-for-linux: 46m 2s -> 53m (+15.1%)
  7. pr-check-2: 38m 43s -> 44m 29s (+14.9%)
  8. aarch64-apple: 3h 23m -> 2h 54m (-14.5%)
  9. x86_64-gnu-miri: 1h 14m -> 1h 25m (+13.7%)
  10. x86_64-gnu-llvm-20: 1h 11m -> 1h 20m (+13.1%)
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
Copy Markdown
Collaborator

Finished benchmarking commit (75b9d89): 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
Regressions ❌
(secondary)
0.3% [0.2%, 0.4%] 4
Improvements ✅
(primary)
-0.3% [-0.4%, -0.1%] 14
Improvements ✅
(secondary)
-2.7% [-7.1%, -0.1%] 50
All ❌✅ (primary) -0.3% [-0.4%, -0.1%] 14

Max RSS (memory usage)

Results (secondary 8.9%)

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

Cycles

Results (primary 2.2%, secondary -3.2%)

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

mean range count
Regressions ❌
(primary)
2.2% [2.2%, 2.2%] 1
Regressions ❌
(secondary)
6.0% [4.2%, 7.8%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.1% [-6.7%, -1.8%] 20
All ❌✅ (primary) 2.2% [2.2%, 2.2%] 1

Binary size

Results (primary -0.0%, secondary -0.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)
- - 0
Improvements ✅
(primary)
-0.0% [-0.1%, -0.0%] 22
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.0%] 20
All ❌✅ (primary) -0.0% [-0.1%, -0.0%] 22

Bootstrap: 481.339s -> 480.584s (-0.16%)
Artifact size: 398.00 MiB -> 397.92 MiB (-0.02%)

@Kobzol
Copy link
Copy Markdown
Member

Kobzol commented Feb 17, 2026

Many more wins than losses. Nice work!

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Feb 17, 2026
rust-bors Bot pushed a commit that referenced this pull request Mar 18, 2026
Do not shallow resolve to root var while fudging



Fixes #153816 and fixes #153849

In #151380, I thought that whether shallow resolve to root var or not wouldn't affect the actual type inferencing, but it isn't true for the fudge, in which we discard all newly created relationships between unresolved inference variables 😅

r? lcnr
rust-bors Bot pushed a commit that referenced this pull request Mar 19, 2026
Do not shallow resolve to root var while fudging



Fixes #153816 and fixes #153849

In #151380, I thought that whether shallow resolve to root var or not wouldn't affect the actual type inferencing, but it isn't true for the fudge, in which we discard all newly created relationships between unresolved inference variables 😅

r? lcnr
github-actions Bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Mar 23, 2026
Do not shallow resolve to root var while fudging



Fixes rust-lang/rust#153816 and fixes rust-lang/rust#153849

In rust-lang/rust#151380, I thought that whether shallow resolve to root var or not wouldn't affect the actual type inferencing, but it isn't true for the fudge, in which we discard all newly created relationships between unresolved inference variables 😅

r? lcnr
RalfJung pushed a commit to RalfJung/miri that referenced this pull request Mar 24, 2026
Do not shallow resolve to root var while fudging



Fixes rust-lang/rust#153816 and fixes rust-lang/rust#153849

In rust-lang/rust#151380, I thought that whether shallow resolve to root var or not wouldn't affect the actual type inferencing, but it isn't true for the fudge, in which we discard all newly created relationships between unresolved inference variables 😅

r? lcnr
ShoyuVanilla added a commit to ShoyuVanilla/rust that referenced this pull request Mar 24, 2026
…-to-root-var, r=lcnr"

This reverts commit 75b9d89, reversing
changes made to 7bee525.
ShoyuVanilla added a commit to ShoyuVanilla/rust that referenced this pull request Mar 24, 2026
…-to-root-var, r=lcnr"

This reverts commit 75b9d89, reversing
changes made to 7bee525.
github-actions Bot pushed a commit to rust-lang/stdarch that referenced this pull request Mar 26, 2026
Do not shallow resolve to root var while fudging



Fixes rust-lang/rust#153816 and fixes rust-lang/rust#153849

In rust-lang/rust#151380, I thought that whether shallow resolve to root var or not wouldn't affect the actual type inferencing, but it isn't true for the fudge, in which we discard all newly created relationships between unresolved inference variables 😅

r? lcnr
github-actions Bot pushed a commit to rust-lang/rust-analyzer that referenced this pull request Mar 26, 2026
Do not shallow resolve to root var while fudging



Fixes rust-lang/rust#153816 and fixes rust-lang/rust#153849

In rust-lang/rust#151380, I thought that whether shallow resolve to root var or not wouldn't affect the actual type inferencing, but it isn't true for the fudge, in which we discard all newly created relationships between unresolved inference variables 😅

r? lcnr
github-actions Bot pushed a commit to rust-lang/compiler-builtins that referenced this pull request Mar 31, 2026
Do not shallow resolve to root var while fudging



Fixes rust-lang/rust#153816 and fixes rust-lang/rust#153849

In rust-lang/rust#151380, I thought that whether shallow resolve to root var or not wouldn't affect the actual type inferencing, but it isn't true for the fudge, in which we discard all newly created relationships between unresolved inference variables 😅

r? lcnr
erickt pushed a commit to erickt/rust that referenced this pull request Apr 14, 2026
…-to-root-var, r=lcnr"

This reverts commit 75b9d89, reversing
changes made to 7bee525.
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. 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