Skip to content

Fix termination and performance issues with DecEq#7840

Draft
ana-pantilie wants to merge 4 commits into
masterfrom
ana/remove-terminating-deceq
Draft

Fix termination and performance issues with DecEq#7840
ana-pantilie wants to merge 4 commits into
masterfrom
ana/remove-terminating-deceq

Conversation

@ana-pantilie

@ana-pantilie ana-pantilie commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Needs #7832

Termination fix

Removes the need for the TERMINATING pragma in the decEq definitions, Agda can now prove that they terminate.

Performance fix

The matching on refl inside decEq triggered normalization of terms when typechecking, which affected performance significantly, to the point of using more than 128GB of memory for the example @basetunnel and I worked on.

The example is an equality proof of the first AST to itself, from agda-certificates/cardano_constitution_Cardano_Constitution_Validator_Data_Sorted-b48sy0.agda-cert. This was the certificate produced for defaultConstitutionCode from cardano-constitution/src/Cardano/Constitution/Validator/Data/Sorted.hs.

For this particular example comparing cons was the most expensive, so avoiding matching on refl in the recursive call to decEq-⟦ t ⟧tag x x₁ inside decEq-TmCon did the trick.

@ana-pantilie ana-pantilie changed the title Remove TERMINATING pragma from DecEq Fix issues with DecEq Jul 10, 2026
@ana-pantilie ana-pantilie changed the title Fix issues with DecEq Fix termination and performance issues with DecEq Jul 10, 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.

2 participants