Skip to content

Add certifier tests for UPLC simplifier test inputs #7034

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Apr 17, 2025

Conversation

ana-pantilie
Copy link
Contributor

@ana-pantilie ana-pantilie commented Apr 11, 2025

@ana-pantilie ana-pantilie changed the title Add new certifier tests Add certifier tests for UPLC simplifier test inputs Apr 16, 2025
@ana-pantilie ana-pantilie added the No Changelog Required Add this to skip the Changelog Check label Apr 16, 2025
@ana-pantilie ana-pantilie marked this pull request as ready for review April 16, 2025 11:32
@ana-pantilie ana-pantilie requested review from ramsay-t and a team April 16, 2025 11:32
\f g -> (\a -> f (g 1 0) (a 2)) (\x y -> g y x)
Copy link
Contributor

@effectfully effectfully Apr 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any chance we could make the simplifier handle open terms? Chances are, sooner or later we're gonna end up supporting smart contracts with free variables in them (not as a feature, just not to pay the cost of ensuring the script is closed).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would need a bigger change in the metatheory, and hence warrants a bigger discussion.

]
$ fmap (uncurry goldenVsSimplified) testSimplifyInputs
<>
[ goldenVsCse "cse1" cse1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not test the certifier on CSE?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch, I forgot to add those! I'll add them as part of a separate PR/issue.

import: lang
visibility: public
default-language: Haskell2010
default-extensions: CPP
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed? I don't think CPP should be a default extension regardless

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, when I moved the modules to a cabal library they weren't compiling because of this. Maybe a cabal test-suite has this extension turned on by default?

Just result ->
assertBool "The certifier returned false." result
Nothing ->
assertFailure "The certifier exited with an error."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there no information of the error at all when the certifier fails?

Copy link
Contributor

@ramsay-t ramsay-t Apr 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there no information of the error at all when the certifier fails?

You need the counter examples from #6957 :) They are still too big to present in this message. We could at least parse enough of the response to see which phase failed? Currently I don't think we parse the response at all - it is all done in Agda and only returns a boolean value to Haskell.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, I'll open an issue for this.

Copy link
Contributor

@ramsay-t ramsay-t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

... | nothing =
putStrLn "The certifier was unable to check the compilation. Please open a bug report at https://www.github.com/IntersectMBO/plutus."
... | just (cert (proof a)) = just true
... | just (cert (ce ¬p t b a)) = just false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we pull out the phase tag (t here) and return that as part of the result somehow? It would be useful for Ziyang's question above. I appreciate that we would then need a more complicated type...

@ana-pantilie ana-pantilie enabled auto-merge (squash) April 17, 2025 09:35
@ana-pantilie ana-pantilie merged commit e0c3fd0 into master Apr 17, 2025
7 checks passed
@ana-pantilie ana-pantilie deleted the ana/add-new-certifier-tests branch April 17, 2025 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
No Changelog Required Add this to skip the Changelog Check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants