Skip to content

Conversation

@blyxyas
Copy link
Member

@blyxyas blyxyas commented Sep 23, 2025

eval_always gives the impression that the query is evaluated every time it's called. (thus, evaluated always). Turns out this isn't the truth, it just affects how the dependency graph behaves with that node (i.e. not even trying to mark it green)

This commit renames eval_always to no_incremental, I thought about always_red_on_depgraph or similar but I don't think that expecting every query author to know what "red" means in this context is preferable or useful.

@rustbot
Copy link
Collaborator

rustbot commented Sep 23, 2025

The rustc-dev-guide subtree was changed. If this PR only touches the dev guide consider submitting a PR directly to rust-lang/rustc-dev-guide otherwise thank you for updating the dev guide with your changes.

cc @BoxyUwU, @jieyouxu, @Kobzol, @tshepang

@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-rustc-dev-guide Area: rustc-dev-guide 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. labels Sep 23, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 23, 2025

r? @jackh726

rustbot has assigned @jackh726.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot

This comment has been minimized.

\`eval_always\` gives the impression that the query is evaluated every time it's called. (thus, evaluated always). Turns out this isn't the truth, it just affects how the dependency graph behaves with that node (i.e. not even trying to mark it green) This commit renames `eval_always` to `no_incremental`, I thought about `always_red_on_depgraph` or similar but I don't think that gatekeeping its use under minor details of how the dep graph works is that preferable.
@rustbot
Copy link
Collaborator

rustbot commented Sep 23, 2025

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@jackh726
Copy link
Member

Seems good to me, but may want a second look from someone more familiar with the incremental system.

Maybe one of @cjgillot @bjorn3 @Zalathar

@cjgillot
Copy link
Contributor

I'm not convinced that this terminology is better.
eval_always queries are always evaluated at least once. Not tracking dependencies is just an optimisation.
I'm not sure what no_incremental means.
always_red is wrong: an eval_always query can be green.

@blyxyas
Copy link
Member Author

blyxyas commented Sep 24, 2025

eval_always queries are always evaluated at least once.

But this is not clear, in fact it's so unclear I was misguided just until yesterday :< maybe another name would be better, but eval_always is really not helpful when figuring out what the modifier actually does.

If no_incremental isn't that clear either, we can make it a bit longer, what about not_taken_from_incremental, not_read_from_disk or only_in_single_compilation?

@bjorn3
Copy link
Member

bjorn3 commented Sep 24, 2025

Query results are by default not stored on the disk. You have to use cache_on_disk_if to specify when to store them. Most queries only have their dep node stored to help determine if things need to be rerun. With eval_always a query will always run, while without it, it will only run if either dependencies are red or if cache_on_disk_if doesn't apply and a query that does need its output runs.

@jackh726
Copy link
Member

Okay, so I'd like to move this PR somewhere towards merge (in some form) or close. Sounds like @cjgillot has specific concerns about this PR, not sure if @bjorn3 had specific concerns or anything.

@blyxyas what are your feelings here? Do you want to try to push for some kind of rename? Or would you rather just close?

@jackh726 jackh726 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 Oct 27, 2025
@blyxyas
Copy link
Member Author

blyxyas commented Oct 27, 2025

I prefer renaming it to another terminology than closing this, I really think that eval_always is really confusing.

eval_at_least_once could also be an alternative

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-rustc-dev-guide Area: rustc-dev-guide 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.

5 participants