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

Turn -Z incremental-verify-ich on by default #83007

Merged
merged 1 commit into from
Mar 13, 2021

Conversation

Aaron1011
Copy link
Member

Issue #82920 showed that the kind of bugs caught by this flag have
soundness implications.

@rust-highfive
Copy link
Collaborator

r? @lcnr

(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 Mar 11, 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 Mar 11, 2021
@bors
Copy link
Contributor

bors commented Mar 11, 2021

⌛ Trying commit 2595de5dfec7fd075f1f6789ac6f8f80c5ae51cc with merge e0c7bc5ed28e5116a211482f55d4561c7cf17451...

@bors
Copy link
Contributor

bors commented Mar 11, 2021

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

@rust-timer
Copy link
Collaborator

Queued e0c7bc5ed28e5116a211482f55d4561c7cf17451 with parent 066f01d, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking try commit (e0c7bc5ed28e5116a211482f55d4561c7cf17451): comparison url.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying rollup- to bors.

Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up.

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

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 11, 2021
@bjorn3
Copy link
Member

bjorn3 commented Mar 11, 2021

Huge regressions up to 330% for incr-unchanged and 58% for incr-patched.

@lcnr
Copy link
Contributor

lcnr commented Mar 11, 2021

i think these perf regressions are still somewhat acceptable depending on how much we expect to catch with this 🤔

that's not a decision i want to make myself though, because this is not an area i have much expertise in.

@matthiaskrgr
Copy link
Member

Is it possible to verify incremental compilation with a crater run?

@Aaron1011
Copy link
Member Author

@matthiaskrgr: If you mean proactively trying to find ICEs caused by this change - this is issue rust-lang/crater#556, since we need to built a crate multiple times (the second time with an incremental cache).

If you mean doing that instead of enabling this option, then no. There are an enormous number of combinations of (incremental cache, changed code), and we have no hope of testing any appreciable fraction of them using Crater.

@Aaron1011
Copy link
Member Author

cc @rust-lang/wg-incr-comp

@tgnottingham
Copy link
Contributor

The incremental_verify_ich function is marked #[cold] and #[inline(never)], and has debug traces. We could remove these to try to improve performance.

@Aaron1011
Copy link
Member Author

The debug! statements are compiled out in builds without debug asserions. I'll try to removing the #[cold] and #[inline(never)] attributes, and change the unlikely! to likely!

@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 Mar 11, 2021
@bors
Copy link
Contributor

bors commented Mar 11, 2021

⌛ Trying commit 3223ba5f048da053ecd8d7c63fa853ae635f86a2 with merge 213521923e2df5e849eee21b917477d429078204...

@bors
Copy link
Contributor

bors commented Mar 11, 2021

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

@rust-timer
Copy link
Collaborator

Queued 213521923e2df5e849eee21b917477d429078204 with parent 61365c0, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking try commit (213521923e2df5e849eee21b917477d429078204): comparison url.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying rollup- to bors.

Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up.

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

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 11, 2021
@michaelwoerister
Copy link
Member

I wonder if it would be an option to just check one fingerprint in a thousand (in a deterministic way so things are reproducible). We would not have the performance regression and would have at least a chance of catching cases like these.

I'm not sure I actually want to propose this :)

@Aaron1011
Copy link
Member Author

As a result of this PR, we'll start getting some ICEs due to #80691

@bors
Copy link
Contributor

bors commented Mar 13, 2021

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

@rust-timer
Copy link
Collaborator

Queued 122ea760160db6203a78fe170cd8011824ebe52b with parent 46a934a, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking try commit (122ea760160db6203a78fe170cd8011824ebe52b): comparison url.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying rollup- to bors.

Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up.

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

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 13, 2021
@Aaron1011
Copy link
Member Author

The performance impact is much smaller if we only re-hash the result when the query gets re-computed (not when we just load an existing result from disk). I've confirmed that this causes the reproducer in #82920 to ICE instead of producing a miscompilation.

@Mark-Simulacrum: I think we should land this PR in its current form (since the performance impact appears strictly lower than the previous perf run), since we know that it would have prevented at least one case of incr-comp-induced miscompilation. We can then consider whether or not we gain anything from re-hashing results loaded from disk.

@Mark-Simulacrum
Copy link
Member

I think it would be good to add a note in the comments explaining the kind of bug that leads to a verification failure (likely similar to the comments on #82920 which narrowed down the cause of one bug).

r=me with that done, and I agree that we can follow up with more extensive fixes or better performance in the future.

Issue rust-lang#82920 showed that the kind of bugs caught by this flag have
soundness implications.

This causes performance regressions of up to 15.2% during incremental
compilation, but this is necessary to catch miscompilations caused by
bugs in query implementations.
@Aaron1011
Copy link
Member Author

@bors r=Mark-Simulacrum

@bors
Copy link
Contributor

bors commented Mar 13, 2021

📌 Commit 7d7c81a has been approved by Mark-Simulacrum

@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 Mar 13, 2021
@bors
Copy link
Contributor

bors commented Mar 13, 2021

⌛ Testing commit 7d7c81a with merge e7e1dc1...

@bors
Copy link
Contributor

bors commented Mar 13, 2021

☀️ Test successful - checks-actions
Approved by: Mark-Simulacrum
Pushing e7e1dc1 to master...

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.