Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign up[incremental] Add support for eval always queries #45353
Conversation
rust-highfive
assigned
eddyb
Oct 18, 2017
This comment has been minimized.
This comment has been minimized.
|
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
rust-highfive
assigned
michaelwoerister
and unassigned
eddyb
Oct 18, 2017
kennytm
added
the
S-waiting-on-review
label
Oct 18, 2017
michaelwoerister
reviewed
Oct 18, 2017
|
Looking good, except for the result fingerprinting being missing. Since we essentially disable dependency tracking for this tasks its even more important for them to be fingerprinted. If you add the fingerprint, however, I guess there'll be a lot of code duplication between I'm also a bit skeptical about the term |
| @@ -782,6 +812,24 @@ impl CurrentDepGraph { | |||
| } | |||
| } | |||
|
|
|||
| pub(super) fn push_untracked_task(&mut self, key: DepNode) { | |||
This comment has been minimized.
This comment has been minimized.
michaelwoerister
Oct 18, 2017
Contributor
You should be able to make the push and the pop methods here private.
| @@ -812,7 +860,7 @@ impl CurrentDepGraph { | |||
| reads.push(source); | |||
| } | |||
| } | |||
| Some(&mut OpenTask::Ignore) | None => { | |||
| Some(&mut OpenTask::Ignore) | Some(&mut OpenTask::Untracked { .. }) | None => { | |||
This comment has been minimized.
This comment has been minimized.
michaelwoerister
Oct 18, 2017
Contributor
Since this line is getting a little long, it would be more readable to have each arm on its own line.
kennytm
added
S-waiting-on-author
and removed
S-waiting-on-review
labels
Oct 18, 2017
This comment has been minimized.
This comment has been minimized.
|
Hm, it looks like implementing pub fn with_xxx_task<C, A, R, HCX>(&self,
key: DepNode,
cx: C,
arg: A,
task: fn(C, A) -> R)
-> (R, DepNodeIndex)
{
self.with_task(key, cx, arg, |cx, arg| {
// Explicitly add the read to the Krate node
self.read(DepNode::Krate);
// Execute the task without recording any other reads
self.with_ignore(|| {
task(cx, arg)
})
})
}But |
This comment has been minimized.
This comment has been minimized.
|
Thanks for the review! What about something like "crate-wide query"? I'm also fine just changing it to "eval-always". |
This comment has been minimized.
This comment has been minimized.
|
Yeah, let's stick to "eval-always". It's not a pretty name but it conveys the underlying concept well enough. |
wesleywiser
force-pushed the
wesleywiser:untracked_queries
branch
from
38b3aa5
to
9794bb5
Oct 21, 2017
This comment has been minimized.
This comment has been minimized.
|
@michaelwoerister I fixed up the commit per your feedback. |
kennytm
added
S-waiting-on-review
and removed
S-waiting-on-author
labels
Oct 21, 2017
This comment has been minimized.
This comment has been minimized.
|
@wesleywiser Yes, that looks very good now! If you want to continue working on this, I suggest just appending to this PR. |
michaelwoerister
added
S-waiting-on-author
and removed
S-waiting-on-review
labels
Oct 23, 2017
This comment has been minimized.
This comment has been minimized.
|
@michaelwoerister Thanks! Pushed three new commits. |
This comment has been minimized.
This comment has been minimized.
|
Looks very good! I'm seeing this error on travis:
This suggests that we are re-running queries although they've already been marked as green. This is because we are not doing the whole Thinking about it some more, there should really be no reason to treat an eval-always query different from a regular one, except for the changes you already implemented in rust/src/librustc/ty/maps/plumbing.rs Lines 433 to 442 in b247805 That should also not introduce any code duplication. Let me know if you have any questions about this change of strategy. |
This comment has been minimized.
This comment has been minimized.
|
Hmmm... I can't seem to repro that. Regardless, I can certainly revert the changes to |
This comment has been minimized.
This comment has been minimized.
You are probably building with debug assertions disabled. I generally recommend setting I imagine the updated profq_msg!(tcx, ProfileQueriesMsg::ProviderBegin);
let res = tcx.cycle_check(span, Query::$name(key), || {
tcx.sess.diagnostic().track_diagnostics(|| {
if dep_node.is_eval_always() {
tcx.dep_graph.with_eval_always_task(dep_node,
tcx,
key,
Self::compute_result)
} else {
tcx.dep_graph.with_task(dep_node,
tcx,
key,
Self::compute_result)
}
})
})?;
profq_msg!(tcx, ProfileQueriesMsg::ProviderEnd);This way eval-always tasks are treated the same as regular with the only exception of what reads are recorded from them. |
This comment has been minimized.
This comment has been minimized.
|
Oh got it. That makes sense.
Thanks! I'll do that. |
wesleywiser
added some commits
Oct 18, 2017
wesleywiser
force-pushed the
wesleywiser:untracked_queries
branch
from
9e3be26
to
8281e88
Oct 26, 2017
This comment has been minimized.
This comment has been minimized.
|
@michaelwoerister Done |
wesleywiser
changed the title
[incremental] Add support for untracked queries
[incremental] Add support for eval always queries
Oct 27, 2017
This comment has been minimized.
This comment has been minimized.
|
Awesome, thank you so much @wesleywiser! @bors r+ |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Oct 27, 2017
This comment has been minimized.
This comment has been minimized.
|
|
bors
merged commit 8281e88
into
rust-lang:master
Oct 27, 2017
This comment has been minimized.
This comment has been minimized.
|
Thanks for all the help @michaelwoerister!! |
This comment has been minimized.
This comment has been minimized.
|
You're welcome! |
wesleywiser commentedOct 18, 2017
Part of #45238