Skip to content

Implement a new flag -Zdisable-fast-paths in trait solving#156172

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
ShoyuVanilla:slowbro
May 5, 2026
Merged

Implement a new flag -Zdisable-fast-paths in trait solving#156172
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
ShoyuVanilla:slowbro

Conversation

@ShoyuVanilla
Copy link
Copy Markdown
Member

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 5, 2026

Some changes occurred to the core trait solver

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

@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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels May 5, 2026
Copy link
Copy Markdown
Contributor

@lcnr lcnr left a comment

Choose a reason for hiding this comment

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

nice, r=me after nit

View changes since this review

Comment thread compiler/rustc_session/src/options.rs Outdated
themselves (default: no)"),
direct_access_external_data: Option<bool> = (None, parse_opt_bool, [TRACKED],
"Direct or use GOT indirect to reference external data symbols"),
disable_fast_paths: bool = (false, parse_bool, [UNTRACKED],
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.

i think this in theory impacts behavior, so it should be TRACKED 🤔

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ah, right. I actually got some codes failing to compile with the flags due to the overflow since we don't do compute_goal_fast_path with it but goes into the nested goals

@ShoyuVanilla
Copy link
Copy Markdown
Member Author

@bors r=lcnr

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 5, 2026

📌 Commit 4432f6b 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 May 5, 2026
rust-bors Bot pushed a commit that referenced this pull request May 5, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #156014 (resolve: Catch "cannot reexport" errors from macros 2.0 better)
 - #156058 (Print HRTB binders before fn qualifiers)
 - #156172 (Implement a new flag `-Zdisable-fast-paths` in trait solving)
 - #156184 (Revert "remove `MethodReceiverExpr` special-casing")
 - #155957 (Revert const hacks and use const closures in std)
 - #156127 (Update `askama` version to `0.16.0`)
 - #156183 (Remove duplicate debug assert)
rust-bors Bot pushed a commit that referenced this pull request May 5, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #156014 (resolve: Catch "cannot reexport" errors from macros 2.0 better)
 - #156058 (Print HRTB binders before fn qualifiers)
 - #156172 (Implement a new flag `-Zdisable-fast-paths` in trait solving)
 - #156184 (Revert "remove `MethodReceiverExpr` special-casing")
 - #155957 (Revert const hacks and use const closures in std)
 - #156127 (Update `askama` version to `0.16.0`)
 - #156183 (Remove duplicate debug assert)
rust-bors Bot pushed a commit that referenced this pull request May 5, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #156014 (resolve: Catch "cannot reexport" errors from macros 2.0 better)
 - #156058 (Print HRTB binders before fn qualifiers)
 - #156172 (Implement a new flag `-Zdisable-fast-paths` in trait solving)
 - #156184 (Revert "remove `MethodReceiverExpr` special-casing")
 - #155957 (Revert const hacks and use const closures in std)
 - #156127 (Update `askama` version to `0.16.0`)
 - #156183 (Remove duplicate debug assert)
@rust-bors rust-bors Bot merged commit b503949 into rust-lang:main May 5, 2026
11 checks passed
@rustbot rustbot added this to the 1.97.0 milestone May 5, 2026
rust-timer added a commit that referenced this pull request May 5, 2026
Rollup merge of #156172 - ShoyuVanilla:slowbro, r=lcnr

Implement a new flag `-Zdisable-fast-paths` in trait solving

Discussion: [#t-types/trait-system-refactor > ask for help @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/ask.20for.20help/near/583953725)

r? lcnr
@ShoyuVanilla ShoyuVanilla deleted the slowbro branch May 6, 2026 00:02
@JonathanBrouwer
Copy link
Copy Markdown
Contributor

@rust-timer build 6cebd3e

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (6cebd3e): comparison URL.

Overall result: ❌ regressions - 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.1% [0.1%, 0.1%] 2
Regressions ❌
(secondary)
0.8% [0.2%, 1.5%] 22
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [0.1%, 0.1%] 2

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

Cycles

Results (secondary -0.3%)

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.4% [0.4%, 0.4%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.6% [-0.7%, -0.5%] 2
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 495.494s -> 495.573s (0.02%)
Artifact size: 394.42 MiB -> 394.43 MiB (0.00%)

@rustbot rustbot added the perf-regression Performance regression. label May 8, 2026
@JonathanBrouwer
Copy link
Copy Markdown
Contributor

Caused the regression in
#156190

@lqd
Copy link
Copy Markdown
Member

lqd commented May 8, 2026

why is the old solver impacted? 🤔

@ShoyuVanilla
Copy link
Copy Markdown
Member Author

This flag also affects some old solver optimization routines. But anyway, it's surprising that this impacts the perf in non-negligible amounts 🤔
Maybe having this impacts some optimizations like branch prediction. I'll try some experiments with that hypothesis

ChayimFriedman2 pushed a commit to ChayimFriedman2/rust-analyzer that referenced this pull request May 11, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#156014 (resolve: Catch "cannot reexport" errors from macros 2.0 better)
 - rust-lang/rust#156058 (Print HRTB binders before fn qualifiers)
 - rust-lang/rust#156172 (Implement a new flag `-Zdisable-fast-paths` in trait solving)
 - rust-lang/rust#156184 (Revert "remove `MethodReceiverExpr` special-casing")
 - rust-lang/rust#155957 (Revert const hacks and use const closures in std)
 - rust-lang/rust#156127 (Update `askama` version to `0.16.0`)
 - rust-lang/rust#156183 (Remove duplicate debug assert)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

perf-regression Performance regression. 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.

6 participants