Skip to content
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

WIP: move const prop lints before borrowck #115756

Closed
wants to merge 3 commits into from

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Sep 11, 2023

r? @ghost

for this we need to stop revealing hidden types during const prop

and for that I'm opening this WIP PR to do some perf runs

…oking the query

This allows us to have full control over whether `layout_of` may reveal hidden types
The r-a vscode extension has started `cd`-ing into the current crate's root directory, and then invoking rustfmt. But our rustfmt path is relative, and was then not available.
@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) 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 Sep 11, 2023
@oli-obk
Copy link
Contributor Author

oli-obk commented Sep 11, 2023

@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 Sep 11, 2023
@bors
Copy link
Contributor

bors commented Sep 11, 2023

⌛ Trying commit b241641 with merge 7ea1d3c...

bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 11, 2023
WIP: move const prop lints before borrowck

r? `@ghost`

for this we need to stop revealing hidden types during const prop

and for that I'm opening this WIP PR to do some perf runs
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-tools failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
.................................................................................................... 300
.................................................................................................... 400
..........................................................
tests/fail/layout_cycle.rs FAILED:
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/miri" "--error-format=json" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--target" "x86_64-unknown-linux-gnu" "--extern" "getrandom=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui/miri/x86_64-unknown-linux-gnu/debug/deps/libgetrandom-d7a4052c69114fb5.rlib" "--extern" "getrandom=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui/miri/x86_64-unknown-linux-gnu/debug/deps/libgetrandom-d7a4052c69114fb5.rmeta" "--extern" "getrandom_1=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui/miri/x86_64-unknown-linux-gnu/debug/deps/libgetrandom-5991f5d440f70ef3.rlib" "--extern" "getrandom_1=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui/miri/x86_64-unknown-linux-gnu/debug/deps/libgetrandom-5991f5d440f70ef3.rmeta" "--extern" "libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui/miri/x86_64-unknown-linux-gnu/debug/deps/liblibc-be8bd72d0542ae04.rlib" "--extern" "libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui/miri/x86_64-unknown-linux-gnu/debug/deps/liblibc-be8bd72d0542ae04.rmeta" "--extern" "num_cpus=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui/miri/x86_64-unknown-linux-gnu/debug/deps/libnum_cpus-a80677ae50b20308.rlib" "--extern" "num_cpus=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui/miri/x86_64-unknown-linux-gnu/debug/deps/libnum_cpus-a80677ae50b20308.rmeta" "--extern" "rand=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui/miri/x86_64-unknown-linux-gnu/debug/deps/librand-e12fe57f7c618d0e.rlib" "--extern" "rand=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui/miri/x86_64-unknown-linux-gnu/debug/deps/librand-e12fe57f7c618d0e.rmeta" "--extern" "page_size=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui/miri/x86_64-unknown-linux-gnu/debug/deps/libpage_size-803279deabcf4836.rlib" "--extern" "page_size=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui/miri/x86_64-unknown-linux-gnu/debug/deps/libpage_size-803279deabcf4836.rmeta" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui/miri/x86_64-unknown-linux-gnu/debug/deps/libtokio-603931411f1c023e.rlib" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui/miri/x86_64-unknown-linux-gnu/debug/deps/libtokio-603931411f1c023e.rmeta" "--extern" "miri_test_deps=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui/miri/x86_64-unknown-linux-gnu/debug/miri-test-deps" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui/miri/debug/build/proc-macro2-7355c72729c2ad6f" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui/miri/x86_64-unknown-linux-gnu/debug/deps" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui/miri/debug/build/libc-2918892fb0531a5b" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui/miri/x86_64-unknown-linux-gnu/debug" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui/miri/debug/build/syn-cf93ee47d0aaea1b" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui/miri/debug/build/lock_api-d760b7744004939a" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui/miri/debug/build/quote-b08851073e1a2b12" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui/miri/debug/build/parking_lot_core-9bdeebce5fa9e654" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui/miri/debug/build/tokio-0abef059fb4058da" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui/miri/debug/build/memchr-27ff70bb6751a99e" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui/miri/debug/build/log-0ca1ad2c2013013e" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui/miri/debug/build/getrandom-411106a7d83e1c5b" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui/miri/debug/deps" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui" "tests/fail/layout_cycle.rs" "--edition" "2021"

actual output differed from expected
actual output differed from expected
Execute `./miri test --bless` to update `tests/fail/layout_cycle.stderr` to the actual output
--- tests/fail/layout_cycle.stderr
+++ <stderr output>
 error[E0391]: cycle detected when computing layout of `S<S<()>>`
    |
-   = note: ...which requires computing layout of `<S<()> as Tr>::I`...
-   = note: ...which again requires computing layout of `S<S<()>>`, completing the cycle
+   = note: ...which immediately requires computing layout of `S<S<()>>` again
    = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
... 24 lines skipped ...


full stderr:
full stderr:
error[E0391]: cycle detected when computing layout of `S<S<()>>`
   |
   = note: ...which immediately requires computing layout of `S<S<()>>` again
   = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information

error: post-monomorphization error: a cycle occurred during layout computation
   |
LL |     intrinsics::size_of::<T>()
LL |     intrinsics::size_of::<T>()
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ a cycle occurred during layout computation
   |
   = note: inside `std::mem::size_of::<S<S<()>>>` at /checkout/library/core/src/mem/mod.rs:313:5: 313:31
note: inside `foo::<S<()>>`
   |
   |
LL |     mem::size_of::<S<T>>()
note: inside `main`
  --> tests/fail/layout_cycle.rs:27:20
   |
   |
LL |     println!("{}", foo::<S<()>>());

note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

error: aborting due to 2 previous errors
---
test result: FAIL. 1 tests failed, 454 tests passed, 3 ignored, 0 filtered out
Error: 
   0: tests failed

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

Caused by:
  process didn't exit successfully: `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/compiletest-35881ecbf657b161 --quiet` (exit status: 1)
Build completed unsuccessfully in 0:02:58

@bors
Copy link
Contributor

bors commented Sep 11, 2023

☀️ Try build successful - checks-actions
Build commit: 7ea1d3c (7ea1d3ca4bc01f749af5f204034c423373653fda)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (7ea1d3c): comparison URL.

Overall result: ❌✅ regressions and improvements - 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.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

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

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
Regressions ❌
(secondary)
3.0% [0.4%, 14.8%] 33
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.4% [-0.5%, -0.3%] 6
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results

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.6% [2.6%, 2.6%] 1
Improvements ✅
(primary)
-1.7% [-1.9%, -1.4%] 2
Improvements ✅
(secondary)
-2.2% [-5.0%, -0.7%] 4
All ❌✅ (primary) -1.7% [-1.9%, -1.4%] 2

Cycles

Results

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)
9.5% [9.2%, 9.7%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.0% [-3.6%, -2.4%] 5
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 629.551s -> 629.748s (0.03%)
Artifact size: 317.53 MiB -> 317.36 MiB (-0.05%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Sep 11, 2023
@oli-obk oli-obk closed this Sep 12, 2023
@oli-obk oli-obk deleted the early_const_prop_lint branch October 23, 2023 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) perf-regression Performance regression. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants