Skip to content

Make ObligationEmittingRelations emit Goal rather than Obligation #126130

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 4 commits into from
Jun 12, 2024

Conversation

compiler-errors
Copy link
Member

Helps avoid needing to uplift Obligation into the solver. We still can't get rid of ObligationCause, but we can keep it as an associated type for InferCtxtLike and just give it a dummy function.

There's some shuttling between Goal and Obligation that may be perf-sensitive... Let's see what rust-timer says.

r? lcnr

@compiler-errors
Copy link
Member Author

@bors try @rust-timer queue

@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 Jun 7, 2024
@rustbot
Copy link
Collaborator

rustbot commented Jun 7, 2024

Some changes occurred to the core trait solver

cc @rust-lang/initiative-trait-system-refactor

changes to the core type system

cc @compiler-errors, @lcnr

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 7, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 7, 2024
Make `ObligationEmittingRelation`s emit `Goal` rather than `Obligation`

Helps avoid needing to uplift `Obligation` into the solver. We still can't get rid of `ObligationCause`, but we can keep it as an associated type for `InferCtxtLike` and just give it a `dummy` function.

There's some shuttling between `Goal` and `Obligation` that may be perf-sensitive... Let's see what rust-timer says.

r? lcnr
@bors
Copy link
Collaborator

bors commented Jun 7, 2024

⌛ Trying commit 9f8c5ca with merge 90af023...

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Jun 7, 2024

💔 Test failed - checks-actions

@bors bors 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 Jun 7, 2024
.obligations,
.obligations
.into_iter()
// FIXME: Shuttling between obligations and goals is awkward.
Copy link
Contributor

Choose a reason for hiding this comment

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

i guess we should move the Goal -> Obligation conversion one step further out: to ObligationCtxt/FnCtxt 🤔

@lcnr
Copy link
Contributor

lcnr commented Jun 10, 2024

sgtm, r=me after fixing CI if no tests change

@compiler-errors
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 11, 2024
Make `ObligationEmittingRelation`s emit `Goal` rather than `Obligation`

Helps avoid needing to uplift `Obligation` into the solver. We still can't get rid of `ObligationCause`, but we can keep it as an associated type for `InferCtxtLike` and just give it a `dummy` function.

There's some shuttling between `Goal` and `Obligation` that may be perf-sensitive... Let's see what rust-timer says.

r? lcnr
@bors
Copy link
Collaborator

bors commented Jun 11, 2024

⌛ Trying commit e4be97c with merge b56de0f...

@bors
Copy link
Collaborator

bors commented Jun 11, 2024

☀️ Try build successful - checks-actions
Build commit: b56de0f (b56de0fe7652bec8f89eb2608eb2ec637087104f)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b56de0f): comparison URL.

Overall result: ❌ regressions - 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 a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.4% [0.3%, 0.6%] 7
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 6.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)
6.6% [6.6%, 6.6%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 6.6% [6.6%, 6.6%] 1

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: 679.328s -> 676.811s (-0.37%)
Artifact size: 320.10 MiB -> 319.37 MiB (-0.23%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 11, 2024
@compiler-errors
Copy link
Member Author

@bors r=lcnr

@bors
Copy link
Collaborator

bors commented Jun 11, 2024

📌 Commit e4be97c 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 11, 2024
@bors
Copy link
Collaborator

bors commented Jun 12, 2024

⌛ Testing commit e4be97c with merge 76c7382...

@bors
Copy link
Collaborator

bors commented Jun 12, 2024

☀️ Test successful - checks-actions
Approved by: lcnr
Pushing 76c7382 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 12, 2024
@bors bors merged commit 76c7382 into rust-lang:master Jun 12, 2024
7 checks passed
@rustbot rustbot added this to the 1.81.0 milestone Jun 12, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (76c7382): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

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

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

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

Max RSS (memory usage)

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

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: 675.928s -> 675.467s (-0.07%)
Artifact size: 320.08 MiB -> 319.43 MiB (-0.20%)

@rustbot rustbot added the perf-regression Performance regression. label Jun 12, 2024
@rylev
Copy link
Member

rylev commented Jun 20, 2024

@compiler-errors I'm asssuming the perf regression was deemed acceptable since these only occurred in stress tests?

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Jun 20, 2024
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. 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. 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