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

Don't normalize opaque types with escaping late-bound regions #89285

Merged
merged 1 commit into from
Sep 27, 2021

Conversation

jackh726
Copy link
Member

Fixes #88862

Turns out, this has some really bad perf implications in large types (issue #88862). While we technically can handle them fine, it doesn't change test output either way. For now, revert with an added benchmark. Future attempts to change this back will have to consider perf.

Needs a perf run once rust-lang/rustc-perf#1033 is merged

r? @nikomatsakis

Turns out, this has some really bad perf implications in large types (issue rust-lang#88862). While we technically can handle them fine, it doesn't change test output either way. For now, revert with an added benchmark. Future attempts to change this back will have to consider perf.
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 26, 2021
@Mark-Simulacrum
Copy link
Member

@bors try @rust-timer queue

rust-lang/rustc-perf#1033 is now merged and this should pick it up (there's a pending master commit in queue right now, which'll get benchmarked first, so it should have the parent in its results).

@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 Sep 26, 2021
@bors
Copy link
Contributor

bors commented Sep 26, 2021

⌛ Trying commit a84e3fa with merge 4c8c238b723c4afdf0522ee26708dc84b917d544...

@bors
Copy link
Contributor

bors commented Sep 26, 2021

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

@rust-timer
Copy link
Collaborator

Queued 4c8c238b723c4afdf0522ee26708dc84b917d544 with parent c09d637, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (4c8c238b723c4afdf0522ee26708dc84b917d544): comparison url.

Summary: This change led to very large relevant mixed results 🤷 in compiler performance.

  • Very large improvement in instruction counts (up to -86.7% on full builds of issue-88862)
  • Large regression in instruction counts (up to 1.3% on full builds of deeply-nested-async)

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

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

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

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

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Sep 26, 2021
@jackh726
Copy link
Member Author

This is a targeted perf fix for the one benchmark. The slight regression for others is probably expected, but not too bad.

@jackh726 jackh726 added the perf-regression-triaged The performance regression has been triaged. label Sep 27, 2021
@jackh726
Copy link
Member Author

The only other question here is whether we want to backport to beta or not. I'm not sure how widespread the actually issue is, but on balance, this is a very small change and effectively an extremely partial revert.

I'm going to go ahead and mark as beta-nominated; I'll let the team decide if it's worth backporting.

@jackh726 jackh726 added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Sep 27, 2021
@nikomatsakis
Copy link
Contributor

@bors r+

Seems ok as a stopgap measure

@bors
Copy link
Contributor

bors commented Sep 27, 2021

📌 Commit a84e3fa has been approved by nikomatsakis

@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 Sep 27, 2021
@bors
Copy link
Contributor

bors commented Sep 27, 2021

⌛ Testing commit a84e3fa with merge 2b6ed3b...

@bors
Copy link
Contributor

bors commented Sep 27, 2021

☀️ Test successful - checks-actions
Approved by: nikomatsakis
Pushing 2b6ed3b to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 27, 2021
@bors bors merged commit 2b6ed3b into rust-lang:master Sep 27, 2021
@rustbot rustbot added this to the 1.57.0 milestone Sep 27, 2021
@Emilgardis Emilgardis mentioned this pull request Sep 27, 2021
@jackh726 jackh726 deleted the issue-88862 branch September 27, 2021 19:56
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (2b6ed3b): comparison url.

Summary: This change led to very large relevant mixed results 🤷 in compiler performance.

  • Very large improvement in instruction counts (up to -86.7% on full builds of issue-88862)
  • Large regression in instruction counts (up to 1.3% on full builds of deeply-nested-async)

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression

@apiraino apiraino added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Sep 30, 2021
@apiraino
Copy link
Contributor

Beta backport accepted as per compiler team on Zulip

@rustbot label +beta-accepted

@rustbot rustbot added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Sep 30, 2021
ehuss pushed a commit to ehuss/rust that referenced this pull request Oct 4, 2021
Don't normalize opaque types with escaping late-bound regions

Fixes rust-lang#88862

Turns out, this has some really bad perf implications in large types (issue rust-lang#88862). While we technically can handle them fine, it doesn't change test output either way. For now, revert with an added benchmark. Future attempts to change this back will have to consider perf.

Needs a perf run once rust-lang/rustc-perf#1033 is merged

r? `@nikomatsakis`
@ehuss ehuss mentioned this pull request Oct 4, 2021
@ehuss ehuss removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Oct 4, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 4, 2021
[beta] Beta rollup

* Fix WinUWP std compilation errors due to I/O safety rust-lang#88587
* Disable RemoveZsts in generators to avoid query cycles rust-lang#88979
* Disable the evaluation cache when in intercrate mode rust-lang#88994
* Fix linting when trailing macro expands to a trailing semi rust-lang#88996
* Don't use projection cache or candidate cache in intercrate mode rust-lang#89125
* 2229: Mark insignificant dtor in stdlib rust-lang#89144
* Temporarily rename int_roundings functions to avoid conflicts rust-lang#89184
* [rfc 2229] Drop fully captured upvars in the same order as the regular drop code rust-lang#89208
* Use the correct edition for syntax highlighting doctests rust-lang#89277
* Don't normalize opaque types with escaping late-bound regions rust-lang#89285
* Update Let's Encrypt ROOT CA certificate in dist-(i686|x86_64)-linux docker images rust-lang#89486

Cargo update:
* - [beta] 1.56 backports (rust-lang/cargo#9958)
* - [beta] Revert "When a dependency does not have a version, git or path… (rust-lang/cargo#9912)
* - [beta] Fix rustc --profile=dev unstable check. (rust-lang/cargo#9901)
@Mark-Simulacrum Mark-Simulacrum modified the milestones: 1.57.0, 1.56.0 Oct 6, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 22, 2022
…ound-vars, r=lcnr

Normalize opaques w/ bound vars

First, we reenable normalization of opaque types with escaping late bound regions to fix rust-lang/miri#2433. This essentially reverts rust-lang#89285.

Second, we mitigate the perf regression found in rust-lang#88862 by simplifying the way that we relate (sub and eq) GeneratorWitness types.

This relies on the fact that we construct these GeneratorWitness types somewhat particularly (with all free regions found in the witness types replaced with late bound regions) -- but those bound regions really should be treated as existential regions, not universal ones. Those two facts leads me to believe that we do not need to use the full `higher_ranked_sub` machinery to relate two generator witnesses. I'm pretty confident that this is correct, but I'm glad to discuss this further.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. 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.

Cargo build hangs
9 participants