Skip to content

Commit

Permalink
chore(avm): smaller skippable test (#8664)
Browse files Browse the repository at this point in the history
The elements are completely random so a few iterations should be more
than enough.
  • Loading branch information
fcarreiro authored Sep 20, 2024
1 parent 8bfc769 commit 2418977
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ using namespace bb::Avm_vm;
TEST(AvmSkippableTests, shouldSkipCorrectly)
{
using FF = AvmFlavor::FF;
constexpr size_t TRACE_SIZE = 1 << 15;
constexpr size_t TRACE_SIZE = 300;

std::vector<AvmFullRow<FF>> trace(TRACE_SIZE);
std::cerr << "Generating trace of size " << TRACE_SIZE << "..." << std::endl;
// This is the most time consuming part of this test!
// In particular, the generation of random fields.
bb::parallel_for(trace.size(), [&](size_t i) {
Expand All @@ -39,13 +38,11 @@ TEST(AvmSkippableTests, shouldSkipCorrectly)
// Set the conditions for skippable to return true.
row.poseidon2_sel_poseidon_perm = 0;
});
std::cerr << "Done generating trace..." << std::endl;

// We build the polynomials needed to run "sumcheck".
AvmCircuitBuilder cb;
cb.set_trace(std::move(trace));
auto polys = cb.compute_polynomials();
std::cerr << "Done computing polynomials..." << std::endl;

// For each skippable relation we will check:
// 1. That Relation::skippable returns true (i.e., we correctly set the conditions)
Expand Down Expand Up @@ -75,7 +72,7 @@ TEST(AvmSkippableTests, shouldSkipCorrectly)
if (result[j] != 0) {
EXPECT_EQ(result[j], 0)
<< "Relation " << Relation::NAME << " subrelation " << j << " was expected to be zero.";
GTEST_SKIP();
GTEST_FAIL();
}
}
}
Expand Down

0 comments on commit 2418977

Please sign in to comment.