Skip to content

Do not unify borrowed locals in CopyProp. #143509

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

Merged
merged 2 commits into from
Jul 6, 2025

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Jul 5, 2025

Instead of trying yet another scheme to unify borrowed locals in CopyProp, let's just stop trying. We had already enough miscompilations because of this.

I'm convinced it's possible to have both unification of some borrowed locals and soundness, but I don't have a simple and convincing formulation yet.

Fixes #143491

@rustbot
Copy link
Collaborator

rustbot commented Jul 5, 2025

r? @davidtwco

rustbot has assigned @davidtwco.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@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 Jul 5, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jul 5, 2025

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@compiler-errors
Copy link
Member

Thanks

@bors r+ rollup=never p=1

@bors
Copy link
Collaborator

bors commented Jul 5, 2025

📌 Commit da431ec has been approved by compiler-errors

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 Jul 5, 2025
@rust-log-analyzer

This comment has been minimized.

@compiler-errors
Copy link
Member

@bors r-

r=me after fixing test

@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 Jul 5, 2025
@lqd lqd added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jul 6, 2025
@cjgillot cjgillot force-pushed the copy-prop-noborrow branch from da431ec to bab9c75 Compare July 6, 2025 10:14
@tmiasko
Copy link
Contributor

tmiasko commented Jul 6, 2025

@bors r+

@bors
Copy link
Collaborator

bors commented Jul 6, 2025

📌 Commit bab9c75 has been approved by tmiasko

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 Jul 6, 2025
bors added a commit that referenced this pull request Jul 6, 2025
Do not unify borrowed locals in CopyProp.

Instead of trying yet another scheme to unify borrowed locals in CopyProp, let's just stop trying. We had already enough miscompilations because of this.

I'm convinced it's possible to have both unification of some borrowed locals and soundness, but I don't have a simple and convincing formulation yet.

Fixes #143491
@bors
Copy link
Collaborator

bors commented Jul 6, 2025

⌛ Testing commit bab9c75 with merge 89486a4...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Jul 6, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 6, 2025
@tmiasko
Copy link
Contributor

tmiasko commented Jul 6, 2025

@bors r+

@bors
Copy link
Collaborator

bors commented Jul 6, 2025

📌 Commit b1fdb4b has been approved by tmiasko

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 Jul 6, 2025
@bors
Copy link
Collaborator

bors commented Jul 6, 2025

⌛ Testing commit b1fdb4b with merge a84ab0c...

@bors
Copy link
Collaborator

bors commented Jul 6, 2025

☀️ Test successful - checks-actions
Approved by: tmiasko
Pushing a84ab0c to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 6, 2025
@bors bors merged commit a84ab0c into rust-lang:master Jul 6, 2025
12 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jul 6, 2025
Copy link
Contributor

github-actions bot commented Jul 6, 2025

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing de031bb (parent) -> a84ab0c (this PR)

Test differences

Show 4 test diffs

4 doctest diffs were found. These are ignored, as they are noisy.

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard a84ab0ce6c4557a2f01a3a6c3fdb0f92098db78d --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. x86_64-rust-for-linux: 3077.8s -> 2483.0s (-19.3%)
  2. x86_64-gnu-tools: 3953.6s -> 3292.8s (-16.7%)
  3. pr-check-1: 1869.9s -> 1584.9s (-15.2%)
  4. dist-apple-various: 7478.4s -> 6340.5s (-15.2%)
  5. aarch64-gnu-debug: 4226.4s -> 3663.6s (-13.3%)
  6. x86_64-apple-2: 4378.7s -> 3891.8s (-11.1%)
  7. x86_64-gnu-llvm-20-1: 3632.2s -> 3293.3s (-9.3%)
  8. i686-gnu-nopt-1: 7948.8s -> 7233.7s (-9.0%)
  9. i686-gnu-2: 6099.6s -> 5565.3s (-8.8%)
  10. x86_64-gnu-llvm-19-1: 3654.7s -> 3338.0s (-8.7%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (a84ab0c): comparison URL.

Overall result: ❌ regressions - please read the text below

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.2% [0.1%, 0.3%] 21
Regressions ❌
(secondary)
0.4% [0.1%, 1.1%] 38
Improvements ✅
(primary)
-0.4% [-0.4%, -0.4%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [-0.4%, 0.3%] 23

Max RSS (memory usage)

Results (primary -2.6%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.1% [2.1%, 2.1%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.8% [-5.6%, -2.5%] 4
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.6% [-5.6%, 2.1%] 5

Cycles

Results (primary 2.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

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

Binary size

Results (primary 0.0%, secondary 0.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.1% [0.0%, 0.3%] 30
Regressions ❌
(secondary)
0.1% [0.0%, 0.6%] 26
Improvements ✅
(primary)
-0.3% [-1.0%, -0.0%] 9
Improvements ✅
(secondary)
-0.1% [-0.3%, -0.0%] 5
All ❌✅ (primary) 0.0% [-1.0%, 0.3%] 39

Bootstrap: 460.528s -> 464.608s (0.89%)
Artifact size: 372.13 MiB -> 372.10 MiB (-0.01%)

@rustbot rustbot added the perf-regression Performance regression. label Jul 7, 2025
@cjgillot cjgillot deleted the copy-prop-noborrow branch July 7, 2025 07:10
@panstromek
Copy link
Contributor

perf triage:

Are these regressions expected/warranted? IIUC this disables some parts of the optimization to fix soundness, so some regressions might be expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-nominated Nominated for backporting to the compiler in the beta channel. merged-by-bors This PR was explicitly merged by bors. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CopyProp miscompilation when destination is borrowed
10 participants