Skip to content

Make lowering incremental, take 3/N#142830

Merged
rust-bors[bot] merged 8 commits into
rust-lang:mainfrom
cjgillot:lower-incr-2
Jun 16, 2026
Merged

Make lowering incremental, take 3/N#142830
rust-bors[bot] merged 8 commits into
rust-lang:mainfrom
cjgillot:lower-incr-2

Conversation

@cjgillot

@cjgillot cjgillot commented Jun 21, 2025

Copy link
Copy Markdown
Contributor

View all comments

Rebase of #88186 that was rebased by #127262

No real change in design, so I'm not expecting a perf miracle.

r? @ghost

@rustbot rustbot added PG-exploit-mitigations Project group: Exploit mitigations 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 Jun 21, 2025
@cjgillot

This comment was marked as outdated.

@rust-timer

This comment was marked as outdated.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 21, 2025
@bors

This comment was marked as outdated.

@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jun 21, 2025
@cjgillot

Copy link
Copy Markdown
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@bors

bors commented Jun 21, 2025

Copy link
Copy Markdown
Collaborator

⌛ Trying commit 0e2f90b with merge a6b131d...

bors added a commit that referenced this pull request Jun 21, 2025
Make lowering incremental, take 3/N

Rebase of #88186 that was rebased by #127262

No real change in design, so I'm not expecting a perf miracle.

r? `@ghost`
@rust-log-analyzer

This comment has been minimized.

@bors

bors commented Jun 21, 2025

Copy link
Copy Markdown
Collaborator

☀️ Try build successful - checks-actions
Build commit: a6b131d (a6b131d42573c085b032a153779366b448148b9d)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (a6b131d): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@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.8% [0.2%, 1.8%] 157
Regressions ❌
(secondary)
1.1% [0.2%, 4.3%] 69
Improvements ✅
(primary)
-0.4% [-0.5%, -0.3%] 5
Improvements ✅
(secondary)
-0.3% [-0.5%, -0.2%] 7
All ❌✅ (primary) 0.7% [-0.5%, 1.8%] 162

Max RSS (memory usage)

Results (primary 10.5%, secondary 10.1%)

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

mean range count
Regressions ❌
(primary)
10.5% [3.1%, 28.6%] 249
Regressions ❌
(secondary)
10.1% [2.2%, 31.4%] 142
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 10.5% [3.1%, 28.6%] 249

Cycles

Results (primary 2.5%, secondary 4.1%)

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

mean range count
Regressions ❌
(primary)
2.5% [1.4%, 5.5%] 35
Regressions ❌
(secondary)
4.1% [1.8%, 7.5%] 22
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.5% [1.4%, 5.5%] 35

Binary size

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

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.1% [-0.2%, -0.0%] 82
Improvements ✅
(secondary)
-0.2% [-0.9%, -0.0%] 43
All ❌✅ (primary) -0.1% [-0.2%, -0.0%] 82

Bootstrap: 690.042s -> 689.298s (-0.11%)
Artifact size: 371.86 MiB -> 371.81 MiB (-0.01%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jun 21, 2025
@cjgillot

Copy link
Copy Markdown
Contributor Author

@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 Jun 22, 2025
@bors

bors commented Jun 22, 2025

Copy link
Copy Markdown
Collaborator

⌛ Trying commit 8ab4e63 with merge 31325ff...

bors added a commit that referenced this pull request Jun 22, 2025
Make lowering incremental, take 3/N

Rebase of #88186 that was rebased by #127262

No real change in design, so I'm not expecting a perf miracle.

r? `@ghost`
@rust-log-analyzer

This comment has been minimized.

@bors

bors commented Jun 22, 2025

Copy link
Copy Markdown
Collaborator

☀️ Try build successful - checks-actions
Build commit: 31325ff (31325ff312ad91d8a2dd156c832cacc0435f9ea1)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (31325ff): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@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.5% [0.2%, 1.3%] 120
Regressions ❌
(secondary)
0.8% [0.2%, 3.2%] 77
Improvements ✅
(primary)
-0.7% [-1.3%, -0.2%] 12
Improvements ✅
(secondary)
-0.6% [-1.3%, -0.2%] 37
All ❌✅ (primary) 0.4% [-1.3%, 1.3%] 132

Max RSS (memory usage)

Results (primary 10.8%, secondary 10.4%)

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

mean range count
Regressions ❌
(primary)
10.8% [2.3%, 29.1%] 248
Regressions ❌
(secondary)
10.4% [1.9%, 31.7%] 143
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 10.8% [2.3%, 29.1%] 248

Cycles

Results (primary 2.1%, secondary 4.1%)

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

mean range count
Regressions ❌
(primary)
2.1% [1.2%, 3.8%] 20
Regressions ❌
(secondary)
4.1% [1.7%, 6.6%] 16
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.1% [1.2%, 3.8%] 20

Binary size

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

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.1% [-0.2%, -0.0%] 83
Improvements ✅
(secondary)
-0.2% [-0.9%, -0.0%] 43
All ❌✅ (primary) -0.1% [-0.2%, -0.0%] 83

Bootstrap: 689.082s -> 688.79s (-0.04%)
Artifact size: 371.89 MiB -> 371.87 MiB (-0.00%)

Comment thread compiler/rustc_middle/src/queries.rs Outdated
Comment thread compiler/rustc_ast_lowering/src/lib.rs
self.insert(id, AstOwner::NestedUseTree(parent));
items.push(self.make_dummy(id, span, ItemKind::MacCall));

let def_id = self.owners[&id].def_id;

@petrochenkov petrochenkov Jun 15, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary to pass parent to this function?
It seems like parent is always equal to this def_id (and refers to the single owner def id of the whole use tree hierarchy).

View changes since the review

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's actually building a real tree instead of everything being a child of the root use tree. the nested_vec contains NodeIds of the nested items, so they resolve to different DefIds, too. This logic matches what was here before and how I remember the logic needing to work

Comment thread compiler/rustc_ast_lowering/src/lib.rs Outdated
@petrochenkov

Copy link
Copy Markdown
Contributor

r=me after addressing the remaining comments, responding to #142830 (comment), and cleaning up the git history.
@rustbot author

@rustbot rustbot 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 Jun 15, 2026
@rustbot

rustbot commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@oli-obk oli-obk removed their assignment Jun 15, 2026
@rustbot

rustbot commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@oli-obk

oli-obk commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

@bors r=petrochenkov

@rust-bors

rust-bors Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 2a30bc0 has been approved by petrochenkov

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Jun 16, 2026
@rust-bors

This comment has been minimized.

@rust-bors rust-bors Bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 16, 2026
@rust-bors

rust-bors Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: petrochenkov
Duration: 3h 22m 34s
Pushing 89a9993 to main...

@rust-bors rust-bors Bot merged commit 89a9993 into rust-lang:main Jun 16, 2026
14 checks passed
@github-actions

Copy link
Copy Markdown
Contributor
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 b998449 (parent) -> 89a9993 (this PR)

Test differences

Show 116 test diffs

116 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 89a99936d9e76a50e8df622e7242190841fd871b --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. i686-gnu-nopt-2: 1h 25m -> 2h 23m (+69.0%)
  2. dist-powerpc64le-linux-gnu: 1h 6m -> 1h 34m (+42.3%)
  3. x86_64-gnu-llvm-22-2: 1h 44m -> 1h 4m (-38.4%)
  4. dist-x86_64-solaris: 1h 16m -> 1h 39m (+29.6%)
  5. aarch64-apple: 3h 27m -> 2h 30m (-27.8%)
  6. x86_64-mingw-1: 2h 17m -> 2h 54m (+27.6%)
  7. test-various: 1h 46m -> 2h 13m (+25.6%)
  8. dist-x86_64-illumos: 1h 25m -> 1h 47m (+25.6%)
  9. dist-various-1: 1h 2m -> 1h 16m (+23.9%)
  10. dist-x86_64-netbsd: 1h 32m -> 1h 10m (-23.6%)
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
Copy Markdown
Collaborator

Finished benchmarking commit (89a9993): comparison URL.

Overall result: ❌ regressions - please read:

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.8% [0.1%, 2.7%] 172
Regressions ❌
(secondary)
1.1% [0.1%, 4.2%] 105
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.4% [-0.4%, -0.4%] 1
All ❌✅ (primary) 0.8% [0.1%, 2.7%] 172

Max RSS (memory usage)

Results (primary 3.3%, 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)
3.3% [1.0%, 12.3%] 145
Regressions ❌
(secondary)
2.9% [1.3%, 5.6%] 30
Improvements ✅
(primary)
-2.8% [-2.8%, -2.8%] 1
Improvements ✅
(secondary)
-5.3% [-11.5%, -1.1%] 11
All ❌✅ (primary) 3.3% [-2.8%, 12.3%] 146

Cycles

Results (primary 2.4%, 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)
2.9% [2.1%, 3.7%] 10
Regressions ❌
(secondary)
4.7% [2.7%, 8.1%] 23
Improvements ✅
(primary)
-2.6% [-2.6%, -2.6%] 1
Improvements ✅
(secondary)
-3.8% [-4.9%, -2.2%] 7
All ❌✅ (primary) 2.4% [-2.6%, 3.7%] 11

Binary size

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

Bootstrap: 524.623s -> 522.035s (-0.49%)
Artifact size: 401.77 MiB -> 401.81 MiB (0.01%)

@oli-obk

oli-obk commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

@rustbot label: +perf-regression-triaged

This is unavoidable without making this PR bitrot for a long time and much more complex. I have various ideas for improving perf here, which I am pursuing as part of rust-lang/rust-project-goals#620

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. PG-exploit-mitigations Project group: Exploit mitigations 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants