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

do not rerun trait solver cycles on ambiguity #125981

Closed
wants to merge 3 commits into from

Conversation

lcnr
Copy link
Contributor

@lcnr lcnr commented Jun 4, 2024

See the comment in fn reached_fixpoint.

Fixes a minimization of the hang in fuchsia (even if it doesn't fix fuchsia itself) and may impact other hangs as well 🤷 doesn't fix the regression in diesel by itself

r? @compiler-errors

@lcnr lcnr marked this pull request as draft June 4, 2024 15:52
@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 4, 2024
@rustbot
Copy link
Collaborator

rustbot commented Jun 4, 2024

Some changes occurred to the core trait solver

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

@lqd
Copy link
Member

lqd commented Jun 4, 2024

may impact other hangs as well 🤷

As an example of other cases where this PR helps: it improves the new solver's current simili-hang on #125994 a lot.

@lcnr lcnr marked this pull request as ready for review June 10, 2024 09:46
@lcnr
Copy link
Contributor Author

lcnr commented Jun 10, 2024

@rustbot ready

looked at rust-lang/chalk#48 and to my understanding their reasoning was about an implementation detail of chalk. I still don't fully get why they got hangs when rerunning goals, but it seems unrelated as we do "apply the constraints" from ambiguous results and the added test works with the new solver (after changing it to (): Sized<ty> to avoid the "self ty is infer" check).

@bors
Copy link
Contributor

bors commented Jun 18, 2024

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

@compiler-errors
Copy link
Member

@rustbot author

@rustbot rustbot 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 Jul 9, 2024
@jimblandy
Copy link
Contributor

@lcnr @fmease Hi! Is there anything else blocking this? We're still effectively unable to build docs for wgpu-core.

@lqd
Copy link
Member

lqd commented Aug 2, 2024

@jimblandy are you sure you're commenting on the correct PR? This PR is for the new solver, and shouldn't help building docs for wgpu-core.

@jimblandy
Copy link
Contributor

jimblandy commented Aug 2, 2024

@jimblandy are you sure you're commenting on the correct PR? This PR is for the new solver, and shouldn't help building docs for wgpu-core.

Yes, I think I am commenting on the right PR:

Honestly, I'm as surprised as you are, but here we are.

@fmease
Copy link
Member

fmease commented Aug 2, 2024

To clear things up, #114891 is due to something going wrong in the old solver (it can't be the next solver because it's not yet enabled by default). First, I minimized the issue here: #114891 (comment). Then, I profiled rustdoc and realized it had something to do with the (old) trait solver. However, I'm not particularly well-versed in either trait solver much less in the gnarly details around cycles & caching which seems to be the root cause.

So instead I decided to experimentally migrate the problematic rustdoc 'routine' (blanket impl synthesis) from the old to the next solver in #126196 to check if that might solve the problem. However, it turns out that the "rustc equivalent" of #114891 currently also hangs in the next solver (coincidentally I presume). For that, I opened #126196. This brings us to this PR which might unblock #126196 which in turn might fix #114891.

Getting slightly off-topic but unfortunately I don't know when and why #114891 regressed (since it's hard to bisect a compiletime or hang issue).

@lcnr
Copy link
Contributor Author

lcnr commented Aug 15, 2024

merged as part of #128828

@lcnr lcnr closed this Aug 15, 2024
@lcnr lcnr deleted the ambig-no-rerun branch August 15, 2024 10:07
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. 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