6#include <gtest/gtest.h>
9template <
typename Builder>
class RomTableTests :
public ::testing::Test {
15using BuilderTypes = testing::Types<UltraCircuitBuilder, MegaCircuitBuilder>;
25TEST(RomTable, TagCorrectness)
44 table_values.emplace_back(entry_1);
45 table_values.emplace_back(entry_2);
46 table_values.emplace_back(entry_3);
57 EXPECT_THROW(table[0] + table[2], std::runtime_error);
67 using field_ct =
typename TestFixture::field_ct;
68 using witness_ct =
typename TestFixture::witness_ct;
73 const size_t table_size = 10;
75 for (
size_t i = 0; i < table_size; ++i) {
84 for (
size_t i = 0; i < table_size; ++i) {
89 const auto before_n =
builder.num_gates();
90 const auto to_add = table[
index];
91 const auto after_n =
builder.num_gates();
96 EXPECT_EQ(after_n - before_n, 1ULL);
100 const auto before_n =
builder.num_gates();
101 const auto to_add = table[i];
102 const auto after_n =
builder.num_gates();
104 EXPECT_EQ(after_n - before_n, 0ULL);
107 expected += table_values[i].get_value();
117 using field_ct =
typename TestFixture::field_ct;
118 using witness_ct =
typename TestFixture::witness_ct;
119 using rom_table_ct =
typename TestFixture::rom_table_ct;
124 const size_t table_size = 5;
125 for (
size_t i = 0; i < table_size; ++i) {
130 const auto copied_rom_table = table;
134 for (
size_t i = 0; i < table_size; ++i) {
137 const auto to_add = (i % 2 == 0) ? copied_rom_table[
index] : table[
index];
139 expected += table_values[i].get_value();
144 EXPECT_EQ(verified,
true);
static bool check(const Builder &circuit)
Check the witness satisifies the circuit.
bb::fr get_value() const
Given a := *this, compute its value given by a.v * a.mul + a.add.
void set_origin_tag(const OriginTag &new_tag) const
bn254::witness_ct witness_ct
stdlib::field_t< Builder > field_ct
RNG & get_debug_randomness(bool reset, std::uint_fast64_t seed)
Entry point for Barretenberg command-line interface.
TYPED_TEST_SUITE(ShpleminiTest, TestSettings)
UltraCircuitBuilder_< UltraExecutionTraceBlocks > UltraCircuitBuilder
TYPED_TEST(ShpleminiTest, CorrectnessOfMultivariateClaimBatching)
TEST(BoomerangMegaCircuitBuilder, BasicCircuit)
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
This file contains part of the logic for the Origin Tag mechanism that tracks the use of in-circuit p...
#define STANDARD_TESTING_TAGS
::testing::Types< UltraCircuitBuilder, MegaCircuitBuilder > BuilderTypes
static field random_element(numeric::RNG *engine=nullptr) noexcept