Skip to content

Ensure constants are WF before calling into CTFE #137972

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

BoxyUwU
Copy link
Member

@BoxyUwU BoxyUwU commented Mar 4, 2025

Fixes #127643
Fixes #131046
Fixes #131406
Fixes #133066
Fixes #137813
Fixes #136894
Fixes #135617

I'll write a PR desc for this tommorow

r? @ghost

@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. labels Mar 4, 2025
@compiler-errors
Copy link
Member

@bors try @rust-timer queue

(even if perf is bad we should still land something like this, i just want to know if we should look into a fast-path for consts with no predicates or something)

@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 Mar 4, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 4, 2025
…try>

Ensure constants are WF before calling into CTFE

Fixes rust-lang#127643
Fixes rust-lang#131046
Fixes rust-lang#131406
Fixes rust-lang#133066

I'll write a PR desc for this tommorow

r? `@ghost`
@bors
Copy link
Collaborator

bors commented Mar 4, 2025

⌛ Trying commit f770b29 with merge 4cbf2ca...

@bors
Copy link
Collaborator

bors commented Mar 4, 2025

☀️ Try build successful - checks-actions
Build commit: 4cbf2ca (4cbf2caac854e029139f36a69fee8be4648333a7)

@rust-timer

This comment has been minimized.

@BoxyUwU
Copy link
Member Author

BoxyUwU commented Mar 4, 2025

I don't think this actually takes any effect on stable so i dont think a perf run will show anything ^^' and there's already a fast path for no preds so would have to remove that before a perf run to get actual info

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (4cbf2ca): comparison URL.

Overall result: ❌ regressions - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

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

Max RSS (memory usage)

Results (primary 3.0%, secondary 1.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)
3.0% [3.0%, 3.0%] 1
Regressions ❌
(secondary)
1.4% [1.4%, 1.4%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.0% [3.0%, 3.0%] 1

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 773.808s -> 773.59s (-0.03%)
Artifact size: 361.97 MiB -> 361.99 MiB (0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 4, 2025
@compiler-errors
Copy link
Member

noise

@bors rollup=maybe

@compiler-errors
Copy link
Member

actually, ctfe stress test lol

maybe not noise 🤔

@BoxyUwU
Copy link
Member Author

BoxyUwU commented Mar 4, 2025

idk what could have caused it lol, the only stable affecting change here should be that we check an extra feature gate or two.. which seems ridiculous for it to cause a 0.5% perf regression lol

@BoxyUwU BoxyUwU force-pushed the ty_const_wf_before_eval branch from f770b29 to d2152f4 Compare March 4, 2025 18:53
@BoxyUwU
Copy link
Member Author

BoxyUwU commented Mar 4, 2025

@bors try @rust-timer queue

redoing perf but without the fast-path and also not skipped for repeat-exprs

@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 Mar 4, 2025
@bors
Copy link
Collaborator

bors commented Mar 4, 2025

⌛ Trying commit d2152f4 with merge efc52dd...

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 4, 2025
…try>

Ensure constants are WF before calling into CTFE

Fixes rust-lang#127643
Fixes rust-lang#131046
Fixes rust-lang#131406
Fixes rust-lang#133066

I'll write a PR desc for this tommorow

r? `@ghost`
@bors
Copy link
Collaborator

bors commented Mar 4, 2025

☀️ Try build successful - checks-actions
Build commit: efc52dd (efc52dd16f1ef3064cac12292a24e76cfb8446f2)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (efc52dd): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.3% [-0.3%, -0.3%] 1
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -1.6%, secondary -1.7%)

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)
2.5% [2.5%, 2.5%] 1
Improvements ✅
(primary)
-1.6% [-1.6%, -1.6%] 1
Improvements ✅
(secondary)
-2.5% [-3.0%, -2.0%] 6
All ❌✅ (primary) -1.6% [-1.6%, -1.6%] 1

Cycles

Results (secondary -3.6%)

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)
1.5% [1.5%, 1.5%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-6.2% [-6.2%, -6.1%] 2
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: missing data
Artifact size: 362.04 MiB -> 362.12 MiB (0.02%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 4, 2025
@BoxyUwU
Copy link
Member Author

BoxyUwU commented Mar 4, 2025

ok I think it was just entirely spurrious regression the previous perf run, and also we in general do not need a fast path for empty preds

@BoxyUwU BoxyUwU force-pushed the ty_const_wf_before_eval branch from d2152f4 to 32aff32 Compare March 6, 2025 01:30
@rustbot rustbot added the PG-exploit-mitigations Project group: Exploit mitigations label Mar 6, 2025
@BoxyUwU BoxyUwU force-pushed the ty_const_wf_before_eval branch from 32aff32 to 5f88c8c Compare March 6, 2025 02:29
@BoxyUwU BoxyUwU removed the PG-exploit-mitigations Project group: Exploit mitigations label Mar 6, 2025
@craterbot
Copy link
Collaborator

🎉 Experiment pr-137972 is completed!
📊 6 regressed and 13 fixed (597764 total)
📰 Open the full report.

⚠️ If you notice any spurious failure please add them to the denylist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-crater Status: Waiting on a crater run to be completed. labels Mar 15, 2025
@BoxyUwU
Copy link
Member Author

BoxyUwU commented Mar 16, 2025

(2 real regressions, both in code using feature(generic_const_exprs). so this change has no stable affecting breakage in practice even though theoretically breaking.)

@bors
Copy link
Collaborator

bors commented Apr 2, 2025

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

@BoxyUwU
Copy link
Member Author

BoxyUwU commented Apr 2, 2025

ah right i need to finish this PR off..

@BoxyUwU BoxyUwU force-pushed the ty_const_wf_before_eval branch from c15f5a9 to 93e48fd Compare April 14, 2025 15:34
@rust-log-analyzer

This comment has been minimized.

@BoxyUwU BoxyUwU force-pushed the ty_const_wf_before_eval branch 2 times, most recently from 335a964 to ffdfbca Compare April 14, 2025 16:20
Comment on lines +24 to +26
// FIXME(BoxyUwU) FIXME(min_generic_const_args): I could not figure out how to write a test for this
// as we don't currently support constants in the type system with impossible predicates. It may become
// possible once `min_generic_const_args` has progressed more.
Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe this is possible with GCE? I don't really want to write a load bearing GCE test lol

@rust-log-analyzer

This comment has been minimized.

@BoxyUwU BoxyUwU force-pushed the ty_const_wf_before_eval branch from ffdfbca to a5ed0a7 Compare April 14, 2025 18:23
@BoxyUwU BoxyUwU force-pushed the ty_const_wf_before_eval branch from a5ed0a7 to d5a2707 Compare April 15, 2025 14:19
@rust-log-analyzer

This comment has been minimized.

@BoxyUwU BoxyUwU force-pushed the ty_const_wf_before_eval branch from 962bddf to 376ff5d Compare April 15, 2025 18:21
@BoxyUwU BoxyUwU closed this Apr 16, 2025
@BoxyUwU
Copy link
Member Author

BoxyUwU commented Apr 16, 2025

I think mgca is just going to accidentally fix this once type system norm is implemented as we'll wind up with fully concrete anon consts to norm to and evaluate 🤔

@BoxyUwU BoxyUwU reopened this Apr 23, 2025
@BoxyUwU
Copy link
Member Author

BoxyUwU commented Apr 23, 2025

I changed my mind...

@compiler-errors
Copy link
Member

meow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. PG-exploit-mitigations Project group: Exploit mitigations 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
7 participants