T Compiler Meeting Agenda 2024 02 15

T-compiler Meeting Agenda 2024-02-15

Announcements

  • Reminder: if you see a PR/issue that seems like there might be legal implications due to copyright/IP/etc, please let us know (or at least message @davidtwco or @Wesley Wiser so we can pass it along).

Other WG meetings

MCPs/FCPs

WG checkins

Backport nominations

T-compiler beta / T-compiler stable

  • :beta: [1.77] “Update jobserver-rs to 0.1.28” rust#120846
    • Fixes #120515, regression when running rustc with make -j2
    • nominated by @Vadim Petrochenkov
  • :beta: [1.77] “Improve wording of static_mut_refrust#121034
    • nominated by @oli, closes #120964 (documentation wording, IIUC)
    • PR is being reviewed. Diff is non-trivial even if not code
  • :beta: [1.77] “Update LLVM submodule” rust#121132
    • nominated by @nikic
    • Fixes various P-high LLVM related issues
  • :stable: [1.76] “Update jobserver-rs to 0.1.28” rust#120846
    • as above. Stable backport in case a minor release is in the air

T-types stable / T-types beta

  • No beta nominations for T-types this time.
  • No stable nominations for T-types this time.

PRs S-waiting-on-team

T-compiler

Issues of Note

Short Summary

P-critical

T-compiler

  • “thread ‘rustc’ panicked at compiler/rustc_metadata/src/rmeta/encoder.rs:1888:17” rust#120830
    • Happens on nightly
    • diesel crate author proposes to revert the change rolled up in #121038 (exact PR is #119592)
    • Vadim suggest a different approach than reverting (comment)

T-types

  • No P-critical issues for T-types this time.

P-high regressions

P-high beta regressions

  • No P-high beta regressions this time.

Unassigned P-high nightly regressions

  • No unassigned P-high nightly regressions this time.

Performance logs

triage logs for 2024-02-13

Relatively balanced results this week, with more improvements than regressions. Some of the larger regressions are not relevant, however there was a real large regression on doc builds, that was caused by a correctness fix (rustdoc was doing the wrong thing before).

Triage done by @kobzol. Revision range: 0984becf..74c3f5a1

Summary:

(instructions:u) mean range count
Regressions (primary) 2.1% [0.2%, 12.0%] 44
Regressions (secondary) 5.2% [0.2%, 20.1%] 76
Improvements (primary) -0.7% [-2.4%, -0.2%] 139
Improvements (secondary) -1.3% [-3.3%, -0.3%] 86
All (primary) -0.1% [-2.4%, 12.0%] 183

6 Regressions, 5 Improvements, 8 Mixed; 5 of them in rollups 53 artifact comparisons made in total

Regressions

pattern_analysis: Gracefully abort on type incompatibility #120313 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) - - 0
Regressions (secondary) 1.9% [1.8%, 2.0%] 6
Improvements (primary) - - 0
Improvements (secondary) - - 0
All (primary) - - 0
  • The pattern matching machinery is now receiving a lot of updates, and the match-stress stress test is swinging back and forth. Marked as triaged.

Rework support for async closures; allow them to return futures that borrow from the closure’s captures #120361 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) 0.5% [0.2%, 0.7%] 11
Regressions (secondary) 0.6% [0.4%, 0.7%] 11
Improvements (primary) - - 0
Improvements (secondary) -0.2% [-0.2%, -0.2%] 1
All (primary) 0.5% [0.2%, 0.7%] 11
  • This is probably just codegen noise, the changes were reverted in followup commits. Marked as triaged.

Make traits / trait methods detected by the dead code lint #118257 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) 0.7% [0.1%, 1.8%] 18
Regressions (secondary) 9.4% [0.2%, 16.0%] 10
Improvements (primary) - - 0
Improvements (secondary) - - 0
All (primary) 0.7% [0.1%, 1.8%] 18
  • This PR implements a new lint for unused traits, so the compiler does more work. The large regression is a red herring, it is a small stress test that didn’t produce any warnings before, but it does now, which causes it to initialize the diagnostics machinery, which is a one-time cost. Marked as triaged.

Stop bailing out from compilation just because there were incoherent traits #120558 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) 0.4% [0.2%, 1.0%] 14
Regressions (secondary) 1.2% [0.1%, 3.5%] 23
Improvements (primary) - - 0
Improvements (secondary) - - 0
All (primary) 0.4% [0.2%, 1.0%] 14
  • The regression was resolved in #120835.

Rollup of 6 pull requests #120862 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) 0.5% [0.3%, 0.7%] 7
Regressions (secondary) 4.0% [1.2%, 7.7%] 13
Improvements (primary) - - 0
Improvements (secondary) - - 0
All (primary) 0.5% [0.3%, 0.7%] 7
  • Regression is expected to be partially resolved by #120942.

Assert that params with the same index have the same name #120619 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) 6.0% [1.6%, 19.0%] 18
Regressions (secondary) 12.2% [0.8%, 19.1%] 22
Improvements (primary) - - 0
Improvements (secondary) - - 0
All (primary) 6.0% [1.6%, 19.0%] 18
  • The doc regressions are unfortunately real, however this is a bugfix, rustdoc was doing incorrect work.

Improvements

Rollup of 13 pull requests #120748 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) - - 0
Regressions (secondary) - - 0
Improvements (primary) -1.1% [-2.3%, -0.2%] 27
Improvements (secondary) -1.7% [-2.2%, -1.4%] 11
All (primary) -1.1% [-2.3%, -0.2%] 27

Prevent running some code if it is already in the map #120579 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) - - 0
Regressions (secondary) - - 0
Improvements (primary) -2.3% [-5.9%, -0.8%] 19
Improvements (secondary) -4.0% [-6.4%, -0.6%] 22
All (primary) -2.3% [-5.9%, -0.8%] 19
  • A nice win for doc benchmarks.

Continue to borrowck even if there were previous errors #120550 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) - - 0
Regressions (secondary) - - 0
Improvements (primary) -0.9% [-1.0%, -0.8%] 4
Improvements (secondary) -0.5% [-0.7%, -0.3%] 17
All (primary) -0.9% [-1.0%, -0.8%] 4

Harmonize AsyncFn implementations, make async closures conditionally impl Fn* traits #120712 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) - - 0
Regressions (secondary) - - 0
Improvements (primary) -0.5% [-0.8%, -0.2%] 5
Improvements (secondary) -0.6% [-0.7%, -0.5%] 2
All (primary) -0.5% [-0.8%, -0.2%] 5

A trait’s local impls are trivially coherent if there are no impls. #120834 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) - - 0
Regressions (secondary) - - 0
Improvements (primary) -0.4% [-1.0%, -0.2%] 10
Improvements (secondary) -1.4% [-3.5%, -0.3%] 24
All (primary) -0.4% [-1.0%, -0.2%] 10

Mixed

Rollup of 9 pull requests #120660 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) 0.8% [0.2%, 1.4%] 2
Regressions (secondary) - - 0
Improvements (primary) - - 0
Improvements (secondary) -0.2% [-0.3%, -0.2%] 2
All (primary) 0.8% [0.2%, 1.4%] 2
  • The regression was small and looks like noise, marking as triaged.

Make NonZero constructors generic. #120521 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) 0.7% [0.4%, 1.7%] 9
Regressions (secondary) - - 0
Improvements (primary) -1.0% [-1.0%, -1.0%] 1
Improvements (secondary) -1.3% [-1.3%, -1.3%] 1
All (primary) 0.5% [-1.0%, 1.7%] 10
  • Regression later resolved in #120809.

Rollup of 9 pull requests #120767 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) 0.4% [0.3%, 0.4%] 2
Regressions (secondary) 0.3% [0.3%, 0.3%] 1
Improvements (primary) -0.2% [-0.3%, -0.2%] 13
Improvements (secondary) -0.4% [-0.8%, -0.2%] 25
All (primary) -0.2% [-0.3%, 0.4%] 15
  • The improvements outweight the regressions. Marked as triaged.

Toggle assert_unsafe_precondition in codegen instead of expansion #120594 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) 0.5% [0.3%, 1.0%] 13
Regressions (secondary) 0.5% [0.2%, 2.1%] 8
Improvements (primary) -0.6% [-1.4%, -0.2%] 15
Improvements (secondary) -0.6% [-1.4%, -0.2%] 15
All (primary) -0.1% [-1.4%, 1.0%] 28
  • The wins and regressions are more or less balanced out.

Rollup of 8 pull requests #120843 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) 0.2% [0.2%, 0.2%] 1
Regressions (secondary) 0.6% [0.2%, 1.0%] 11
Improvements (primary) -0.5% [-1.0%, -0.2%] 41
Improvements (secondary) -0.8% [-2.4%, -0.2%] 17
All (primary) -0.5% [-1.0%, 0.2%] 42
  • More wins than losses. Marked as triaged.

Enable MIR JumpThreading by default #117206 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) 1.8% [0.4%, 7.1%] 10
Regressions (secondary) 1.0% [0.4%, 3.3%] 18
Improvements (primary) -0.5% [-1.6%, -0.2%] 130
Improvements (secondary) -0.8% [-2.5%, -0.3%] 74
All (primary) -0.4% [-1.6%, 7.1%] 140
  • Wins outweight the losses here, and this PR should also hopefully improve runtime performance slightly, which seems to be confirmed by our runtime hashmap benchmarks. Marked as triaged.

Fold pointer operations in GVN #120405 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) 0.9% [0.7%, 1.1%] 2
Regressions (secondary) 2.7% [2.7%, 2.7%] 1
Improvements (primary) -0.5% [-0.8%, -0.3%] 4
Improvements (secondary) -1.8% [-1.8%, -1.8%] 1
All (primary) 0.0% [-0.8%, 1.1%] 6
  • There are a few regressions, but nothing too large. This change should eventually help the compiler optimize Rust code better. Marked as triaged.

Lowering unnamed fields and anonymous adt #115367 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) - - 0
Regressions (secondary) 6.1% [0.3%, 20.7%] 9
Improvements (primary) -1.1% [-1.1%, -1.1%] 1
Improvements (secondary) -0.3% [-0.3%, -0.3%] 1
All (primary) -1.1% [-1.1%, -1.1%] 1
  • A large regression on a stress test. Not marking as triaged yet.

Nominated Issues

T-compiler

  • “Limit -C strip on MSVC” rust#115120
    • Nominated by @davidtwco
    • Discussion about -C flags starts here
  • “Feature gates for renamed features hard error, breaking “nightly-detecting” crates” rust#120804
    • Nominated by @Manish Goregaokar
    • Seems that renaming nightly features can break some crates (also fundamental ones, like proc-macro2). The proposal is to add some machinery in rustc to prevent this to happen
    • Other comments point out that this is a “bad” behaviour that crates should avoid (comment and following)
    • Also interesting this comment from @RalfJ in a crate affected
  • “debuginfo: Stabilize -Z debug-macros, -Z collapse-macro-debuginfo and #[collapse_debuginfo]rust#120845

RFC

  • No I-compiler-nominated RFCs this time.

Oldest PRs waiting for review

T-compiler

  • None this week

Next week’s WG checkins

  • @_WG-diagnostics by @Esteban Küber and @oli
  • @_WG-rustc-dev-guide by @Santiago Pastorino and @Yuki Okushi|217081

Next meetings' agenda draft: hackmd link