T Compiler Meeting Agenda 2024 06 20

T-compiler Meeting Agenda 2024-06-20

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).
  • Tomorrow time:2024-06-21T16:00:00+02:00 Bonanza backlog meeting (see comment)

Other WG meetings

MCPs/FCPs

WG checkins

None

Backport nominations

T-compiler beta / T-compiler stable

  • :beta: “Only compute specializes query if (min)specialization is enabled in the crate of the specializing impl” rust#126139
    • Authored by compiler-errors
    • Fixes #125197
    • Mentioned last week: missed the beta backport, are we going to stable backport?
  • :beta: “Add pub struct with allow(dead_code) into worklist” rust#126315
    • Authored by mu001999
    • Fixes #126289, A P-medium lint regression
  • :stable: “defrost RUST_MIN_STACK=ice rustc hello.rsrust#125302
    • Authored by workingjubilee
    • Fixes #126431, a panic when setting the env var RUST_MIN_STACK incorrectly
    • author suggests stable backport, if a dot release is planned
  • :stable: “Closures are recursively reachable” rust#125996
    • Authored by tmiasko
    • Fixes #126012, a P-medium missing MIR optimization, reported by tmiasko (seems to not have received other reports in the wild)
    • This fix lost the previous beta backport train so nominated for stable (if a point release is planned)

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

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

T-types

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

P-high regressions

P-high beta regressions

  • None new

Unassigned P-high nightly regressions

  • None new

Performance logs

triage logs for 2024-06-18

Regressions outnumbered the improvements this week, but most of the regressions were deemed worth it for one reason or another. Overall, compiler performance didn’t end up changing very much.

Triage done by @rylev. Revision range: b5b13568..c2932aaf

Summary:

(instructions:u) mean range count
Regressions (primary) 0.4% [0.2%, 1.0%] 63
Regressions (secondary) 0.7% [0.2%, 2.4%] 70
Improvements (primary) -0.6% [-1.2%, -0.2%] 8
Improvements (secondary) -1.1% [-5.2%, -0.2%] 7
All (primary) 0.3% [-1.2%, 1.0%] 71

5 Regressions, 2 Improvements, 7 Mixed; 2 of them in rollups 58 artifact comparisons made in total

Regressions

Print token::Interpolated with token stream pretty printing. #125174 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) 0.3% [0.2%, 0.4%] 9
Regressions (secondary) - - 0
Improvements (primary) - - 0
Improvements (secondary) - - 0
All (primary) 0.3% [0.2%, 0.4%] 9
  • No discussion of the perf run done before merging, so I asked the author/reviewer for their thoughts.
  • It seems like most libc benchmarks were negatively impacted while no other benchmarks were. I’m not quite sure why that would be.

Add TyCtxt::is_lang_item, use it in the compiler #126491 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) 0.3% [0.2%, 0.4%] 10
Regressions (secondary) - - 0
Improvements (primary) - - 0
Improvements (secondary) - - 0
All (primary) 0.3% [0.2%, 0.4%] 10
  • The change was deemed worth it despite the perf regression.

Indicate in non_local_defs lint that the macro needs to change #125722 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) 0.2% [0.2%, 0.2%] 6
Regressions (secondary) - - 0
Improvements (primary) - - 0
Improvements (secondary) - - 0
All (primary) 0.2% [0.2%, 0.2%] 6
  • Only the diesel benchmark is affected, which is somewhat expected as it triggers the lint many many times (over 150 times).

Rollup of 6 pull requests #126605 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) 0.3% [0.3%, 0.4%] 6
Regressions (secondary) - - 0
Improvements (primary) - - 0
Improvements (secondary) - - 0
All (primary) 0.3% [0.3%, 0.4%] 6
  • The benchmarks impacted seem to now swing wildly back and forth with every run so this isn’t a perf regression per say.

Migrate inaccessible-temp-dir, output-with-hyphens and issue-10971-temps-dir run-make tests to rmake #126279 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) 0.3% [0.3%, 0.3%] 6
Regressions (secondary) - - 0
Improvements (primary) - - 0
Improvements (secondary) - - 0
All (primary) 0.3% [0.3%, 0.3%] 6
  • This has to be noise, this PR only modified tests.

Improvements

Migrate link-arg, link-dedup and issue-26092 run-make tests to rmake format #125500 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) - - 0
Regressions (secondary) - - 0
Improvements (primary) -0.4% [-0.4%, -0.3%] 6
Improvements (secondary) - - 0
All (primary) -0.4% [-0.4%, -0.3%] 6

Migrate extern-flag-fun, incremental-debugger-visualiser and incremental-session-fail run-make tests to rmake.rs #126490 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) - - 0
Regressions (secondary) - - 0
Improvements (primary) -0.3% [-0.4%, -0.3%] 6
Improvements (secondary) - - 0
All (primary) -0.3% [-0.4%, -0.3%] 6

Mixed

Add SingleUseConsts mir-opt pass #125910 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) 0.4% [0.3%, 0.4%] 2
Regressions (secondary) - - 0
Improvements (primary) -0.3% [-0.4%, -0.2%] 4
Improvements (secondary) -2.3% [-2.9%, -1.7%] 2
All (primary) -0.1% [-0.4%, 0.4%] 6
  • Wash on instruction counts, but nice binary size wins. The cycles improvements on tt-muncher is noise returning back to normal.

Make ObligationEmittingRelations emit Goal rather than Obligation #126130 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) - - 0
Regressions (secondary) 0.4% [0.1%, 0.6%] 14
Improvements (primary) -0.2% [-0.2%, -0.2%] 1
Improvements (secondary) - - 0
All (primary) -0.2% [-0.2%, -0.2%] 1
  • I’m asssuming the perf regression was deemed acceptable since these only occurred in stress tests?

Tait must be constrained if in sig #113169 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) 0.7% [0.7%, 0.7%] 1
Regressions (secondary) - - 0
Improvements (primary) -0.3% [-0.4%, -0.3%] 2
Improvements (secondary) - - 0
All (primary) -0.0% [-0.4%, 0.7%] 3
  • Probably noise + we need the fix

Extend SCC construction to enable extra functionality #125069 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) 0.2% [0.2%, 0.3%] 6
Regressions (secondary) 0.5% [0.1%, 1.0%] 10
Improvements (primary) - - 0
Improvements (secondary) -0.3% [-0.3%, -0.3%] 2
All (primary) 0.2% [0.2%, 0.3%] 6
  • The perf regressions were brought down since the first perf run, but there’s still instruction count regressions in primary benchmarks here (albeit not large ones). I asked the author/reviewer for thoughts.

Remove superfluous UbChecks from SliceIndex methods #126299 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) 0.4% [0.2%, 0.6%] 4
Regressions (secondary) 0.8% [0.5%, 1.3%] 5
Improvements (primary) -0.4% [-0.6%, -0.2%] 3
Improvements (secondary) -0.6% [-0.8%, -0.4%] 7
All (primary) 0.1% [-0.6%, 0.6%] 7
  • Perf is largely a wash and was expected to have far reach consequences since it changes how slices are codegened.

rustc_span: Optimize more hygiene operations using Span::map_ctxt #126543 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) 0.2% [0.2%, 0.2%] 1
Regressions (secondary) 0.3% [0.2%, 0.4%] 3
Improvements (primary) -1.1% [-1.4%, -0.3%] 4
Improvements (secondary) -0.3% [-0.3%, -0.2%] 3
All (primary) -0.8% [-1.4%, 0.2%] 5
  • Improvements outweigh the regressions which all seemed to be reversed sometime soon after this landed.

Rollup of 3 pull requests #126581 (Comparison Link)

(instructions:u) mean range count
Regressions (primary) - - 0
Regressions (secondary) 1.3% [1.3%, 1.3%] 1
Improvements (primary) -0.3% [-0.4%, -0.2%] 6
Improvements (secondary) - - 0
All (primary) -0.3% [-0.4%, -0.2%] 6
  • Regression might be noise (and isn’t big enough to care about even if it isn’t)

Nominated Issues

T-compiler

  • “in asm!() using a local numeric label made of all 0’s and 1’s gives a confusing error” rust#94426
    • nominated by @Josh Triplett
    • (assumed for suggesting what the behaviour here should be)
    • issue reporter comments:

      As per Rust By Example, we use 2: as a local label there to work around an LLVM bug that mistakes labels like 0:, 1:, or 10: for binary. This example works. However, if we don’t know about this rule, and we try to use 0: instead, the error we get is confusing

RFC

  • No I-compiler-nominated RFCs this time.

Oldest PRs waiting for review

  • “Stop using LLVM struct types for array/pointer offset GEPs” rust#122325 (last review activity: 3 months ago)
    • cc @Nikita Popov
  • “Apply dllimport in ThinLTO for -Z dylib-lto” rust#122790 (last review activity: 3 months ago)
    • cc @Wesley Wiser
  • “[WIP] Enforce may-define-must-define for ATPITs” rust#123046 (last review activity: 2 months ago)
    • cc: @aliemjay
  • “CFI: Fix fn items, closures, and Fn trait objects” rust#123082 (last review activity: 2 months ago)
    • cc @Michael Goulet (compiler-errors)

Next meetings' agenda draft: hackmd link