perf: skip preprocessOutParam for noMVars queries#12489
Draft
perf: skip preprocessOutParam for noMVars queries#12489
Conversation
This reverts part of the `OrderDual` workaround from #12286. The `preprocessOutParam` step is morally not needed when the type has no metavariables, because output params should be uniquely determined by the input params. The optimization was removed because semireducible type aliases like `OrderDual` caused TC resolution to fail (e.g. `FunLike F (OrderDual α) (OrderDual β)` where the last two arguments are output parameters — without `preprocessOutParam`, TC resolution fails because it cannot unfold `OrderDual`). This is an experimental branch for testing whether Mathlib's `OrderDual` refactoring has progressed enough to restore this optimization.
|
Mathlib CI status (docs):
|
Collaborator
|
Reference manual CI status:
|
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.
This PR restores the optimization of skipping the
preprocessOutParamstep when the type has no metavariables, reverting one of the workarounds from #12286 needed for Mathlib compatibility. (See #12488 for the other.)The
preprocessOutParamstep is morally not needed when the type has no metavariables, because output params should be uniquely determined by the input params. The optimization was removed in #12286 because semireducible type aliases likeOrderDualcaused TC resolution to fail. For example, synthesizingFunLike F (OrderDual α) (OrderDual β)where the last two arguments are output parameters: withoutpreprocessOutParam, TC resolution fails because it cannot unfoldOrderDualsince it is semireducible.This is an experimental branch for exploring changes to Mathlib.
🤖 Prepared with Claude Code