cairo_native icon indicating copy to clipboard operation
cairo_native copied to clipboard

Implement circuit libfuncs

Open JulianGCalderon opened this issue 1 year ago • 2 comments

This PR implements all circuit related libfuncs.

It also removes the copied corelib as its no longer needed.

Libfuncs

  • [x] init_circuit_data
  • [x] add_circuit_input
  • [x] try_into_circuit_modulus
  • [ ] eval_circuit: inverse gate is missing
  • [x] get_circuit_output
  • [x] into_u96_guarantee

The following are implemented as noops.

  • [x] get_circuit_descriptor
  • [x] u96_guarantee_verify
  • [x] failure_guarantee_verify
  • [x] u96_limbs_less_than_guarantee_verify
  • [x] u96_single_limb_less_than_guarantee_verify

TODO

  • Swap unreachable and unwrap with proper errors
  • Fix layout formula instead of hardcoding it
  • Add tests

Checklist

  • [ ] Linked to Github Issue
  • [ ] Unit tests added
  • [ ] Integration tests added.
  • [ ] This change requires new documentation.
    • [ ] Documentation has been added/updated.

JulianGCalderon avatar Aug 14 '24 13:08 JulianGCalderon

Codecov Report

Attention: Patch coverage is 96.22787% with 49 lines in your changes missing coverage. Please review.

Project coverage is 92.07%. Comparing base (a40dc16) to head (14349f3).

Files with missing lines Patch % Lines
src/types/circuit.rs 78.80% 32 Missing :warning:
src/libfuncs/circuit.rs 98.64% 15 Missing :warning:
src/types.rs 90.47% 2 Missing :warning:
Additional details and impacted files
@@                   Coverage Diff                    @@
##           cairo-lang2.7.0-rc.3     #759      +/-   ##
========================================================
+ Coverage                 91.79%   92.07%   +0.27%     
========================================================
  Files                       118      120       +2     
  Lines                     34156    35445    +1289     
========================================================
+ Hits                      31355    32635    +1280     
- Misses                     2801     2810       +9     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov-commenter avatar Aug 14 '24 17:08 codecov-commenter

✅ Code is now correctly formatted.

github-actions[bot] avatar Aug 15 '24 13:08 github-actions[bot]