Always compute coroutine layout for eagerly emitting recursive layout errors by compiler-errors · Pull Request #136073 · rust-lang/rust (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation25 Commits1 Checks6 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

compiler-errors

Detect recursive coroutine layouts even if we don't detect opaque type recursion in the new solver. This is for two reasons:

  1. It helps us detect (bad) recursive async function calls in the new solver, which due to its approach to normalization causes us to not detect this via a recursive RPIT (since the opaques are more eagerly revealed in the opaque body).
  2. It helps us detect (bad) recursive async functions behind AFITs. See the AFIT test that changed for the old solver too.
  3. It also greatly simplifies the recursive impl trait check, since I can remove some jankness around how it handles coroutines.

@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

Jan 25, 2025

@compiler-errors

@rust-timer

This comment has been minimized.

@bors

bors added a commit to rust-lang-ci/rust that referenced this pull request

Jan 25, 2025

@bors

…s, r=

Always compute coroutine layout when checking for recursive opaques

r? @ghost

@bors

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

@rust-timer

This comment has been minimized.

@rust-timer

Finished benchmarking commit (c104bc5): comparison URL.

Overall result: ❌ regressions - please read the text below

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 may lead 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-perf +perf-regression

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌ (primary) - - 0
Regressions ❌ (secondary) 2.6% [0.4%, 5.9%] 12
Improvements ✅ (primary) - - 0
Improvements ✅ (secondary) - - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 1.3%, secondary 2.4%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌ (primary) 1.3% [0.7%, 2.0%] 8
Regressions ❌ (secondary) 2.4% [2.1%, 2.7%] 2
Improvements ✅ (primary) - - 0
Improvements ✅ (secondary) - - 0
All ❌✅ (primary) 1.3% [0.7%, 2.0%] 8

Cycles

Results (secondary 4.1%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌ (primary) - - 0
Regressions ❌ (secondary) 4.1% [2.5%, 7.0%] 6
Improvements ✅ (primary) - - 0
Improvements ✅ (secondary) - - 0
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 771.158s -> 772.043s (0.11%)
Artifact size: 325.82 MiB -> 325.82 MiB (0.00%)

@compiler-errors

I still think we should land this even tho it has regressions on some pathological tests.

We need it to detect some recursive coroutines in the new solver.

I'll add more info, add some tests, and take this out of draft.

@compiler-errors

@rust-timer

This comment has been minimized.

@bors

bors added a commit to rust-lang-ci/rust that referenced this pull request

Jan 27, 2025

@bors

…s, r=

Always compute coroutine layout when checking for recursive opaques

r? @ghost

@bors

☀️ Try build successful - checks-actions
Build commit: 313ad1f (313ad1f53edbaaf88cd78023244a12e4af14c352)

@rust-timer

This comment has been minimized.

@rust-timer

Finished benchmarking commit (313ad1f): comparison URL.

Overall result: ❌ regressions - please read the text below

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 may lead 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-perf +perf-regression

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌ (primary) - - 0
Regressions ❌ (secondary) 4.7% [0.5%, 8.0%] 4
Improvements ✅ (primary) - - 0
Improvements ✅ (secondary) - - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (secondary 2.2%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌ (primary) - - 0
Regressions ❌ (secondary) 2.2% [2.2%, 2.2%] 1
Improvements ✅ (primary) - - 0
Improvements ✅ (secondary) - - 0
All ❌✅ (primary) - - 0

Cycles

Results (secondary 8.4%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌ (primary) - - 0
Regressions ❌ (secondary) 8.4% [7.4%, 9.4%] 2
Improvements ✅ (primary) - - 0
Improvements ✅ (secondary) - - 0
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 772.206s -> 774.281s (0.27%)
Artifact size: 328.24 MiB -> 328.18 MiB (-0.02%)

@compiler-errors

This is only a regression for check builds on a pathological test for coroutines. Notably it doesn't affect full builds (at least from what I could tell from the results).

I think that we should otherwise land this; see PR description for why.

@compiler-errors

@compiler-errors compiler-errors changed the titleAlways compute coroutine layout when checking for recursive opaques Always compute coroutine layout for eagerly emitting recursive layout errors

Jan 27, 2025

@oli-obk

@bors

📌 Commit d75d180 has been approved by oli-obk

It is now in the queue for this repository.

@bors

@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

Jan 30, 2025

@bors

🔒 Merge conflict

This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again.

How do I rebase?

Assuming self is your fork and upstream is this repository, you can resolve the conflict following these steps:

  1. git checkout recursive-coro-always (switch to your branch)
  2. git fetch upstream master (retrieve the latest master)
  3. git rebase upstream/master -p (rebase on top of it)
  4. Follow the on-screen instruction to resolve conflicts (check git status if you got lost).
  5. git push self recursive-coro-always --force-with-lease (update this PR)

You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial.

Please avoid the "Resolve conflicts" button on GitHub. It uses git merge instead of git rebase which makes the PR commit history more difficult to read.

Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Cargo.lock conflict is handled during merge and rebase. This is normal, and you should still perform step 5 to update this PR.

Error message

Auto-merging compiler/rustc_interface/src/passes.rs
Auto-merging compiler/rustc_hir_analysis/src/check/check.rs
CONFLICT (content): Merge conflict in compiler/rustc_hir_analysis/src/check/check.rs
Automatic merge failed; fix conflicts and then commit the result.

@compiler-errors

@bors

📌 Commit eedfece has been approved by oli-obk

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-author

Status: This is awaiting some action (such as code changes or more information) from the author.

labels

Feb 2, 2025

@Noratrieb

@bors rollup=maybe basically perf neutral and queue is full

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Feb 3, 2025

@matthiaskrgr

…ays, r=oli-obk

Always compute coroutine layout for eagerly emitting recursive layout errors

Detect recursive coroutine layouts even if we don't detect opaque type recursion in the new solver. This is for two reasons:

  1. It helps us detect (bad) recursive async function calls in the new solver, which due to its approach to normalization causes us to not detect this via a recursive RPIT (since the opaques are more eagerly revealed in the opaque body).
  2. It helps us detect (bad) recursive async functions behind AFITs. See the AFIT test that changed for the old solver too.
  3. It also greatly simplifies the recursive impl trait check, since I can remove some jankness around how it handles coroutines.

@matthiaskrgr

looks like this needs another rebase
@bors r-

@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

Feb 3, 2025

@compiler-errors

@lcnr

@bors

📌 Commit d0b0b02 has been approved by oli-obk

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-author

Status: This is awaiting some action (such as code changes or more information) from the author.

labels

Feb 6, 2025

bors added a commit to rust-lang-ci/rust that referenced this pull request

Feb 6, 2025

@bors

…iaskrgr

Rollup of 7 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

bors added a commit to rust-lang-ci/rust that referenced this pull request

Feb 6, 2025

@bors

Rollup of 7 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

try-job: aarch64-gnu-debug

bors added a commit to rust-lang-ci/rust that referenced this pull request

Feb 6, 2025

@bors

…iaskrgr

Rollup of 7 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

try-job: aarch64-gnu-debug

rust-timer added a commit to rust-lang-ci/rust that referenced this pull request

Feb 6, 2025

@rust-timer

Rollup merge of rust-lang#136073 - compiler-errors:recursive-coro-always, r=oli-obk

Always compute coroutine layout for eagerly emitting recursive layout errors

Detect recursive coroutine layouts even if we don't detect opaque type recursion in the new solver. This is for two reasons:

  1. It helps us detect (bad) recursive async function calls in the new solver, which due to its approach to normalization causes us to not detect this via a recursive RPIT (since the opaques are more eagerly revealed in the opaque body).
  2. It helps us detect (bad) recursive async functions behind AFITs. See the AFIT test that changed for the old solver too.
  3. It also greatly simplifies the recursive impl trait check, since I can remove some jankness around how it handles coroutines.

flip1995 pushed a commit to flip1995/rust that referenced this pull request

Feb 20, 2025

@bors

…iaskrgr

Rollup of 7 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

try-job: aarch64-gnu-debug

Labels

perf-regression

Performance regression.

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.