Skip to content

Suppress errors in const eval during trait selection #92653

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

Closed
wants to merge 12 commits into from

Conversation

b-naber
Copy link
Contributor

@b-naber b-naber commented Jan 7, 2022

Continues the work of #81339

Addressed most of the points that were raised in the previous PR. The main worry in the previous implementation was the duplication of query results that only differed in their Reveal type and the resulting duplication for on disk encoding, this should be solved by the current implementation.

On the other hand, this adds quite a bit of complexity, especially on the error reporting side, since cached errors with Reveal::Selection can now be used by Reveal::UserFacing to report an error. I'm not sure whether this is worth it (or whether this actually improves performance for that matter). Could also use better abstractions for hiding the deduplication logic in the trait selection code, but I'd like to wait for perf results before investing more time.

This needs a perf-run, if anybody reading this could request one that'd be great.

r? @oli-obk

cc @lcnr @RalfJung

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jan 7, 2022
@rust-highfive
Copy link
Contributor

Some changes occured to the CTFE / Miri engine

cc @rust-lang/miri

Some changes occured to rustc_codegen_cranelift

cc @bjorn3

Some changes occured to the CTFE / Miri engine

cc @rust-lang/miri

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 7, 2022
@rust-log-analyzer

This comment has been minimized.

@b-naber b-naber force-pushed the const-eval-no-errs branch from 81b24e5 to 614301a Compare January 7, 2022 19:57
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer
Copy link
Collaborator

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
configure: rust.debug-assertions := True
configure: rust.overflow-checks := True
configure: llvm.assertions      := True
configure: dist.missing-tools   := True
configure: build.configure-args := ['--enable-sccache', '--disable-manage-submodu ...
configure: writing `config.toml` in current directory
configure: 
configure: run `python /checkout/x.py --help`
configure: 
---
skip untracked path src/llvm-project/ during rustfmt invocations
Diff in /checkout/compiler/rustc_codegen_cranelift/src/constant.rs at line 65:
                             );
                         }
                         ErrorHandled::Silent(_) => {
-                            span_bug!(
-                                constant.span,
-                                "codegen encountered silent error",
-                            );
+                            span_bug!(constant.span, "codegen encountered silent error",);
                     }
                 }
                 }
Running `"/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/rustfmt" "--config-path" "/checkout" "--edition" "2018" "--unstable-features" "--skip-children" "--check" "/checkout/compiler/rustc_codegen_cranelift/src/pretty_clif.rs" "/checkout/compiler/rustc_codegen_cranelift/src/constant.rs" "/checkout/compiler/rustc_codegen_cranelift/src/unsize.rs" "/checkout/compiler/rustc_codegen_cranelift/src/trap.rs" "/checkout/compiler/rustc_codegen_cranelift/src/debuginfo/unwind.rs" "/checkout/compiler/rustc_codegen_cranelift/build_sysroot/src/lib.rs" "/checkout/compiler/rustc_codegen_cranelift/src/debuginfo/line_info.rs" "/checkout/compiler/rustc_codegen_cranelift/src/cast.rs"` failed.
If you're running `tidy`, try again with `--bless`. Or, if you just want to format code, run `./x.py fmt` instead.

@RalfJung
Copy link
Member

RalfJung commented Jan 7, 2022 via email

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 7, 2022
@bors
Copy link
Collaborator

bors commented Jan 7, 2022

⌛ Trying commit bbfaef6 with merge 7229268871b1d61e92f9b7c1e49da8560ab48bb7...

@bors
Copy link
Collaborator

bors commented Jan 7, 2022

☀️ Try build successful - checks-actions
Build commit: 7229268871b1d61e92f9b7c1e49da8560ab48bb7 (7229268871b1d61e92f9b7c1e49da8560ab48bb7)

@rust-timer
Copy link
Collaborator

Queued 7229268871b1d61e92f9b7c1e49da8560ab48bb7 with parent e012a19, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (7229268871b1d61e92f9b7c1e49da8560ab48bb7): comparison url.

Summary: This change led to very large relevant mixed results 🤷 in compiler performance.

  • Moderate improvement in instruction counts (up to -1.1% on incr-full builds of coercions)
  • Very large regression in instruction counts (up to 12.0% on incr-full builds of issue-46449)

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

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 led 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-review -S-waiting-on-perf +perf-regression

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jan 8, 2022
@b-naber
Copy link
Contributor Author

b-naber commented Jan 8, 2022

Closing in favor of #92674

@b-naber b-naber closed this Jan 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

9 participants