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

Remove predicate queries #129532

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Aug 24, 2024

Removes:

  • predicates_defined_on - Not necessary. Literally unused. Get rid of predicates_defined_on #129546
  • trait_explicit_predicates_and_bounds - Not necessary technically. The side-effect of this is that we now don't remove where Self::Assoc: Bound item bounds from the where clauses of traits. This may require more trait solving to be done, but should be fine. Let's see what the fallout of this is.

r? @ghost

@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 Aug 24, 2024
@compiler-errors
Copy link
Member Author

@bors try @rust-timer queue

@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 Aug 24, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 24, 2024
…ries, r=<try>

Remove predicate queries

Removes:
* `predicates_defined_on` - Not necessary. Literally unused.
* `trait_explicit_predicates_and_bounds` - Not necessary technically. The side-effect of this is that we now don't remove `where Self::Assoc: Bound` item bounds from the where clauses of traits. This may require more trait solving to be done, but should be fine. Let's see what the fallout of this is.

r? `@ghost`
@bors
Copy link
Contributor

bors commented Aug 24, 2024

⌛ Trying commit 8ca62f0 with merge 8104373...

@bors
Copy link
Contributor

bors commented Aug 25, 2024

☀️ Try build successful - checks-actions
Build commit: 8104373 (8104373427fae4f23eca1b02f2790d02f929e9e2)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (8104373): 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 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.4%, 0.4%] 1
Improvements ✅
(primary)
-0.4% [-1.4%, -0.2%] 112
Improvements ✅
(secondary)
-0.7% [-2.0%, -0.1%] 70
All ❌✅ (primary) -0.4% [-1.4%, -0.2%] 112

Max RSS (memory usage)

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

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.2% [1.1%, 1.3%] 2
Regressions ❌
(secondary)
5.7% [5.7%, 5.7%] 1
Improvements ✅
(primary)
-1.3% [-3.3%, -0.6%] 8
Improvements ✅
(secondary)
-4.9% [-8.5%, -2.3%] 11
All ❌✅ (primary) -0.8% [-3.3%, 1.3%] 10

Cycles

Results (secondary -2.4%)

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

Binary size

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

Bootstrap: 750.904s -> 750.388s (-0.07%)
Artifact size: 338.92 MiB -> 338.91 MiB (-0.00%)

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

:3

r? lcnr

ill leave this to them for a vibe check when theyre back

@compiler-errors compiler-errors marked this pull request as ready for review August 25, 2024 03:30
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 25, 2024
…-dead

Get rid of `predicates_defined_on`

This is the uncontroversial part of rust-lang#129532. This simply inlines the `predicates_defined_on` into into `predicates_of`. Nothing should change here logically.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 25, 2024
…-dead

Get rid of `predicates_defined_on`

This is the uncontroversial part of rust-lang#129532. This simply inlines the `predicates_defined_on` into into `predicates_of`. Nothing should change here logically.
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 26, 2024
Get rid of `predicates_defined_on`

This is the uncontroversial part of rust-lang#129532. This simply inlines the `predicates_defined_on` into into `predicates_of`. Nothing should change here logically.
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 26, 2024
Get rid of `predicates_defined_on`

This is the uncontroversial part of rust-lang#129532. This simply inlines the `predicates_defined_on` into into `predicates_of`. Nothing should change here logically.
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 28, 2024
Get rid of `predicates_defined_on`

This is the uncontroversial part of rust-lang#129532. This simply inlines the `predicates_defined_on` into into `predicates_of`. Nothing should change here logically.
@compiler-errors
Copy link
Member Author

@bors try @rust-timer queue

@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 Aug 28, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 28, 2024
…ries, r=<try>

Remove predicate queries

Removes:
* `predicates_defined_on` - Not necessary. Literally unused.
* `trait_explicit_predicates_and_bounds` - Not necessary technically. The side-effect of this is that we now don't remove `where Self::Assoc: Bound` item bounds from the where clauses of traits. This may require more trait solving to be done, but should be fine. Let's see what the fallout of this is.

r? `@ghost`
@bors
Copy link
Contributor

bors commented Aug 28, 2024

⌛ Trying commit 8ca62f0 with merge 2e9a6da...

@bors
Copy link
Contributor

bors commented Aug 28, 2024

☀️ Try build successful - checks-actions
Build commit: 2e9a6da (2e9a6da9e514e64d0fdec2ba47c1506c388d75ba)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (2e9a6da): comparison URL.

Overall result: no relevant changes - 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 benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (primary -2.1%, secondary 2.2%)

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.2% [1.5%, 3.0%] 2
Improvements ✅
(primary)
-2.1% [-2.1%, -2.1%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.1% [-2.1%, -2.1%] 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: 752.822s -> 753.788s (0.13%)
Artifact size: 338.90 MiB -> 338.86 MiB (-0.01%)

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

OK, well no perf by itself but it removes a major source of confusion in what's required to prove vs what we can assume whatever IMO.

@compiler-errors compiler-errors force-pushed the remove-predicate-queries branch from 8ca62f0 to 590dbe7 Compare August 28, 2024 16:36
Copy link
Contributor

@lcnr lcnr left a comment

Choose a reason for hiding this comment

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

I worry that this is a theoretical breaking change with the current cycle semantics.

Something like this probably won't cause issues, because this change is only impacting trait where-clauses.

trait Bound {}
trait Trait
where
    Self::Assoc: Bound,
{
    type Assoc;    
}

impl<T: Bound> Trait for T {
    type Assoc = T;
}
impl<T: Trait> Bound for T {}

I don't think we currently use predicates_of of the trait inside of the trait solver, so this should be alright? Would have to look at all the use-sites to make sure of that though 😅

@bors
Copy link
Contributor

bors commented Oct 23, 2024

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

@lcnr
Copy link
Contributor

lcnr commented Oct 24, 2024

we talked about this at some point, I think we ended up at r=me with

I don't think we currently use predicates_of of the trait inside of the trait solver, so this should be alright? Would have to look at all the use-sites to make sure of that though 😅

being resolved

@oli-obk oli-obk 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 Dec 4, 2024
@oli-obk
Copy link
Contributor

oli-obk commented Dec 4, 2024

Both solvers use explicit_super_predicates_of on traits.

The new solver does not call predicates_of on a trait anywhere.

The old solver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants