Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

eagerly compute sub_relations again #140375

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

Open
lcnr wants to merge 5 commits into rust-lang:master
base: master
Choose a base branch
Loading
from lcnr:subrelations-infcx

Conversation

Copy link
Contributor

@lcnr lcnr commented Apr 27, 2025
edited by rustbot
Loading

We still only using them for diagnostics right now. This mostly reverts #119989. Necessary for type inference guidance due to not-yet defined opaque types, cc rust-lang/trait-system-refactor-initiative#182.

We could use them for cycle detection in generalization and it seems desirable to do so in the future. However, this is unsound with the old trait solver as its cache does not track these sub_relations in any way.

We now properly track the sub_relations when canonicalizing so using them in the new solver is totally sound and the performance impact is far more manageable than I thought back in #119989.

r? @compiler-errors

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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 Apr 27, 2025

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor Author

lcnr commented Apr 28, 2025

@bors try @rust-timer queue

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 28, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 28, 2025
eagerly compute `sub_relations` again
We still only using them for diagnostics with the old solver.
We could use them for cycle detection in generalization and it seems desirable to do so in the future. However, this is unsound with the old trait solver as its cache does not track these `sub_relations` in any way. We would also need to consider them when canonicalizing as otherwise instantiating the canonical response may fail.
Necessary for type inference guidance due to not-yet defined opaque types, cc rust-lang/trait-system-refactor-initiative#182.
r? `@compiler-errors`
Copy link
Collaborator

bors commented Apr 28, 2025

⌛ Trying commit 54a32a1 with merge 3c1d077...

This comment has been minimized.

Copy link
Member

@bors try @rust-timer queue

This comment has been minimized.

Copy link
Collaborator

bors commented Apr 29, 2025

⌛ Trying commit 26f4ee0 with merge e184142...

bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 29, 2025
eagerly compute `sub_relations` again
We still only using them for diagnostics with the old solver.
We could use them for cycle detection in generalization and it seems desirable to do so in the future. However, this is unsound with the old trait solver as its cache does not track these `sub_relations` in any way. We would also need to consider them when canonicalizing as otherwise instantiating the canonical response may fail.
Necessary for type inference guidance due to not-yet defined opaque types, cc rust-lang/trait-system-refactor-initiative#182.
r? `@compiler-errors`
Copy link
Collaborator

bors commented Apr 29, 2025

☀️ Try build successful - checks-actions
Build commit: e184142 (e1841428183d264d2f48328b3de5c0f25654315a)

This comment has been minimized.

Copy link
Collaborator

Finished benchmarking commit (e184142): comparison URL.

Overall result: ❌ regressions - 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.4% [0.2%, 1.7%] 75
Regressions ❌
(secondary)
0.4% [0.2%, 0.7%] 48
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.4% [0.2%, 1.7%] 75

Max RSS (memory usage)

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

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)
0.8% [0.8%, 0.8%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.7% [-1.1%, -0.4%] 12
Improvements ✅
(secondary)
-4.5% [-4.5%, -4.5%] 1
All ❌✅ (primary) -0.6% [-1.1%, 0.8%] 13

Cycles

Results (primary 0.0%, secondary -1.6%)

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)
0.7% [0.5%, 0.9%] 3
Regressions ❌
(secondary)
2.2% [2.2%, 2.2%] 1
Improvements ✅
(primary)
-0.6% [-0.7%, -0.5%] 3
Improvements ✅
(secondary)
-2.6% [-2.8%, -2.1%] 4
All ❌✅ (primary) 0.0% [-0.7%, 0.9%] 6

Binary size

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

Bootstrap: 765.701s -> 765.069s (-0.08%)
Artifact size: 365.36 MiB -> 365.11 MiB (-0.07%)

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

This comment has been minimized.

Copy link
Collaborator

bors commented Apr 29, 2025

☔ The latest upstream changes (presumably #140474) made this pull request unmergeable. Please resolve the merge conflicts.

Copy link
Contributor Author

lcnr commented Apr 29, 2025

see perf run in #140480 (comment)

Copy link
Contributor Author

lcnr commented Apr 29, 2025

comparing these two perf runs, tracking sub_relations in canonical inputs does slightly worsen performance: https://perf.rust-lang.org/compare.html?start=e1841428183d264d2f48328b3de5c0f25654315a&end=9613271ee15ea18ed41f396fc7aaf4c1f760410a&stat=instructions%3Au

@lcnr lcnr force-pushed the subrelations-infcx branch 4 times, most recently from 51a0c95 to 970a01b Compare August 27, 2025 08:23
Copy link

rust-bors bot commented Aug 27, 2025

☀️ Try build successful (CI)
Build commit: 3f24acc (3f24acc4eaccd5e7db5ddcc0c119c06490377d69, parent: 269d5b56bcfdf2be82213e72ef9a2e4c592a8c6b)

This comment has been minimized.

Copy link
Collaborator

Finished benchmarking commit (3f24acc): 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.3% [0.1%, 1.5%] 49
Regressions ❌
(secondary)
0.8% [0.1%, 2.7%] 59
Improvements ✅
(primary)
-0.4% [-0.5%, -0.2%] 5
Improvements ✅
(secondary)
-1.4% [-2.9%, -0.1%] 13
All ❌✅ (primary) 0.3% [-0.5%, 1.5%] 54

Max RSS (memory usage)

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

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.0% [1.0%, 1.0%] 2
Improvements ✅
(primary)
-1.2% [-1.2%, -1.2%] 1
Improvements ✅
(secondary)
-2.5% [-2.8%, -2.3%] 2
All ❌✅ (primary) -1.2% [-1.2%, -1.2%] 1

Cycles

Results (secondary 2.8%)

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)
2.8% [1.3%, 3.9%] 8
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 466.752s -> 466.953s (0.04%)
Artifact size: 391.24 MiB -> 391.35 MiB (0.03%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 27, 2025
Copy link
Collaborator

bors commented Aug 27, 2025

☔ The latest upstream changes (presumably #145923) made this pull request unmergeable. Please resolve the merge conflicts.

@lcnr lcnr force-pushed the subrelations-infcx branch from 970a01b to fcab000 Compare August 28, 2025 06:54

This comment has been minimized.

Copy link
Contributor

given the number of changes in the last days I'll switch to waiting on author. switch back when you want a review

@rustbot author

@rustbot rustbot 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 Aug 28, 2025
@rust-lang rust-lang deleted a comment from rustbot Aug 28, 2025
Copy link
Contributor Author

lcnr commented Aug 28, 2025

I want a review

apiraino reacted with thumbs up emoji

Copy link
Contributor Author

lcnr commented Aug 28, 2025

😁

r? @BoxyUwU though probably

@rustbot ready

@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 Aug 28, 2025
@lcnr lcnr force-pushed the subrelations-infcx branch from fcab000 to f84f3f6 Compare August 29, 2025 08:54
Copy link
Collaborator

rustbot commented Aug 29, 2025

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

Copy link
Collaborator

bors commented Sep 2, 2025

☔ The latest upstream changes (presumably #146113) made this pull request unmergeable. Please resolve the merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Labels
perf-regression Performance regression. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /