Skip to content

Remove deterministic picking from query cycle handling#152229

Open
Zoxc wants to merge 1 commit intorust-lang:mainfrom
Zoxc:rem-det-pick
Open

Remove deterministic picking from query cycle handling#152229
Zoxc wants to merge 1 commit intorust-lang:mainfrom
Zoxc:rem-det-pick

Conversation

@Zoxc
Copy link
Contributor

@Zoxc Zoxc commented Feb 6, 2026

This removes the deterministic picking of queries from the query cycle handling. The sets we pick from are themselves non-deterministic, making this ineffective. There may be additional entry points to the cycle which we won't discover until after we resume from the cycle handler and run more code.

@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) 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. labels Feb 6, 2026
@Zoxc
Copy link
Contributor Author

Zoxc commented Feb 7, 2026

cc @nnethercote

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 12, 2026

☔ The latest upstream changes (presumably #152484) made this pull request unmergeable. Please resolve the merge conflicts.

let entry_point = entry_points
.iter()
.find(|entry_point| entry_point.waiter.is_some())
.unwrap_or(entry_points.first().unwrap());
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
.unwrap_or(entry_points.first().unwrap());
.unwrap_or(entry_points[0]);

if query_in_cycle.parent(query_map).is_none() {
// This query is connected to the root (it has no query parent)
Some((span, query, None))

Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: stray empty line.

@petrochenkov petrochenkov added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 13, 2026
@petrochenkov petrochenkov marked this pull request as ready for review February 13, 2026 14:52
@petrochenkov
Copy link
Contributor

If the existing approach is indeed non-deterministic, then this looks like a good simplification.
This will simplify #149849 as well, if merged.

cc @zetanumbers @Zalathar @nnethercote

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) 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants