Skip to content

Parallelize AST -> HIR lowering - #163495

Open
aerooneqq wants to merge 6 commits into
rust-lang:mainfrom
aerooneqq:parallel-ast-hir-lowering
Open

aerooneqq wants to merge 6 commits into
rust-lang:mainfrom
aerooneqq:parallel-ast-hir-lowering

Conversation

@aerooneqq

@aerooneqq aerooneqq commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

View all comments

Parallelize AST -> HIR lowering.

r? @petrochenkov

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 29, 2026
@petrochenkov

Copy link
Copy Markdown
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 Sep 29, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 29, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-bors

rust-bors Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 79a91eb (79a91eb0736d9f47b5af3d4282e49ada6baa01ca)
Base parent: ea6bb45 (ea6bb45b74c24a026dab4187b1550e97b6985c8a)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (79a91eb): comparison URL.

Overall result: ❌ regressions - please read:

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

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

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.9% [0.2%, 9.2%] 88
Regressions ❌
(secondary)
1.3% [0.1%, 7.4%] 172
Improvements ✅
(primary)
-0.2% [-0.2%, -0.2%] 1
Improvements ✅
(secondary)
-0.2% [-0.2%, -0.2%] 1
All ❌✅ (primary) 0.9% [-0.2%, 9.2%] 89

Max RSS (memory usage)

Results (primary 1.2%, secondary 0.4%)

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

mean range count
Regressions ❌
(primary)
1.8% [1.1%, 2.8%] 4
Regressions ❌
(secondary)
3.3% [1.7%, 7.2%] 10
Improvements ✅
(primary)
-0.9% [-0.9%, -0.9%] 1
Improvements ✅
(secondary)
-4.5% [-5.9%, -2.7%] 6
All ❌✅ (primary) 1.2% [-0.9%, 2.8%] 5

Cycles

Results (primary 11.0%, secondary 2.7%)

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

mean range count
Regressions ❌
(primary)
11.0% [2.2%, 28.4%] 13
Regressions ❌
(secondary)
4.8% [2.2%, 9.7%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.5% [-3.5%, -3.5%] 1
All ❌✅ (primary) 11.0% [2.2%, 28.4%] 13

Binary size

Results (primary -0.1%, secondary -0.3%)

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

mean range count
Regressions ❌
(primary)
0.2% [0.2%, 0.2%] 4
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.3% [-0.3%, -0.3%] 4
Improvements ✅
(secondary)
-0.3% [-0.3%, -0.3%] 4
All ❌✅ (primary) -0.1% [-0.3%, 0.2%] 8

Bootstrap: 489.575s -> 491.192s (0.33%)
Artifact size: 406.37 MiB -> 407.23 MiB (0.21%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Sep 29, 2026
@Kobzol

Kobzol commented Sep 30, 2026

Copy link
Copy Markdown
Member

Pretty nice results!

@rust-log-analyzer

This comment has been minimized.

@aerooneqq

aerooneqq commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor Author

Parallelization of AST -> HIR lowering broke deterministic encoding of syntax contexts 🤣 (#161450).
UPD: not that sure about that, maybe some other parts of metadata causing it, will research it.

@petrochenkov

Copy link
Copy Markdown
Contributor

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 30, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 30, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-bors

rust-bors Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 335f660 (335f660f9c0a0a3b69b6e32858af6d7f3af36c51)
Base parent: 7d2cd0f (7d2cd0fbc092625ea371da704f15f80216d2220e)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (335f660): comparison URL.

Overall result: ❌✅ regressions and improvements - please read:

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

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

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.7% [0.2%, 1.1%] 9
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.7% [-0.8%, -0.7%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.4% [-0.8%, 1.1%] 11

Max RSS (memory usage)

Results (primary -3.1%, secondary -2.7%)

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

mean range count
Regressions ❌
(primary)
1.8% [1.8%, 1.8%] 1
Regressions ❌
(secondary)
2.1% [2.0%, 2.2%] 2
Improvements ✅
(primary)
-3.1% [-7.8%, -1.2%] 118
Improvements ✅
(secondary)
-3.1% [-5.2%, -1.4%] 23
All ❌✅ (primary) -3.1% [-7.8%, 1.8%] 119

Cycles

Results (primary 14.6%, secondary -2.7%)

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

mean range count
Regressions ❌
(primary)
14.6% [4.4%, 27.7%] 9
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.7% [-3.0%, -2.5%] 3
All ❌✅ (primary) 14.6% [4.4%, 27.7%] 9

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
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.0% [-0.1%, -0.0%] 9
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.1%] 5
All ❌✅ (primary) -0.0% [-0.1%, -0.0%] 9

Bootstrap: 489.84s -> 488.516s (-0.27%)
Artifact size: 406.54 MiB -> 406.46 MiB (-0.02%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 30, 2026
@oli-obk oli-obk self-assigned this Oct 2, 2026
@petrochenkov petrochenkov added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Oct 21, 2026
@Kobzol

Kobzol commented Oct 21, 2026

Copy link
Copy Markdown
Member

bors try rust-timer queue

Note that we have to gather the parent benchmark results first, so it only makes sense to do a perf. run here for the new benchmark configurations after the next PR merges into main.

@aerooneqq

Copy link
Copy Markdown
Contributor Author

@bors try cancel

@petrochenkov

Copy link
Copy Markdown
Contributor

In any case let's block this on #162848.
@rustbot blocked

@rust-bors

rust-bors Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Try build cancelled. Cancelled workflows:

Hint: if you want to run another try build, you do not need to manually cancel the previous one. Just run @bors try and bors will cancel the previous build automatically.

@rustbot rustbot added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 21, 2026
@aerooneqq

Copy link
Copy Markdown
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Oct 21, 2026
@rust-bors

This comment has been minimized.

@rust-bors

rust-bors Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 5e0645b (5e0645ba0af774ffb0502a41652ae5e7208b6381)
Base parent: 6a58677 (6a58677913ae3e443146503de3933abef0b2eda3)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (5e0645b): comparison URL.

Overall result: ❌✅ regressions and improvements - please read:

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

@bors rollup=iffy rustc-perf
@rustbot label: -S-waiting-on-perf +perf-regression

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.4% [0.3%, 0.7%] 8
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.6% [-0.6%, -0.6%] 1
All ❌✅ (primary) 0.4% [0.3%, 0.7%] 8

Max RSS (memory usage)

Results (primary 0.9%, secondary 0.7%)

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

mean range count
Regressions ❌
(primary)
1.6% [0.4%, 3.1%] 22
Regressions ❌
(secondary)
2.2% [0.5%, 5.5%] 7
Improvements ✅
(primary)
-1.2% [-2.5%, -0.6%] 7
Improvements ✅
(secondary)
-2.7% [-4.9%, -1.3%] 3
All ❌✅ (primary) 0.9% [-2.5%, 3.1%] 29

Cycles

Results (primary 3.2%, 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)
3.8% [0.4%, 9.7%] 32
Regressions ❌
(secondary)
1.3% [0.9%, 1.9%] 4
Improvements ✅
(primary)
-2.4% [-3.2%, -0.7%] 4
Improvements ✅
(secondary)
-1.1% [-2.5%, -0.5%] 6
All ❌✅ (primary) 3.2% [-3.2%, 9.7%] 36

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 488.496s -> 491.134s (0.54%)
Artifact size: 406.57 MiB -> 406.46 MiB (-0.03%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 21, 2026
@aerooneqq

Copy link
Copy Markdown
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 22, 2026
rust-bors Bot pushed a commit that referenced this pull request Oct 22, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-bors

rust-bors Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 02b947e (02b947e39b782ed5ab7e1ae86fe43c274a41ce14)
Base parent: f8125e4 (f8125e48dc669320b4e5e83487dcbfb681957961)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (02b947e): comparison URL.

Overall result: ❌ regressions - please read:

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

@bors rollup=iffy rustc-perf
@rustbot label: -S-waiting-on-perf +perf-regression

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

Max RSS (memory usage)

Results (primary 1.5%, secondary 0.0%)

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

mean range count
Regressions ❌
(primary)
1.6% [0.6%, 3.2%] 21
Regressions ❌
(secondary)
2.5% [1.5%, 5.3%] 4
Improvements ✅
(primary)
-0.4% [-0.4%, -0.4%] 1
Improvements ✅
(secondary)
-3.3% [-4.7%, -2.1%] 3
All ❌✅ (primary) 1.5% [-0.4%, 3.2%] 22

Cycles

Results (primary 4.1%, secondary -0.7%)

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

mean range count
Regressions ❌
(primary)
4.9% [0.8%, 11.7%] 25
Regressions ❌
(secondary)
1.7% [0.5%, 4.6%] 6
Improvements ✅
(primary)
-0.7% [-0.9%, -0.6%] 4
Improvements ✅
(secondary)
-2.5% [-7.1%, -0.4%] 8
All ❌✅ (primary) 4.1% [-0.9%, 11.7%] 29

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 485.551s -> 488.779s (0.66%)
Artifact size: 406.38 MiB -> 406.44 MiB (0.02%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 22, 2026
Comment thread compiler/rustc_data_structures/src/sync/parallel.rs
Comment thread compiler/rustc_interface/src/passes.rs Outdated

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

perf-regression Performance regression. S-blocked Status: Blocked on something else such as an RFC or other implementation work. 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