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

tree-wide: parallel: Fully removed all Lrc, replaced with Arc #136471

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

safinaskar
Copy link
Contributor

@safinaskar safinaskar commented Feb 3, 2025

tree-wide: parallel: Fully removed all Lrc, replaced with Arc

This is continuation of #132282 .

I'm pretty sure I did everything right. In particular, I searched all occurrences of Lrc in submodules and made sure that they don't need replacement.

There are other possibilities, through.

We can define enum Lrc<T> { Rc(Rc<T>), Arc(Arc<T>) }. Or we can make Lrc a union and on every clone we can read from special thread-local variable. Or we can add a generic parameter to Lrc and, yes, this parameter will be everywhere across all codebase.

So, if you think we should take some alternative approach, then don't merge this PR. But if it is decided to stick with Arc, then, please, merge.

cc "Parallel Rustc Front-end" ( #113349 )

r? SparrowLii

@rustbot label WG-compiler-parallel

@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-rustc-dev-guide Area: rustc-dev-guide A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Feb 3, 2025
@rustbot
Copy link
Collaborator

rustbot commented Feb 3, 2025

The rustc-dev-guide subtree was changed. If this PR only touches the dev guide consider submitting a PR directly to rust-lang/rustc-dev-guide otherwise thank you for updating the dev guide with your changes.

cc @BoxyUwU, @jieyouxu, @Kobzol

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo, @GuillaumeGomez

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

Some changes occurred in src/tools/rustfmt

cc @rust-lang/rustfmt

rustc_error_messages was changed

cc @davidtwco, @compiler-errors, @TaKO8Ki

The Miri subtree was changed

cc @rust-lang/miri

@jieyouxu jieyouxu added the WG-compiler-parallel Working group: Parallelizing the compiler label Feb 3, 2025
@rustbot
Copy link
Collaborator

rustbot commented Feb 3, 2025

Some changes occurred in src/tools/rustfmt

cc @rust-lang/rustfmt

The rustc-dev-guide subtree was changed. If this PR only touches the dev guide consider submitting a PR directly to rust-lang/rustc-dev-guide otherwise thank you for updating the dev guide with your changes.

cc @BoxyUwU, @jieyouxu, @Kobzol

The Miri subtree was changed

cc @rust-lang/miri

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

rustc_error_messages was changed

cc @davidtwco, @compiler-errors, @TaKO8Ki

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo, @GuillaumeGomez

@rustbot rustbot added has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 3, 2025
@rustbot

This comment has been minimized.

@rustbot rustbot removed has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 3, 2025
@safinaskar
Copy link
Contributor Author

I rebased

@rust-log-analyzer

This comment has been minimized.

@SparrowLii
Copy link
Member

SparrowLii commented Feb 5, 2025

This is our way forward :) Thanks!
@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 Feb 5, 2025
@rust-timer

This comment has been minimized.

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 5, 2025
tree-wide: parallel: Fully removed all `Lrc`, replaced with `Arc`

tree-wide: parallel: Fully removed all `Lrc`, replaced with `Arc`

This is continuation of rust-lang#132282 .

I'm pretty sure I did everything right. In particular, I searched all occurrences of `Lrc` in submodules and made sure that they don't need replacement.

There are other possibilities, through.

We can define `enum Lrc<T> { Rc(Rc<T>), Arc(Arc<T>) }`. Or we can make `Lrc` a union and on every clone we can read from special thread-local variable. Or we can add a generic parameter to `Lrc` and, yes, this parameter will be everywhere across all codebase.

So, if you think we should take some alternative approach, then don't merge this PR. But if it is decided to stick with `Arc`, then, please, merge.

cc "Parallel Rustc Front-end" ( rust-lang#113349 )

r? SparrowLii

`@rustbot` label WG-compiler-parallel
@bors
Copy link
Contributor

bors commented Feb 5, 2025

⌛ Trying commit 0a21f1d with merge c1d3b4f...

@SparrowLii
Copy link
Member

The compiler should in fact already use Arc as Lrc, this PR should have no substantial impact, perf testing is just for verification.

@bors
Copy link
Contributor

bors commented Feb 5, 2025

☀️ Try build successful - checks-actions
Build commit: c1d3b4f (c1d3b4f4788aac48b595223d6a1c5842755ab015)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (c1d3b4f): comparison URL.

Overall result: no relevant changes - no 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.

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

Instruction count

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

Max RSS (memory usage)

Results (secondary 0.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.8% [0.8%, 0.8%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

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

Binary size

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

Bootstrap: 776.632s -> 777.793s (0.15%)
Artifact size: 328.78 MiB -> 328.78 MiB (0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 5, 2025
@safinaskar
Copy link
Contributor Author

@SparrowLii , why this is not merged?

@SparrowLii
Copy link
Member

Just waited a while in case there were other opinions

@bors r+ rollup=never

@bors
Copy link
Contributor

bors commented Feb 6, 2025

📌 Commit 0a21f1d has been approved by SparrowLii

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 Feb 6, 2025
@bors
Copy link
Contributor

bors commented Feb 6, 2025

⌛ Testing commit 0a21f1d with merge 2f92f05...

@bors
Copy link
Contributor

bors commented Feb 6, 2025

☀️ Test successful - checks-actions
Approved by: SparrowLii
Pushing 2f92f05 to master...

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (2f92f05): comparison URL.

Overall result: ❌✅ regressions and improvements - no action needed

@rustbot label: -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)
1.2% [1.2%, 1.2%] 1
Improvements ✅
(primary)
-0.3% [-0.3%, -0.3%] 1
Improvements ✅
(secondary)
-0.3% [-0.3%, -0.3%] 2
All ❌✅ (primary) -0.3% [-0.3%, -0.3%] 1

Max RSS (memory usage)

Results (secondary 3.9%)

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.9%, 3.9%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

Results (primary -3.7%, secondary 2.3%)

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.3% [2.1%, 2.4%] 2
Improvements ✅
(primary)
-3.7% [-6.4%, -1.1%] 12
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -3.7% [-6.4%, -1.1%] 12

Binary size

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

Bootstrap: 779.996s -> 778.937s (-0.14%)
Artifact size: 329.00 MiB -> 329.00 MiB (0.00%)

@safinaskar safinaskar deleted the parallel branch February 7, 2025 02:49
carolynzech added a commit to carolynzech/kani that referenced this pull request Feb 10, 2025
  - Implement internal for RawPtrKind, c.f. rust-lang/rust#136590
  - Replace Lrc with Arc, c.f. rust-lang/rust#136471
carolynzech added a commit to carolynzech/kani that referenced this pull request Feb 10, 2025
  - Implement internal for RawPtrKind, c.f. rust-lang/rust#136590
  - Replace Lrc with Arc, c.f. rust-lang/rust#136471
github-merge-queue bot pushed a commit to model-checking/kani that referenced this pull request Feb 11, 2025
Upgrade toolchain to 2/10.

I **highly recommend** reviewing this PR commit-by-commit. The
description in each commit message links to the upstream PRs that
prompted those particular changes.

## Callouts
- 2/1 had a lot of formatting changes. I split the commits for that day
into formatting changes and functionality changes accordingly.
- 2/5 introduced a regression in our delayed UB instrumentation, so I
made a new fixme test. See #3881 for details.


## Culprit PRs:
rust-lang/rust#134424 
rust-lang/rust#130514
rust-lang/rust#135748
rust-lang/rust#136590
rust-lang/rust#135318
rust-lang/rust#135265

rust-lang/rust@bcb8565
rust-lang/rust#136471
rust-lang/rust#136645

Resolves #3863

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 and MIT licenses.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-rustc-dev-guide Area: rustc-dev-guide A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic merged-by-bors This PR was explicitly merged by bors. 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. WG-compiler-parallel Working group: Parallelizing the compiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants