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

Fix dependency tracking for debugger visualizers #111641

Merged
merged 6 commits into from
May 19, 2023

Conversation

michaelwoerister
Copy link
Member

@michaelwoerister michaelwoerister commented May 16, 2023

This PR fixes dependency tracking for debugger visualizer files by changing the debugger_visualizers query to an eval_always query that scans the AST while it is still available. This way the set of visualizer files is already available when dep-info is emitted. Since the query is turned into an eval_always query, dependency tracking will now reliably detect changes to the visualizer script files themselves.

TODO:

  • perf.rlo
  • Needs a bit more documentation in some places
  • Needs regression test for the incr. comp. case

Fixes #111226
Fixes #111227
Fixes #111295

r? @wesleywiser
cc @gibbyfree

@rustbot rustbot added 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 May 16, 2023
@michaelwoerister michaelwoerister 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 16, 2023
@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels May 16, 2023
@michaelwoerister
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

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

bors commented May 16, 2023

⌛ Trying commit 554f8e4a67a414bcabaa33283bdcc6ee4dc2f923 with merge d75ea5f73435c497a3cb2de433e97109163f94a1...

compiler/rustc_passes/src/debugger_visualizer.rs Outdated Show resolved Hide resolved
compiler/rustc_span/src/lib.rs Outdated Show resolved Hide resolved
compiler/rustc_passes/src/check_attr.rs Outdated Show resolved Hide resolved
tests/run-make/debugger-visualizer-dep-info/Makefile Outdated Show resolved Hide resolved
@bors
Copy link
Contributor

bors commented May 16, 2023

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

@rust-timer

This comment has been minimized.

compiler/rustc_middle/src/hir/map/mod.rs Show resolved Hide resolved
compiler/rustc_interface/src/passes.rs Outdated Show resolved Hide resolved
compiler/rustc_span/src/lib.rs Outdated Show resolved Hide resolved
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (d75ea5f73435c497a3cb2de433e97109163f94a1): comparison URL.

Overall result: ❌ regressions - no action needed

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 may lead to changes in compiler perf.

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

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.4% [0.4%, 0.4%] 1
Regressions ❌
(secondary)
0.4% [0.4%, 0.4%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.4% [0.4%, 0.4%] 1

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.1% [2.2%, 6.6%] 6
Improvements ✅
(primary)
-0.9% [-0.9%, -0.9%] 1
Improvements ✅
(secondary)
-1.5% [-1.5%, -1.5%] 1
All ❌✅ (primary) -0.9% [-0.9%, -0.9%] 1

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.9% [1.9%, 5.0%] 16
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 641.487s -> 643.487s (0.31%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 16, 2023
@michaelwoerister michaelwoerister force-pushed the debugger-visualizer-fixes branch from 554f8e4 to a7d4880 Compare May 16, 2023 16:53
@michaelwoerister
Copy link
Member Author

Performance looks fine, I'd say. The only regressions come from AST-heavy incr-unchanged tests where it makes a difference that we are now doing the change-detection work that the compiler invalidly skipped before.

@michaelwoerister michaelwoerister changed the title (wip) Fix dependency tracking for debugger visualizers Fix dependency tracking for debugger visualizers May 17, 2023
@rust-log-analyzer

This comment has been minimized.

@michaelwoerister michaelwoerister force-pushed the debugger-visualizer-fixes branch from 96a1854 to cfca5b0 Compare May 17, 2023 09:39
@michaelwoerister michaelwoerister marked this pull request as ready for review May 17, 2023 10:20
@michaelwoerister
Copy link
Member Author

@rustbot ready

@rustbot rustbot 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 May 17, 2023
/// Traverses and collects the debugger visualizers for a specific crate.
fn debugger_visualizers(tcx: TyCtxt<'_>, _: LocalCrate) -> Vec<DebuggerVisualizerFile> {
let resolver_and_krate = tcx.resolver_for_lowering(()).borrow();
let krate = &*resolver_and_krate.1;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why can't this be done on HIR, like it used to?

Copy link
Member Author

Choose a reason for hiding this comment

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

So that emitting only dep-info does not depend on HIR lowering. See this test for example.

@cjgillot
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented May 18, 2023

📌 Commit 927e1ef has been approved by cjgillot

It is now in the queue for this repository.

@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 May 18, 2023
@bors
Copy link
Contributor

bors commented May 18, 2023

⌛ Testing commit 927e1ef with merge 2e9660f1bb00ee53638f73fe48cc8f8842daaf60...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented May 18, 2023

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 18, 2023
@michaelwoerister
Copy link
Member Author

Let's see if that fixed the test for macOS.
@bors r=cjgillot

@bors
Copy link
Contributor

bors commented May 19, 2023

📌 Commit 987655a has been approved by cjgillot

It is now in the queue for this repository.

@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 May 19, 2023
@bors
Copy link
Contributor

bors commented May 19, 2023

⌛ Testing commit 987655a with merge 17a6810...

@bors
Copy link
Contributor

bors commented May 19, 2023

☀️ Test successful - checks-actions
Approved by: cjgillot
Pushing 17a6810 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 19, 2023
@bors bors merged commit 17a6810 into rust-lang:master May 19, 2023
@rustbot rustbot added this to the 1.71.0 milestone May 19, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (17a6810): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.2% [0.2%, 0.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.1% [1.2%, 3.5%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.5% [-1.7%, -1.3%] 2
All ❌✅ (primary) - - 0

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 640.861s -> 640.817s (-0.01%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc 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-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
7 participants