Skip to content

Consider param-env for sizedness fast path #143309

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
Jul 21, 2025

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Jul 2, 2025

Look up T: Sized in param-env if T is a param or placeholder (the latter is for use in the new solver).

@rustbot rustbot added 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 Jul 2, 2025
@compiler-errors
Copy link
Member Author

@bors2 try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Jul 2, 2025

⌛ Trying commit 089656e with merge 7c68135

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

rust-bors bot added a commit that referenced this pull request Jul 2, 2025
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 2, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Jul 2, 2025

☀️ Try build successful (CI)
Build commit: 7c68135 (7c68135aa7729b5e1a168883c992b097f120c51a, parent: 085c24790e591948f788fd294ca3f9858313741c)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

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

mean range count
Regressions ❌
(primary)
0.3% [0.3%, 0.3%] 1
Regressions ❌
(secondary)
0.1% [0.1%, 0.1%] 1
Improvements ✅
(primary)
-0.9% [-3.6%, -0.1%] 34
Improvements ✅
(secondary)
-1.2% [-3.0%, -0.3%] 17
All ❌✅ (primary) -0.9% [-3.6%, 0.3%] 35

Max RSS (memory usage)

Results (primary -4.0%)

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

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-4.0% [-4.9%, -1.5%] 9
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -4.0% [-4.9%, -1.5%] 9

Cycles

Results (primary -1.9%, secondary 2.0%)

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

mean range count
Regressions ❌
(primary)
2.5% [2.5%, 2.6%] 2
Regressions ❌
(secondary)
2.3% [0.6%, 4.1%] 11
Improvements ✅
(primary)
-2.9% [-3.7%, -1.5%] 9
Improvements ✅
(secondary)
-0.8% [-0.8%, -0.8%] 1
All ❌✅ (primary) -1.9% [-3.7%, 2.6%] 11

Binary size

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

Bootstrap: 462.05s -> 462.11s (0.01%)
Artifact size: 372.27 MiB -> 372.22 MiB (-0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 3, 2025
@compiler-errors compiler-errors changed the title [perf] Consider param-env for fast path Consider param-env for sizedness fast path Jul 3, 2025
@compiler-errors compiler-errors marked this pull request as ready for review July 3, 2025 19:49
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 3, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jul 3, 2025

Some changes occurred to the core trait solver

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

@compiler-errors compiler-errors force-pushed the param-sized-fast-path branch from 089656e to 339b6f1 Compare July 3, 2025 19:52
@bors
Copy link
Collaborator

bors commented Jul 4, 2025

☔ The latest upstream changes (presumably #143407) made this pull request unmergeable. Please resolve the merge conflicts.

|
LL | UUU: Copy,
| ^^^ not found in this scope

error[E0282]: type annotations needed
Copy link
Member Author

Choose a reason for hiding this comment

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

This used to stall on an ambiguous T: Sized because the param-env had T: Sized, {type error}: Sized and both matched. I'm not worried about the incompleteness we're introducing here, since there's nothing wrong with always preferring the non-error candidate.

@compiler-errors compiler-errors force-pushed the param-sized-fast-path branch from 339b6f1 to 4aa4b18 Compare July 4, 2025 17:49
@lcnr
Copy link
Contributor

lcnr commented Jul 11, 2025

@bors r+ rollup=never

@bors
Copy link
Collaborator

bors commented Jul 11, 2025

📌 Commit 4aa4b18 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 Jul 11, 2025
bors added a commit that referenced this pull request Jul 11, 2025
Consider param-env for sizedness fast path

Look up `T: Sized` in param-env if `T` is a param or placeholder (the latter is for use in the new solver).
@bors
Copy link
Collaborator

bors commented Jul 11, 2025

⌛ Testing commit 4aa4b18 with merge 21492bb...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Jul 11, 2025

💔 Test failed - checks-actions

@bors bors removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jul 11, 2025
Kobzol added a commit to Kobzol/rust that referenced this pull request Jul 14, 2025
…ath, r=lcnr

Consider param-env for sizedness fast path

Look up `T: Sized` in param-env if `T` is a param or placeholder (the latter is for use in the new solver).
@jdonszelmann
Copy link
Contributor

@bors r- seems to have already failed ci, unsure why still r+

@bors bors 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 Jul 15, 2025
@compiler-errors
Copy link
Member Author

compiler-errors commented Jul 16, 2025

This seems to have failed due to a float parsing apple test. I don't think it's related? Or am I misreading the logs or something?

@bors r=lcnr rollup=never

@bors
Copy link
Collaborator

bors commented Jul 16, 2025

📌 Commit 4aa4b18 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 16, 2025
@bors
Copy link
Collaborator

bors commented Jul 18, 2025

⌛ Testing commit 4aa4b18 with merge 71a44f7...

bors added a commit that referenced this pull request Jul 18, 2025
Consider param-env for sizedness fast path

Look up `T: Sized` in param-env if `T` is a param or placeholder (the latter is for use in the new solver).
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Jul 18, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 18, 2025
@compiler-errors compiler-errors force-pushed the param-sized-fast-path branch from 4aa4b18 to 1e96d7a Compare July 20, 2025 17:45
@compiler-errors
Copy link
Member Author

Split the test in tests/ui/sized-hierarchy/incomplete-inference-issue-143992.rs into four revisions, which is {feature(sized_hierarchy), no feature enabled} x {current, next}. The test changed behavior since we're now using the same fast path function for both solvers, and I wanted to make sure we're actually testing the MetaSized opt-out properly regardless of the presence of -Znext-solver.

@bors r=lcnr

@bors
Copy link
Collaborator

bors commented Jul 20, 2025

📌 Commit 1e96d7a 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 Jul 20, 2025
@bors
Copy link
Collaborator

bors commented Jul 20, 2025

⌛ Testing commit 1e96d7a with merge 460259d...

@bors
Copy link
Collaborator

bors commented Jul 21, 2025

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 21, 2025
@bors bors merged commit 460259d into rust-lang:master Jul 21, 2025
12 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jul 21, 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 9982d64 (parent) -> 460259d (this PR)

Test differences

Show 9 test diffs

Stage 1

  • [ui] tests/ui/sized-hierarchy/incomplete-inference-issue-143992.rs#current_sized_hierarchy: [missing] -> pass (J1)
  • [ui] tests/ui/sized-hierarchy/incomplete-inference-issue-143992.rs#next_sized_hierarchy: [missing] -> pass (J1)

Stage 2

  • [ui] tests/ui/sized-hierarchy/incomplete-inference-issue-143992.rs#current_sized_hierarchy: [missing] -> pass (J0)
  • [ui] tests/ui/sized-hierarchy/incomplete-inference-issue-143992.rs#next_sized_hierarchy: [missing] -> pass (J0)

Additionally, 5 doctest diffs were found. These are ignored, as they are noisy.

Job group index

  • J0: aarch64-apple, aarch64-gnu, aarch64-msvc-1, arm-android, armhf-gnu, dist-i586-gnu-i586-i686-musl, i686-gnu-1, i686-gnu-nopt-1, i686-msvc-1, test-various, x86_64-apple-2, x86_64-gnu, x86_64-gnu-llvm-19-2, x86_64-gnu-llvm-20-2, x86_64-gnu-nopt, x86_64-gnu-stable, x86_64-mingw-1, x86_64-msvc-1
  • J1: x86_64-gnu-llvm-19-3, x86_64-gnu-llvm-20-3
Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 460259d14de0274b97b8801e08cb2fe5f16fdac5 --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-x86_64-apple: 9248.2s -> 11563.9s (25.0%)
  2. x86_64-apple-2: 4426.2s -> 5373.1s (21.4%)
  3. tidy: 76.7s -> 65.6s (-14.4%)
  4. armhf-gnu: 5448.5s -> 4885.6s (-10.3%)
  5. i686-gnu-2: 6197.2s -> 5694.2s (-8.1%)
  6. x86_64-gnu-debug: 6011.3s -> 6468.4s (7.6%)
  7. x86_64-rust-for-linux: 2974.5s -> 2757.8s (-7.3%)
  8. x86_64-gnu-llvm-19-1: 3814.8s -> 3541.1s (-7.2%)
  9. dist-arm-linux-musl: 5299.9s -> 5664.7s (6.9%)
  10. x86_64-apple-1: 8406.0s -> 7845.2s (-6.7%)
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 (460259d): 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.

mean range count
Regressions ❌
(primary)
0.3% [0.3%, 0.3%] 2
Regressions ❌
(secondary)
0.1% [0.1%, 0.1%] 1
Improvements ✅
(primary)
-1.3% [-2.9%, -0.3%] 16
Improvements ✅
(secondary)
-1.1% [-2.9%, -0.1%] 19
All ❌✅ (primary) -1.1% [-2.9%, 0.3%] 18

Max RSS (memory usage)

Results (primary -2.2%)

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

mean range count
Regressions ❌
(primary)
2.9% [1.8%, 4.0%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.9% [-5.7%, -1.7%] 6
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.2% [-5.7%, 4.0%] 8

Cycles

Results (primary -2.8%)

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

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.8% [-3.5%, -2.1%] 5
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.8% [-3.5%, -2.1%] 5

Binary size

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

Bootstrap: 466.584s -> 466.025s (-0.12%)
Artifact size: 374.58 MiB -> 374.56 MiB (-0.01%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants