Return type op fast path results without the full fulfillment machinery [-0.83% avg] - #30
Draft
xmakro wants to merge 1 commit into
Draft
Return type op fast path results without the full fulfillment machinery [-0.83% avg]#30xmakro wants to merge 1 commit into
xmakro wants to merge 1 commit into
Conversation
xmakro
force-pushed
the
perf/typeop-fastpath-hoist
branch
from
July 26, 2026 05:57
5190b9a to
03969d2
Compare
xmakro
force-pushed
the
perf/typeop-fastpath-hoist
branch
2 times, most recently
from
August 10, 2026 03:19
26da146 to
04c5b11
Compare
xmakro
force-pushed
the
perf/typeop-fastpath-hoist
branch
from
August 10, 2026 03:21
04c5b11 to
29e4967
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Query type ops check their fast paths (trivial sizedness proofs, alias free normalizations) inside the closure passed to scrape_region_constraints, so every fast path hit still paid for an inference snapshot, an ObligationCtxt with a boxed fulfillment engine, and the region constraint scraping itself, all over empty data. MIR type check issues several type ops per statement and the overwhelming majority hit a fast path.
Fast path results are final: they register no obligations and produce no region constraints, so the fast path is now checked once at the top of fully_perform and the result returned directly. resolve_vars_if_possible is kept on the returned value, matching what scrape_region_constraints did before.
Skipping the scrape requires that no region state is pending on the inference context between type ops. The one place that violated this, the eager hidden type equation reached from relate_opaques, now rolls back on failure via commit_if_ok, and the fast path asserts the invariant through a new InferCtxt::has_pending_region_state helper.