Skip to content
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

Use fulfillment in method probe, not evaluation #122317

Merged
merged 6 commits into from Apr 23, 2024

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Mar 11, 2024

This PR reworks method probing to use fulfillment instead of a for-loop of evaluate_predicate calls, and moves normalization from method candidate assembly into the consider_probe, where it's applied to all candidates. This last part coincidentally fixes #121643 (comment).

Regarding why this large rewrite is done: In general, it's an anti-pattern to do for o in obligations { evaluate(o); } because it's not compatible with the way that the new solver emits alias-relate obligations which constrain variables that may show up in other predicates.

r? lcnr

@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. labels Mar 11, 2024
@rustbot
Copy link
Collaborator

rustbot commented Mar 11, 2024

Some changes occurred in engine.rs, potentially modifying the public API of ObligationCtxt.

cc @lcnr, @compiler-errors

@rust-log-analyzer

This comment has been minimized.

@compiler-errors
Copy link
Member Author

@bors try

@bors
Copy link
Contributor

bors commented Mar 11, 2024

⌛ Trying commit 3702ab1 with merge 1f75533...

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 11, 2024
…, r=<try>

Use fulfillment in method probe, not evaluation

This PR reworks method probing to use fulfillment instead of a `for`-loop of `evaluate_predicate` calls, and moves normalization from method candidate assembly into the `consider_probe`, where it's applied to *all* candidates. This last part coincidentally fixes rust-lang#121643 (comment).

Regarding *why* this large rewrite is done: In general, it's an anti-pattern to do `for o in obligations { evaluate(o); }` because it's not compatible with the way that the new solver emits alias-relate obligations which constrain variables that may show up in other predicates.

Putting this up for vibe-check mostly. Tests aren't yet blessed, and there are some nuances about whether it's worthwhile to restore regressed diagnostics.

r? lcnr
@bors
Copy link
Contributor

bors commented Mar 11, 2024

☀️ Try build successful - checks-actions
Build commit: 1f75533 (1f7553361c08f8eafdc645e09215667278ab86f4)

@compiler-errors
Copy link
Member Author

@craterbot check

@craterbot
Copy link
Collaborator

👌 Experiment pr-122317 created and queued.
🤖 Automatically detected try build 1f75533
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 11, 2024
@compiler-errors compiler-errors mentioned this pull request Mar 14, 2024
4 tasks
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 14, 2024
Crater rollup

This is a crater rollup of:

- [ ] rust-lang#122317
- [ ] rust-lang#122501
- [ ] rust-lang#122077

What does that mean? Well, I'm gonna run crater with p=3 on this PR, and then re-run *just* the list of failed crates on each PR. That should deduplicate the bulk of crates which we expect are unaffected by these PRs.

Don't touch this PR please.

r? `@ghost`
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 14, 2024
Crater rollup

This is a crater rollup of:

- [ ] rust-lang#122317
- [ ] rust-lang#122501
- [ ] rust-lang#122077

What does that mean? Well, I'm gonna run crater with p=3 on this PR, and then re-run *just* the list of failed crates on each PR. That should deduplicate the bulk of crates which we expect are unaffected by these PRs.

Don't touch this PR please.

r? `@ghost`
@compiler-errors
Copy link
Member Author

@bors try

@bors
Copy link
Contributor

bors commented Mar 14, 2024

⌛ Trying commit 35d6003 with merge 3aea706...

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 14, 2024
…, r=<try>

Use fulfillment in method probe, not evaluation

This PR reworks method probing to use fulfillment instead of a `for`-loop of `evaluate_predicate` calls, and moves normalization from method candidate assembly into the `consider_probe`, where it's applied to *all* candidates. This last part coincidentally fixes rust-lang#121643 (comment).

Regarding *why* this large rewrite is done: In general, it's an anti-pattern to do `for o in obligations { evaluate(o); }` because it's not compatible with the way that the new solver emits alias-relate obligations which constrain variables that may show up in other predicates.

Putting this up for vibe-check mostly. Tests aren't yet blessed, and there are some nuances about whether it's worthwhile to restore regressed diagnostics.

r? lcnr
@bors
Copy link
Contributor

bors commented Mar 15, 2024

☀️ Try build successful - checks-actions
Build commit: 3aea706 (3aea7069a654d82dd39c4479794b5560f4977307)

1 similar comment
@bors
Copy link
Contributor

bors commented Mar 15, 2024

☀️ Try build successful - checks-actions
Build commit: 3aea706 (3aea7069a654d82dd39c4479794b5560f4977307)

@craterbot
Copy link
Collaborator

🚧 Experiment pr-122317 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot
Copy link
Collaborator

🎉 Experiment pr-122317 is completed!
📊 34 regressed and 1 fixed (425628 total)
📰 Open the full report.

⚠️ If you notice any spurious failure please add them to the blacklist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-crater Status: Waiting on a crater run to be completed. labels Mar 20, 2024
@bors
Copy link
Contributor

bors commented Apr 16, 2024

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

@rfcbot rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Apr 20, 2024
@rfcbot
Copy link

rfcbot commented Apr 20, 2024

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

This will be merged soon.

@rfcbot rfcbot added the to-announce Announce this issue on triage meeting label Apr 20, 2024
@bors
Copy link
Contributor

bors commented Apr 21, 2024

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

@lcnr
Copy link
Contributor

lcnr commented Apr 23, 2024

@bors r+ rollup=never

@bors
Copy link
Contributor

bors commented Apr 23, 2024

📌 Commit 8995c2c 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 Apr 23, 2024
@bors
Copy link
Contributor

bors commented Apr 23, 2024

⌛ Testing commit 8995c2c with merge cd90d5c...

@bors
Copy link
Contributor

bors commented Apr 23, 2024

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 23, 2024
@bors bors merged commit cd90d5c into rust-lang:master Apr 23, 2024
13 checks passed
@rustbot rustbot added this to the 1.79.0 milestone Apr 23, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (cd90d5c): comparison URL.

Overall result: ❌ regressions - 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.5% [0.2%, 1.3%] 38
Regressions ❌
(secondary)
4.2% [0.5%, 23.6%] 39
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.5% [0.2%, 1.3%] 38

Max RSS (memory usage)

Results

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

Cycles

Results

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.3%, 1.6%] 2
Regressions ❌
(secondary)
6.7% [2.1%, 25.2%] 23
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.5% [1.3%, 1.6%] 2

Binary size

Results

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

Bootstrap: 673.699s -> 674.88s (0.18%)
Artifact size: 316.17 MiB -> 316.16 MiB (-0.00%)

@rustbot rustbot added the perf-regression Performance regression. label Apr 23, 2024
@compiler-errors
Copy link
Member Author

checking perf in #124303

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. 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-types Relevant to the types team, which will review and decide on the PR/issue. to-announce Announce this issue on triage meeting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Trait methods can't be found by method resolution if the self type involves projections
8 participants