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

Remove semi-nondeterminism of DefPathHash ordering from inliner #130455

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

compiler-errors
Copy link
Member

Déjà vu or something because I kinda thought I had put this PR up before. I recall a discussion somewhere where I think it was @saethlin mentioning that this check was no longer needed since we have "proper" cycle detection. Putting that up as a PR now.

This may slighlty negatively affect inlining, since the cycle breaking here means that we still inlined some cycles when the def path hashes were ordered in certain ways, this leads to really bad nondeterminism that makes minimizing ICEs and putting up inliner bugfixes difficult.

r? @cjgillot or @saethlin or someone else idk

@compiler-errors
Copy link
Member Author

@bors try @rust-timer queue

@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 Sep 17, 2024
@rustbot
Copy link
Collaborator

rustbot commented Sep 17, 2024

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 17, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 17, 2024
…try>

Remove semi-nondeterminism of `DefPathHash` ordering from inliner

Déjà vu or something because I kinda thought I had put this PR up before. I recall a discussion somewhere where I think it was `@saethlin` mentioning that this check was no longer needed since we have "proper" cycle detection. Putting that up as a PR now.

This may slighlty negatively affect inlining, since the cycle breaking here means that we still inlined some cycles when the def path hashes were ordered in certain ways, this leads to really bad nondeterminism that makes minimizing ICEs and putting up inliner bugfixes difficult.

r? `@cjgillot` or `@saethlin` or someone else idk
@bors
Copy link
Contributor

bors commented Sep 17, 2024

⌛ Trying commit 8f97231 with merge af813e4...

@saethlin
Copy link
Member

I recall a discussion somewhere where I think it was @saethlin mentioning that this check was no longer needed since we have "proper" cycle detection.

I don't think I ever said that; the DefPathHash comparison has been in here the whole time I've worked on the code. But I similarly detest this property of the inliner. It doesn't just make minimizing ICEs difficult, it also makes our codegen globally unstable with respect to small edits of almost any kind.

@bors
Copy link
Contributor

bors commented Sep 17, 2024

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

@rust-timer

This comment has been minimized.

@oli-obk
Copy link
Contributor

oli-obk commented Sep 17, 2024

Yea this was always fishy. The original inliner (even before I added cycle detection) already had this check to prevent cycle errors. Glad we have a principled way now

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (af813e4): comparison URL.

Overall result: ❌ regressions - ACTION NEEDED

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 a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.9% [0.4%, 2.6%] 5
Regressions ❌
(secondary)
0.5% [0.1%, 0.8%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.9% [0.4%, 2.6%] 5

Max RSS (memory usage)

Results (primary -2.8%)

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)
- - 0
Improvements ✅
(primary)
-2.8% [-2.8%, -2.8%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.8% [-2.8%, -2.8%] 2

Cycles

Results (primary 1.6%)

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.6% [1.6%, 1.6%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.6% [1.6%, 1.6%] 1

Binary size

Results (primary 0.1%, secondary -0.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.1% [0.1%, 0.1%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.2% [-0.4%, -0.0%] 2
All ❌✅ (primary) 0.1% [0.1%, 0.1%] 1

Bootstrap: 760.616s -> 767.093s (0.85%)
Artifact size: 341.32 MiB -> 341.30 MiB (-0.01%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Sep 17, 2024
@saethlin
Copy link
Member

@rustbot label +perf-regression-triaged Acceptable overhead for being able to bisect inliner issues, or alternatively for a bugfix. See comments above.

@bors r+

@bors
Copy link
Contributor

bors commented Sep 17, 2024

📌 Commit 8f97231 has been approved by saethlin

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-review Status: Awaiting review from the assignee but also interested parties. labels Sep 17, 2024
@bors
Copy link
Contributor

bors commented Sep 17, 2024

⌛ Testing commit 8f97231 with merge 46b0f8b...

@bors
Copy link
Contributor

bors commented Sep 17, 2024

☀️ Test successful - checks-actions
Approved by: saethlin
Pushing 46b0f8b to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 17, 2024
@bors bors merged commit 46b0f8b into rust-lang:master Sep 17, 2024
7 checks passed
@rustbot rustbot added this to the 1.83.0 milestone Sep 17, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (46b0f8b): comparison URL.

Overall result: ❌ regressions - ACTION NEEDED

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
cc @rust-lang/wg-compiler-performance

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.8% [0.3%, 2.5%] 5
Regressions ❌
(secondary)
0.6% [0.1%, 1.0%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.8% [0.3%, 2.5%] 5

Max RSS (memory usage)

Results (primary 2.5%)

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)
2.5% [2.5%, 2.5%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.5% [2.5%, 2.5%] 1

Cycles

Results (primary 1.5%)

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.5% [1.5%, 1.5%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.5% [1.5%, 1.5%] 1

Binary size

Results (primary 0.1%, secondary -0.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.1% [0.1%, 0.1%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.2% [-0.4%, -0.0%] 2
All ❌✅ (primary) 0.1% [0.1%, 0.1%] 1

Bootstrap: 759.624s -> 767.973s (1.10%)
Artifact size: 341.31 MiB -> 341.29 MiB (-0.01%)

@pnkfelix
Copy link
Member

pnkfelix commented Sep 23, 2024

@rustbot label: +perf-regression-triaged

not sure why @saethlin 's attempt to do this above didn't work; do we strictly require the colon after the word "label" in the command?

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Sep 23, 2024
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. 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.

8 participants