Skip to content

Use the new solver in the impossible_predicates #136988

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

Merged
merged 1 commit into from
May 15, 2025

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Feb 13, 2025

The old solver is unsound for many reasons. One of which was weaponized by @lcnr in #140212, where the old solver was incompletely considering a dyn vtable method to be impossible and replacing its vtable entry with a null value. This null function could be called post-mono.

The new solver is expected to be less incomplete due to its correct handling of higher-ranked aliases in relate. This PR switches the impossible_predicates query to use the new solver, which patches this UB.

r? lcnr

@compiler-errors
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@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. S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Feb 13, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 13, 2025
…s, r=<try>

Use the new solver in the `impossible_predicates`

r? lcnr
@bors
Copy link
Collaborator

bors commented Feb 13, 2025

⌛ Trying commit 42565da with merge 6aac808...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Feb 13, 2025

☀️ Try build successful - checks-actions
Build commit: 6aac808 (6aac80825ffa245e49ce6e80bdcfdc433dbb3559)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (6aac808): comparison URL.

Overall result: ❌✅ regressions and 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.3% [0.3%, 0.3%] 1
Regressions ❌
(secondary)
0.5% [0.5%, 0.6%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.1%] 3
All ❌✅ (primary) 0.3% [0.3%, 0.3%] 1

Max RSS (memory usage)

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

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)
- - 0
Improvements ✅
(primary)
-1.6% [-2.3%, -0.9%] 2
Improvements ✅
(secondary)
-2.9% [-3.7%, -2.4%] 3
All ❌✅ (primary) -1.6% [-2.3%, -0.9%] 2

Cycles

Results (secondary 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.

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

Binary size

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

Bootstrap: 788.486s -> 790.527s (0.26%)
Artifact size: 347.76 MiB -> 347.72 MiB (-0.01%)

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

Ok let me fix AFIDT first.

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 14, 2025
@rustbot rustbot added the WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) label Feb 14, 2025
@compiler-errors
Copy link
Member Author

@bors try @rust-timer queue

(and crater)

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

Use the new solver in the `impossible_predicates`

r? lcnr
@bors
Copy link
Collaborator

bors commented Mar 19, 2025

⌛ Trying commit 40269a1 with merge 4c525d4...

@bors
Copy link
Collaborator

bors commented Mar 19, 2025

☀️ Try build successful - checks-actions
Build commit: 4c525d4 (4c525d43052e921548191f82f6ed9e2f9e98dcb1)

@rust-timer

This comment has been minimized.

@compiler-errors
Copy link
Member Author

@craterbot check

@craterbot
Copy link
Collaborator

👌 Experiment pr-136988 created and queued.
🤖 Automatically detected try build 4c525d4
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Mar 19, 2025
@rfcbot rfcbot added the final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. label May 15, 2025
@rfcbot
Copy link
Collaborator

rfcbot commented May 15, 2025

🔔 This is now entering its final comment period, as per the review above. 🔔

@rfcbot rfcbot removed the proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. label May 15, 2025
@compiler-errors
Copy link
Member Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 15, 2025
@lcnr
Copy link
Contributor

lcnr commented May 15, 2025

@bors r+ rollup=never

@bors
Copy link
Collaborator

bors commented May 15, 2025

📌 Commit 257f687 has been approved by lcnr

It is now in the queue for this repository.

@bors bors 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 May 15, 2025
@bors
Copy link
Collaborator

bors commented May 15, 2025

⌛ Testing commit 257f687 with merge c4e05e5...

@bors
Copy link
Collaborator

bors commented May 15, 2025

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 15, 2025
@bors bors merged commit c4e05e5 into rust-lang:master May 15, 2025
7 checks passed
@rustbot rustbot added this to the 1.89.0 milestone May 15, 2025
Copy link
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 d163a28 (parent) -> c4e05e5 (this PR)

Test differences

Show 4 test diffs

Stage 1

  • [ui] tests/ui/traits/vtable/impossible-method.rs#current: [missing] -> pass (J0)
  • [ui] tests/ui/traits/vtable/impossible-method.rs#next: [missing] -> pass (J0)

Stage 2

  • [ui] tests/ui/traits/vtable/impossible-method.rs#current: [missing] -> pass (J1)
  • [ui] tests/ui/traits/vtable/impossible-method.rs#next: [missing] -> pass (J1)

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard c4e05e53d19b550a358ee8b2e29ecd5a11075800 --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. x86_64-apple-1: 11122.2s -> 7412.5s (-33.4%)
  2. dist-apple-various: 10358.5s -> 7424.1s (-28.3%)
  3. dist-x86_64-apple: 11586.4s -> 8656.9s (-25.3%)
  4. aarch64-apple: 5105.4s -> 4710.9s (-7.7%)
  5. dist-x86_64-musl: 7408.3s -> 7962.1s (7.5%)
  6. dist-armv7-linux: 5317.7s -> 5711.8s (7.4%)
  7. dist-aarch64-apple: 5827.8s -> 5404.2s (-7.3%)
  8. x86_64-apple-2: 5290.9s -> 5629.2s (6.4%)
  9. dist-aarch64-msvc: 8416.2s -> 8897.4s (5.7%)
  10. dist-x86_64-freebsd: 5281.0s -> 4990.2s (-5.5%)
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
Collaborator

Finished benchmarking commit (c4e05e5): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

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.9% [0.4%, 1.1%] 5
Regressions ❌
(secondary)
0.5% [0.3%, 1.0%] 27
Improvements ✅
(primary)
-0.1% [-0.1%, -0.1%] 1
Improvements ✅
(secondary)
-0.1% [-0.2%, -0.1%] 6
All ❌✅ (primary) 0.8% [-0.1%, 1.1%] 6

Max RSS (memory usage)

Results (primary 1.4%, 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)
2.4% [1.0%, 4.5%] 3
Regressions ❌
(secondary)
1.7% [1.2%, 2.2%] 2
Improvements ✅
(primary)
-1.5% [-1.5%, -1.5%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.4% [-1.5%, 4.5%] 4

Cycles

Results (primary -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.

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

Binary size

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

Bootstrap: 772.725s -> 773.554s (0.11%)
Artifact size: 365.38 MiB -> 365.48 MiB (0.03%)

@rustbot rustbot added the perf-regression Performance regression. label May 15, 2025
@compiler-errors
Copy link
Member Author

Lol. I'm somewhat surprised that perf has diverged so dramatically between March and May.

Previous run: #136988 (comment)

@Kobzol
Copy link
Contributor

Kobzol commented May 20, 2025

The regressions are mostly in helloworld and tiny benchmarks, and they are relatively small, so I think it's fine. We generally expect the perf. of the new solver to improve over time.

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label May 20, 2025
@rfcbot rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. to-announce Announce this issue on triage meeting and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels May 25, 2025
@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-types Relevant to the types 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
Development

Successfully merging this pull request may close these issues.

incompletely relating alias args is unsound during vtable creation