-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Do not use global caches if opaque types can be defined #126024
Do not use global caches if opaque types can be defined #126024
Conversation
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
…ound_yay, r=<try> Do not use global cache for selection candidates if opaque types can be constrained fixes rust-lang#105787 r? `@ghost` This is certainly the crudest way to make the cache sound wrt opaque types, but if perf lets us get away with this, let's do it in the old solver and let the new solver fix this correctly once and for all. If perf is prohibitively bad, I'll look into alternatives (using canonical queries, checking whether any opaque types got constrained or whether decisions based on the availability of opaque types were made, ..) cc rust-lang#122192 (comment)
This comment has been minimized.
This comment has been minimized.
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (22162a8): comparison URL. Overall result: ❌ regressions - ACTION NEEDEDBenchmarking 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 @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)Results (secondary 4.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.
CyclesResults (primary -0.7%, secondary 3.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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 667.402s -> 668.179s (0.12%) |
0714168
to
319843a
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
…ound_yay, r=<try> Do not use global cache for selection candidates if opaque types can be constrained fixes rust-lang#105787 r? `@ghost` This is certainly the crudest way to make the cache sound wrt opaque types, but if perf lets us get away with this, let's do it in the old solver and let the new solver fix this correctly once and for all. If perf is prohibitively bad, I'll look into alternatives (using canonical queries, checking whether any opaque types got constrained or whether decisions based on the availability of opaque types were made, still using the cache for things that can't possibly constrain opaque types (probably sound, famous last words), ..) cc rust-lang#122192 (comment) * [ ] check if this actually fixes rust-lang#105787 or if it just fixes the opaque type reproducer
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (56d23c2): comparison URL. Overall result: ❌ regressions - no action neededBenchmarking 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 Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)Results (primary -2.5%)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.
CyclesResults (secondary -0.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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 666.65s -> 668.05s (0.21%) |
this is unfortunately still not tracking the current hidden type for the opaque afaict: Have you tried entirely disabling the global cache, only using the one local to the current |
That would require duplicating the cache data structures, but i'll give it a shot. Just disabling caching entirely was too bad to land #126024 (comment) |
Huh? only in reveal all mode, where it doesn't matter anyway. We don't use the hidden type in projections in the old solver iirc |
rust/compiler/rustc_trait_selection/src/traits/project.rs Lines 271 to 276 in 2d28b63
|
This includes changes to unblock merging rust-lang#126024.
…r=<try> Bump Fuchsia This includes changes to unblock merging rust-lang#126024. try-job: x86_64-fuchsia
…r=Kobzol Bump Fuchsia This includes changes to unblock merging rust-lang#126024. try-job: x86_64-fuchsia
#128127 was merged. |
221ae5e
to
61b5e11
Compare
@bors r=lcnr |
☀️ Test successful - checks-actions |
Finished benchmarking commit (2ccafed): comparison URL. Overall result: ❌ regressions - ACTION NEEDEDNext Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesResults (primary 2.6%, secondary 4.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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 771.472s -> 772.807s (0.17%) |
Hmm... I forgot to rerun perf... But, this PR does fix a lingering soundness issue that we just don't have a reproduction for. The caches are now sound, but not used globally if an item has opaques. That's obviously a bulldozing way of solving this issue, but I'm not sure we can fix it in a robust way in the old solver. |
This is to unblock an upstream change: rust-lang/rust#126024 Change-Id: I4e1c0b2ba35da81c9e2c6e3ae3e07fa8db1a48a1 Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1082793 Reviewed-by: James Robinson <jamesr@google.com> Reviewed-by: Tyler Mandry <tmandry@google.com> Commit-Queue: Auto-Submit <auto-submit@fuchsia-infra.iam.gserviceaccount.com> Reviewed-by: Marie Janssen <jamuraa@google.com> Fuchsia-Auto-Submit: Julia Ryan <pineapple@google.com>
This is a follow-up to I4e1c0b2ba35da81c9e2c6e3ae3e07fa8db1a48a1 to increase the recursion limit in more places to unblock the upstream change rust-lang/rust#126024. Test: full build with custom Rust toolchain including the PR Change-Id: Ia0b9ee4d53c00a94864a50190973f48515d2f76d Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1087892 Commit-Queue: Mitchell Kember <mkember@google.com> Reviewed-by: James Robinson <jamesr@google.com> Reviewed-by: Tyler Mandry <tmandry@google.com>
This is a follow-up to I4e1c0b2ba35da81c9e2c6e3ae3e07fa8db1a48a1 to increase the recursion limit in more places to unblock the upstream change rust-lang/rust#126024. Test: full build with custom Rust toolchain including the PR Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1087892 Original-Revision: 577138b8eed9d4a9737c4d644db16f601be69362 GitOrigin-RevId: 96bea561bbfb8776e33b00a4e8c05ae38ad0775d Change-Id: I240d5f70e3663fd6690e2acf6f42e622e7450475
Hmm... this PR claims that it fixes #119272 , but the ICE listed there is still occurring on nightly. Is the idea that there is an unsoundness that is somehow being illustrated by the test case in that issue, and this PR is addressing that unsoundness (via a blunt hammer) while the ICE itself is still not addressed? (Or was the wrong issue simply linked here?) |
…, r=lcnr Only disable cache if predicate has opaques within it This is an alternative to rust-lang#132075. This refines the check implemented in rust-lang#126024 to only disable the global cache if the predicate being considered has opaques in it. This is still theoretically unsound, since goals can indirectly rely on opaques in the defining scope, but we're much less likely to hit it. It doesn't totally fix rust-lang#132064: for example, `lemmy` goes from 1:29 (on rust 1.81) to 9:53 (on nightly) to 4:07 (after this PR). But I think it's at least *more* sound than a total revert :/ r? lcnr
fixes #119272
r? @lcnr
This is certainly a crude way to make the cache sound wrt opaque types, but since perf lets us get away with this, let's do it in the old solver and let the new solver fix this correctly once and for all.
cc #122192 (comment)