Skip to content

Skip fulfillment when normalization produces no obligations - #165847

Open
TaKO8Ki wants to merge 1 commit into
rust-lang:mainfrom
TaKO8Ki:skip-empty-normalization-fulfillment
Open

TaKO8Ki wants to merge 1 commit into
rust-lang:mainfrom
TaKO8Ki:skip-empty-normalization-fulfillment

Conversation

@TaKO8Ki

@TaKO8Ki TaKO8Ki commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

In the next solver, normalization always builds and evaluates a new FulfillmentCtxt afterwards, even when it produced no obligations. This PR returns early in that case.

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 Nov 12, 2026
@TaKO8Ki

TaKO8Ki commented Nov 12, 2026

Copy link
Copy Markdown
Member Author

@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 Nov 12, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Nov 12, 2026
… r=<try>

Skip fulfillment when normalization produces no obligations
@rust-bors

rust-bors Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: c27d81c (c27d81c57f48e22647bfb2eed42d2ea6c652b730)
Base parent: ee8268e (ee8268e23d0e2e308b52e4f63df69afb69bc61a4)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (c27d81c): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

@bors rollup=iffy rustc-perf
@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)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.3% [-0.8%, -0.2%] 10
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 2.7%, secondary 1.3%)

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

mean range count
Regressions ❌
(primary)
2.7% [2.7%, 2.7%] 1
Regressions ❌
(secondary)
1.3% [0.5%, 1.9%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.7% [2.7%, 2.7%] 1

Cycles

Results (primary -2.9%)

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

mean range count
Regressions ❌
(primary)
2.1% [2.1%, 2.1%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.8% [-4.3%, -3.3%] 6
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.9% [-4.3%, 2.1%] 7

Binary size

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

Bootstrap: 484.606s -> 486.397s (0.37%)
Artifact size: 406.06 MiB -> 405.95 MiB (-0.03%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 12, 2026
@TaKO8Ki

TaKO8Ki commented Nov 17, 2026

Copy link
Copy Markdown
Member Author

The perf run shows up to -0.89% instructions on the -Znext-solver benchmarks and no change elsewhere.

@TaKO8Ki
TaKO8Ki marked this pull request as ready for review November 17, 2026 16:59
@rustbot

rustbot commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

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. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 17, 2026
return Err(errors);
}

Ok((value, stalled_coroutine_goals))

@lcnr lcnr Nov 23, 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.

want to instead make this an else

style nit, otherwise r=me

View changes since the review

This branch has not been deployed

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

Labels

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)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants