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

interpret: avoid a long-lived PlaceTy in stack frames #121985

Merged
merged 2 commits into from
Mar 7, 2024

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Mar 4, 2024

PlaceTy uses a representation that's not very stable under changes to the stack. I'd feel better if we didn't have one in the long-term machine state.

r? @oli-obk

@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 Mar 4, 2024
@rustbot
Copy link
Collaborator

rustbot commented Mar 4, 2024

Some changes occurred to the CTFE / Miri engine

cc @rust-lang/miri

@RalfJung
Copy link
Member Author

RalfJung commented Mar 4, 2024

Let's see if this has a perf impact.

@bors try @rust-timer queue

@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 Mar 4, 2024
@bors
Copy link
Contributor

bors commented Mar 4, 2024

⌛ Trying commit 8de72e4 with merge 1a272fb...

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 4, 2024
…try>

interpret: avoid a long-lived PlaceTy in stack frames

`PlaceTy` uses a representation that's not very stable under changes to the stack. I'd feel better if we didn't have one in the long-term machine state.

r? `@oli-obk`
@RalfJung
Copy link
Member Author

RalfJung commented Mar 4, 2024

This now shows up as "pending" in the queue, even though it never got approved... for avoidance of doubt:
@bors r- force

@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-review Status: Awaiting review from the assignee but also interested parties. labels Mar 4, 2024
@compiler-errors
Copy link
Member

Let's try closing and reopening

@compiler-errors
Copy link
Member

Or uh... a retry? That usually kicks a merge job.

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 4, 2024
@compiler-errors
Copy link
Member

Cool it's gone

@RalfJung
Copy link
Member Author

RalfJung commented Mar 4, 2024

Okay let's get our try build going again then.

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@RalfJung RalfJung removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Mar 4, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 4, 2024
…try>

interpret: avoid a long-lived PlaceTy in stack frames

`PlaceTy` uses a representation that's not very stable under changes to the stack. I'd feel better if we didn't have one in the long-term machine state.

r? `@oli-obk`
@bors
Copy link
Contributor

bors commented Mar 4, 2024

⌛ Trying commit 8de72e4 with merge 96f5a38...

@bors
Copy link
Contributor

bors commented Mar 4, 2024

☀️ Try build successful - checks-actions
Build commit: 96f5a38 (96f5a38dad266d234e141c769334d11beb29b4db)

1 similar comment
@bors
Copy link
Contributor

bors commented Mar 4, 2024

☀️ Try build successful - checks-actions
Build commit: 96f5a38 (96f5a38dad266d234e141c769334d11beb29b4db)

@rust-timer

This comment has been minimized.

@RalfJung
Copy link
Member Author

RalfJung commented Mar 4, 2024

Ah that's why this felt so familiar... I made a similar experiment last year already: #113964. Damn.

I think I still don't understand why these return places are so hot though...

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (96f5a38): 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.3% [0.3%, 0.3%] 1
Regressions ❌
(secondary)
2.8% [0.2%, 4.9%] 9
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.3% [0.3%, 0.3%] 1

Max RSS (memory usage)

Results

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)
2.7% [2.1%, 3.4%] 5
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.2% [-5.5%, -2.0%] 38
All ❌✅ (primary) 2.5% [2.5%, 2.5%] 1

Cycles

Results

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% [3.7%, 4.5%] 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: 645.218s -> 642.92s (-0.36%)
Artifact size: 175.01 MiB -> 174.94 MiB (-0.04%)

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

RalfJung commented Mar 4, 2024

That's a lot better than the last one. Only primary regression is in a doc build, I assume that's spurious. (If it was systematic it should affect the other builds as well.)

Might be acceptable for improved interpreter maintainability?

@rustbot
Copy link
Collaborator

rustbot commented Mar 4, 2024

The Miri subtree was changed

cc @rust-lang/miri

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@RalfJung
Copy link
Member Author

RalfJung commented Mar 4, 2024

Pushing this change in return place type through the rest of the interpreter, I found some things in Miri that definitely should not use PlaceTy... they are actually involved in concurrency.

OTOH this also changes the return place to MPlaceTy for intrinsics, which may or may not be a good idea.

@bors try @rust-timer queue

@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 Mar 4, 2024
@bors
Copy link
Contributor

bors commented Mar 4, 2024

⌛ Trying commit 3f0b6a0 with merge ee3afb2...

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 4, 2024
…try>

interpret: avoid a long-lived PlaceTy in stack frames

`PlaceTy` uses a representation that's not very stable under changes to the stack. I'd feel better if we didn't have one in the long-term machine state.

r? `@oli-obk`
@rust-timer

This comment has been minimized.

1 similar comment
@rust-timer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Mar 5, 2024

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (ee3afb2): 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.3% [0.3%, 0.3%] 1
Regressions ❌
(secondary)
3.2% [0.2%, 4.4%] 8
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.3% [0.3%, 0.3%] 1

Max RSS (memory usage)

Results

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)
3.8% [1.9%, 7.2%] 15
Regressions ❌
(secondary)
3.1% [0.5%, 7.5%] 78
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.8% [1.9%, 7.2%] 15

Cycles

Results

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.3% [4.0%, 4.6%] 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: 643.087s -> 642.263s (-0.13%)
Artifact size: 174.99 MiB -> 174.96 MiB (-0.02%)

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

RalfJung commented Mar 5, 2024

Seems like doing this also for intrinsics doesn't cost anything extra. :) That way we can keep the foreign-item and intrinsic paths consistent.

@oli-obk
Copy link
Contributor

oli-obk commented Mar 5, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Mar 5, 2024

📌 Commit 3f0b6a0 has been approved by oli-obk

It is now in the queue for this repository.

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Mar 5, 2024
@bors
Copy link
Contributor

bors commented Mar 7, 2024

⌛ Testing commit 3f0b6a0 with merge 52f8aec...

@bors
Copy link
Contributor

bors commented Mar 7, 2024

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing 52f8aec to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 7, 2024
@bors bors merged commit 52f8aec into rust-lang:master Mar 7, 2024
12 checks passed
@rustbot rustbot added this to the 1.78.0 milestone Mar 7, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (52f8aec): 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.3% [0.3%, 0.3%] 1
Regressions ❌
(secondary)
3.0% [0.2%, 4.5%] 8
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.3% [0.3%, 0.3%] 1

Max RSS (memory usage)

Results

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

Cycles

Results

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

Binary size

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

Bootstrap: 648.501s -> 647.761s (-0.11%)
Artifact size: 172.69 MiB -> 172.64 MiB (-0.03%)

@RalfJung RalfJung deleted the interpret-return-place branch March 9, 2024 08:16
@pnkfelix
Copy link
Member

  • primary regression was to html5ever doc-full; was anctipated during development and is presumed spurious.
  • marking as triaged.

@rustbot label: +perf-regression-triaged

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

7 participants