Skip to content

perf: skip preprocessOutParam for noMVars queries#12489

Draft
kim-em wants to merge 1 commit intomasterfrom
revert-tc-cache-preprocessOutParam
Draft

perf: skip preprocessOutParam for noMVars queries#12489
kim-em wants to merge 1 commit intomasterfrom
revert-tc-cache-preprocessOutParam

Conversation

@kim-em
Copy link
Collaborator

@kim-em kim-em commented Feb 15, 2026

This PR restores the optimization of skipping the preprocessOutParam step when the type has no metavariables, reverting one of the workarounds from #12286 needed for Mathlib compatibility. (See #12488 for the other.)

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 in #12286 because semireducible type aliases like OrderDual caused TC resolution to fail. For example, synthesizing FunLike F (OrderDual α) (OrderDual β) where the last two arguments are output parameters: without preprocessOutParam, TC resolution fails because it cannot unfold OrderDual since it is semireducible.

This is an experimental branch for exploring changes to Mathlib.

🤖 Prepared with Claude Code

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.
@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Feb 15, 2026
@mathlib-lean-pr-testing
Copy link

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 0d2a511bde100b0c8690bee398b52c1b715e618f --onto 6ca23a7b8bee57152110ce500ce795148707d4ed. You can force Mathlib CI using the force-mathlib-ci label. (2026-02-15 04:30:37)

@leanprover-bot
Copy link
Collaborator

Reference manual CI status:

  • ❗ Reference manual CI will not be attempted unless your PR branches off the nightly-with-manual branch. Try git rebase 0d2a511bde100b0c8690bee398b52c1b715e618f --onto 9da8f5dce42832b8411d58446653f3640a94a6e3. You can force reference manual CI using the force-manual-ci label. (2026-02-15 04:30:39)

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

Labels

toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants