Skip to content

Commit

Permalink
clean up and run all CI
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasxia01 committed Sep 16, 2024
1 parent 4f0421f commit a4b80bb
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,20 @@ TEST(MegaCircuitBuilder, GoblinEccOpQueueUltraOps)
}
}

/**
* @brief Check that the selector partitioning is correct for the mega circuit builder
* @details We check that for the arithmetic, delta_range, elliptic, aux, lookup, busread, poseidon2_external,
* poseidon2_internal blocks, and the other selectors are zero on that block.
*/
TEST(MegaCircuitBuilder, CompleteSelectorPartitioningCheck)
{
auto builder = MegaCircuitBuilder();
GoblinMockCircuits::construct_simple_circuit(builder);
bool result = CircuitChecker::check(builder);
EXPECT_EQ(result, true);

// Check that for the blocks arithmetic, delta_range, elliptic, aux, lookup, busread, poseidon2_external,
// poseidon2_internal the corresponding selector polynomial is non-zero on the appropriate rows and the other
// selectors are zero get the trace blocks
// For each block, we want to check that all of the other selectors are zero on that block besides the one
// corresponding to the current block
for (auto& block : builder.blocks.get()) {
for (size_t i = 0; i < block.size(); ++i) {
if (&block != &builder.blocks.arithmetic) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ TEST(UltraCircuitConstructor, NonNativeFieldMultiplication)
}

/**
* @brief Test that each block only contains gates which have the corresponding selector turned on.
* @brief Test that the aux block only contains aux gates.
*
*/
TEST(UltraCircuitConstructor, NonNativeFieldMultiplicationSortCheck)
Expand Down Expand Up @@ -705,7 +705,8 @@ TEST(UltraCircuitConstructor, NonNativeFieldMultiplicationSortCheck)
bool result = CircuitChecker::check(circuit_constructor);
EXPECT_EQ(result, true);

// Check that in the aux blocks, only the aux selector is nonzero, while the other selectors are zero
// Everything above was copied from the previous test.
// Check that in the aux blocks, the other selectors besides the aux selector are zero
for (size_t i = 0; i < circuit_constructor.blocks.aux.size(); ++i) {
EXPECT_EQ(circuit_constructor.blocks.aux.q_arith()[i], 0);
EXPECT_EQ(circuit_constructor.blocks.aux.q_delta_range()[i], 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,41 @@ TEST_F(MegaMockCircuitsPinning, AppCircuitSizes)
run_test(false);
}

TEST_F(MegaMockCircuitsPinning, StructuredAztecIVCBenchSizes)
/**
* @brief Regression test that the structured circuit size has not increased over a power of 2.
*/
TEST_F(MegaMockCircuitsPinning, SmallTestStructuredCircuitSize)
{
GoblinProver goblin;
MegaCircuitBuilder app_circuit{ goblin.op_queue };
GoblinMockCircuits::construct_mock_app_circuit(app_circuit);
auto proving_key = std::make_shared<DeciderProvingKey>(app_circuit, TraceStructure::SMALL_TEST);
EXPECT_EQ(proving_key->proving_key.log_circuit_size, 18);
}

TEST_F(MegaMockCircuitsPinning, ClientIVCBenchStructuredCircuitSize)
{
GoblinProver goblin;
MegaCircuitBuilder app_circuit{ goblin.op_queue };
GoblinMockCircuits::construct_mock_app_circuit(app_circuit);
auto proving_key = std::make_shared<DeciderProvingKey>(app_circuit, TraceStructure::CLIENT_IVC_BENCH);
EXPECT_EQ(proving_key->proving_key.log_circuit_size, 18);
}

TEST_F(MegaMockCircuitsPinning, AztecIVCBenchStructuredCircuitSize)
{
GoblinProver goblin;
MegaCircuitBuilder app_circuit{ goblin.op_queue };
GoblinMockCircuits::construct_mock_app_circuit(app_circuit);
auto proving_key = std::make_shared<DeciderProvingKey>(app_circuit, TraceStructure::AZTEC_IVC_BENCH);
EXPECT_EQ(proving_key->proving_key.log_circuit_size, 19);
}

TEST_F(MegaMockCircuitsPinning, E2EStructuredCircuitSize)
{
GoblinProver goblin;
MegaCircuitBuilder app_circuit{ goblin.op_queue };
GoblinMockCircuits::construct_mock_app_circuit(app_circuit);
auto proving_key = std::make_shared<DeciderProvingKey>(app_circuit, TraceStructure::E2E_FULL_TEST);
EXPECT_EQ(proving_key->proving_key.log_circuit_size, 20);
}
Original file line number Diff line number Diff line change
Expand Up @@ -1719,7 +1719,7 @@ std::array<uint32_t, 2> UltraCircuitBuilder_<Arithmetization>::evaluate_non_nati

// TODO(https://github.com/AztecProtocol/barretenberg/issues/879): Originally this was a single arithmetic gate.
// With trace sorting, we must add a dummy gate since the add gate would otherwise try to read into an aux gate that
// has been sorted out of sequence. (Note: temporarily disabled in favor of manual arith gate in aux block above).
// has been sorted out of sequence.
// product gate 1
// (lo_0 + q_0(p_0 + p_1*2^b) + q_1(p_0*2^b) - (r_1)2^b)2^-2b - lo_1 = 0
create_big_add_gate({ input.q[0],
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@ COMMIT_TAG=<RELEASE_TAG_NUMBER_YOU_WANT e.g. aztec-packages-v0.8.8>
- Extract `VERSION` as the script shows (in the eg it should be 0.8.8)
- Skip the version existing checks like `if [ "$VERSION" == "$PUBLISHED_VERSION" ]` and `if [ "$VERSION" != "$HIGHER_VERSION" ]`. Since this is our first time deploying the package, `PUBLISHED_VERSION` and `HIGHER_VERSION` will be empty and hence these checks would fail. These checks are necessary in the CI for continual releases.
- Locally update the package version in package.json using `jq` as shown in the script.
- Do a dry-run
- Do a dry-run
- If dry run succeeds, publish the package!
5. Create a PR by adding your package into the `deploy-npm` script so next release onwards, CI can cut releases for your package.

0 comments on commit a4b80bb

Please sign in to comment.