Skip to content
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

chore(avm): extra column information in lookups #10905

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// AUTOGENERATED FILE
#pragma once

#include "../columns.hpp"
#include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp"

#include <cstddef>
Expand All @@ -19,6 +20,14 @@ class incl_main_tag_err_lookup_settings {
static constexpr size_t READ_TERM_DEGREE = 0;
static constexpr size_t WRITE_TERM_DEGREE = 0;

// Columns using the Column enum.
static constexpr Column SRC_SELECTOR = Column::mem_tag_err;
static constexpr Column DST_SELECTOR = Column::main_tag_err;
static constexpr Column COUNTS = Column::incl_main_tag_err_counts;
static constexpr Column INVERSES = Column::incl_main_tag_err_inv;
static constexpr std::array<Column, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = { Column::mem_clk };
static constexpr std::array<Column, LOOKUP_TUPLE_SIZE> DST_COLUMNS = { Column::main_clk };

template <typename AllEntities> static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in)
{
return (in.mem_tag_err == 1 || in.main_tag_err == 1);
Expand All @@ -35,15 +44,15 @@ class incl_main_tag_err_lookup_settings {

template <typename AllEntities> static inline auto get_const_entities(const AllEntities& in)
{
return std::forward_as_tuple(in.incl_main_tag_err_inv,
in.incl_main_tag_err_counts,
in.mem_tag_err,
in.main_tag_err,
in.mem_clk,
in.main_clk);
return get_entities(in);
}

template <typename AllEntities> static inline auto get_nonconst_entities(AllEntities& in)
{
return get_entities(in);
}

template <typename AllEntities> static inline auto get_entities(AllEntities&& in)
{
return std::forward_as_tuple(in.incl_main_tag_err_inv,
in.incl_main_tag_err_counts,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// AUTOGENERATED FILE
#pragma once

#include "../columns.hpp"
#include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp"

#include <cstddef>
Expand All @@ -19,6 +20,14 @@ class incl_mem_tag_err_lookup_settings {
static constexpr size_t READ_TERM_DEGREE = 0;
static constexpr size_t WRITE_TERM_DEGREE = 0;

// Columns using the Column enum.
static constexpr Column SRC_SELECTOR = Column::main_tag_err;
static constexpr Column DST_SELECTOR = Column::mem_tag_err;
static constexpr Column COUNTS = Column::incl_mem_tag_err_counts;
static constexpr Column INVERSES = Column::incl_mem_tag_err_inv;
static constexpr std::array<Column, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = { Column::main_clk };
static constexpr std::array<Column, LOOKUP_TUPLE_SIZE> DST_COLUMNS = { Column::mem_clk };

template <typename AllEntities> static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in)
{
return (in.main_tag_err == 1 || in.mem_tag_err == 1);
Expand All @@ -35,15 +44,15 @@ class incl_mem_tag_err_lookup_settings {

template <typename AllEntities> static inline auto get_const_entities(const AllEntities& in)
{
return std::forward_as_tuple(in.incl_mem_tag_err_inv,
in.incl_mem_tag_err_counts,
in.main_tag_err,
in.mem_tag_err,
in.main_clk,
in.mem_clk);
return get_entities(in);
}

template <typename AllEntities> static inline auto get_nonconst_entities(AllEntities& in)
{
return get_entities(in);
}

template <typename AllEntities> static inline auto get_entities(AllEntities&& in)
{
return std::forward_as_tuple(in.incl_mem_tag_err_inv,
in.incl_mem_tag_err_counts,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// AUTOGENERATED FILE
#pragma once

#include "../columns.hpp"
#include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp"

#include <cstddef>
Expand All @@ -19,6 +20,16 @@ class lookup_byte_lengths_lookup_settings {
static constexpr size_t READ_TERM_DEGREE = 0;
static constexpr size_t WRITE_TERM_DEGREE = 0;

// Columns using the Column enum.
static constexpr Column SRC_SELECTOR = Column::binary_start;
static constexpr Column DST_SELECTOR = Column::byte_lookup_sel_bin;
static constexpr Column COUNTS = Column::lookup_byte_lengths_counts;
static constexpr Column INVERSES = Column::lookup_byte_lengths_inv;
static constexpr std::array<Column, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = { Column::binary_in_tag,
Column::binary_mem_tag_ctr };
static constexpr std::array<Column, LOOKUP_TUPLE_SIZE> DST_COLUMNS = { Column::byte_lookup_table_in_tags,
Column::byte_lookup_table_byte_lengths };

template <typename AllEntities> static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in)
{
return (in.binary_start == 1 || in.byte_lookup_sel_bin == 1);
Expand All @@ -35,17 +46,15 @@ class lookup_byte_lengths_lookup_settings {

template <typename AllEntities> static inline auto get_const_entities(const AllEntities& in)
{
return std::forward_as_tuple(in.lookup_byte_lengths_inv,
in.lookup_byte_lengths_counts,
in.binary_start,
in.byte_lookup_sel_bin,
in.binary_in_tag,
in.binary_mem_tag_ctr,
in.byte_lookup_table_in_tags,
in.byte_lookup_table_byte_lengths);
return get_entities(in);
}

template <typename AllEntities> static inline auto get_nonconst_entities(AllEntities& in)
{
return get_entities(in);
}

template <typename AllEntities> static inline auto get_entities(AllEntities&& in)
{
return std::forward_as_tuple(in.lookup_byte_lengths_inv,
in.lookup_byte_lengths_counts,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// AUTOGENERATED FILE
#pragma once

#include "../columns.hpp"
#include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp"

#include <cstddef>
Expand All @@ -19,6 +20,19 @@ class lookup_byte_operations_lookup_settings {
static constexpr size_t READ_TERM_DEGREE = 0;
static constexpr size_t WRITE_TERM_DEGREE = 0;

// Columns using the Column enum.
static constexpr Column SRC_SELECTOR = Column::binary_sel_bin;
static constexpr Column DST_SELECTOR = Column::byte_lookup_sel_bin;
static constexpr Column COUNTS = Column::lookup_byte_operations_counts;
static constexpr Column INVERSES = Column::lookup_byte_operations_inv;
static constexpr std::array<Column, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = {
Column::binary_op_id, Column::binary_ia_bytes, Column::binary_ib_bytes, Column::binary_ic_bytes
};
static constexpr std::array<Column, LOOKUP_TUPLE_SIZE> DST_COLUMNS = { Column::byte_lookup_table_op_id,
Column::byte_lookup_table_input_a,
Column::byte_lookup_table_input_b,
Column::byte_lookup_table_output };

template <typename AllEntities> static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in)
{
return (in.binary_sel_bin == 1 || in.byte_lookup_sel_bin == 1);
Expand All @@ -35,21 +49,15 @@ class lookup_byte_operations_lookup_settings {

template <typename AllEntities> static inline auto get_const_entities(const AllEntities& in)
{
return std::forward_as_tuple(in.lookup_byte_operations_inv,
in.lookup_byte_operations_counts,
in.binary_sel_bin,
in.byte_lookup_sel_bin,
in.binary_op_id,
in.binary_ia_bytes,
in.binary_ib_bytes,
in.binary_ic_bytes,
in.byte_lookup_table_op_id,
in.byte_lookup_table_input_a,
in.byte_lookup_table_input_b,
in.byte_lookup_table_output);
return get_entities(in);
}

template <typename AllEntities> static inline auto get_nonconst_entities(AllEntities& in)
{
return get_entities(in);
}

template <typename AllEntities> static inline auto get_entities(AllEntities&& in)
{
return std::forward_as_tuple(in.lookup_byte_operations_inv,
in.lookup_byte_operations_counts,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// AUTOGENERATED FILE
#pragma once

#include "../columns.hpp"
#include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp"

#include <cstddef>
Expand All @@ -19,6 +20,15 @@ class lookup_cd_value_lookup_settings {
static constexpr size_t READ_TERM_DEGREE = 0;
static constexpr size_t WRITE_TERM_DEGREE = 0;

// Columns using the Column enum.
static constexpr Column SRC_SELECTOR = Column::slice_sel_cd_cpy;
static constexpr Column DST_SELECTOR = Column::main_sel_calldata;
static constexpr Column COUNTS = Column::lookup_cd_value_counts;
static constexpr Column INVERSES = Column::lookup_cd_value_inv;
static constexpr std::array<Column, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = { Column::slice_col_offset,
Column::slice_val };
static constexpr std::array<Column, LOOKUP_TUPLE_SIZE> DST_COLUMNS = { Column::main_clk, Column::main_calldata };

template <typename AllEntities> static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in)
{
return (in.slice_sel_cd_cpy == 1 || in.main_sel_calldata == 1);
Expand All @@ -35,17 +45,15 @@ class lookup_cd_value_lookup_settings {

template <typename AllEntities> static inline auto get_const_entities(const AllEntities& in)
{
return std::forward_as_tuple(in.lookup_cd_value_inv,
in.lookup_cd_value_counts,
in.slice_sel_cd_cpy,
in.main_sel_calldata,
in.slice_col_offset,
in.slice_val,
in.main_clk,
in.main_calldata);
return get_entities(in);
}

template <typename AllEntities> static inline auto get_nonconst_entities(AllEntities& in)
{
return get_entities(in);
}

template <typename AllEntities> static inline auto get_entities(AllEntities&& in)
{
return std::forward_as_tuple(in.lookup_cd_value_inv,
in.lookup_cd_value_counts,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// AUTOGENERATED FILE
#pragma once

#include "../columns.hpp"
#include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp"

#include <cstddef>
Expand All @@ -19,6 +20,14 @@ class lookup_da_gas_rng_chk_0_lookup_settings {
static constexpr size_t READ_TERM_DEGREE = 0;
static constexpr size_t WRITE_TERM_DEGREE = 0;

// Columns using the Column enum.
static constexpr Column SRC_SELECTOR = Column::main_is_gas_accounted;
static constexpr Column DST_SELECTOR = Column::main_sel_rng_16;
static constexpr Column COUNTS = Column::lookup_da_gas_rng_chk_0_counts;
static constexpr Column INVERSES = Column::lookup_da_gas_rng_chk_0_inv;
static constexpr std::array<Column, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = { Column::main_da_gas_u16_r0 };
static constexpr std::array<Column, LOOKUP_TUPLE_SIZE> DST_COLUMNS = { Column::main_clk };

template <typename AllEntities> static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in)
{
return (in.main_is_gas_accounted == 1 || in.main_sel_rng_16 == 1);
Expand All @@ -35,15 +44,15 @@ class lookup_da_gas_rng_chk_0_lookup_settings {

template <typename AllEntities> static inline auto get_const_entities(const AllEntities& in)
{
return std::forward_as_tuple(in.lookup_da_gas_rng_chk_0_inv,
in.lookup_da_gas_rng_chk_0_counts,
in.main_is_gas_accounted,
in.main_sel_rng_16,
in.main_da_gas_u16_r0,
in.main_clk);
return get_entities(in);
}

template <typename AllEntities> static inline auto get_nonconst_entities(AllEntities& in)
{
return get_entities(in);
}

template <typename AllEntities> static inline auto get_entities(AllEntities&& in)
{
return std::forward_as_tuple(in.lookup_da_gas_rng_chk_0_inv,
in.lookup_da_gas_rng_chk_0_counts,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// AUTOGENERATED FILE
#pragma once

#include "../columns.hpp"
#include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp"

#include <cstddef>
Expand All @@ -19,6 +20,14 @@ class lookup_da_gas_rng_chk_1_lookup_settings {
static constexpr size_t READ_TERM_DEGREE = 0;
static constexpr size_t WRITE_TERM_DEGREE = 0;

// Columns using the Column enum.
static constexpr Column SRC_SELECTOR = Column::main_is_gas_accounted;
static constexpr Column DST_SELECTOR = Column::main_sel_rng_16;
static constexpr Column COUNTS = Column::lookup_da_gas_rng_chk_1_counts;
static constexpr Column INVERSES = Column::lookup_da_gas_rng_chk_1_inv;
static constexpr std::array<Column, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = { Column::main_da_gas_u16_r1 };
static constexpr std::array<Column, LOOKUP_TUPLE_SIZE> DST_COLUMNS = { Column::main_clk };

template <typename AllEntities> static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in)
{
return (in.main_is_gas_accounted == 1 || in.main_sel_rng_16 == 1);
Expand All @@ -35,15 +44,15 @@ class lookup_da_gas_rng_chk_1_lookup_settings {

template <typename AllEntities> static inline auto get_const_entities(const AllEntities& in)
{
return std::forward_as_tuple(in.lookup_da_gas_rng_chk_1_inv,
in.lookup_da_gas_rng_chk_1_counts,
in.main_is_gas_accounted,
in.main_sel_rng_16,
in.main_da_gas_u16_r1,
in.main_clk);
return get_entities(in);
}

template <typename AllEntities> static inline auto get_nonconst_entities(AllEntities& in)
{
return get_entities(in);
}

template <typename AllEntities> static inline auto get_entities(AllEntities&& in)
{
return std::forward_as_tuple(in.lookup_da_gas_rng_chk_1_inv,
in.lookup_da_gas_rng_chk_1_counts,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// AUTOGENERATED FILE
#pragma once

#include "../columns.hpp"
#include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp"

#include <cstddef>
Expand All @@ -19,6 +20,14 @@ class lookup_l2_gas_rng_chk_0_lookup_settings {
static constexpr size_t READ_TERM_DEGREE = 0;
static constexpr size_t WRITE_TERM_DEGREE = 0;

// Columns using the Column enum.
static constexpr Column SRC_SELECTOR = Column::main_is_gas_accounted;
static constexpr Column DST_SELECTOR = Column::main_sel_rng_16;
static constexpr Column COUNTS = Column::lookup_l2_gas_rng_chk_0_counts;
static constexpr Column INVERSES = Column::lookup_l2_gas_rng_chk_0_inv;
static constexpr std::array<Column, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = { Column::main_l2_gas_u16_r0 };
static constexpr std::array<Column, LOOKUP_TUPLE_SIZE> DST_COLUMNS = { Column::main_clk };

template <typename AllEntities> static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in)
{
return (in.main_is_gas_accounted == 1 || in.main_sel_rng_16 == 1);
Expand All @@ -35,15 +44,15 @@ class lookup_l2_gas_rng_chk_0_lookup_settings {

template <typename AllEntities> static inline auto get_const_entities(const AllEntities& in)
{
return std::forward_as_tuple(in.lookup_l2_gas_rng_chk_0_inv,
in.lookup_l2_gas_rng_chk_0_counts,
in.main_is_gas_accounted,
in.main_sel_rng_16,
in.main_l2_gas_u16_r0,
in.main_clk);
return get_entities(in);
}

template <typename AllEntities> static inline auto get_nonconst_entities(AllEntities& in)
{
return get_entities(in);
}

template <typename AllEntities> static inline auto get_entities(AllEntities&& in)
{
return std::forward_as_tuple(in.lookup_l2_gas_rng_chk_0_inv,
in.lookup_l2_gas_rng_chk_0_counts,
Expand Down
Loading
Loading