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

Stop bailing out from compilation just because there were incoherent traits #120558

Merged
merged 3 commits into from
Feb 8, 2024

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Feb 1, 2024

fixes #120343

but also has a lot of "type annotations needed" fallout. Some are fixed in the second commit.

@rustbot
Copy link
Collaborator

rustbot commented Feb 1, 2024

r? @nnethercote

(rustbot has picked a reviewer for you, use r? to override)

@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 Feb 1, 2024
@nnethercote
Copy link
Contributor

That's a lot of error output changes for such small compiler changes. I'm uncomfortable reviewing this because I know very little about trait stuff in general.

r? @lcnr

(or anyone else who might want to steal it, such as @compiler-errors or @estebank)

@rustbot rustbot assigned lcnr and unassigned nnethercote Feb 1, 2024
@rust-log-analyzer

This comment has been minimized.

@oli-obk
Copy link
Contributor Author

oli-obk commented Feb 2, 2024

r? @estebank

@rustbot rustbot assigned estebank and unassigned lcnr Feb 2, 2024
Comment on lines +10 to +14
error[E0282]: type annotations needed
--> $DIR/opaques.rs:13:20
|
LL | pub fn cast<T>(x: Container<Alias<T>, T>) -> Container<T, T> {
| ^ cannot infer type for struct `Container<Alias<T>, T>`
Copy link
Contributor

Choose a reason for hiding this comment

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

Unfortunate but ok.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yea this one had me scratching my head. It's an unfortunate combination of opaque types and type inference, but has a good chance of getting properly resolved with cleanups that will be enabled by #113169

@estebank
Copy link
Contributor

estebank commented Feb 2, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Feb 2, 2024

📌 Commit 965da3a has been approved by estebank

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Feb 2, 2024

🌲 The tree is currently closed for pull requests below priority 100. This pull request will be tested once the tree is reopened.

@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 Feb 2, 2024
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@oli-obk
Copy link
Contributor Author

oli-obk commented Feb 2, 2024

@bors r-

@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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 2, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (870a01a): 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.4% [0.2%, 1.0%] 14
Regressions ❌
(secondary)
1.2% [0.1%, 3.5%] 23
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.4% [0.2%, 1.0%] 14

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)
8.6% [2.5%, 14.8%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.0% [-1.1%, -0.9%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.8% [-1.1%, 14.8%] 4

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

Binary size

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

Bootstrap: 663.578s -> 662.662s (-0.14%)
Artifact size: 308.27 MiB -> 308.26 MiB (-0.00%)

@rustbot rustbot added the perf-regression Performance regression. label Feb 8, 2024
@oli-obk oli-obk deleted the missing_impl_item_ice branch February 8, 2024 09:16
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 8, 2024
…l, r=<try>

Use `ensure` when the result of the query is not needed beyond its `Result`ness

while I would like to just remove the `tcx` methods for ensure-only queries, that is hard to do without another query annotation or by turning the `define_callbacks` macro into a proc macro to get more control

should fix perf regression of rust-lang#120558
@nnethercote
Copy link
Contributor

@oli-obk: a bunch of possible icount regressions, is that expected?

@oli-obk
Copy link
Contributor Author

oli-obk commented Feb 8, 2024

I already opened a PR: #120771

it is not expected, but from the detailed diffs (only incremental cache changes, no actual execution changes), I presume it's that one missing ensure call

@oli-obk
Copy link
Contributor Author

oli-obk commented Feb 8, 2024

Weirdly, while that PR is a perf improvement, it's completely orthogonal to this PR (because I also fixed another missing ensure).

I'll dig into what happened here, This regression must be fixable, we're not actually doing extra work in successful builds, so it must just be some query/caching thing

@oli-obk
Copy link
Contributor Author

oli-obk commented Feb 9, 2024

The queries I'm ensureing here, are not decoded from the cache at all (they aren't cached). All that is happening is that they get checked for being green. Since only incr_comp_encode_dep_graph regresses, the issue is in fact writing the additional edge to the dep graph. I do not see a way to resolve this regression.

I mean, since we only use the query to check for errors at the individual item level, we could just not ensure the query if

  • we know it must have already been invoked, and
  • has_errors is false

but that feels quite hacky.

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 9, 2024
A trait's local impls are trivially coherent if there are no impls.

This avoids creating a dependency edge on the hir or the specialization graph

This may resolve part of the performance issue of rust-lang#120558
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 9, 2024
Avoid accessing the HIR in the happy path of `coherent_trait`

based on rust-lang#120834

This may resolve part of the performance issue of rust-lang#120558
@oli-obk
Copy link
Contributor Author

oli-obk commented Feb 9, 2024

Perf regression fully resolved after #120835 (comment)

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Feb 9, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 9, 2024
Avoid accessing the HIR in the happy path of `coherent_trait`

This may resolve part of the performance issue of rust-lang#120558
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 10, 2024
…l, r=davidtwco

Use `ensure` when the result of the query is not needed beyond its `Result`ness

while I would like to just remove the `tcx` methods for ensure-only queries, that is hard to do without another query annotation or by turning the `define_callbacks` macro into a proc macro to get more control

should fix perf regression of rust-lang#120558
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Feb 11, 2024
…dtwco

Use `ensure` when the result of the query is not needed beyond its `Result`ness

while I would like to just remove the `tcx` methods for ensure-only queries, that is hard to do without another query annotation or by turning the `define_callbacks` macro into a proc macro to get more control

should fix perf regression of rust-lang/rust#120558
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 12, 2024
A trait's local impls are trivially coherent if there are no impls.

This avoids creating a dependency edge on the hir or the specialization graph

This may resolve part of the performance issue of rust-lang#120558
RalfJung pushed a commit to RalfJung/miri that referenced this pull request Feb 12, 2024
A trait's local impls are trivially coherent if there are no impls.

This avoids creating a dependency edge on the hir or the specialization graph

This may resolve part of the performance issue of rust-lang/rust#120558
lnicola pushed a commit to lnicola/rust-analyzer that referenced this pull request Apr 7, 2024
A trait's local impls are trivially coherent if there are no impls.

This avoids creating a dependency edge on the hir or the specialization graph

This may resolve part of the performance issue of rust-lang/rust#120558
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 9, 2024
Silence some follow-up errors on trait impls in case the trait has conflicting or otherwise incoherent impls

fixes rust-lang#123292

Also removes a bunch of extra diagnostics that were introduced in rust-lang#121154 and rust-lang#120558
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 10, 2024
Silence some follow-up errors on trait impls in case the trait has conflicting or otherwise incoherent impls

fixes rust-lang#123292

Also removes a bunch of extra diagnostics that were introduced in rust-lang#121154 and rust-lang#120558
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 17, 2024
Silence some follow-up errors on trait impls in case the trait has conflicting or otherwise incoherent impls

fixes rust-lang#123292

Also removes a bunch of extra diagnostics that were introduced in rust-lang#121154 and rust-lang#120558
RalfJung pushed a commit to RalfJung/miri that referenced this pull request Apr 17, 2024
Silence some follow-up errors on trait impls in case the trait has conflicting or otherwise incoherent impls

fixes #123292

Also removes a bunch of extra diagnostics that were introduced in rust-lang/rust#121154 and rust-lang/rust#120558
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this pull request Apr 27, 2024
A trait's local impls are trivially coherent if there are no impls.

This avoids creating a dependency edge on the hir or the specialization graph

This may resolve part of the performance issue of rust-lang/rust#120558
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE: missing value for assoc item in impl
10 participants