-
Notifications
You must be signed in to change notification settings - Fork 2
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
Verifier optimizations #106
Comments
Sword-Smith
added a commit
that referenced
this issue
Jun 11, 2024
Saves 10 % of the rows in the processor table for this snippet. This addresses the 1st optimization mentioned in #106.
Sword-Smith
added a commit
that referenced
this issue
Jun 11, 2024
Save another 11 % of rows in the processor table for the relevant problem size. This is close to being the end-of-the-line for efficient Merkle root calculation, I believe. Even fewer lines could be used if the leaf number is known, by using the snippet for statically-known leaf counts, but you pay a big price for program size (and thus hash table row count) if you do that. This completes the 1st optimization mentioned in #106.
Sword-Smith
added a commit
that referenced
this issue
Jun 11, 2024
Rewrite the snippet for barycentric evaluation to use fewer processor and opstack rows, and more RAM rows. The goal with this rewrite is to make higher expansion factors more feasible, as the very high row count for this snippet made expansion factors above 8 meaningless. With this rewrite, expansion factors above 8 can be considered. This rewrite is not completely without controversy, as it increases the RAM table row-count somewhat. For expansion factor 4, RAM table row count is increases by 4'600 and twice that for expansion factor 16. The savings to the processor table are 7'000 and 20'000, respectively. If these changes are not beneficial, this commit can be reverted. This completes 2nd and 3rd optimizations in #106.
Sword-Smith
added a commit
that referenced
this issue
Jun 11, 2024
Saves 10 % of the rows in the processor table for this snippet. This addresses the 1st optimization mentioned in #106.
Sword-Smith
added a commit
that referenced
this issue
Jun 11, 2024
Save another 11 % of rows in the processor table for the relevant problem size. This is close to being the end-of-the-line for efficient Merkle root calculation, I believe. Even fewer lines could be used if the leaf number is known, by using the snippet for statically-known leaf counts, but you pay a big price for program size (and thus hash table row count) if you do that. This completes the 1st optimization mentioned in #106.
Note that cd71bd2 can be reverted to save ~4.600 RAM table rows at the cost of 7.300 processor table rows. Twice that for EF 16. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Some optimizations that we could do to the STARK verifier
recurse_or_return
in inner looprecurse_or_return
in inner loopmerkle_walk
zip
for return valuemap
s for verifying last codewordAll savings are calculated for a FRI expansion factor of 4 and an inner padded height of$2^{19}$ on triton-vm 0.42-alpha5. A negative value indicates an increase in the row count for this change.
For reference current row counts for the execution of the STARK verifier program are given below.
Introducing
merkle_walk
would get us very close to being RAM-table dominated1. And when we are RAM dominated, I'm not sure further optimizations are that beneficial. But that depends on what program recursion is combined with.Update
After addressing the first three optimizations, we have:
Footnotes
notice that the above-mentioned savings are for expansion factor 4, and that the savings introduced by
merkle_walk
decrease with a higher expansion factor. ↩The text was updated successfully, but these errors were encountered: