Skip to content

Fix goal-tactic association in typeclass search#22037

Open
Janno wants to merge 6 commits into
rocq-prover:masterfrom
Janno:janno/tc-quadratic
Open

Fix goal-tactic association in typeclass search#22037
Janno wants to merge 6 commits into
rocq-prover:masterfrom
Janno:janno/tc-quadratic

Conversation

@Janno
Copy link
Copy Markdown
Contributor

@Janno Janno commented May 19, 2026

The code was written by GPT-5.5 based on the findings from my debugging attempts in #21044. I have not changed the LLM's code yet. I hope the change is small enough to be reviewable. If the mechanism is acceptable, I will polish the code.

This change introduces a notion of search "generations" to search_fixpoint. This allows us to track precisely which goals have been stuck for how long and which ones need to be retried when we make any kind of progress. Then, to make sure that goals and tactics stay properly aligned in the presence of goal reorderings, we look up the evar's index in the proofview goals and focus that index explicitly.

The lookup is currently a linear search through the list of goals. I have previously tried to work with goal state instead. My idea was to keep an index in the goal that maps to a tactic in some kind of array/map. But Class_tactics drops goal state in several places and I could not make the change work. The LLM might have a better chance so I am happy to try that if the linear search is a problem and there is no easy workaround.

The change has been tested on skylabs code where it brings a very modest 0.1% overall speedup with no significant slowdowns. Full report

Fixes / closes #21044

  • Added / updated test-suite.
  • Added changelog.
  • Added / updated documentation.
    • Documented any new / changed user messages.
    • Updated documented syntax by running make doc_gram_rsts.
  • Opened overlay pull requests.

@Janno Janno requested a review from a team as a code owner May 19, 2026 10:40
@coqbot-app coqbot-app Bot added the needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. label May 19, 2026
@Janno
Copy link
Copy Markdown
Contributor Author

Janno commented May 19, 2026

@coqbot run full ci

@coqbot-app coqbot-app Bot removed the needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. label May 19, 2026
@mattam82
Copy link
Copy Markdown
Member

@coqbot bench

@mattam82 mattam82 self-assigned this May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Specifying Hint Mode(s) causes quadratic slowdown on stuck goals

2 participants