-
Notifications
You must be signed in to change notification settings - Fork 96
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
o1vm/mips: use batch_inversion for the witness generation #2813
base: master
Are you sure you want to change the base?
Conversation
00087d6
to
86aa2a5
Compare
f384222
to
e6169b1
Compare
799172e
to
b45339e
Compare
b45339e
to
30c9354
Compare
4122619
to
8be102a
Compare
@@ -121,3 +125,31 @@ fn test_small_circuit() { | |||
); | |||
assert!(verif, "Verification fails"); | |||
} | |||
|
|||
#[test] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to disagree with these changes. It is a single commit we can simply delete. I only want to keep a regression test in case arkworks changes.
@@ -50,10 +50,17 @@ pub const NUM_INSTRUCTION_LOOKUP_TERMS: usize = 5; | |||
pub const NUM_LOOKUP_TERMS: usize = | |||
NUM_GLOBAL_LOOKUP_TERMS + NUM_DECODING_LOOKUP_TERMS + NUM_INSTRUCTION_LOOKUP_TERMS; | |||
// TODO: Delete and use a vector instead | |||
// FIXME: since the introduction of the scratch size inverse, the value below |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fixed in #2815.
scratch_state: [Fp::from(0); SCRATCH_SIZE], | ||
scratch_state_inverse: [Fp::from(0); SCRATCH_SIZE_INVERSE], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a future PR, as suggested by @mrmr1993, we can try to use BigInt/BigUInt directly to avoid computation in Montgomery representation. I do not know if it would make it better.
// MIPS + hash_counter + byte_counter + eof + num_bytes_read + chunk + bytes | ||
// + length + has_n_bytes + chunk_bytes + preimage | ||
pub const SCRATCH_SIZE: usize = 98; | ||
|
||
/// Number of columns used by the MIPS interpreter to keep values to be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To verify it was the minimal value, I did try to use 11, and it failed.
From there, I run for some millions instructions the op-program, and it never failed.
8be102a
to
4d82c40
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2813 +/- ##
==========================================
+ Coverage 72.10% 72.15% +0.04%
==========================================
Files 256 256
Lines 59946 60042 +96
==========================================
+ Hits 43227 43326 +99
+ Misses 16719 16716 -3 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
These fields will be used to keep track of the elements that should be inverted while generating the proof.
Checking as a regression tests that the batch inversion works with zeroes
4d82c40
to
a11a350
Compare
These fields will be used to keep track of the elements that should be inverted while generating the proof.
Speed from ~250kHz (commit 82464fb) to ~420kHz (head of this branch, i.e. o1vm/batch-inversion).
In a follow-up PR, we should take a look at mrmr1993 idea here to get the same expected performances. Also, we should decrease the number of columns in scratch_state as stated in the FIXME.
On commit 82464fb, getting:
On the head of this branch: