-
Notifications
You must be signed in to change notification settings - Fork 324
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: fixed VK in MegaZK/ECCVM/Translator/Tube Recursive Verifier ci…
…rcuits (#11377) * Ensure that the verification keys for MegaZK-/ECCVM-/Translator Recursive Verifier circuits are fixed. * Ensure that the verification key for the Tube(=ClientIVC Recursive Verifier) circuit is fixed. Will close AztecProtocol/barretenberg#1146
- Loading branch information
1 parent
d4b7075
commit 5018c94
Showing
6 changed files
with
276 additions
and
87 deletions.
There are no files selected for viewing
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
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
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
57 changes: 57 additions & 0 deletions
57
...etenberg/cpp/src/barretenberg/stdlib/honk_verifier/ultra_verification_keys_comparator.hpp
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
|
||
|
||
#include "barretenberg/common/assert.hpp" | ||
#include "barretenberg/common/log.hpp" | ||
#include <array> | ||
#include <memory> | ||
namespace bb { | ||
|
||
template <typename OuterFlavor> | ||
static void compare_ultra_blocks_and_verification_keys( | ||
std::array<typename OuterFlavor::CircuitBuilder::ExecutionTrace, 2> blocks, | ||
std::array<std::shared_ptr<typename OuterFlavor::VerificationKey>, 2> verification_keys) | ||
{ | ||
|
||
// Retrieves the trace blocks (each consisting of a specific gate) from the recursive verifier circuit | ||
|
||
bool broke(false); | ||
auto check_eq = [&broke](auto& p1, auto& p2, size_t block_idx, size_t selector_idx) { | ||
ASSERT(p1.size() == p2.size()); | ||
for (size_t idx = 0; idx < p1.size(); idx++) { | ||
if (p1[idx] != p2[idx]) { | ||
info("Mismatch selector ", selector_idx, " in block ", block_idx, ", at ", idx); | ||
broke = true; | ||
break; | ||
} | ||
} | ||
}; | ||
|
||
size_t block_idx = 0; | ||
for (auto [block_0, block_1] : zip_view(blocks[0].get(), blocks[1].get())) { | ||
ASSERT(block_0.selectors.size() == 13); | ||
ASSERT(block_1.selectors.size() == 13); | ||
size_t selector_idx = 0; | ||
for (auto [p_10, p_11] : zip_view(block_0.selectors, block_1.selectors)) { | ||
check_eq(p_10, p_11, block_idx, selector_idx); | ||
selector_idx++; | ||
} | ||
block_idx++; | ||
} | ||
|
||
typename OuterFlavor::CommitmentLabels labels; | ||
for (auto [vk_0, vk_1, label] : | ||
zip_view(verification_keys[0]->get_all(), verification_keys[1]->get_all(), labels.get_precomputed())) { | ||
if (vk_0 != vk_1) { | ||
broke = true; | ||
info("Mismatch verification key label: ", label, " left: ", vk_0, " right: ", vk_1); | ||
} | ||
} | ||
|
||
ASSERT(verification_keys[0]->circuit_size == verification_keys[1]->circuit_size); | ||
ASSERT(verification_keys[0]->num_public_inputs == verification_keys[1]->num_public_inputs); | ||
ASSERT(verification_keys[0]->pub_inputs_offset == verification_keys[1]->pub_inputs_offset); | ||
|
||
ASSERT(!broke); | ||
} | ||
|
||
} // namespace bb |
Oops, something went wrong.
5018c94
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.
Possible performance regression was detected for benchmark 'C++ Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold
1.05
.wasmClientIVCBench/Full/6
85492.789257
ms/iter75253.680304
ms/iter1.14
commit(t)
3875433356
ns/iter3260263498
ns/iter1.19
Goblin::merge(t)
161086378
ns/iter139078838
ns/iter1.16
This comment was automatically generated by workflow using github-action-benchmark.
CC: @ludamad @codygunton