make the provisional cache slightly less broken #114694
Merged
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
It is still broken for the following cycles:
the
R -> A -> B -> Rcycle should be considered to not hold, as it is mixed, but because we first putBinto the cache from theR -> B -> Rcycle which is coinductive, it does hold.This issue will also affect our new coinduction approach. Longterm cycles are coinductive as long as one step goes through an impl where-clause, see https://github.com/rust-lang/a-mir-formality/blob/f4fc5bae36ab1a9fefddd54e5ccffc5f671467ec/crates/formality-prove/src/prove/prove_wc.rs#L51-L62. Here we would first have a fully inductive cycle
R -> B -> Rwhich is then entered by a cycle with a coinductive stepR -> A -coinductive-> B -> R.I don't know how to soundly implement a provisional cache for goals not on the stack without tracking all cycles the goal was involved in and whether they were inductive or not. We could then only use goals from the cache if the inductivity? of every cycle remained the same. This is a mess to implement. I therefore want to rip out the provisional cache entirely, but will wait with this until I talked about it with @nikomatsakis.
r? @compiler-errors