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

Polonius: fix some cases of killed fact generation, and most of the ui test suite #62736

Merged
merged 29 commits into from
Jul 25, 2019

Conversation

lqd
Copy link
Member

@lqd lqd commented Jul 16, 2019

Since basic Polonius functionality was re-enabled by @matthewjasper in #54468, some tests were still failing in the polonius compare-mode.

This PR fixes all but one test in the ui suite by:

  • fixing some bugs in the fact generation code, related to the killed relation: Polonius would incorrectly reject some NLL-accepted code, because of these missing killed facts.
  • ignoring some tests in the polonius compare-mode: a lot of those manually test the NLL or migrate mode, and the failures were mostly artifacts of the test revisions, e.g. that -Z polonius requires full NLLs. Some others were also both failing with NLL and succeeding with Polonius, which we can't encode in tests at the moment.
  • blessing the output of some tests: whenever Polonius and NLL have basically the same errors, except for diagnostics differences, the Polonius output is blessed. Whenever we've advanced into a less experimental phase, we'll want to revisit these cases (much like we did on the NLL test suite last year) to specifically work on diagnostics.

Fact generation changes:

  • we now kill loans on the destination place of Call terminators
  • we now kill loans on the locals destroyed by StorageDead
  • we now also handle assignments to projections: killing the loans on a either a deref-ed local, or the ones whose borrowed_place conflicts with the current place.

One failing test remains: an overflow during fact generation, on a case of polymorphic recursion (and which I'll continue investigating later).

This adds some tests for the fact generation changes, with some simple Polonius cases similar to the existing smoke tests, but also for some cases encountered in the wild (in the rand crate for example).

A more detailed write-up is available here with an explanation for each test failure, the steps taken to resolve it (as a commit in the current PR), NLL and Polonius outputs (and diff), etc.

Since they've worked on this before, and we've discussed some of these failures together:

r? @matthewjasper

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 16, 2019
@matthewjasper
Copy link
Contributor

@bors r+
At some point we'll probably want to have CI running these tests cc @rust-lang/infra

@bors
Copy link
Contributor

bors commented Jul 17, 2019

📌 Commit 3920403008067135b6255068f80c5f23ebeec816 has been approved by matthewjasper

@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 17, 2019
@bors
Copy link
Contributor

bors commented Jul 20, 2019

⌛ Testing commit 3920403008067135b6255068f80c5f23ebeec816 with merge 85d339d554a6ac0acc1bd8c49722045c09dac5b2...

@bors
Copy link
Contributor

bors commented Jul 20, 2019

💔 Test failed - checks-azure

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-aux of your PR failed (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-07-20T09:57:21.3086437Z do so (now or later) by using -b with the checkout command again. Example:
2019-07-20T09:57:21.3086497Z 
2019-07-20T09:57:21.3086773Z   git checkout -b <new-branch-name>
2019-07-20T09:57:21.3086824Z 
2019-07-20T09:57:21.3087159Z HEAD is now at 85d339d55 Auto merge of #62736 - lqd:polonius_tests3, r=matthewjasper
2019-07-20T09:57:21.3223189Z ##[section]Starting: Collect CPU-usage statistics in the background
2019-07-20T09:57:21.3226150Z ==============================================================================
2019-07-20T09:57:21.3226241Z Task         : Bash
2019-07-20T09:57:21.3226329Z Description  : Run a Bash script on macOS, Linux, or Windows

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@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 Jul 20, 2019
@lqd
Copy link
Member Author

lqd commented Jul 20, 2019

Looks like a network issue

2019-07-20T12:18:08.1142326Z error: failed to download from `https://crates.io/api/v1/crates/bitflags/1.0.3/download`
2019-07-20T12:18:08.1142895Z 
2019-07-20T12:18:08.1143134Z Caused by:
2019-07-20T12:18:08.1143339Z   [35] SSL connect error (OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to crates.io:443 )
2019-07-20T12:18:08.1164594Z thread 'main' panicked at 'tests failed for https://github.com/servo/webrender', src/tools/cargotest/main.rs:88:9

@bors retry

@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 20, 2019
@bors

This comment has been minimized.

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 21, 2019
lqd added 12 commits July 22, 2019 10:32
This is test specific to the NLL migrate mode which is irrelevant to -Z polonius.
It can't currently be encoded depending on migrate-mode and NLL/Polonius mode, so the NLL compare-mode also ignores it.
There is no difference between the NLL and Polonius outputs, and it manually tests NLLs.
…mpare mode

This is just a difference from the test construction, it's ignore-compare-mode-nll and manually checks migrate/nll over edition2015/2018.

This failure is because the `migrate2015` and `migrate2018`  revisions are ran with `-Zpolonius`. There is no actual difference in the errors output by NLLs and Polonius.
This is a test about turning the NLL feature gate on, ignored by the NLL compare-mode.
…re mode

Once again, the difference is in the test construction, it is ignored in compare-mode NLL and tested manually with revisions, and fails because the `migrate` revision is ran with `-Zpolonius`. There is no actual difference in the errors output by NLLs and Polonius.
2 of the 3 errors are "fixed by Polonius" 🎉
@lqd
Copy link
Member Author

lqd commented Jul 22, 2019

Thanks to @oli-obk for the information about the Place 2.0 changes for the rebase.

@bors r=matthewjasper rollup

@bors
Copy link
Contributor

bors commented Jul 22, 2019

📌 Commit e16bede has been approved by matthewjasper

@bors
Copy link
Contributor

bors commented Jul 22, 2019

🌲 The tree is currently closed for pull requests below priority 1500, this pull request will be tested once the tree is reopened

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 22, 2019
@Centril
Copy link
Contributor

Centril commented Jul 22, 2019

@bors rollup-

Centril added a commit to Centril/rust that referenced this pull request Jul 24, 2019
Polonius: fix some cases of `killed` fact generation, and most of the `ui` test suite

Since basic Polonius functionality was re-enabled by @matthewjasper in rust-lang#54468, some tests were still failing in the polonius compare-mode.

This PR fixes all but one test in the `ui` suite by:
- fixing some bugs in the fact generation code, related to the `killed` relation: Polonius would incorrectly reject some NLL-accepted code, because of these missing `killed` facts.
- ignoring some tests in the polonius compare-mode: a lot of those manually test the NLL or migrate mode, and the failures were mostly artifacts of the test revisions, e.g. that `-Z polonius` requires full NLLs. Some others were also both failing with NLL and succeeding with Polonius, which we can't encode in tests at the moment.
- blessing the output of some tests: whenever Polonius and NLL have basically the same errors, except for diagnostics differences, the Polonius output is blessed. Whenever we've advanced into a less experimental phase, we'll want to revisit these cases (much like we did on the NLL test suite last year) to specifically work on diagnostics.

Fact generation changes:
- we now kill loans on the destination place of `Call` terminators
- we now kill loans on the locals destroyed by `StorageDead`
- we now also handle assignments to projections: killing the loans on a either a deref-ed local, or the ones whose `borrowed_place` conflicts with the current place.

One failing test remains: an overflow during fact generation, on a case of polymorphic recursion (and which I'll continue investigating later).

This adds some tests for the fact generation changes, with some simple Polonius cases similar to the existing smoke tests, but also for some cases encountered in the wild (in the `rand` crate for example).

A more detailed write-up is available [here](https://hackmd.io/CjYB0fs4Q9CweyeTdKWyEg?view) with an explanation for each test failure, the steps taken to resolve it (as a commit in the current PR), NLL and Polonius outputs (and diff), etc.

Since they've worked on this before, and we've discussed some of these failures together:

r? @matthewjasper
Centril added a commit to Centril/rust that referenced this pull request Jul 24, 2019
Polonius: fix some cases of `killed` fact generation, and most of the `ui` test suite

Since basic Polonius functionality was re-enabled by @matthewjasper in rust-lang#54468, some tests were still failing in the polonius compare-mode.

This PR fixes all but one test in the `ui` suite by:
- fixing some bugs in the fact generation code, related to the `killed` relation: Polonius would incorrectly reject some NLL-accepted code, because of these missing `killed` facts.
- ignoring some tests in the polonius compare-mode: a lot of those manually test the NLL or migrate mode, and the failures were mostly artifacts of the test revisions, e.g. that `-Z polonius` requires full NLLs. Some others were also both failing with NLL and succeeding with Polonius, which we can't encode in tests at the moment.
- blessing the output of some tests: whenever Polonius and NLL have basically the same errors, except for diagnostics differences, the Polonius output is blessed. Whenever we've advanced into a less experimental phase, we'll want to revisit these cases (much like we did on the NLL test suite last year) to specifically work on diagnostics.

Fact generation changes:
- we now kill loans on the destination place of `Call` terminators
- we now kill loans on the locals destroyed by `StorageDead`
- we now also handle assignments to projections: killing the loans on a either a deref-ed local, or the ones whose `borrowed_place` conflicts with the current place.

One failing test remains: an overflow during fact generation, on a case of polymorphic recursion (and which I'll continue investigating later).

This adds some tests for the fact generation changes, with some simple Polonius cases similar to the existing smoke tests, but also for some cases encountered in the wild (in the `rand` crate for example).

A more detailed write-up is available [here](https://hackmd.io/CjYB0fs4Q9CweyeTdKWyEg?view) with an explanation for each test failure, the steps taken to resolve it (as a commit in the current PR), NLL and Polonius outputs (and diff), etc.

Since they've worked on this before, and we've discussed some of these failures together:

r? @matthewjasper
Centril added a commit to Centril/rust that referenced this pull request Jul 24, 2019
Rollup of 9 pull requests

Successful merges:

 - rust-lang#61727 (Add binary dependencies to dep-info files)
 - rust-lang#62736 (Polonius: fix some cases of `killed` fact generation, and most of the `ui` test suite)
 - rust-lang#62758 (ci: Install clang on Windows through tarballs)
 - rust-lang#62784 (Add riscv32i-unknown-none-elf target)
 - rust-lang#62814 (add support for hexagon-unknown-linux-musl)
 - rust-lang#62827 (Don't link mcjit/interpreter LLVM components)
 - rust-lang#62901 (cleanup: Remove `extern crate serialize as rustc_serialize`s)
 - rust-lang#62903 (Support SDKROOT env var on iOS)
 - rust-lang#62906 (Require a value for configure --debuginfo-level)

Failed merges:

 - rust-lang#62910 (cleanup: Remove lint annotations in specific crates that are already enforced by rustbuild)

r? @ghost
bors added a commit that referenced this pull request Jul 25, 2019
Rollup of 9 pull requests

Successful merges:

 - #61727 (Add binary dependencies to dep-info files)
 - #62736 (Polonius: fix some cases of `killed` fact generation, and most of the `ui` test suite)
 - #62758 (ci: Install clang on Windows through tarballs)
 - #62784 (Add riscv32i-unknown-none-elf target)
 - #62814 (add support for hexagon-unknown-linux-musl)
 - #62827 (Don't link mcjit/interpreter LLVM components)
 - #62901 (cleanup: Remove `extern crate serialize as rustc_serialize`s)
 - #62903 (Support SDKROOT env var on iOS)
 - #62906 (Require a value for configure --debuginfo-level)

Failed merges:

 - #62910 (cleanup: Remove lint annotations in specific crates that are already enforced by rustbuild)

r? @ghost
@bors bors merged commit e16bede into rust-lang:master Jul 25, 2019
@lqd lqd deleted the polonius_tests3 branch July 25, 2019 08:15
Centril added a commit to Centril/rust that referenced this pull request Sep 18, 2019
Polonius: more `ui` test suite fixes

Since rust-lang#62736, new tests have been added, and the `run-pass` suite was merged into the `ui` suite.

This PR adds the missing tests expectations for Polonius, and updates the existing ones where the NLL output has changed in some manner (e.g. ordering of notes)

Those are the trivial cases, but a more-detailed explanation is available [in this write-up](https://hackmd.io/CjYB0fs4Q9CweyeTdKWyEg?both#26-async-awaitasync-borrowck-escaping-closure-errorrs-outputs-from-NLL-Polonius-diff) starting at test case 26: they are only differing in diagnostics and instances of other existing test cases differences.

Only 3 of the 9020 tests are still "failing" at the moment (1 failure, 2 OOMs).

r? @nikomatsakis
Centril added a commit to Centril/rust that referenced this pull request Sep 19, 2019
Polonius: more `ui` test suite fixes

Since rust-lang#62736, new tests have been added, and the `run-pass` suite was merged into the `ui` suite.

This PR adds the missing tests expectations for Polonius, and updates the existing ones where the NLL output has changed in some manner (e.g. ordering of notes)

Those are the trivial cases, but a more-detailed explanation is available [in this write-up](https://hackmd.io/CjYB0fs4Q9CweyeTdKWyEg?both#26-async-awaitasync-borrowck-escaping-closure-errorrs-outputs-from-NLL-Polonius-diff) starting at test case 26: they are only differing in diagnostics and instances of other existing test cases differences.

Only 3 of the 9020 tests are still "failing" at the moment (1 failure, 2 OOMs).

r? @nikomatsakis
Centril added a commit to Centril/rust that referenced this pull request Sep 19, 2019
Polonius: more `ui` test suite fixes

Since rust-lang#62736, new tests have been added, and the `run-pass` suite was merged into the `ui` suite.

This PR adds the missing tests expectations for Polonius, and updates the existing ones where the NLL output has changed in some manner (e.g. ordering of notes)

Those are the trivial cases, but a more-detailed explanation is available [in this write-up](https://hackmd.io/CjYB0fs4Q9CweyeTdKWyEg?both#26-async-awaitasync-borrowck-escaping-closure-errorrs-outputs-from-NLL-Polonius-diff) starting at test case 26: they are only differing in diagnostics and instances of other existing test cases differences.

Only 3 of the 9020 tests are still "failing" at the moment (1 failure, 2 OOMs).

r? @nikomatsakis
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants