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

Fix races conditions with SyntaxContext decoding #115082

Merged
merged 2 commits into from Aug 24, 2023

Conversation

Zoxc
Copy link
Contributor

@Zoxc Zoxc commented Aug 22, 2023

This changes SyntaxContext decoding to work with concurrent decoding. The remapped_ctxts field now only stores SyntaxContext which have completed decoding, while the new decoding and local_in_progress keeps track of SyntaxContexts which are in process of being decoding and on which threads.

This fixes 2 issues with the current implementation. It can return an SyntaxContext which contains dummy data if another thread starts decoding before the first one has completely finished. Multiple threads could also allocate multiple SyntaxContexts for the same raw_id.

@rustbot
Copy link
Collaborator

rustbot commented Aug 22, 2023

r? @cjgillot

(rustbot has picked a reviewer for you, use r? to override)

@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 Aug 22, 2023
@Zoxc
Copy link
Contributor Author

Zoxc commented Aug 22, 2023

This could use a perf run.

@cjgillot
Copy link
Contributor

@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 Aug 22, 2023
@bors
Copy link
Contributor

bors commented Aug 22, 2023

⌛ Trying commit e41240e with merge 7251ff878f99800ce3b521cacac760ceb8c60931...

@bors
Copy link
Contributor

bors commented Aug 22, 2023

☀️ Try build successful - checks-actions
Build commit: 7251ff878f99800ce3b521cacac760ceb8c60931 (7251ff878f99800ce3b521cacac760ceb8c60931)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (7251ff878f99800ce3b521cacac760ceb8c60931): 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.2% [0.2%, 0.2%] 3
Regressions ❌
(secondary)
0.3% [0.2%, 0.4%] 7
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.2% [0.2%, 0.2%] 3

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)
2.5% [2.5%, 2.5%] 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: 634.844s -> 635.738s (0.14%)
Artifact size: 346.96 MiB -> 347.13 MiB (0.05%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Aug 22, 2023
@cjgillot
Copy link
Contributor

Perf: unfiltered results show small improvements and small regressions balancing out.
@bors r+

@bors
Copy link
Contributor

bors commented Aug 24, 2023

📌 Commit 246a6a6 has been approved by cjgillot

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 Aug 24, 2023
@bors
Copy link
Contributor

bors commented Aug 24, 2023

⌛ Testing commit 246a6a6 with merge b60e31b...

@bors
Copy link
Contributor

bors commented Aug 24, 2023

☀️ Test successful - checks-actions
Approved by: cjgillot
Pushing b60e31b to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 24, 2023
@bors bors merged commit b60e31b into rust-lang:master Aug 24, 2023
12 checks passed
@rustbot rustbot added this to the 1.74.0 milestone Aug 24, 2023
@Zoxc Zoxc deleted the syntax-context-decode-race branch August 24, 2023 21:46
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b60e31b): 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.2%, 0.3%] 4
Regressions ❌
(secondary)
0.3% [0.3%, 0.4%] 7
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.3% [0.2%, 0.3%] 4

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

Binary size

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

Bootstrap: 630.156s -> 630.278s (0.02%)
Artifact size: 315.55 MiB -> 315.65 MiB (0.03%)

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

None yet

5 participants