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

A couple of fixes for dataflow graphviz dumps #131121

Merged
merged 2 commits into from
Oct 2, 2024
Merged

Conversation

lqd
Copy link
Member

@lqd lqd commented Oct 2, 2024

A couple of trivial drive-by fixes to issues I noticed while debugging my buggy borrowck code:

One is a fix of the -Zdump-mir-dataflow file extensions, the dataflow graphviz files are currently dumped as ..dot.

-rw-rw-r-- 1 lqd lqd 13051 Oct  1 23:21 mir_dump/issue_47680.main.-------.borrows.borrowck..dot
-rw-rw-r-- 1 lqd lqd 13383 Oct  1 23:21 mir_dump/issue_47680.main.-------.ever_init.borrowck..dot
-rw-rw-r-- 1 lqd lqd 13591 Oct  1 23:21 mir_dump/issue_47680.main.-------.maybe_init.borrowck..dot
-rw-rw-r-- 1 lqd lqd  9257 Oct  1 23:21 mir_dump/issue_47680.main.-------.maybe_init.elaborate_drops..dot
-rw-rw-r-- 1 lqd lqd 14086 Oct  1 23:21 mir_dump/issue_47680.main.-------.maybe_uninit.borrowck..dot
-rw-rw-r-- 1 lqd lqd  9257 Oct  1 23:21 mir_dump/issue_47680.main.-------.maybe_uninit.elaborate_drops..dot
Some examples on nightly

And the other is for the specific Borrows dataflow analysis, whose domain is loans but shows locations when dumped (the location where the loan is introduced). It's not a huge deal but we didn't even print these locations in MIR dumps, and in general cross-referencing loan data (like loan liveness) is more annoying without this change.

Untitled

Here's how it'll look in case inquisitive minds want to know

The visualization state diff display is still suboptimal in loops for some of the effects escaping a block, e.g. a gen that's not dominated/postdominated by a kill will not show up in statement diffs. (This happens in the previous screenshot, there's no +bw1 anywhere). We can fix that in the future.

@rustbot
Copy link
Collaborator

rustbot commented Oct 2, 2024

r? @nnethercote

rustbot has assigned @nnethercote.
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 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 Oct 2, 2024
Copy link
Member

@compiler-errors compiler-errors left a comment

Choose a reason for hiding this comment

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

thank u!

@compiler-errors
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Oct 2, 2024

📌 Commit 98d6fdb has been approved by compiler-errors

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 Oct 2, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 2, 2024
A couple of fixes for dataflow graphviz dumps

A couple of trivial drive-by fixes to issues I noticed while debugging my buggy borrowck code:

One is a fix of the `-Zdump-mir-dataflow` file extensions, the dataflow graphviz files are currently dumped  as `..dot`.

<details>

```console
-rw-rw-r-- 1 lqd lqd 13051 Oct  1 23:21 mir_dump/issue_47680.main.-------.borrows.borrowck..dot
-rw-rw-r-- 1 lqd lqd 13383 Oct  1 23:21 mir_dump/issue_47680.main.-------.ever_init.borrowck..dot
-rw-rw-r-- 1 lqd lqd 13591 Oct  1 23:21 mir_dump/issue_47680.main.-------.maybe_init.borrowck..dot
-rw-rw-r-- 1 lqd lqd  9257 Oct  1 23:21 mir_dump/issue_47680.main.-------.maybe_init.elaborate_drops..dot
-rw-rw-r-- 1 lqd lqd 14086 Oct  1 23:21 mir_dump/issue_47680.main.-------.maybe_uninit.borrowck..dot
-rw-rw-r-- 1 lqd lqd  9257 Oct  1 23:21 mir_dump/issue_47680.main.-------.maybe_uninit.elaborate_drops..dot
```

<summary>Some examples on nightly</summary>

</details>

And the other is for the specific `Borrows` dataflow analysis, whose domain is loans but shows locations when dumped (the location where the loan is introduced). It's not a huge deal but we didn't even print these locations in MIR dumps, and in general cross-referencing loan data (like loan liveness) is more annoying without this change.

<details>

![Untitled](https://github.com/user-attachments/assets/b325a6e9-1aee-4655-8441-d3b1b55ded3c)

<summary>Here's how it'll look in case inquisitive minds want to know</summary>

</details>

The visualization state diff display is still suboptimal in loops for some of the effects escaping a block, e.g. a gen that's not dominated/postdominated by a kill will not show up in statement diffs. (This happens in the previous screenshot, there's no `+bw1` anywhere). We can fix that in the future.
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 2, 2024
…kingjubilee

Rollup of 3 pull requests

Successful merges:

 - rust-lang#130885 (panic when an interpreter error gets unintentionally discarded)
 - rust-lang#131108 (Revert rust-lang#131060 "Drop conditionally applied cargo `-Zon-broken-pipe=kill` flags")
 - rust-lang#131121 (A couple of fixes for dataflow graphviz dumps)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit cd084ab into rust-lang:master Oct 2, 2024
6 checks passed
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Oct 2, 2024
Rollup merge of rust-lang#131121 - lqd:dataflow-viz, r=compiler-errors

A couple of fixes for dataflow graphviz dumps

A couple of trivial drive-by fixes to issues I noticed while debugging my buggy borrowck code:

One is a fix of the `-Zdump-mir-dataflow` file extensions, the dataflow graphviz files are currently dumped  as `..dot`.

<details>

```console
-rw-rw-r-- 1 lqd lqd 13051 Oct  1 23:21 mir_dump/issue_47680.main.-------.borrows.borrowck..dot
-rw-rw-r-- 1 lqd lqd 13383 Oct  1 23:21 mir_dump/issue_47680.main.-------.ever_init.borrowck..dot
-rw-rw-r-- 1 lqd lqd 13591 Oct  1 23:21 mir_dump/issue_47680.main.-------.maybe_init.borrowck..dot
-rw-rw-r-- 1 lqd lqd  9257 Oct  1 23:21 mir_dump/issue_47680.main.-------.maybe_init.elaborate_drops..dot
-rw-rw-r-- 1 lqd lqd 14086 Oct  1 23:21 mir_dump/issue_47680.main.-------.maybe_uninit.borrowck..dot
-rw-rw-r-- 1 lqd lqd  9257 Oct  1 23:21 mir_dump/issue_47680.main.-------.maybe_uninit.elaborate_drops..dot
```

<summary>Some examples on nightly</summary>

</details>

And the other is for the specific `Borrows` dataflow analysis, whose domain is loans but shows locations when dumped (the location where the loan is introduced). It's not a huge deal but we didn't even print these locations in MIR dumps, and in general cross-referencing loan data (like loan liveness) is more annoying without this change.

<details>

![Untitled](https://github.com/user-attachments/assets/b325a6e9-1aee-4655-8441-d3b1b55ded3c)

<summary>Here's how it'll look in case inquisitive minds want to know</summary>

</details>

The visualization state diff display is still suboptimal in loops for some of the effects escaping a block, e.g. a gen that's not dominated/postdominated by a kill will not show up in statement diffs. (This happens in the previous screenshot, there's no `+bw1` anywhere). We can fix that in the future.
@rustbot rustbot added this to the 1.83.0 milestone Oct 2, 2024
@lqd lqd deleted the dataflow-viz branch October 2, 2024 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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