Skip to content

Remove usages of QueryNormalizer in the compiler #135914

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 2 commits into from
Jan 24, 2025

Conversation

compiler-errors
Copy link
Member

I want to get rid of the QueryNormalizer, possibly changing it to be special cased just for normalizing erasing regions, or perhaps adapting normalize_erasing_regions to use the assoc type normalizer if caching is sufficient and removing it altogther.

This removes the last two usages of .query_normalize in the compiler. There are a few usages left in rustdoc and clippy, which exist only because the query normalizer is more resilient to errors and non-well-formed alias types. I will remove those next.

r? lcnr or reassign

@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 Jan 23, 2025
@jackh726
Copy link
Member

I certainly see the appeal of having a "querified" way to normalize, but....good riddance to this thing

@bors r+

@bors
Copy link
Collaborator

bors commented Jan 23, 2025

📌 Commit 00a0ef4 has been approved by jackh726

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 Jan 23, 2025
@compiler-errors
Copy link
Member Author

with the new trait solver, we definitely have even less of a reason to have a query based normalizer

bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 24, 2025
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#133605 (Add extensive set of drop order tests)
 - rust-lang#135489 (remove pointless allowed_through_unstable_modules on TryFromSliceError)
 - rust-lang#135757 (Add NuttX support for AArch64 and ARMv7-A targets)
 - rust-lang#135799 (rustdoc-json: Rename `Path::name` to `path`, and give it the path again.)
 - rust-lang#135865 (For E0223, suggest associated functions that are similar to the path, even if the base type has multiple inherent impl blocks.)
 - rust-lang#135890 (Implement `VecDeque::pop_front_if` & `VecDeque::pop_back_if`)
 - rust-lang#135914 (Remove usages of `QueryNormalizer` in the compiler)
 - rust-lang#135936 (fix reify-intrinsic test)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 556d901 into rust-lang:master Jan 24, 2025
6 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Jan 24, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jan 24, 2025
Rollup merge of rust-lang#135914 - compiler-errors:vanquish-query-norm, r=jackh726

Remove usages of `QueryNormalizer` in the compiler

I want to get rid of the `QueryNormalizer`, possibly changing it to be special cased just for normalizing erasing regions, or perhaps adapting `normalize_erasing_regions` to use the assoc type normalizer if caching is sufficient and removing it altogther.

This removes the last two usages of `.query_normalize` in the *compiler*. There are a few usages left in rustdoc and clippy, which exist only because the query normalizer is more resilient to errors and non-well-formed alias types. I will remove those next.

r? lcnr or reassign
@Kobzol
Copy link
Contributor

Kobzol commented Jan 24, 2025

@rust-timer build 5f929e7

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (5f929e7): comparison URL.

Overall result: ❌✅ regressions and improvements - 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.1%] 17
Regressions ❌
(secondary)
6.3% [0.8%, 11.5%] 10
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.4% [-0.7%, -0.3%] 19
All ❌✅ (primary) 0.4% [0.2%, 1.1%] 17

Max RSS (memory usage)

Results (primary -0.9%, secondary -1.1%)

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.0% [0.6%, 1.4%] 2
Regressions ❌
(secondary)
2.1% [2.1%, 2.1%] 1
Improvements ✅
(primary)
-2.7% [-3.2%, -2.3%] 2
Improvements ✅
(secondary)
-2.8% [-2.8%, -2.7%] 2
All ❌✅ (primary) -0.9% [-3.2%, 1.4%] 4

Cycles

Results (secondary 4.9%)

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)
6.3% [2.1%, 11.3%] 10
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.4% [-2.5%, -2.4%] 2
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 775.645s -> 769.912s (-0.74%)
Artifact size: 325.97 MiB -> 325.67 MiB (-0.09%)

@rustbot rustbot added the perf-regression Performance regression. label Jan 24, 2025
@jackh726
Copy link
Member

@compiler-errors we should probably address the perf in some way

@compiler-errors
Copy link
Member Author

Yeah I'll probably just revert this with a FIXME lol

I don't think caching is sufficient in the old solver, so we may just need to wait until the new solver is gone to deal with this (or at least we're comfortable using the new solver within specific queries). I don't think the perf can be addressed, and changing how projection caching works in the old solver is really risky lol.

compiler-errors added a commit to compiler-errors/rust that referenced this pull request Jan 24, 2025
…uery-norm, r=jackh726"

This reverts commit 556d901, reversing
changes made to be15391.
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 29, 2025
…es-us, r=jackh726

Revert rust-lang#135914: Remove usages of `QueryNormalizer` in the compiler

Reverts rust-lang#135914.

r? jackh726
github-actions bot pushed a commit to tautschnig/verify-rust-std that referenced this pull request Mar 11, 2025
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#133605 (Add extensive set of drop order tests)
 - rust-lang#135489 (remove pointless allowed_through_unstable_modules on TryFromSliceError)
 - rust-lang#135757 (Add NuttX support for AArch64 and ARMv7-A targets)
 - rust-lang#135799 (rustdoc-json: Rename `Path::name` to `path`, and give it the path again.)
 - rust-lang#135865 (For E0223, suggest associated functions that are similar to the path, even if the base type has multiple inherent impl blocks.)
 - rust-lang#135890 (Implement `VecDeque::pop_front_if` & `VecDeque::pop_back_if`)
 - rust-lang#135914 (Remove usages of `QueryNormalizer` in the compiler)
 - rust-lang#135936 (fix reify-intrinsic test)

r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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-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.

7 participants