T Compiler Meeting Agenda 2022 06 30

T-compiler Meeting Agenda 2022-06-30

Announcements

Other WG meetings

MCPs/FCPs

  • New MCPs (take a look, see if you like them!)
    • No new proposals this time.
  • Old MCPs (not seconded, take a look)
    • “Dealing with type/const ambiguities” compiler-team#480 (last review activity: 5 months ago)
    • “Removing codegen logic for nvptx-nvidia-cuda (32-bit target)” compiler-team#496 (last review activity: 3 months ago)
    • “Arbitrary annotations in compiletest” compiler-team#513 (last review activity: about 54 days ago)
    • “Add support for the LoongArch architecture” compiler-team#518 (last review activity: about 13 days ago)
  • Pending FCP requests (check your boxes!)
    • “Stabilize -Zgcc-ld=lld as -Clink-self-contained=linker -Clinker-flavor=gcc-lldcompiler-team#510
    • “Increase the minimum linux-gnu versions” rust#95026
    • “session: stabilize split debuginfo on linux” rust#98051
  • Things in FCP (make sure you’re good with it)
  • Accepted MCPs
    • “Tier 3 target proposal: riscv64gc-linux-android (Android target for riscv64gc)” compiler-team#472
    • “Split TypeVisitable out from TypeFoldable” compiler-team#520
  • Finalized FCPs (disposition merge)
    • “Remove migrate borrowck mode” rust#95565
    • “Modify MIR building to drop repeat expressions with length zero” rust#95953
    • “Lang: Stabilize usage of rustc_nonnull_optimization_guaranteed on -1” rust#97122
    • “Remove a back-compat hack on lazy TAIT” rust#97346
    • “make cenum_impl_drop_cast deny-by-default” rust#97652
    • “make const_err show up in future breakage reports” rust#97743
    • “lub: don’t bail out due to empty binders” rust#97867
    • “allow unions with mutable references and tuples of allowed types” rust#97995

WG checkins

  • @_WG-traits (Generic associated types initiative) by @Jack Huey (prev checkin)

Still lots of discussion in stabilization PR and zulip. Niko posted a nice comment giving a nice example use case of GATs

  • @_WG-diagnostics by @Esteban Küber and @oli (prev checkin)

Biggest announcement is the ongoing work on the translation machinery. There are some HackMD documents with context here and here

Backport nominations

T-compiler stable / T-compiler beta

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

T-rustdoc stable / T-rustdoc beta

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

:back: / :shrug: / :hand:

PRs S-waiting-on-team

T-compiler

  • “Enable varargs support for calling conventions other than C or cdecl” rust#97971
    • @Jack Huey comments this PR could go through a FCP (comment)
  • “TypeId: use a (v0) mangled type to remain sound in the face of hash collisions.” rust#95845
    • @eddyb nominates for various teams discussions (comment), T-lang contributes to the discussion.
    • See also T-compiler nominations
  • (Omitted 4 PRs in draft or waiting on other teams / RFC process)

Oldest PRs waiting for review

T-compiler

  • “Warn about dead tuple struct fields” rust#95977 (last review activity: about 29 days ago)
    • unsure about the status, perhaps need another round of review? cc @eddyb
  • “Use liballoc’s specialised in-place vec collection” rust#97870 (last review activity: about 21 days ago)
    • hifive bot autoassigned to @Wesley Wiser? re-roll :dice:?

Issues of Note

Short Summary

P-critical

T-compiler

  • “Wrong cast of u16 to usize on aarch64” rust#97463
    • Issue is being addressed by @__pnkfelix in #97800
    • previously discussed, pending a downgrade to P-high and perhaps adding more tests to the PR (suggested last week)
  • “Wrong optimization” rust#98568
  • “Function type with opaque return type can be coerced to dyn Fn with arbitrary return type” rust#98608
    • @oli self-assigned

T-rustdoc

  • No P-critical issues for T-rustdoc 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

2022-06-28 Triage Log

Overall, a positive week for compiler performance with regressions mainly being relegated to smaller issues. This can be see by the fact that 95 test cases in real world crates were improvements while regressions only happened in 22 test cases. The largest improvement was by @nnethercote where the compilation of #[derive(Debug)] was improved. This led to an average of 1% improvement in compile times across 124 real world crate test cases.

Triage done by @rylev. Revision range: abace0a1f17986d89aedf610819deab2b4afee56..baf382e63c023259fa1f9042f8f479f183ca6ed3

Summary:

mean max count
Regressions (primary) 0.6% 2.4% 22
Regressions (secondary) 0.5% 1.0% 35
Improvements (primary) -1.1% -5.2% 95
Improvements (secondary) -2.3% -10.3% 35
All (primary) -0.8% -5.2% 117

3 Regressions, 3 Improvements, 4 Mixed; 5 of them in rollups 34 artifact comparisons made in total

Regressions

Rollup of 16 pull requests #98438 (Comparison Link)

mean max count
Regressions (primary) 0.3% 0.4% 37
Regressions (secondary) 0.4% 0.6% 17
Improvements (primary) N/A N/A 0
Improvements (secondary) -0.4% -0.5% 3
All (primary) 0.3% 0.4% 37
  • Given the difficulty of investigation and the relatively small magnitude of the regression, I’ve marked this as triaged.

fix universes in the NLL type tests #98109 (Comparison Link)

mean max count
Regressions (primary) 0.6% 1.9% 31
Regressions (secondary) 0.9% 2.0% 35
Improvements (primary) N/A N/A 0
Improvements (secondary) N/A N/A 0
All (primary) 0.6% 1.9% 31
  • This was a high-priority correctness fix, so the regressions are acceptable at least in the short term.
  • Oli already commented on possible ideas for fixing the regression.

Rollup of 9 pull requests #98591 (Comparison Link)

mean max count
Regressions (primary) N/A N/A 0
Regressions (secondary) 1.2% 1.7% 7
Improvements (primary) N/A N/A 0
Improvements (secondary) N/A N/A 0
All (primary) N/A N/A 0
  • #98576 is probably the only likely candidate for this regression.
  • The cahcegrind didn’t reveal anything super interesting though unfortunately.
  • Left a comment here.

Improvements

Rollup of 11 pull requests #98335 (Comparison Link)

mean max count
Regressions (primary) N/A N/A 0
Regressions (secondary) 1.1% 1.1% 1
Improvements (primary) -0.9% -1.2% 8
Improvements (secondary) -0.6% -0.7% 13
All (primary) -0.9% -1.2% 8

proc_macro/bridge: cache static spans in proc_macro’s client thread-local state #98187 (Comparison Link)

mean max count
Regressions (primary) N/A N/A 0
Regressions (secondary) N/A N/A 0
Improvements (primary) -0.4% -0.7% 12
Improvements (secondary) N/A N/A 0
All (primary) -0.4% -0.7% 12

Only keep a single query for well-formed checking #98222 (Comparison Link)

mean max count
Regressions (primary) N/A N/A 0
Regressions (secondary) N/A N/A 0
Improvements (primary) -0.2% -0.3% 2
Improvements (secondary) -0.2% -0.3% 7
All (primary) -0.2% -0.3% 2

Mixed

Remove dereferencing of Box from codegen #95576 (Comparison Link)

mean max count
Regressions (primary) 0.6% 1.6% 5
Regressions (secondary) 0.5% 0.8% 17
Improvements (primary) -0.5% -0.5% 1
Improvements (secondary) -1.2% -1.7% 8
All (primary) 0.4% 1.6% 6
  • Some light investigation from Oli already done.
  • Seems like we’re spending a bit more time in trait obligation resolution
  • Asked Oli whether this is acceptable.

Rollup of 6 pull requests #98359 (Comparison Link)

mean max count
Regressions (primary) 0.8% 1.0% 6
Regressions (secondary) N/A N/A 0
Improvements (primary) -0.3% -0.6% 14
Improvements (secondary) N/A N/A 0
All (primary) 0.0% 1.0% 20
  • By in large, a wash in terms of change to overall performance.
  • The regressions are contained to diesel.
  • If I had to guess about a place to investigate, it would be #87867, but it might not be worth the effort.

Rollup of 9 pull requests #98447 (Comparison Link)

mean max count
Regressions (primary) 2.1% 2.1% 1
Regressions (secondary) N/A N/A 0
Improvements (primary) N/A N/A 0
Improvements (secondary) -0.3% -0.3% 1
All (primary) 2.1% 2.1% 1
  • The regressions are contained to only one test case (regex opt) in codegen related queries.
  • I didn’t find any PRs that seemed like likely culprits.

Improve derive(Debug) #98190 (Comparison Link)

mean max count
Regressions (primary) 0.5% 0.6% 4
Regressions (secondary) 0.5% 0.8% 13
Improvements (primary) -1.0% -5.3% 120
Improvements (secondary) -1.8% -10.3% 69
All (primary) -1.0% -5.3% 124
  • Largely a very positive win.

Nominated Issues

T-compiler

  • “TypeId: use a (v0) mangled type to remain sound in the face of hash collisions.” rust#95845
    • nominated by @eddyb (comment)
    • points out the main discussion is whether we need anything other than a larger hash.
  • “pessimistically treat all function items as containing an opaque type” rust#98614
    • PR authored by @oli, fixes unsound P-critical #98608 and related ICE #98604
    • perf. results show significant regressions
    • nominated by @oli to evaluate if the perf. regression is acceptable since this fixes an unsoundness (comment)
  • for<'a> &'a T: 'a and closures regressed” rust#98437
    • @_apiraino nominated to get some eyeballs on the general question raised by @Jack Huey about reverting some PRs related to the merged NLL (comment)

RFC

  • No nominated RFCs for T-compiler this time.

Next week’s WG checkins

  • @_WG-rustc-dev-guide by @Santiago Pastorino and @Yuki Okushi|217081
  • @_WG-traits (Impl Trait initiative) by @oli