Skip to content

Create QuerySideEffects and use it for diagnostics #87416

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

Merged
merged 2 commits into from
Jul 29, 2021

Conversation

Aaron1011
Copy link
Member

@Aaron1011 Aaron1011 commented Jul 23, 2021

The code for saving and loading diagnostics during execution is generalized to handle a new QuerySideEffects struct. Currently, this struct just holds diagnostics - in a follow-up PR, I plan to add support for storing attriutes marked as used during query execution.

This is a pure refactor, with no intended behavior changes.

@rust-highfive
Copy link
Contributor

r? @cjgillot

(rust-highfive has picked a reviewer for you, use r? to override)

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

@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 Jul 23, 2021
@bors
Copy link
Collaborator

bors commented Jul 23, 2021

⌛ Trying commit 89cc7b5da823e6322fc6df30b17cb4e7ac55f999 with merge 8da7cd35c07e3102223f370de2274c9234cf349c...

@bors
Copy link
Collaborator

bors commented Jul 23, 2021

☀️ Try build successful - checks-actions
Build commit: 8da7cd35c07e3102223f370de2274c9234cf349c (8da7cd35c07e3102223f370de2274c9234cf349c)

@rust-timer
Copy link
Collaborator

Queued 8da7cd35c07e3102223f370de2274c9234cf349c with parent 4a1f419, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking try commit (8da7cd35c07e3102223f370de2274c9234cf349c): comparison url.

Summary: This change led to significant regressions 😿 in compiler performance.

  • Very large regression in instruction counts (up to 12.7% on incr-unchanged builds of tokio-webpush-simple-check)

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf.

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

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

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jul 24, 2021
@Aaron1011 Aaron1011 force-pushed the query-side-effect branch from 89cc7b5 to 68c35e4 Compare July 24, 2021 14:20
@Aaron1011
Copy link
Member Author

@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 Jul 24, 2021
@bors
Copy link
Collaborator

bors commented Jul 24, 2021

⌛ Trying commit 68c35e4eaf058dfb492d8580ced9e13009a4af6f with merge 0cee03201c63f955fddcddfd7d96eb25569ca877...

@bors
Copy link
Collaborator

bors commented Jul 24, 2021

☀️ Try build successful - checks-actions
Build commit: 0cee03201c63f955fddcddfd7d96eb25569ca877 (0cee03201c63f955fddcddfd7d96eb25569ca877)

@rust-timer
Copy link
Collaborator

Queued 0cee03201c63f955fddcddfd7d96eb25569ca877 with parent f9b95f9, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking try commit (0cee03201c63f955fddcddfd7d96eb25569ca877): comparison url.

Summary: This benchmark run did not return any significant changes.

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up.

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

@rustbot rustbot removed S-waiting-on-perf Status: Waiting on a perf run to be completed. perf-regression Performance regression. labels Jul 24, 2021
@Aaron1011 Aaron1011 force-pushed the query-side-effect branch from 68c35e4 to 8ed6349 Compare July 24, 2021 21:46
@Aaron1011 Aaron1011 changed the title [WIP] Create QuerySideEffects and use it for diagnostics Create QuerySideEffects and use it for diagnostics Jul 24, 2021
@Aaron1011
Copy link
Member Author

@cjgillot This is now ready for review

{
break;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this modification cause us to emit the diagnostic twice for parallel_compiler runs?
(And if it does, is it a big deal?)

Copy link
Member Author

Choose a reason for hiding this comment

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

No - only the thread that inserts into processed first will process the side effects.

@cjgillot
Copy link
Contributor

This PR is about wrapping the diagnostic load/save inside a more general QuerySideEffect abstraction. Most is straightforward renaming.
You mention using this framework for marking attributes as used.
What are the correctness conditions for a side-effect to be included in this abstraction?
Should we restrict to idempotent side-effects (see my comment about parallel-compiler)?

@Aaron1011 Aaron1011 force-pushed the query-side-effect branch from 8ed6349 to 87740ba Compare July 26, 2021 01:43
@cjgillot
Copy link
Contributor

@bors r+
But I am still interested by the correctness conditions for more side-effects to be included.

@bors
Copy link
Collaborator

bors commented Jul 28, 2021

📌 Commit 87740ba has been approved by cjgillot

@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-review Status: Awaiting review from the assignee but also interested parties. labels Jul 28, 2021
@bors
Copy link
Collaborator

bors commented Jul 29, 2021

⌛ Testing commit 87740ba with merge 581b166...

@bors
Copy link
Collaborator

bors commented Jul 29, 2021

☀️ Test successful - checks-actions
Approved by: cjgillot
Pushing 581b166 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 29, 2021
@bors bors merged commit 581b166 into rust-lang:master Jul 29, 2021
@rustbot rustbot added this to the 1.56.0 milestone Jul 29, 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants