Skip to content
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

Test with any prime and circuit compilation #608

Closed

Conversation

ClementWalter
Copy link
Member

@ClementWalter ClementWalter commented Jan 29, 2025

Why

The idea of this PR is to leverage regular cairo zero syntax to compile circuits for the mod builtins.

What

  • make the cairo base prime a parameter of the test
  • allow for running tests against any prime
  • write a compile function to extract the circuit from the cairo compilation
  • generate templates and scripts to dump results

This PR adds the compile_circuit scripts that can be run with uv like

uv run compile_circuit src/cairo_ec/circuits.cairo

to generate a circuits_compiled.cairo file which actually rewrite the initial logic into a function calling the mod bultins.

The generated artifacts and the compiler are diff tested against python reference logic and cairo regular run.

How

Ask cursor

@ClementWalter ClementWalter force-pushed the cw/test-with-any-prime branch 6 times, most recently from a65e521 to e699f12 Compare January 31, 2025 11:53
@ClementWalter ClementWalter changed the title Test with any prime Test with any prime and circuit compilation Jan 31, 2025
@ClementWalter ClementWalter force-pushed the cw/test-with-any-prime branch from 21ea9fe to 6874b6c Compare January 31, 2025 12:13
@ClementWalter ClementWalter deleted the cw/test-with-any-prime branch January 31, 2025 12:29
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.

1 participant