Skip to content

Conversation

@matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost

Create a similar rollup

SpriteOvO and others added 22 commits January 14, 2026 19:15
Support {bool,char,int,uint,float,str} primitive types for feature
`type_info` reflection.
Now that Rc::new_zeroed is stable, remove the cfg(feature = "nightly")
branch and the temporary zeroed array on stable. This avoids copying a
potentially large [Word; CHUNK_WORDS] into the Rc.

Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
Provide `const` functions to get around lack of `const Default` for `FxHash*` types.

Use default field values in `Resolver` more.
To be consistent with the closely related `cycle_stash` and
`cycle_delay_bug`.
Issue rust-lang#124901 was an OOM caused by a query cycle. It was fixed by
a complex change in PR rust-lang#138672, but that PR did not add the test case.
Let's add it now, because it's the only known reproducer of the OOM.
PR rust-lang#138672 introduced a complex and invasive split of `QueryStackFrame`
to avoid a query cycle. This commit reverts that change because there is
a much simpler change that fixes the problem, which will be in the next
commit.
This changes the error message of `query-cycle-issue-124901.rs`, which
doesn't matter much.
…henkov

Cache derive proc macro expansion with incremental query

This is a revival of rust-lang#129102, originally implemented by @futile. Since it looks like they are not active currently, I'd like to push this work forward.

The first commit is squashed and rebased work from the original PR, with author attribution to futile. The rest of the commits are some additional comments that I created mostly for myself to understand what happens here. I also did some cleanups based on Vadim's review comments on the original PR, plus I refactored the TLS access a bit using `scoped_tls`.

The biggest issue, as usually, are tests... I tried using `#[rustc_clean(..., loaded_from_disk = "derive_macro_expansion")]`, but the problem is that since this query cannot recover the original key from its hash, and thus its fingerprintstyle is `FingerprintStyle::Opaque`, [this](https://github.com/rust-lang/rust/blob/2fef0a30ae6b2687dfb286cb544d2a542f7e2335/compiler/rustc_incremental/src/persist/dirty_clean.rs#L388) crashes when I try to use `loaded_from_disk`. Any suggestions from someone who actually understands the query system would be welcome 😅

TODO: document the new unstable flag

On a no-op change re-check of `octocrab 0.49` (which has a ton of `serde` derive proc macro invocations), this saves ~0.6s out of ~6s (so a ~10% win) on my PC.

r? @petrochenkov
Support primitives in type info reflection

Tracking issue: rust-lang#146922 `#![feature(type_info)]`

This PR supports {`bool`,`char`,`int`,`uint`,`float`,`str`} primitive types for feature `type_info` reflection.

r? @oli-obk
simplify words initialization using Rc::new_zeroed

Now that Rc::new_zeroed is stable, remove the cfg(feature = "nightly") branch and the temporary zeroed array on stable. This avoids copying a potentially large [Word; CHUNK_WORDS] into the Rc.
Use `default_field_values` more in `Resolver`

Extend more ways of building `FxHashSet`, `FxHashMap`, `UnordSet`, `UnordMap` and `DisambiguatorState` in `const` contexts to allow for more fields in `Resolver` to have a default value. `FxIndexSet`/`FxIndexMap` are still outstanding and not const-buildable.

r? @petrochenkov
remove lcnr from compiler review rotation

Have been feeling somewhat swamped by review and mentoring work and want to focus my review time on involved type system changes. I am very much available to review specific changes, but don't want to be auto-assigned to general compiler changes.
…i-obk

Revert `QueryStackFrame` split

PR rust-lang#138672 fixed a query cycle OOM reported in rust-lang#124901. The fix involved delaying computation of some query stack frame elements and was very complex. It involved the addition of two new types, the addition of a generic `I` parameter to eleven(!) other types, a `PhantomData` field, and even required an unsafe transmute of a closure. [This comment](rust-lang#124901 (comment)) had suggested a much simpler fix, but it was ignored. The PR also failed to add a test case.

This PR adds a test case, reverts the complex fix, applies the simpler fix, and does a few other minor cleanups.

r? @oli-obk
@rust-bors rust-bors bot added the rollup A PR which is a rollup label Jan 16, 2026
@rustbot rustbot added A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) 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-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jan 16, 2026
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 16, 2026

📌 Commit 57e950b has been approved by matthiaskrgr

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-review Status: Awaiting review from the assignee but also interested parties. labels Jan 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 Jan 16, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 16, 2026

☀️ Test successful - CI
Approved by: matthiaskrgr
Pushing 503745e to main...

@rust-bors rust-bors bot merged commit 503745e into rust-lang:main Jan 16, 2026
12 checks passed
@rustbot rustbot added this to the 1.94.0 milestone Jan 16, 2026
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#145354 Cache derive proc macro expansion with incremental query 2885283ab623bf494a4f00ecf9f7d2b0363d60cf (link)
#151123 Support primitives in type info reflection eb44b405ea870abc328d9a885d5ba91e8331b8ed (link)
#151178 simplify words initialization using Rc::new_zeroed c90ae4091a5cecc3ce3e5331634f095d54ddfaf8 (link)
#151187 Use default_field_values more in Resolver 8c8b4e8dc4c89b80f3d8b6fa9336bff98f6b4740 (link)
#151197 remove lcnr from compiler review rotation 6b55a8fb9f6d23b7098b689bd6b0e5cbfd1d116b (link)
#151203 Revert QueryStackFrame split 94d9f65781e72cab60d4d5ecbe7e1cedfb722793 (link)

previous master: b08c11df4b

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@github-actions
Copy link
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 b08c11d (parent) -> 503745e (this PR)

Test differences

Show 260 test diffs

Stage 1

  • [incremental] tests/incremental/derive_macro_expansion/proc_macro_unchanged.rs: [missing] -> pass (J0)
  • [ui] tests/ui/reflection/dump.rs: pass -> [missing] (J0)
  • [ui] tests/ui/reflection/dump.rs#bit32: [missing] -> ignore (only executed when the pointer width is 32bit) (J0)
  • [ui] tests/ui/reflection/dump.rs#bit64: [missing] -> pass (J0)
  • [ui] tests/ui/resolve/query-cycle-issue-124901.rs: [missing] -> pass (J0)
  • mem::type_info::test_primitives: [missing] -> pass (J4)

Stage 2

  • [ui] tests/ui/reflection/dump.rs#bit32: [missing] -> ignore (only executed when the pointer width is 32bit) (J1)
  • [ui] tests/ui/reflection/dump.rs#bit64: [missing] -> pass (J1)
  • [ui] tests/ui/reflection/dump.rs#bit32: [missing] -> pass (J2)
  • [ui] tests/ui/reflection/dump.rs#bit64: [missing] -> ignore (only executed when the pointer width is 64bit) (J2)
  • [incremental] tests/incremental/derive_macro_expansion/proc_macro_unchanged.rs: [missing] -> pass (J3)
  • [ui] tests/ui/reflection/dump.rs: pass -> [missing] (J5)
  • [ui] tests/ui/resolve/query-cycle-issue-124901.rs: [missing] -> pass (J5)
  • mem::type_info::test_primitives: [missing] -> pass (J6)
  • [incremental] tests/incremental/derive_macro_expansion/proc_macro_unchanged.rs: [missing] -> ignore (gcc backend is marked as ignore) (J7)

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

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 503745e9170b40841611aaaa634641edffd00b29 --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. dist-aarch64-linux: 6418.5s -> 8796.1s (+37.0%)
  2. pr-check-1: 1528.3s -> 1975.6s (+29.3%)
  3. dist-aarch64-apple: 7726.9s -> 9444.5s (+22.2%)
  4. x86_64-rust-for-linux: 2717.7s -> 3193.2s (+17.5%)
  5. dist-x86_64-apple: 8815.7s -> 9978.4s (+13.2%)
  6. x86_64-msvc-ext1: 8100.9s -> 7295.3s (-9.9%)
  7. x86_64-gnu-aux: 7279.8s -> 7908.3s (+8.6%)
  8. i686-gnu-2: 5579.0s -> 6051.4s (+8.5%)
  9. i686-gnu-nopt-1: 7796.9s -> 8362.9s (+7.3%)
  10. x86_64-gnu-miri: 4664.9s -> 4979.4s (+6.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 (503745e): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -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
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.8% [-1.5%, -0.1%] 2
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -0.7%, secondary -1.8%)

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.0%, 2.3%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.6% [-3.8%, -0.7%] 3
Improvements ✅
(secondary)
-1.8% [-2.7%, -0.9%] 2
All ❌✅ (primary) -0.7% [-3.8%, 2.3%] 5

Cycles

Results (secondary 2.0%)

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)
2.0% [1.4%, 2.9%] 5
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

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

Bootstrap: 475.411s -> 473.941s (-0.31%)
Artifact size: 383.60 MiB -> 383.50 MiB (-0.03%)

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

Labels

A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants