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

crater: assert_eq!(NLL, location-insensitive polonius); #117593

Closed
wants to merge 2 commits into from

Conversation

lqd
Copy link
Member

@lqd lqd commented Nov 4, 2023

Crater run to check -Zpolonius=next. Any differences in how NLLs and location-insensitive polonius compute scopes will cause an assert to trip and an ICE.

r? @ghost

@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 Nov 4, 2023
@lqd
Copy link
Member Author

lqd commented Nov 4, 2023

@bors try

@bors
Copy link
Contributor

bors commented Nov 4, 2023

⌛ Trying commit 16af7f5 with merge 031b389...

bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 4, 2023
crater: assert_eq!(NLL, location-insensitive polonius);

Crater run to check `-Zpolonius=next`. Any differences in how NLLs and location-insensitive polonius compute scopes will cause an assert to trip and an ICE.

Depends on rust-lang#117560 to fix the last known fuzzing example where there was such a difference.

r? `@ghost`
@bors
Copy link
Contributor

bors commented Nov 4, 2023

☀️ Try build successful - checks-actions
Build commit: 031b389 (031b389f0c31c0f91c9464d26313ae513dbe8d36)

@lqd
Copy link
Member Author

lqd commented Nov 4, 2023

@craterbot check

@craterbot
Copy link
Collaborator

👌 Experiment pr-117593 created and queued.
🤖 Automatically detected try build 031b389
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 4, 2023
@craterbot
Copy link
Collaborator

🚧 Experiment pr-117593 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot
Copy link
Collaborator

🎉 Experiment pr-117593 is completed!
📊 206 regressed and 10 fixed (385369 total)
📰 Open the full report.

⚠️ If you notice any spurious failure please add them to the blacklist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-crater Status: Waiting on a crater run to be completed. labels Nov 8, 2023
@lqd
Copy link
Member Author

lqd commented Nov 8, 2023

WIP triage until I can properly dedupe the root causes:

  • "No space left on device": 48
  • most of the rest are differences in loan scopes

Some hacky and quick deduplication on crates with loan differences:

Liveness data is pushed from multiple parts of NLL. Instead of changing
the call sites to maintain live loans, move the latter to `LivenessValues` where
this liveness data is pushed to, and maintain live loans there.

This fixes the differences in polonius scopes on some CFGs where a
variable was dead in tracing but as a MIR terminator its regions were marked
live from "constraint generation"
@lqd
Copy link
Member Author

lqd commented Nov 22, 2023

I've minimized 6 of the crudely deduped regressions, and they all looked similar to me. I've pushed a commit fixing these liveness differences and it's likely it will fix the other affected crates as well. Let's try it on crater then.

@bors try

@bors
Copy link
Contributor

bors commented Nov 22, 2023

⌛ Trying commit 952ab19 with merge 08b2c37...

bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 22, 2023
crater: assert_eq!(NLL, location-insensitive polonius);

Crater run to check `-Zpolonius=next`. Any differences in how NLLs and location-insensitive polonius compute scopes will cause an assert to trip and an ICE.

Depends on rust-lang#117560 to fix the last known fuzzing example where there was such a difference.

r? `@ghost`
@bors
Copy link
Contributor

bors commented Nov 22, 2023

☀️ Try build successful - checks-actions
Build commit: 08b2c37 (08b2c37c39cf0d12f78ab70b2b8811ea41390c90)

@lqd
Copy link
Member Author

lqd commented Nov 22, 2023

Short run, and will also filter out the disk space related issues.

@craterbot check p=1 crates=https://crater-reports.s3.amazonaws.com/pr-117593/retry-regressed-list.txt

@craterbot
Copy link
Collaborator

👌 Experiment pr-117593-1 created and queued.
🤖 Automatically detected try build 08b2c37
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 22, 2023
@craterbot
Copy link
Collaborator

🚧 Experiment pr-117593-1 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot
Copy link
Collaborator

🎉 Experiment pr-117593-1 is completed!
📊 0 regressed and 0 fixed (206 total)
📰 Open the full report.

⚠️ If you notice any spurious failure please add them to the blacklist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot removed the S-waiting-on-crater Status: Waiting on a crater run to be completed. label Nov 24, 2023
@craterbot craterbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 24, 2023
@lqd
Copy link
Member Author

lqd commented Nov 25, 2023

sweet

@lqd lqd closed this Nov 25, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 2, 2023
Centralize live loans maintenance to fix scope differences due to liveness

As found in the recent [polonius crater run](rust-lang#117593 (comment)), NLLs and the location-insensitive polonius computed different scopes on some specific CFG shapes, e.g. the following.

![image](https://github.com/rust-lang/rust/assets/247183/c3649f5e-3058-454e-854e-1a6b336bdd5e)

I had missed that liveness data was pushed from different sources than just the liveness computation: there are a few places that do this -- and some of them may be unneeded or at the very least untested, as no tests changed when I tried removing some of them.

Here, `_6` is e.g. dead on entry to `bb2[0]` during `liveness::trace`, but its regions will be marked as live later during "constraint generation" (which I plan to refactor away and put in the liveness module soon). This should cause the inflowing loans to be marked live, but they were only computed in `liveness::trace`.

Therefore, this PR moves live loan maintenance to `LivenessValues`, so that the various places pushing liveness data will all also update live loans at the same time -- except for promoteds which I don't believe need them, and their liveness handling is already interesting/peculiar.

All the regressions I saw in the initial crater run were related to this kind of shapes, and this change did fix all of them on the [next run](rust-lang#117593 (comment)).

r? `@matthewjasper`

(This will conflict with rust-lang#117880 but whichever lands first is fine by me, the end goal is the same for both)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

None yet

4 participants