Skip to content

Try to mark param env as rigid with the next solver#158643

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
adwinwhite:rigid-param-env
Jul 8, 2026
Merged

Try to mark param env as rigid with the next solver#158643
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
adwinwhite:rigid-param-env

Conversation

@adwinwhite

@adwinwhite adwinwhite commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

View all comments

This PR tries to make normalization of param env behave exactly the same as the old solver.

Notably,

  • we treat the param env used to normalize param env itself as rigid.
  • the normalizes-to term of projection predicate is treated as normalizable rather than rigid.

This fixes some overflow bugs we met in the next solver but unfix some other bugs (existing in the old solver).
See the blessed tests.

r? lcnr

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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 1, 2026
@adwinwhite

adwinwhite commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Haven't blessed tests or added comments.

@bors try @rust-timer queue

@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 Jul 1, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jul 1, 2026
Try to mark param env as rigid with the next solver
@rust-log-analyzer

This comment has been minimized.

@adwinwhite

Copy link
Copy Markdown
Contributor Author

@bors try cancel

@rust-bors

rust-bors Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Try build cancelled. Cancelled workflows:

@adwinwhite

Copy link
Copy Markdown
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jul 1, 2026
Try to mark param env as rigid with the next solver
@rust-log-analyzer

This comment has been minimized.

@rust-bors

rust-bors Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 0abe2a0 (0abe2a0937c875c08c170438a9afec1fecf7de22)
Base parent: 17aa775 (17aa77551e89d5e80d4b506c9a32fc151264b8e4)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (0abe2a0): comparison URL.

Overall result: ❌✅ regressions and improvements - please read:

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

@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
Regressions ❌
(secondary)
2.2% [1.2%, 2.8%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.3% [-2.5%, -0.1%] 8
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (secondary -0.6%)

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)
2.8% [2.8%, 2.8%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.8% [-1.9%, -1.7%] 3
All ❌✅ (primary) - - 0

Cycles

Results (secondary -0.7%)

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)
3.7% [3.7%, 3.7%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.1% [-2.2%, -2.0%] 3
All ❌✅ (primary) - - 0

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 486.291s -> 497.243s (2.25%)
Artifact size: 393.72 MiB -> 393.24 MiB (-0.12%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jul 1, 2026
@adwinwhite adwinwhite marked this pull request as ready for review July 1, 2026 12:10
@rustbot

rustbot commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

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.

@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 Jul 1, 2026
@adwinwhite

Copy link
Copy Markdown
Contributor Author

Unsure which minimization is a valid regression test for ml-kem. Part of it should be covered by tachys. Just add my minimization which is very long?

@lcnr

lcnr commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

hmm, good question :3 I think the largest typenum free minimization to make unknown issues easier to detect + all small mimimizations for the separate issues?

might make sense to just have a list of all the minimization and how they cover each other. You want both all smallest and all largest minimizations :3 minimizations should form a poset

@rustbot

This comment has been minimized.

Comment thread compiler/rustc_session/src/options.rs Outdated
Comment on lines +2356 to +2357
disable_param_env_hack: bool = (false, parse_bool, [TRACKED],
"do not try to mark param env as rigid for the next solver"),

@lcnr lcnr Jul 7, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
disable_param_env_hack: bool = (false, parse_bool, [TRACKED],
"do not try to mark param env as rigid for the next solver"),
disable_param_env_normalization_hack: bool = (false, parse_bool, [TRACKED],
"do not treat all aliases in the environment as rigid with `-Znext-solver`"),

View changes since the review

Comment thread compiler/rustc_type_ir/src/fold.rs Outdated
Comment on lines +558 to +559
/// This function should mostly be used under two situations: typing mode or
/// param env differs from the typing env the aliases were normalized in.

@lcnr lcnr Jul 7, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// This function should mostly be used under two situations: typing mode or
/// param env differs from the typing env the aliases were normalized in.
/// This function should ideally only be used if either the `TypingMode`
/// or the `ParamEnv` differs from the environment the aliases were normalized
/// in.

View changes since the review

@lcnr

lcnr commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

two nits, then r=me

@adwinwhite

Copy link
Copy Markdown
Contributor Author

@bors r=lcnr

@rust-bors

rust-bors Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 280cd8f has been approved by lcnr

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 7, 2026
@lcnr

lcnr commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

@bors rollup=never

with #158606 this should have become a lot more perf relevant

@rust-bors rust-bors Bot 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 8, 2026
@rust-bors

This comment has been minimized.

@rustbot

rustbot commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@adwinwhite

Copy link
Copy Markdown
Contributor Author

@bors r=lcnr rollup=never

@rust-bors

rust-bors Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 07da56d has been approved by lcnr

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 8, 2026
@rust-bors

This comment has been minimized.

@rust-bors rust-bors Bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 8, 2026
@rust-bors

rust-bors Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: lcnr
Duration: 3h 22m 7s
Pushing c290daa to main...

@rust-bors rust-bors Bot merged commit c290daa into rust-lang:main Jul 8, 2026
14 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

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 99576cf (parent) -> c290daa (this PR)

Test differences

Show 19 test diffs

Stage 1

  • [ui (polonius)] tests/ui/traits/next-solver/normalize/normalize-param-env-5.rs: [missing] -> pass (J0)
  • [ui (polonius)] tests/ui/traits/next-solver/normalize/normalize-param-env-6.rs: [missing] -> pass (J0)
  • [ui (polonius)] tests/ui/traits/next-solver/normalize/normalize-param-env-7.rs: [missing] -> pass (J0)
  • [ui (polonius)] tests/ui/typeck/issue-116864.rs: pass -> [missing] (J0)
  • [ui (polonius)] tests/ui/typeck/issue-116864.rs#current: [missing] -> pass (J0)
  • [ui (polonius)] tests/ui/typeck/issue-116864.rs#next: [missing] -> pass (J0)
  • [ui] tests/ui/traits/next-solver/normalize/normalize-param-env-5.rs: [missing] -> pass (J1)
  • [ui] tests/ui/traits/next-solver/normalize/normalize-param-env-6.rs: [missing] -> pass (J1)
  • [ui] tests/ui/traits/next-solver/normalize/normalize-param-env-7.rs: [missing] -> pass (J1)
  • [ui] tests/ui/typeck/issue-116864.rs: pass -> [missing] (J1)
  • [ui] tests/ui/typeck/issue-116864.rs#current: [missing] -> pass (J1)
  • [ui] tests/ui/typeck/issue-116864.rs#next: [missing] -> pass (J1)

Stage 2

  • [ui] tests/ui/traits/next-solver/normalize/normalize-param-env-5.rs: [missing] -> pass (J2)
  • [ui] tests/ui/traits/next-solver/normalize/normalize-param-env-6.rs: [missing] -> pass (J2)
  • [ui] tests/ui/traits/next-solver/normalize/normalize-param-env-7.rs: [missing] -> pass (J2)
  • [ui] tests/ui/typeck/issue-116864.rs: pass -> [missing] (J2)
  • [ui] tests/ui/typeck/issue-116864.rs#current: [missing] -> pass (J2)
  • [ui] tests/ui/typeck/issue-116864.rs#next: [missing] -> pass (J2)

Additionally, 1 doctest diff were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard c290daa1e5274a52e54a0f49e31bd70192abc606 --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. arm-android: 1h 3m -> 1h 47m (+68.0%)
  2. x86_64-gnu-gcc-core-tests: 8m 45s -> 13m 59s (+59.9%)
  3. x86_64-gnu-gcc: 48m 44s -> 1h 9m (+43.2%)
  4. pr-check-1: 25m 34s -> 33m 56s (+32.7%)
  5. dist-armhf-linux: 1h 25m -> 1h 1m (-27.4%)
  6. dist-aarch64-apple: 2h 6m -> 1h 33m (-26.0%)
  7. aarch64-gnu-llvm-21-2: 34m 11s -> 42m 36s (+24.6%)
  8. aarch64-apple-macos-26: 2h 32m -> 3h 5m (+21.3%)
  9. dist-x86_64-llvm-mingw: 1h 51m -> 1h 28m (-20.9%)
  10. x86_64-gnu-tools: 54m 30s -> 1h 5m (+20.2%)
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 (c290daa): 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
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-46.8% [-93.2%, -1.0%] 6
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (secondary -4.6%)

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)
- - 0
Improvements ✅
(secondary)
-4.6% [-11.5%, -0.7%] 7
All ❌✅ (primary) - - 0

Cycles

Results (secondary -90.1%)

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)
- - 0
Improvements ✅
(secondary)
-90.1% [-90.9%, -89.3%] 3
All ❌✅ (primary) - - 0

Binary size

Results (primary -0.0%, secondary -0.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)
-0.0% [-0.1%, -0.0%] 31
Improvements ✅
(secondary)
-0.0% [-0.1%, -0.0%] 5
All ❌✅ (primary) -0.0% [-0.1%, -0.0%] 31

Bootstrap: 488.508s -> 488.694s (0.04%)
Artifact size: 388.95 MiB -> 389.00 MiB (0.01%)

@rustbot rustbot removed the perf-regression Performance regression. label Jul 8, 2026
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. 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.

5 participants