T Compiler Meeting Agenda 2022 05 26

T-compiler Meeting Agenda 2022-05-26

Announcements

  • Tomorrow time:2022-05-27T13:00:00+02:00 Types Team: Formality roadmap calendar link and issue
  • Reminder: if you see a PR/issue that seems like there might be legal implications due to copyright/IP/etc, please let the Core team know (or at least message @pnkfelix or @Wesley Wiser so we can pass it along).

Other upcoming WG meetings (calendar link)

MCPs/FCPs

  • New MCPs (take a look, see if you like them!)
    • No new proposals this time.
  • Old MCPs (not seconded, take a look)
    • “Accept pc in place of unknown and unknown in place of pc for x86_64 and i?86 targets” compiler-team#441 (last review activity: about 4 days ago)
      • :loudspeaker: Stale MCP: candidate for closing in a week
      • Zulip discussion
      • @pnkfelix checked the pulse of the discussion in September 2021
      • the core proposal of the MCP seem to have received mixed comments
    • “Make -Z binary-dep-depinfo the default behavior” compiler-team#464 (last review activity: about 4 days ago)
      • :loudspeaker: Stale MCP: candidate for closing in a week
      • Zulip discussion
      • MCP discussion received some favorable comments, no unresolved points
    • “Tier 3 target proposal: riscv64gc-linux-android (Android target for riscv64gc)” compiler-team#472 (last review activity: 5 months ago)
    • -Dwarnings to cover all warnings” compiler-team#473 (last review activity: 5 months ago)
    • “Dealing with type/const ambiguities” compiler-team#480 (last review activity: 4 months ago)
    • “Removing codegen logic for nvptx-nvidia-cuda (32-bit target)” compiler-team#496 (last review activity: 2 months ago)
    • “Change compiletest declarations parsing” compiler-team#512 (last review activity: about 17 days ago)
    • “Arbitrary annotations in compiletest” compiler-team#513 (last review activity: about 17 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
  • Things in FCP (make sure you’re good with it)
    • “Build-time execution sandboxing” compiler-team#475
    • “Tracking issue for Consistent no-prelude attribute (RFC 501)” rust#20561
    • “Tracking Issue for -Z terminal-widthrust#84673
    • “Stabilize the bundle native library modifier” rust#95818
    • “Remove label/lifetime shadowing warnings” rust#96296
  • Accepted MCPs
  • Finalized FCPs (disposition merge)
    • “Neither require nor imply lifetime bounds on opaque type for well formedness” rust#95474

WG checkins

  • @_WG-diagnostics by @Esteban Küber and @oli
  • Introduction of translation machinery in the rustc codebase, with a handful of errors being migrated to this new system for testing.
  • New fn argument diagnostic that detects additions, removals and substitutions in the call site, with appropriate suggestions.
  • Tons of diagnostics improvements and fixes.
  • @_WG-rustc-dev-guide by @Santiago Pastorino and @Yuki Okushi|217081

Most notable changes

  • Add docs for logging of queries. #1350
  • mention WithOptConstParam #1346
  • Update docs for deprecated attribute #1338

Most notable WIPs

  • Update suggested config to expand proc macros #1341
  • rewrite bootstrapping stages #1327
  • Describe Type Alias Impl Trait (TAIT) Inference Algorithm #1297
  • Added detail to codegen section #1216
  • Update build instructions for rustdoc #1117
  • Document inert vs active attributes #1110
  • Explain the new valtree system for type level constants. #1097

Backport nominations

T-compiler stable / T-compiler beta

  • :beta: “Fix some typos in arg checking algorithm” rust#97303
    • Fixes rust#97197, P-medium ICE
    • patch authored and nominated for backport by @Michael Goulet (compiler-errors)
  • :beta: “rustc: Fix ICE in native library error reporting” rust#97328
  • :stable: “rustc: Fix ICE in native library error reporting” rust#97328
    • backport nomination of previous regression

T-rustdoc beta / T-rustdoc stable

  • No backport nominations for T-rustdoc this time.

:back: / :shrug: / :hand:

PRs S-waiting-on-team

T-compiler

  • No PRs waiting on T-compiler this time.

Oldest PRs waiting for review

T-compiler

  • “Mir-Opt for copying enums with large discrepancies” rust#85158 (last review activity: 2 months ago)
  • “Only compile #[used] as llvm.compiler.used for ELF targets” rust#93718 (last review activity: about 41 days ago)
    • PR seems ready for another round of review cc: @pnkfelix
  • “Micro-optimize InferCtxt::replace_bound_vars_with_placeholders by avoiding unnecessary allocation” rust#96021 (last review activity: about 35 days ago)
    • rust highfive bot assigned to @nnethercote, reroll dice?
  • “libcore: Add iter::from_generator which is like iter::from_fn, but for coroutines instead of functions” rust#96298 (last review activity: about 32 days ago)
    • part of PR may be of interest for T-compiler, assign a reviewer for that?
  • “TypeId: use a (v0) mangled type to remain sound in the face of hash collisions.” rust#95845 (last review activity: about 31 days ago)
    • last review from @lcnr end of april (comment)
    • after that, lengthy discussion - unsure if still in flux or any actionable available (maybe add a summary?)

Issues of Note

Short Summary

P-critical

T-compiler

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

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

triage logs for 2022-05-24

Overall a positive week for non-incremental performance (roughly 0.5% faster), with >1% regressions on incremental benchmarks, primarily due to #95563, which will hopefully be investigated in the coming weeks.

Triage done by @simulacrum. Revision range: 7355d971a954ed63293e4191f6677f60c1bc07d9..43d9f3859e0204e764161ee085a360274b5f3e9a

Regressions (primary) Regressions (secondary) Improvements (primary) Improvements (secondary) All (primary)
count 69 58 76 52 145
mean 1.5% 2.2% -1.0% -3.3% 0.2%
max 5.1% 7.3% -2.9% -36.9% 5.1%

2 Regressions, 5 Improvements, 4 Mixed; 0 of them in rollups 57 artifact comparisons made in total

Regressions

Transition to valtrees pt1 #97019 (Comparison Link)

Regressions (primary) Regressions (secondary) Improvements (primary) Improvements (secondary) All (primary)
count 4 5 0 0 4
mean 1.0% 0.1% N/A N/A 1.0%
max 1.1% 0.1% N/A N/A 1.1%

@oli-obk has suggested applying some targeted inlining as a likely resolution to the regressions; work to follow up needs to be done. It seems like the regression is likely to be resolved (or at least effort applied to do so).

Make write/print macros eagerly drop temporaries #96455 (Comparison Link)

Regressions (primary) Regressions (secondary) Improvements (primary) Improvements (secondary) All (primary)
count 3 0 0 0 3
mean 0.4% N/A N/A N/A 0.4%
max 0.6% N/A N/A N/A 0.6%

Change is relatively minor and limited to just a single benchmark, so marking the regression as triaged; further investigation is not warranted at this time.

Improvements

Add PID to PGO profile data filename #97110 (Comparison Link)

Regressions (primary) Regressions (secondary) Improvements (primary) Improvements (secondary) All (primary)
count 0 0 94 54 94
mean N/A N/A -0.3% -0.4% -0.3%
max N/A N/A -0.5% -1.2% -0.5%

An expected improvement in our PGO scripts, with a small magnitude effect across many benchmarks.

–remap-path-prefix: Fix duplicated path components in debuginfo #96867 (Comparison Link)

Regressions (primary) Regressions (secondary) Improvements (primary) Improvements (secondary) All (primary)
count 0 0 2 6 2
mean N/A N/A -0.4% -4.1% -0.4%
max N/A N/A -0.4% -4.7% -0.4%

Improvements likely to be primarily driven by reducing the amount of codegen due to simpler/smaller debuginfo.

rustdoc: Reduce clean::Type size #93963 (Comparison Link)

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

rustc_parse: Move AST -> TokenStream conversion logic to rustc_ast #97251 (Comparison Link)

Regressions (primary) Regressions (secondary) Improvements (primary) Improvements (secondary) All (primary)
count 0 0 6 7 6
mean N/A N/A -0.3% -0.5% -0.3%
max N/A N/A -0.4% -0.6% -0.4%

Refactor call terminator to always include destination place #96098 (Comparison Link)

Regressions (primary) Regressions (secondary) Improvements (primary) Improvements (secondary) All (primary)
count 0 0 5 17 5
mean N/A N/A -0.3% -0.5% -0.3%
max N/A N/A -0.4% -1.1% -0.4%

Mixed

Add a query for checking whether a function is an intrinsic. #97012 (Comparison Link)

Regressions (primary) Regressions (secondary) Improvements (primary) Improvements (secondary) All (primary)
count 7 9 16 2 23
mean 0.3% 0.3% -0.3% -0.5% -0.1%
max 0.3% 0.4% -0.5% -0.5% -0.5%

Mixed results, but overall looks to be pretty neutral. The preparation for future maintainability outweighs the possible small cost to keeping this change. Regression was already marked as triaged by @oli-obk (thank you!).

Cache more queries on disk #95418 (Comparison Link)

Regressions (primary) Regressions (secondary) Improvements (primary) Improvements (secondary) All (primary)
count 33 32 65 28 98
mean 0.8% 1.6% -1.0% -4.4% -0.4%
max 2.1% 4.0% -3.6% -33.0% -3.6%

This is overall an improvement, with regressions primarily limited to secondary benchmarks. Mixed results are fairly expected from a change like this; marking the regression as triaged. @cjgillot (PR author) also posted a good summary:

This PR caches many more queries' results on disk. The queries have been chosen to be: (1) outputs of typechecking, and (2) parts of metadata. This caching allows for wide and large compile time savings, up to 36%. The tradeoff is a compile time increase (4%) when these caches cannot be usefully used, and a increased on-disk size around 30%.

Move the extended lifetime resolution into typeck context #95563 (Comparison Link)

Regressions (primary) Regressions (secondary) Improvements (primary) Improvements (secondary) All (primary)
count 97 42 42 34 139
mean 1.8% 3.0% -0.6% -0.5% 1.1%
max 5.8% 8.9% -1.9% -1.4% 5.8%

Looks like a fairly large regression across a number of benchmarks, though limited to the incremental scenarios. Non-incremental benchmarks show an improvement (hence the mixed results). Left a comment on the PR asking for clarification and further investigation.

Update rustc PGO benchmark list #97120 (Comparison Link)

Regressions (primary) Regressions (secondary) Improvements (primary) Improvements (secondary) All (primary)
count 3 18 83 53 86
mean 0.3% 0.8% -0.5% -0.5% -0.5%
max 0.4% 1.8% -1.3% -1.1% -1.3%

Overall an improvement, some slight regressions are expected from a larger change like this which bumps PGO inputs.

Nominated Issues

T-compiler

  • “Change enum->int casts to not go through MIR casts.” rust#96862
    • nominated by @RalfJ (T-compiler specifically for first point in comment)

RFC

  • “New rustc and Cargo options to allow path sanitisation by default” rfcs#3127
    • nominated by @matklad in response to this comment from @Andy Wang asking T-compiler an opinion about the implementation

Next week’s WG checkins

  • @_WG-traits (impl trait) by @nikomatsakis @oli
  • @_WG-llvm by @nagisa and @Nikita Popov