Skip to content

Commit

Permalink
chore(avm): more column information in permutations (#11070)
Browse files Browse the repository at this point in the history
Needed for avm2.
  • Loading branch information
fcarreiro authored Jan 6, 2025
1 parent 800c834 commit 8829f24
Show file tree
Hide file tree
Showing 31 changed files with 181 additions and 0 deletions.
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_permutation/generic_permutation_relation.hpp"

#include <cstddef>
Expand All @@ -13,6 +14,11 @@ class perm_cmp_alu_permutation_settings {
// This constant defines how many columns are bundled together to form each set.
constexpr static size_t COLUMNS_PER_SET = 7;

// Columns using the Column enum.
static constexpr Column SRC_SELECTOR = Column::cmp_sel_cmp;
static constexpr Column DST_SELECTOR = Column::alu_cmp_gadget_sel;
static constexpr Column INVERSES = Column::perm_cmp_alu_inv;

template <typename AllEntities> static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in)
{
return (in.cmp_sel_cmp == 1 || in.alu_cmp_gadget_sel == 1);
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_permutation/generic_permutation_relation.hpp"

#include <cstddef>
Expand All @@ -13,6 +14,11 @@ class perm_main_alu_permutation_settings {
// This constant defines how many columns are bundled together to form each set.
constexpr static size_t COLUMNS_PER_SET = 16;

// Columns using the Column enum.
static constexpr Column SRC_SELECTOR = Column::main_sel_alu;
static constexpr Column DST_SELECTOR = Column::alu_sel_alu;
static constexpr Column INVERSES = Column::perm_main_alu_inv;

template <typename AllEntities> static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in)
{
return (in.main_sel_alu == 1 || in.alu_sel_alu == 1);
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_permutation/generic_permutation_relation.hpp"

#include <cstddef>
Expand All @@ -13,6 +14,11 @@ class perm_main_bin_permutation_settings {
// This constant defines how many columns are bundled together to form each set.
constexpr static size_t COLUMNS_PER_SET = 6;

// Columns using the Column enum.
static constexpr Column SRC_SELECTOR = Column::main_sel_bin;
static constexpr Column DST_SELECTOR = Column::binary_start;
static constexpr Column INVERSES = Column::perm_main_bin_inv;

template <typename AllEntities> static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in)
{
return (in.main_sel_bin == 1 || in.binary_start == 1);
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_permutation/generic_permutation_relation.hpp"

#include <cstddef>
Expand All @@ -13,6 +14,11 @@ class perm_main_conv_permutation_settings {
// This constant defines how many columns are bundled together to form each set.
constexpr static size_t COLUMNS_PER_SET = 5;

// Columns using the Column enum.
static constexpr Column SRC_SELECTOR = Column::main_sel_op_radix_be;
static constexpr Column DST_SELECTOR = Column::conversion_sel_to_radix_be;
static constexpr Column INVERSES = Column::perm_main_conv_inv;

template <typename AllEntities> static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in)
{
return (in.main_sel_op_radix_be == 1 || in.conversion_sel_to_radix_be == 1);
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_permutation/generic_permutation_relation.hpp"

#include <cstddef>
Expand All @@ -13,6 +14,11 @@ class perm_main_mem_a_permutation_settings {
// This constant defines how many columns are bundled together to form each set.
constexpr static size_t COLUMNS_PER_SET = 8;

// Columns using the Column enum.
static constexpr Column SRC_SELECTOR = Column::main_sel_mem_op_a;
static constexpr Column DST_SELECTOR = Column::mem_sel_op_a;
static constexpr Column INVERSES = Column::perm_main_mem_a_inv;

template <typename AllEntities> static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in)
{
return (in.main_sel_mem_op_a == 1 || in.mem_sel_op_a == 1);
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_permutation/generic_permutation_relation.hpp"

#include <cstddef>
Expand All @@ -13,6 +14,11 @@ class perm_main_mem_b_permutation_settings {
// This constant defines how many columns are bundled together to form each set.
constexpr static size_t COLUMNS_PER_SET = 8;

// Columns using the Column enum.
static constexpr Column SRC_SELECTOR = Column::main_sel_mem_op_b;
static constexpr Column DST_SELECTOR = Column::mem_sel_op_b;
static constexpr Column INVERSES = Column::perm_main_mem_b_inv;

template <typename AllEntities> static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in)
{
return (in.main_sel_mem_op_b == 1 || in.mem_sel_op_b == 1);
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_permutation/generic_permutation_relation.hpp"

#include <cstddef>
Expand All @@ -13,6 +14,11 @@ class perm_main_mem_c_permutation_settings {
// This constant defines how many columns are bundled together to form each set.
constexpr static size_t COLUMNS_PER_SET = 7;

// Columns using the Column enum.
static constexpr Column SRC_SELECTOR = Column::main_sel_mem_op_c;
static constexpr Column DST_SELECTOR = Column::mem_sel_op_c;
static constexpr Column INVERSES = Column::perm_main_mem_c_inv;

template <typename AllEntities> static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in)
{
return (in.main_sel_mem_op_c == 1 || in.mem_sel_op_c == 1);
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_permutation/generic_permutation_relation.hpp"

#include <cstddef>
Expand All @@ -13,6 +14,11 @@ class perm_main_mem_d_permutation_settings {
// This constant defines how many columns are bundled together to form each set.
constexpr static size_t COLUMNS_PER_SET = 7;

// Columns using the Column enum.
static constexpr Column SRC_SELECTOR = Column::main_sel_mem_op_d;
static constexpr Column DST_SELECTOR = Column::mem_sel_op_d;
static constexpr Column INVERSES = Column::perm_main_mem_d_inv;

template <typename AllEntities> static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in)
{
return (in.main_sel_mem_op_d == 1 || in.mem_sel_op_d == 1);
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_permutation/generic_permutation_relation.hpp"

#include <cstddef>
Expand All @@ -13,6 +14,11 @@ class perm_main_mem_ind_addr_a_permutation_settings {
// This constant defines how many columns are bundled together to form each set.
constexpr static size_t COLUMNS_PER_SET = 4;

// Columns using the Column enum.
static constexpr Column SRC_SELECTOR = Column::main_sel_resolve_ind_addr_a;
static constexpr Column DST_SELECTOR = Column::mem_sel_resolve_ind_addr_a;
static constexpr Column INVERSES = Column::perm_main_mem_ind_addr_a_inv;

template <typename AllEntities> static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in)
{
return (in.main_sel_resolve_ind_addr_a == 1 || in.mem_sel_resolve_ind_addr_a == 1);
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_permutation/generic_permutation_relation.hpp"

#include <cstddef>
Expand All @@ -13,6 +14,11 @@ class perm_main_mem_ind_addr_b_permutation_settings {
// This constant defines how many columns are bundled together to form each set.
constexpr static size_t COLUMNS_PER_SET = 4;

// Columns using the Column enum.
static constexpr Column SRC_SELECTOR = Column::main_sel_resolve_ind_addr_b;
static constexpr Column DST_SELECTOR = Column::mem_sel_resolve_ind_addr_b;
static constexpr Column INVERSES = Column::perm_main_mem_ind_addr_b_inv;

template <typename AllEntities> static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in)
{
return (in.main_sel_resolve_ind_addr_b == 1 || in.mem_sel_resolve_ind_addr_b == 1);
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_permutation/generic_permutation_relation.hpp"

#include <cstddef>
Expand All @@ -13,6 +14,11 @@ class perm_main_mem_ind_addr_c_permutation_settings {
// This constant defines how many columns are bundled together to form each set.
constexpr static size_t COLUMNS_PER_SET = 4;

// Columns using the Column enum.
static constexpr Column SRC_SELECTOR = Column::main_sel_resolve_ind_addr_c;
static constexpr Column DST_SELECTOR = Column::mem_sel_resolve_ind_addr_c;
static constexpr Column INVERSES = Column::perm_main_mem_ind_addr_c_inv;

template <typename AllEntities> static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in)
{
return (in.main_sel_resolve_ind_addr_c == 1 || in.mem_sel_resolve_ind_addr_c == 1);
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_permutation/generic_permutation_relation.hpp"

#include <cstddef>
Expand All @@ -13,6 +14,11 @@ class perm_main_mem_ind_addr_d_permutation_settings {
// This constant defines how many columns are bundled together to form each set.
constexpr static size_t COLUMNS_PER_SET = 4;

// Columns using the Column enum.
static constexpr Column SRC_SELECTOR = Column::main_sel_resolve_ind_addr_d;
static constexpr Column DST_SELECTOR = Column::mem_sel_resolve_ind_addr_d;
static constexpr Column INVERSES = Column::perm_main_mem_ind_addr_d_inv;

template <typename AllEntities> static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in)
{
return (in.main_sel_resolve_ind_addr_d == 1 || in.mem_sel_resolve_ind_addr_d == 1);
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_permutation/generic_permutation_relation.hpp"

#include <cstddef>
Expand All @@ -13,6 +14,11 @@ class perm_main_pos2_perm_permutation_settings {
// This constant defines how many columns are bundled together to form each set.
constexpr static size_t COLUMNS_PER_SET = 4;

// Columns using the Column enum.
static constexpr Column SRC_SELECTOR = Column::main_sel_op_poseidon2;
static constexpr Column DST_SELECTOR = Column::poseidon2_sel_poseidon_perm;
static constexpr Column INVERSES = Column::perm_main_pos2_perm_inv;

template <typename AllEntities> static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in)
{
return (in.main_sel_op_poseidon2 == 1 || in.poseidon2_sel_poseidon_perm == 1);
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_permutation/generic_permutation_relation.hpp"

#include <cstddef>
Expand All @@ -13,6 +14,11 @@ class perm_main_sha256_permutation_settings {
// This constant defines how many columns are bundled together to form each set.
constexpr static size_t COLUMNS_PER_SET = 4;

// Columns using the Column enum.
static constexpr Column SRC_SELECTOR = Column::main_sel_op_sha256;
static constexpr Column DST_SELECTOR = Column::sha256_sel_sha256_compression;
static constexpr Column INVERSES = Column::perm_main_sha256_inv;

template <typename AllEntities> static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in)
{
return (in.main_sel_op_sha256 == 1 || in.sha256_sel_sha256_compression == 1);
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_permutation/generic_permutation_relation.hpp"

#include <cstddef>
Expand All @@ -13,6 +14,11 @@ class perm_merkle_poseidon2_permutation_settings {
// This constant defines how many columns are bundled together to form each set.
constexpr static size_t COLUMNS_PER_SET = 4;

// Columns using the Column enum.
static constexpr Column SRC_SELECTOR = Column::merkle_tree_sel_merkle_tree;
static constexpr Column DST_SELECTOR = Column::poseidon2_full_sel_merkle_tree;
static constexpr Column INVERSES = Column::perm_merkle_poseidon2_inv;

template <typename AllEntities> static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in)
{
return (in.merkle_tree_sel_merkle_tree == 1 || in.poseidon2_full_sel_merkle_tree == 1);
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_permutation/generic_permutation_relation.hpp"

#include <cstddef>
Expand All @@ -13,6 +14,11 @@ class perm_pos2_fixed_pos2_perm_permutation_settings {
// This constant defines how many columns are bundled together to form each set.
constexpr static size_t COLUMNS_PER_SET = 9;

// Columns using the Column enum.
static constexpr Column SRC_SELECTOR = Column::poseidon2_full_sel_poseidon;
static constexpr Column DST_SELECTOR = Column::poseidon2_sel_poseidon_perm_immediate;
static constexpr Column INVERSES = Column::perm_pos2_fixed_pos2_perm_inv;

template <typename AllEntities> static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in)
{
return (in.poseidon2_full_sel_poseidon == 1 || in.poseidon2_sel_poseidon_perm_immediate == 1);
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_permutation/generic_permutation_relation.hpp"

#include <cstddef>
Expand All @@ -13,6 +14,11 @@ class perm_pos_mem_read_a_permutation_settings {
// This constant defines how many columns are bundled together to form each set.
constexpr static size_t COLUMNS_PER_SET = 5;

// Columns using the Column enum.
static constexpr Column SRC_SELECTOR = Column::poseidon2_sel_poseidon_perm_mem_op;
static constexpr Column DST_SELECTOR = Column::mem_sel_op_poseidon_read_a;
static constexpr Column INVERSES = Column::perm_pos_mem_read_a_inv;

template <typename AllEntities> static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in)
{
return (in.poseidon2_sel_poseidon_perm_mem_op == 1 || in.mem_sel_op_poseidon_read_a == 1);
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_permutation/generic_permutation_relation.hpp"

#include <cstddef>
Expand All @@ -13,6 +14,11 @@ class perm_pos_mem_read_b_permutation_settings {
// This constant defines how many columns are bundled together to form each set.
constexpr static size_t COLUMNS_PER_SET = 5;

// Columns using the Column enum.
static constexpr Column SRC_SELECTOR = Column::poseidon2_sel_poseidon_perm_mem_op;
static constexpr Column DST_SELECTOR = Column::mem_sel_op_poseidon_read_b;
static constexpr Column INVERSES = Column::perm_pos_mem_read_b_inv;

template <typename AllEntities> static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in)
{
return (in.poseidon2_sel_poseidon_perm_mem_op == 1 || in.mem_sel_op_poseidon_read_b == 1);
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_permutation/generic_permutation_relation.hpp"

#include <cstddef>
Expand All @@ -13,6 +14,11 @@ class perm_pos_mem_read_c_permutation_settings {
// This constant defines how many columns are bundled together to form each set.
constexpr static size_t COLUMNS_PER_SET = 5;

// Columns using the Column enum.
static constexpr Column SRC_SELECTOR = Column::poseidon2_sel_poseidon_perm_mem_op;
static constexpr Column DST_SELECTOR = Column::mem_sel_op_poseidon_read_c;
static constexpr Column INVERSES = Column::perm_pos_mem_read_c_inv;

template <typename AllEntities> static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in)
{
return (in.poseidon2_sel_poseidon_perm_mem_op == 1 || in.mem_sel_op_poseidon_read_c == 1);
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_permutation/generic_permutation_relation.hpp"

#include <cstddef>
Expand All @@ -13,6 +14,11 @@ class perm_pos_mem_read_d_permutation_settings {
// This constant defines how many columns are bundled together to form each set.
constexpr static size_t COLUMNS_PER_SET = 5;

// Columns using the Column enum.
static constexpr Column SRC_SELECTOR = Column::poseidon2_sel_poseidon_perm_mem_op;
static constexpr Column DST_SELECTOR = Column::mem_sel_op_poseidon_read_d;
static constexpr Column INVERSES = Column::perm_pos_mem_read_d_inv;

template <typename AllEntities> static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in)
{
return (in.poseidon2_sel_poseidon_perm_mem_op == 1 || in.mem_sel_op_poseidon_read_d == 1);
Expand Down
Loading

0 comments on commit 8829f24

Please sign in to comment.