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

have on_completion record subcycles #85186

Merged
merged 2 commits into from
May 13, 2021

Conversation

nikomatsakis
Copy link
Contributor

have on_completion record subcycles

Rework on_completion method so that it removes all
provisional cache entries that are "below" a completed
node (while leaving those entries that are not below
the node).

This corrects an imprecise result that could in turn lead
to an incremental compilation failure. Under the old
scheme, if you had:

  • A depends on...
    • B depends on A
    • C depends on...
      • D depends on C
  • T: 'static

then the provisional results for A, B, C, and D would all
be entangled. Thus, if A was EvaluatedToOkModuloRegions
(because of that final condition), then the result for C and
D would also be demoted to "ok modulo regions".

In reality, though, the result for C depends only on C and itself,
and is not dependent on regions. If we happen to evaluate the
cycle starting from C, we would never reach A, and hence the
result would be "ok".

Under the new scheme, the provisional results for C and D
are moved to the permanent cache immediately and are not affected
by the result of A.

Fixes #83538

r? @Aaron1011

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 11, 2021
@Aaron1011
Copy link
Member

Your description of the issue agrees with my thoughts in #83538 (comment). However, I don't have a very good understanding of the co-inductive cycle handling code (which is why I went with the earlier fix). I'd like to have someone else look over this as well.

@Aaron1011
Copy link
Member

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 11, 2021
@bors
Copy link
Contributor

bors commented May 11, 2021

⌛ Trying commit 8c7b7a0 with merge 6fbb7707efd14220bfaa4efa905c7fff7c51cb46...

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented May 11, 2021

💔 Test failed - checks-actions

@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-review Status: Awaiting review from the assignee but also interested parties. labels May 11, 2021
@nikomatsakis
Copy link
Contributor Author

@Aaron1011 maybe it would be good to do a talk through session -- this relates to my goal of building up expertise around the trait system. I'll leave a comment on Zulip.

@nikomatsakis
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@bors
Copy link
Contributor

bors commented May 11, 2021

⌛ Trying commit aa83920b7d1d58015fb19b7e71e2887c83e2babc with merge cd2b79ca5ca0c76854b71f4893e2495a6ce19722...

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented May 11, 2021

💔 Test failed - checks-actions

This attribute will cause us to invoke evaluate on every where clause of an
invoked function and to generate an error with the result.

Without this, it is very difficult to observe the effects of invoking the trait
evaluator.
@nikomatsakis
Copy link
Contributor Author

OK, I finally found a way to test this issue in a satisfactory way. I've included tests both for the original problem and the ICE we found in rustdoc. I also spent some time talking over how it works with @jackh726, which you can watch here.

r? @jackh726

@nikomatsakis

This comment has been minimized.

@jackh726
Copy link
Member

jackh726 commented May 13, 2021

Thanks @nikomatsakis for going over this with me (and for all those that watch the recording)

This is a surprisingly simple change for an extremely complex issue. It is subtle though, so regardless of perf results, I want to @bors rollup=never

That being said, r=me when perf is done.

@rust-timer
Copy link
Collaborator

Finished benchmarking try commit (61b32d567658b13ad4d86cc5fa7c5a4b76bae0e0): comparison url.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying rollup- to bors.

Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels May 13, 2021
@nikomatsakis
Copy link
Contributor Author

@bors r=jackh726

@bors
Copy link
Contributor

bors commented May 13, 2021

📌 Commit 89c58ea has been approved by jackh726

@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. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 13, 2021
@nikomatsakis nikomatsakis added beta-nominated Nominated for backporting to the compiler in the beta channel. stable-nominated Nominated for backporting to the compiler in the stable channel. labels May 13, 2021
@nikomatsakis
Copy link
Contributor Author

Nominating for beta and stable backport. These incremental failures are a big problem.

@bors
Copy link
Contributor

bors commented May 13, 2021

⌛ Testing commit 89c58ea with merge 6d395a1...

@bors
Copy link
Contributor

bors commented May 13, 2021

☀️ Test successful - checks-actions
Approved by: jackh726
Pushing 6d395a1 to master...

@apiraino
Copy link
Contributor

Both backports have been discussed and pushed to next week's T-compiler meeting (Zulip log)

@pnkfelix
Copy link
Member

discussed in steering meeting about incr-comp fingerprints

declining to backport for beta and likewise for stable.

@pnkfelix pnkfelix removed beta-nominated Nominated for backporting to the compiler in the beta channel. stable-nominated Nominated for backporting to the compiler in the stable channel. labels May 28, 2021
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. 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.

Trait evaluation cache interacts badly with incremental compilation
10 participants