Skip to content

Implement new effects desugaring - #120639

Merged
bors merged 10 commits into
rust-lang:masterfrom
fee1-dead-contrib:new-effects-desugaring
Jun 29, 2024
Merged

Implement new effects desugaring#120639
bors merged 10 commits into
rust-lang:masterfrom
fee1-dead-contrib:new-effects-desugaring

Conversation

@fee1-dead

@fee1-dead fee1-dead commented Feb 4, 2024

Copy link
Copy Markdown
Member

cc @rust-lang/project-const-traits.

Notes for the new desugaring: https://hackmd.io/@beef/HJyX7wF70

  • See if we want T: Tr to desugar into T: Tr, T::Effects: Compat<true>
  • Fix ICEs on type Assoc: ~const Tr and type Assoc<T: ~const Tr>
  • add types and traits to minicore test
  • update rustc-dev-guide

Fixes #119717
Fixes #123664
Fixes #124857
Fixes #126148

@rustbot

rustbot commented Feb 4, 2024

Copy link
Copy Markdown
Collaborator

r? @oli-obk

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added 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 Feb 4, 2024
@rust-log-analyzer

This comment has been minimized.

None => {}
}

// effects desugared associated types have no bounds.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could feed this query.

Also: don't we need a where Self: Sized bound to avoid breaking all dyn Trait for now?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assoc types don't break object safety (we'd just need to make it default to Runtime)

what breaks object safety would probably be the const host: bool that we now insert onto each method.

@bors

bors commented Feb 6, 2024

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #120392) made this pull request unmergeable. Please resolve the merge conflicts.

@rust-log-analyzer

This comment has been minimized.

@fee1-dead
fee1-dead force-pushed the new-effects-desugaring branch from e6fa893 to 532300c Compare February 10, 2024 10:05
@rust-log-analyzer

This comment has been minimized.

@bors

bors commented Feb 13, 2024

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #120991) made this pull request unmergeable. Please resolve the merge conflicts.

@fee1-dead
fee1-dead force-pushed the new-effects-desugaring branch from 532300c to d42b128 Compare February 26, 2024 00:30
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@fee1-dead

Copy link
Copy Markdown
Member Author

This PR changes T: Tr where Tr is #[const_trait] to also lower into an additional bound of <T as Tr>::{opaque}: Compat<true>. That means potentially more work for the trait solver. Let's see what the perf impact is like, as right now we have Add as a #[const_trait]

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 26, 2024
@fee1-dead

Copy link
Copy Markdown
Member Author

@bors try

@bors

bors commented Feb 26, 2024

Copy link
Copy Markdown
Collaborator

⌛ Trying commit f1cd746 with merge c5d6267...

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@bors

bors commented Feb 26, 2024

Copy link
Copy Markdown
Collaborator

💔 Test failed - checks-actions

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 26, 2024
@rustbot rustbot added the A-rustdoc-json Area: Rustdoc JSON backend label Feb 27, 2024
@fee1-dead

Copy link
Copy Markdown
Member Author

@bors try @rust-timer queue

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (ba1d7f4): comparison URL.

Overall result: ❌ regressions - ACTION NEEDED

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.3% [0.2%, 0.6%] 72
Regressions ❌
(secondary)
0.4% [0.1%, 0.9%] 24
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.3% [0.2%, 0.6%] 72

Max RSS (memory usage)

Results (primary -0.1%, secondary 3.4%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.8% [0.8%, 0.8%] 1
Regressions ❌
(secondary)
3.4% [3.0%, 3.8%] 3
Improvements ✅
(primary)
-1.0% [-1.0%, -1.0%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.1% [-1.0%, 0.8%] 2

Cycles

Results (secondary -8.2%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-8.2% [-8.5%, -8.0%] 2
All ❌✅ (primary) - - 0

Binary size

Results (primary 0.1%, secondary 0.4%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.1% [0.0%, 0.4%] 93
Regressions ❌
(secondary)
0.4% [0.0%, 0.5%] 33
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [0.0%, 0.4%] 93

Bootstrap: 697.982s -> 695.844s (-0.31%)
Artifact size: 324.48 MiB -> 324.63 MiB (0.05%)

@rustbot rustbot added the perf-regression Performance regression. label Jun 29, 2024
@fee1-dead

Copy link
Copy Markdown
Member Author

Opened #127144 as an attempt to fix the performance regression

@pnkfelix

pnkfelix commented Jul 2, 2024

Copy link
Copy Markdown
Contributor

Visiting for weekly rustc perf triage.

  • Biggest (>=0.4%) primary regressions: regex, bitmaps, typenum, stm32f4, exa. (19 variants of those five benchmarks.)
  • the PR author (fee1-dead) has made a couple follow-up attempts to address the regressions, but nothing has hit yet.
  • not marking as triaged, in order to encourage addressing the regressions. (note however: the cycles:u metric didn't regress, at least not past our noise-filtering significance threshold. Nor did task-clock:u. It is not totally clear how much effort is warranted here, apart from a desire to keep the instruction count low just because that is our most stable proxy for "computational effort")

@fee1-dead fee1-dead mentioned this pull request Aug 25, 2024
14 tasks
@fee1-dead fee1-dead added the F-const_trait_impl `#![feature(const_trait_impl)]` label Jul 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-rustdoc-json Area: Rustdoc JSON backend F-const_trait_impl `#![feature(const_trait_impl)]` merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

10 participants