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 global cache when computing proof trees #117394

Merged
merged 1 commit into from
Nov 2, 2023

Conversation

lcnr
Copy link
Contributor

@lcnr lcnr commented Oct 30, 2023

we're writing the solver while relying on the existence of the global cache to avoid exponential blowup. By disabling the global cache when building proof trees, it is easy to get hangs, e.g. when computing intercrate ambiguity causes.

Removes the unstable -Zdump_solver_proof_tree_use_cache option, as we now always return a full proof tree.

r? @compiler-errors

@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 Oct 30, 2023
@rustbot
Copy link
Collaborator

rustbot commented Oct 30, 2023

Some changes occurred to the core trait solver

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

@compiler-errors
Copy link
Member

Wait, does this mean we compute the full proof tree every time we evaluate an obligation?

Haven't looked too closely at the code, but if so, this seems kinda inefficient?

We should perhaps run another perf run with Ztrait-solver=next-coherence if so

@lcnr
Copy link
Contributor Author

lcnr commented Oct 30, 2023

no, we ignore (and then overwrite) the cache entry if it was previously computed without generating the proof tree. However, when generating proof trees, we do put the tree in the cache as well.

@compiler-errors
Copy link
Member

However, when generating proof trees, we do put the tree in the cache as well.

ah, that seems less bad, idc about that one

Copy link
Member

@compiler-errors compiler-errors left a comment

Choose a reason for hiding this comment

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

r=me, please amend commit with additional comment.

@compiler-errors compiler-errors 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 Nov 1, 2023
@lcnr
Copy link
Contributor Author

lcnr commented Nov 2, 2023

@bors r=compiler-errors rollup

@bors
Copy link
Contributor

bors commented Nov 2, 2023

📌 Commit 15ae59b has been approved by compiler-errors

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 2, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 2, 2023
…iaskrgr

Rollup of 4 pull requests

Successful merges:

 - rust-lang#117394 (use global cache when computing proof trees)
 - rust-lang#117495 (Clarify `Unsize` documentation)
 - rust-lang#117509 (Remove support for alias `-Z symbol-mangling-version`)
 - rust-lang#117512 (Expand mem::offset_of! docs)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 298edd6 into rust-lang:master Nov 2, 2023
11 checks passed
@rustbot rustbot added this to the 1.75.0 milestone Nov 2, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Nov 2, 2023
Rollup merge of rust-lang#117394 - lcnr:proof-tree-cache4, r=compiler-errors

use global cache when computing proof trees

we're writing the solver while relying on the existence of the global cache to avoid exponential blowup. By disabling the global cache when building proof trees, it is easy to get hangs, e.g. when computing intercrate ambiguity causes.

Removes the unstable `-Zdump_solver_proof_tree_use_cache` option, as we now always return a full proof tree.

r? `@compiler-errors`
@lcnr lcnr deleted the proof-tree-cache4 branch November 2, 2023 17:18
bors-ferrocene bot added a commit to ferrocene/ferrocene that referenced this pull request Nov 3, 2023
82: Automated pull from upstream `master` r=tshepang a=github-actions[bot]


This PR pulls the following changes from the upstream repository:

* rust-lang/rust#117313
* rust-lang/rust#117131
* rust-lang/rust#117134
* rust-lang/rust#117471
* rust-lang/rust#117521
* rust-lang/rust#117513
  * rust-lang/rust#117512
  * rust-lang/rust#117509
  * rust-lang/rust#117495
  * rust-lang/rust#117394
* rust-lang/rust#117466
* rust-lang/rust#117204
* rust-lang/rust#117386
* rust-lang/rust#117506



Co-authored-by: Nicholas Nethercote <[email protected]>
Co-authored-by: roblabla <[email protected]>
Co-authored-by: Michael Goulet <[email protected]>
Co-authored-by: massivebird <[email protected]>
Co-authored-by: bors <[email protected]>
Co-authored-by: Zalathar <[email protected]>
Co-authored-by: lcnr <[email protected]>
Co-authored-by: Joshua Liebow-Feeser <[email protected]>
Co-authored-by: Matthias Krüger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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. 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.

4 participants