Skip to content

Apply nested goals certainty to InspectGoals for normalizes-to - #142127

Merged
bors merged 1 commit into
rust-lang:masterfrom
compiler-errors:nested-goals-certainty
Jun 12, 2025
Merged

Apply nested goals certainty to InspectGoals for normalizes-to#142127
bors merged 1 commit into
rust-lang:masterfrom
compiler-errors:nested-goals-certainty

Conversation

@compiler-errors

Copy link
Copy Markdown
Contributor

...so that normalizes-to goals don't have Certainty::Yes even if they have nested goals which don't hold.

r? lcnr

@rustbotrustbot 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Jun 6, 2025
@rustbot

Copy link
Copy Markdown
Collaborator

Some changes occurred to the core trait solver

cc @rust-lang/initiative-trait-system-refactor

This PR changes a file inside tests/crashes. If a crash was fixed, please move into the corresponding ui subdir and add 'Fixes #' to the PR description to autoclose the issue upon merge.

@compiler-errors
compiler-errorsforce-pushed the nested-goals-certainty branch from 9eb62ee to 19be2d3CompareJune 6, 2025 17:33
Comment threadcompiler/rustc_trait_selection/src/solve/inspect/analyse.rs
Comment threadtests/crashes/140571.rs Outdated
@@ -1,14 +0,0 @@
//@ known-bug: #140571

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

This test was coincidentally fixed, but not for a particularly good reason. It's properly fixed in #142126.

@compiler-errors

Copy link
Copy Markdown
ContributorAuthor

@bors2 try @rust-timer queue

Even if perf is bad, we still definitely need to do this for proof trees not to be wrong.

@rust-timer

This comment has been minimized.

@rust-bors

rust-borsBot commented Jun 6, 2025

Copy link
Copy Markdown
Contributor

⌛ Trying commit 19be2d3 with merge 7cf36c7

To cancel the try build, run the command @bors2 try cancel.

rust-borsBot added a commit that referenced this pull request Jun 6, 2025
Apply nested goals certainty to `InspectGoals` for normalizes-to
...so that normalizes-to goals don't have `Certainty::Yes` even if they have nested goals which don't hold.
r? lcnr
@rustbotrustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 6, 2025
@compiler-errors

Copy link
Copy Markdown
ContributorAuthor

Blocking this on #142085 so that I can remove the hack it introduces for normalizes-to goals.

@rust-bors

rust-borsBot commented Jun 6, 2025

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 7cf36c7 (7cf36c7d59c354b06abb77c533b6a03fc4568472)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (7cf36c7): 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.

meanrangecount
Regressions ❌
(primary)
--0
Regressions ❌
(secondary)
--0
Improvements ✅
(primary)
--0
Improvements ✅
(secondary)
-0.2%[-0.2%, -0.2%]1
All ❌✅ (primary)--0

Max RSS (memory usage)

Results (secondary 0.8%)

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.

meanrangecount
Regressions ❌
(primary)
--0
Regressions ❌
(secondary)
5.0%[4.6%, 5.7%]3
Improvements ✅
(primary)
--0
Improvements ✅
(secondary)
-3.4%[-4.9%, -2.0%]3
All ❌✅ (primary)--0

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: 751.682s -> 751.844s (0.02%)
Artifact size: 371.84 MiB -> 371.90 MiB (0.02%)

@rustbotrustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 6, 2025
@compiler-errors
compiler-errorsforce-pushed the nested-goals-certainty branch from 19be2d3 to cd1d84eCompareJune 9, 2025 17:02
@rustbot

Copy link
Copy Markdown
Collaborator

changes to inspect_obligations.rs

cc @compiler-errors, @lcnr

@compiler-errors

Copy link
Copy Markdown
ContributorAuthor

@bors2 try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

rust-borsBot commented Jun 9, 2025

Copy link
Copy Markdown
Contributor

⌛ Trying commit cd1d84e with merge 101fca2

To cancel the try build, run the command @bors2 try cancel.

rust-borsBot added a commit that referenced this pull request Jun 9, 2025
Apply nested goals certainty to `InspectGoals` for normalizes-to
...so that normalizes-to goals don't have `Certainty::Yes` even if they have nested goals which don't hold.
r? lcnr
@rustbotrustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 9, 2025
fn visit_goal(&mut self, inspect_goal: &InspectGoal<'_, 'tcx>) {
// No need to walk into goal subtrees that certainly hold, since they
// wouldn't then be stalled on an infer var.
// FIXME: We also walk into normalizes-to goals since their certainty

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

hopefully this helps out with a bit of perf

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

tho it maybe won't, since we wouldn't walk into nested normalizes-to goals if the parent goal isn't ambig either...

Comment threadcompiler/rustc_trait_selection/src/solve/inspect/analyse.rs
@rust-bors

rust-borsBot commented Jun 9, 2025

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 101fca2 (101fca2e9fdfa9a06b4e893fa727d05fae606376)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (101fca2): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

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

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

meanrangecount
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 5.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

meanrangecount
Regressions ❌
(primary)
5.1%[5.1%, 5.1%]1
Regressions ❌
(secondary)
--0
Improvements ✅
(primary)
--0
Improvements ✅
(secondary)
--0
All ❌✅ (primary)5.1%[5.1%, 5.1%]1

Cycles

Results (secondary 2.3%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

meanrangecount
Regressions ❌
(primary)
--0
Regressions ❌
(secondary)
2.3%[2.1%, 2.6%]3
Improvements ✅
(primary)
--0
Improvements ✅
(secondary)
--0
All ❌✅ (primary)--0

Binary size

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

Bootstrap: 753.531s -> 756.65s (0.41%)
Artifact size: 372.34 MiB -> 372.32 MiB (-0.01%)

@rustbotrustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 9, 2025
@lcnr

lcnr commented Jun 12, 2025

Copy link
Copy Markdown
Contributor

sorry for not reviewing this earlier.

the setup feels a bit iffy to me and i wanted to take a bit more time to look at it locally. I don't really think we can do much better here:

  • we need to do the term-hack + nested-goals check in a probe when creating the InspectGoal to get the right certainty.
  • kinda don't want to do this properly for the candidates of the normalizes-to goal, because otherwise the candidate which we actually use for normalization ends up with NoSolution 🤔 idk

I don't really know how to improve this, but this is an improvement from the status quo

@bors r+

@bors

bors commented Jun 12, 2025

Copy link
Copy Markdown
Collaborator

📌 Commit cd1d84e has been approved by lcnr

It is now in the queue for this repository.

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 12, 2025
@bors

bors commented Jun 12, 2025

Copy link
Copy Markdown
Collaborator

⌛ Testing commit cd1d84e with merge 6c8138d...

@bors

bors commented Jun 12, 2025

Copy link
Copy Markdown
Collaborator

☀️ Test successful - checks-actions
Approved by: lcnr
Pushing 6c8138d to master...

@borsbors added the merged-by-bors This PR was explicitly merged by bors. label Jun 12, 2025
@bors
bors merged commit 6c8138d into rust-lang:masterJun 12, 2025
@rustbotrustbot added this to the 1.89.0 milestone Jun 12, 2025
@github-actions

Copy link
Copy Markdown
Contributor
What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing fd50e10 (parent) -> 6c8138d (this PR)

Test differences

No test diffs found

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 6c8138de8f1c96b2f66adbbc0e37c73525444750 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-aarch64-apple: 4900.5s -> 6316.9s (28.9%)
  2. mingw-check-tidy: 84.0s -> 64.2s (-23.6%)
  3. x86_64-apple-1: 8941.9s -> 7328.3s (-18.0%)
  4. dist-apple-various: 6232.3s -> 6971.2s (11.9%)
  5. x86_64-msvc-2: 6490.8s -> 7254.5s (11.8%)
  6. mingw-check-1: 1877.0s -> 1663.3s (-11.4%)
  7. x86_64-gnu-aux: 6970.2s -> 6179.6s (-11.3%)
  8. x86_64-rust-for-linux: 3100.3s -> 2756.0s (-11.1%)
  9. x86_64-apple-2: 5677.6s -> 5058.2s (-10.9%)
  10. aarch64-apple: 5707.1s -> 5114.6s (-10.4%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (6c8138d): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

meanrangecount
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.3%, secondary -0.5%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

meanrangecount
Regressions ❌
(primary)
--0
Regressions ❌
(secondary)
2.1%[2.1%, 2.1%]1
Improvements ✅
(primary)
-1.3%[-1.3%, -1.3%]1
Improvements ✅
(secondary)
-3.0%[-3.0%, -3.0%]1
All ❌✅ (primary)-1.3%[-1.3%, -1.3%]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: 755.158s -> 754.987s (-0.02%)
Artifact size: 372.13 MiB -> 372.08 MiB (-0.01%)

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-borsThis PR was explicitly merged by bors.S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.WG-trait-system-refactorThe Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@compiler-errors@rustbot@rust-timer@lcnr@bors