-
Notifications
You must be signed in to change notification settings - Fork 45
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
Fix circuit gas diff: Implement u96_limbs_less_than_guarantee_verify #1084
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Benchmark results Main vs HEAD.Base
Head
Base
Head
Base
Head
Base
Head
Base
Head
Base
Head
|
Benchmarking resultsBenchmark for program
|
Command | Mean [s] | Min [s] | Max [s] | Relative |
---|---|---|---|---|
Cairo-vm (Rust, Cairo 1) |
20.930 ± 0.192 | 20.786 | 21.437 | 5.53 ± 0.07 |
cairo-native (embedded AOT) |
3.784 ± 0.030 | 3.725 | 3.833 | 1.00 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
3.838 ± 0.026 | 3.800 | 3.869 | 1.01 ± 0.01 |
Benchmark for program dict_snapshot
Open benchmarks
Command | Mean [s] | Min [s] | Max [s] | Relative |
---|---|---|---|---|
Cairo-vm (Rust, Cairo 1) |
5.845 ± 0.037 | 5.762 | 5.886 | 1.57 ± 0.03 |
cairo-native (embedded AOT) |
3.713 ± 0.060 | 3.636 | 3.811 | 1.00 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
3.758 ± 0.019 | 3.729 | 3.790 | 1.01 ± 0.02 |
Benchmark for program factorial_2M
Open benchmarks
Command | Mean [s] | Min [s] | Max [s] | Relative |
---|---|---|---|---|
Cairo-vm (Rust, Cairo 1) |
14.469 ± 0.074 | 14.374 | 14.627 | 3.58 ± 0.04 |
cairo-native (embedded AOT) |
4.043 ± 0.039 | 3.994 | 4.113 | 1.00 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
4.077 ± 0.025 | 4.039 | 4.127 | 1.01 ± 0.01 |
Benchmark for program fib_2M
Open benchmarks
Command | Mean [s] | Min [s] | Max [s] | Relative |
---|---|---|---|---|
Cairo-vm (Rust, Cairo 1) |
14.443 ± 0.056 | 14.382 | 14.538 | 4.01 ± 0.03 |
cairo-native (embedded AOT) |
3.600 ± 0.027 | 3.558 | 3.642 | 1.00 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
3.642 ± 0.038 | 3.594 | 3.726 | 1.01 ± 0.01 |
Benchmark for program linear_search
Open benchmarks
Command | Mean [s] | Min [s] | Max [s] | Relative |
---|---|---|---|---|
Cairo-vm (Rust, Cairo 1) |
5.837 ± 0.028 | 5.794 | 5.866 | 1.59 ± 0.01 |
cairo-native (embedded AOT) |
3.679 ± 0.021 | 3.649 | 3.723 | 1.00 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
3.796 ± 0.019 | 3.761 | 3.816 | 1.03 ± 0.01 |
Benchmark for program logistic_map
Open benchmarks
Command | Mean [s] | Min [s] | Max [s] | Relative |
---|---|---|---|---|
Cairo-vm (Rust, Cairo 1) |
5.913 ± 0.054 | 5.814 | 5.996 | 1.54 ± 0.02 |
cairo-native (embedded AOT) |
3.840 ± 0.017 | 3.820 | 3.880 | 1.00 |
cairo-native (embedded JIT using LLVM's ORC Engine) |
4.033 ± 0.052 | 3.975 | 4.122 | 1.05 ± 0.01 |
Instead of an array, now its a struct<array, array>, where the second array is the modulo
It is ultimately returned in struct representation, so now it is converted sooner (useful for guarantee representation)
5e5ce0c
to
b6d780c
Compare
4bc34c6
to
aa0cb7f
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1084 +/- ##
==========================================
+ Coverage 80.93% 81.05% +0.11%
==========================================
Files 108 108
Lines 29605 29726 +121
==========================================
+ Hits 23961 24094 +133
+ Misses 5644 5632 -12 ☔ View full report in Codecov by Sentry. |
5 tasks
edg-l
approved these changes
Feb 6, 2025
azteca1998
approved these changes
Feb 6, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes the gas issues related to circuits, by properly implementing u96_limbs_less_than_guarantee_verify
Types
The type
CircuitOutputs
used to contain an array of gate values, in integer form (u384). This PR changes two things:get_circuit_output
, so I moved the logic to theeval_circuit
libfunc.get_circuit_output
libfunc.The type
U96LimbsLessThanGuarantee
was a unit type as the related libfunc was not implemented. Now it contains the associated gate value, and the circuit modulus.Libfuncs
The
eval_circuit
libfunc was changed to output the updated version ofCircuitOutputs
.The
get_circuit_output
libfunc was changed to output the updated version ofU96LimbsLessThanGuarantee
.The
u96_limbs_less_than_guarantee_verify
libfunc was implemented (it was a noop before this):