Skip to content

Commit

Permalink
Remove bin_ prefix in some column names
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanmon committed Mar 27, 2024
1 parent b7c339e commit 30f7af2
Show file tree
Hide file tree
Showing 9 changed files with 89 additions and 91 deletions.
22 changes: 11 additions & 11 deletions barretenberg/cpp/pil/avm/avm_binary.pil
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ include "avm_main.pil";

namespace avm_binary(256);

pol commit bin_clk;
pol commit clk;

// Selector for Binary Operation
pol commit bin_sel;
Expand All @@ -31,9 +31,9 @@ namespace avm_binary(256);

// Little Endian bitwise decomposition of accumulators (which are processed top-down),
// constrained to be U8 given by the lookup to the avm_byte_lookup
pol commit bin_ia_bytes;
pol commit bin_ib_bytes;
pol commit bin_ic_bytes;
pol commit ia_bytes;
pol commit ib_bytes;
pol commit ic_bytes;

pol commit start; // Identifies when we want to capture the output to the main trace.

Expand All @@ -58,24 +58,24 @@ namespace avm_binary(256);
mem_tag_ctr * ((1 - bin_sel) * (1 - mem_tag_ctr_inv) + mem_tag_ctr_inv) - bin_sel = 0;

// Forces accumulator to start at zero when mem_tag_ctr == 0
(1 - bin_sel) * acc_ia = 0;
(1 - bin_sel) * acc_ib = 0;
(1 - bin_sel) * acc_ia = 0;
(1 - bin_sel) * acc_ib = 0;
(1 - bin_sel) * acc_ic = 0;

#[LOOKUP_BYTE_LENGTHS]
start {in_tag, mem_tag_ctr}
start {in_tag, mem_tag_ctr}
in
avm_byte_lookup.bin_sel {avm_byte_lookup.table_in_tags, avm_byte_lookup.table_byte_lengths};

#[LOOKUP_BYTE_OPERATIONS]
bin_sel {op_id, bin_ia_bytes, bin_ib_bytes, bin_ic_bytes}
bin_sel {op_id, ia_bytes, ib_bytes, ic_bytes}
in
avm_byte_lookup.bin_sel {avm_byte_lookup.table_op_id, avm_byte_lookup.table_input_a, avm_byte_lookup.table_input_b, avm_byte_lookup.table_output};

#[ACC_REL_A]
(acc_ia - bin_ia_bytes - 256 * acc_ia') * mem_tag_ctr = 0;
(acc_ia - ia_bytes - 256 * acc_ia') * mem_tag_ctr = 0;
#[ACC_REL_B]
(acc_ib - bin_ib_bytes - 256 * acc_ib') * mem_tag_ctr = 0;
(acc_ib - ib_bytes - 256 * acc_ib') * mem_tag_ctr = 0;
#[ACC_REL_C]
(acc_ic - bin_ic_bytes - 256 * acc_ic') * mem_tag_ctr = 0;
(acc_ic - ic_bytes - 256 * acc_ic') * mem_tag_ctr = 0;

Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ template <typename FF> struct Avm_binaryRow {
FF avm_binary_acc_ib_shift{};
FF avm_binary_acc_ic{};
FF avm_binary_acc_ic_shift{};
FF avm_binary_bin_ia_bytes{};
FF avm_binary_bin_ib_bytes{};
FF avm_binary_bin_ic_bytes{};
FF avm_binary_bin_sel{};
FF avm_binary_ia_bytes{};
FF avm_binary_ib_bytes{};
FF avm_binary_ic_bytes{};
FF avm_binary_mem_tag_ctr{};
FF avm_binary_mem_tag_ctr_inv{};
FF avm_binary_mem_tag_ctr_shift{};
Expand Down Expand Up @@ -126,7 +126,7 @@ template <typename FF_> class avm_binaryImpl {
{
Avm_DECLARE_VIEWS(7);

auto tmp = (((avm_binary_acc_ia - avm_binary_bin_ia_bytes) - (avm_binary_acc_ia_shift * FF(256))) *
auto tmp = (((avm_binary_acc_ia - avm_binary_ia_bytes) - (avm_binary_acc_ia_shift * FF(256))) *
avm_binary_mem_tag_ctr);
tmp *= scaling_factor;
std::get<7>(evals) += tmp;
Expand All @@ -135,7 +135,7 @@ template <typename FF_> class avm_binaryImpl {
{
Avm_DECLARE_VIEWS(8);

auto tmp = (((avm_binary_acc_ib - avm_binary_bin_ib_bytes) - (avm_binary_acc_ib_shift * FF(256))) *
auto tmp = (((avm_binary_acc_ib - avm_binary_ib_bytes) - (avm_binary_acc_ib_shift * FF(256))) *
avm_binary_mem_tag_ctr);
tmp *= scaling_factor;
std::get<8>(evals) += tmp;
Expand All @@ -144,7 +144,7 @@ template <typename FF_> class avm_binaryImpl {
{
Avm_DECLARE_VIEWS(9);

auto tmp = (((avm_binary_acc_ic - avm_binary_bin_ic_bytes) - (avm_binary_acc_ic_shift * FF(256))) *
auto tmp = (((avm_binary_acc_ic - avm_binary_ic_bytes) - (avm_binary_acc_ic_shift * FF(256))) *
avm_binary_mem_tag_ctr);
tmp *= scaling_factor;
std::get<9>(evals) += tmp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
[[maybe_unused]] auto avm_binary_acc_ia = View(new_term.avm_binary_acc_ia); \
[[maybe_unused]] auto avm_binary_acc_ib = View(new_term.avm_binary_acc_ib); \
[[maybe_unused]] auto avm_binary_acc_ic = View(new_term.avm_binary_acc_ic); \
[[maybe_unused]] auto avm_binary_bin_clk = View(new_term.avm_binary_bin_clk); \
[[maybe_unused]] auto avm_binary_bin_ia_bytes = View(new_term.avm_binary_bin_ia_bytes); \
[[maybe_unused]] auto avm_binary_bin_ib_bytes = View(new_term.avm_binary_bin_ib_bytes); \
[[maybe_unused]] auto avm_binary_bin_ic_bytes = View(new_term.avm_binary_bin_ic_bytes); \
[[maybe_unused]] auto avm_binary_bin_sel = View(new_term.avm_binary_bin_sel); \
[[maybe_unused]] auto avm_binary_clk = View(new_term.avm_binary_clk); \
[[maybe_unused]] auto avm_binary_ia_bytes = View(new_term.avm_binary_ia_bytes); \
[[maybe_unused]] auto avm_binary_ib_bytes = View(new_term.avm_binary_ib_bytes); \
[[maybe_unused]] auto avm_binary_ic_bytes = View(new_term.avm_binary_ic_bytes); \
[[maybe_unused]] auto avm_binary_in_tag = View(new_term.avm_binary_in_tag); \
[[maybe_unused]] auto avm_binary_mem_tag_ctr = View(new_term.avm_binary_mem_tag_ctr); \
[[maybe_unused]] auto avm_binary_mem_tag_ctr_inv = View(new_term.avm_binary_mem_tag_ctr_inv); \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ class lookup_byte_operations_lookup_settings {
in.avm_binary_bin_sel,
in.avm_byte_lookup_bin_sel,
in.avm_binary_op_id,
in.avm_binary_bin_ia_bytes,
in.avm_binary_bin_ib_bytes,
in.avm_binary_bin_ic_bytes,
in.avm_binary_ia_bytes,
in.avm_binary_ib_bytes,
in.avm_binary_ic_bytes,
in.avm_byte_lookup_table_op_id,
in.avm_byte_lookup_table_input_a,
in.avm_byte_lookup_table_input_b,
Expand All @@ -162,9 +162,9 @@ class lookup_byte_operations_lookup_settings {
in.avm_binary_bin_sel,
in.avm_byte_lookup_bin_sel,
in.avm_binary_op_id,
in.avm_binary_bin_ia_bytes,
in.avm_binary_bin_ib_bytes,
in.avm_binary_bin_ic_bytes,
in.avm_binary_ia_bytes,
in.avm_binary_ib_bytes,
in.avm_binary_ic_bytes,
in.avm_byte_lookup_table_op_id,
in.avm_byte_lookup_table_input_a,
in.avm_byte_lookup_table_input_b,
Expand Down
8 changes: 4 additions & 4 deletions barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1275,16 +1275,16 @@ std::vector<Row> AvmTraceBuilder::finalize()
for (size_t i = 0; i < bin_trace_size; i++) {
auto const& src = bin_trace.at(i);
auto& dest = main_trace.at(i);
dest.avm_binary_bin_clk = src.binary_clk;
dest.avm_binary_clk = src.binary_clk;
dest.avm_binary_bin_sel = static_cast<uint8_t>(src.bin_sel);
dest.avm_binary_acc_ia = src.acc_ia;
dest.avm_binary_acc_ib = src.acc_ib;
dest.avm_binary_acc_ic = src.acc_ic;
dest.avm_binary_in_tag = src.in_tag;
dest.avm_binary_op_id = src.op_id;
dest.avm_binary_bin_ia_bytes = src.bin_ia_bytes;
dest.avm_binary_bin_ib_bytes = src.bin_ib_bytes;
dest.avm_binary_bin_ic_bytes = src.bin_ic_bytes;
dest.avm_binary_ia_bytes = src.bin_ia_bytes;
dest.avm_binary_ib_bytes = src.bin_ib_bytes;
dest.avm_binary_ic_bytes = src.bin_ic_bytes;
dest.avm_binary_start = FF(static_cast<uint8_t>(src.start));
dest.avm_binary_mem_tag_ctr = src.mem_tag_ctr;
dest.avm_binary_mem_tag_ctr_inv = src.mem_tag_ctr_inv;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ template <typename FF> struct AvmFullRow {
FF avm_binary_acc_ia{};
FF avm_binary_acc_ib{};
FF avm_binary_acc_ic{};
FF avm_binary_bin_clk{};
FF avm_binary_bin_ia_bytes{};
FF avm_binary_bin_ib_bytes{};
FF avm_binary_bin_ic_bytes{};
FF avm_binary_bin_sel{};
FF avm_binary_clk{};
FF avm_binary_ia_bytes{};
FF avm_binary_ib_bytes{};
FF avm_binary_ic_bytes{};
FF avm_binary_in_tag{};
FF avm_binary_mem_tag_ctr{};
FF avm_binary_mem_tag_ctr_inv{};
Expand Down Expand Up @@ -249,11 +249,11 @@ class AvmCircuitBuilder {
polys.avm_binary_acc_ia[i] = rows[i].avm_binary_acc_ia;
polys.avm_binary_acc_ib[i] = rows[i].avm_binary_acc_ib;
polys.avm_binary_acc_ic[i] = rows[i].avm_binary_acc_ic;
polys.avm_binary_bin_clk[i] = rows[i].avm_binary_bin_clk;
polys.avm_binary_bin_ia_bytes[i] = rows[i].avm_binary_bin_ia_bytes;
polys.avm_binary_bin_ib_bytes[i] = rows[i].avm_binary_bin_ib_bytes;
polys.avm_binary_bin_ic_bytes[i] = rows[i].avm_binary_bin_ic_bytes;
polys.avm_binary_bin_sel[i] = rows[i].avm_binary_bin_sel;
polys.avm_binary_clk[i] = rows[i].avm_binary_clk;
polys.avm_binary_ia_bytes[i] = rows[i].avm_binary_ia_bytes;
polys.avm_binary_ib_bytes[i] = rows[i].avm_binary_ib_bytes;
polys.avm_binary_ic_bytes[i] = rows[i].avm_binary_ic_bytes;
polys.avm_binary_in_tag[i] = rows[i].avm_binary_in_tag;
polys.avm_binary_mem_tag_ctr[i] = rows[i].avm_binary_mem_tag_ctr;
polys.avm_binary_mem_tag_ctr_inv[i] = rows[i].avm_binary_mem_tag_ctr_inv;
Expand Down
72 changes: 36 additions & 36 deletions barretenberg/cpp/src/barretenberg/vm/generated/avm_flavor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ class AvmFlavor {
avm_binary_acc_ia,
avm_binary_acc_ib,
avm_binary_acc_ic,
avm_binary_bin_clk,
avm_binary_bin_ia_bytes,
avm_binary_bin_ib_bytes,
avm_binary_bin_ic_bytes,
avm_binary_bin_sel,
avm_binary_clk,
avm_binary_ia_bytes,
avm_binary_ib_bytes,
avm_binary_ic_bytes,
avm_binary_in_tag,
avm_binary_mem_tag_ctr,
avm_binary_mem_tag_ctr_inv,
Expand Down Expand Up @@ -265,11 +265,11 @@ class AvmFlavor {
avm_binary_acc_ia,
avm_binary_acc_ib,
avm_binary_acc_ic,
avm_binary_bin_clk,
avm_binary_bin_ia_bytes,
avm_binary_bin_ib_bytes,
avm_binary_bin_ic_bytes,
avm_binary_bin_sel,
avm_binary_clk,
avm_binary_ia_bytes,
avm_binary_ib_bytes,
avm_binary_ic_bytes,
avm_binary_in_tag,
avm_binary_mem_tag_ctr,
avm_binary_mem_tag_ctr_inv,
Expand Down Expand Up @@ -405,11 +405,11 @@ class AvmFlavor {
avm_binary_acc_ia,
avm_binary_acc_ib,
avm_binary_acc_ic,
avm_binary_bin_clk,
avm_binary_bin_ia_bytes,
avm_binary_bin_ib_bytes,
avm_binary_bin_ic_bytes,
avm_binary_bin_sel,
avm_binary_clk,
avm_binary_ia_bytes,
avm_binary_ib_bytes,
avm_binary_ic_bytes,
avm_binary_in_tag,
avm_binary_mem_tag_ctr,
avm_binary_mem_tag_ctr_inv,
Expand Down Expand Up @@ -560,11 +560,11 @@ class AvmFlavor {
avm_binary_acc_ia,
avm_binary_acc_ib,
avm_binary_acc_ic,
avm_binary_bin_clk,
avm_binary_bin_ia_bytes,
avm_binary_bin_ib_bytes,
avm_binary_bin_ic_bytes,
avm_binary_bin_sel,
avm_binary_clk,
avm_binary_ia_bytes,
avm_binary_ib_bytes,
avm_binary_ic_bytes,
avm_binary_in_tag,
avm_binary_mem_tag_ctr,
avm_binary_mem_tag_ctr_inv,
Expand Down Expand Up @@ -715,11 +715,11 @@ class AvmFlavor {
avm_binary_acc_ia,
avm_binary_acc_ib,
avm_binary_acc_ic,
avm_binary_bin_clk,
avm_binary_bin_ia_bytes,
avm_binary_bin_ib_bytes,
avm_binary_bin_ic_bytes,
avm_binary_bin_sel,
avm_binary_clk,
avm_binary_ia_bytes,
avm_binary_ib_bytes,
avm_binary_ic_bytes,
avm_binary_in_tag,
avm_binary_mem_tag_ctr,
avm_binary_mem_tag_ctr_inv,
Expand Down Expand Up @@ -972,11 +972,11 @@ class AvmFlavor {
Base::avm_binary_acc_ia = "AVM_BINARY_ACC_IA";
Base::avm_binary_acc_ib = "AVM_BINARY_ACC_IB";
Base::avm_binary_acc_ic = "AVM_BINARY_ACC_IC";
Base::avm_binary_bin_clk = "AVM_BINARY_BIN_CLK";
Base::avm_binary_bin_ia_bytes = "AVM_BINARY_BIN_IA_BYTES";
Base::avm_binary_bin_ib_bytes = "AVM_BINARY_BIN_IB_BYTES";
Base::avm_binary_bin_ic_bytes = "AVM_BINARY_BIN_IC_BYTES";
Base::avm_binary_bin_sel = "AVM_BINARY_BIN_SEL";
Base::avm_binary_clk = "AVM_BINARY_CLK";
Base::avm_binary_ia_bytes = "AVM_BINARY_IA_BYTES";
Base::avm_binary_ib_bytes = "AVM_BINARY_IB_BYTES";
Base::avm_binary_ic_bytes = "AVM_BINARY_IC_BYTES";
Base::avm_binary_in_tag = "AVM_BINARY_IN_TAG";
Base::avm_binary_mem_tag_ctr = "AVM_BINARY_MEM_TAG_CTR";
Base::avm_binary_mem_tag_ctr_inv = "AVM_BINARY_MEM_TAG_CTR_INV";
Expand Down Expand Up @@ -1122,11 +1122,11 @@ class AvmFlavor {
Commitment avm_binary_acc_ia;
Commitment avm_binary_acc_ib;
Commitment avm_binary_acc_ic;
Commitment avm_binary_bin_clk;
Commitment avm_binary_bin_ia_bytes;
Commitment avm_binary_bin_ib_bytes;
Commitment avm_binary_bin_ic_bytes;
Commitment avm_binary_bin_sel;
Commitment avm_binary_clk;
Commitment avm_binary_ia_bytes;
Commitment avm_binary_ib_bytes;
Commitment avm_binary_ic_bytes;
Commitment avm_binary_in_tag;
Commitment avm_binary_mem_tag_ctr;
Commitment avm_binary_mem_tag_ctr_inv;
Expand Down Expand Up @@ -1272,11 +1272,11 @@ class AvmFlavor {
avm_binary_acc_ia = deserialize_from_buffer<Commitment>(Transcript::proof_data, num_frs_read);
avm_binary_acc_ib = deserialize_from_buffer<Commitment>(Transcript::proof_data, num_frs_read);
avm_binary_acc_ic = deserialize_from_buffer<Commitment>(Transcript::proof_data, num_frs_read);
avm_binary_bin_clk = deserialize_from_buffer<Commitment>(Transcript::proof_data, num_frs_read);
avm_binary_bin_ia_bytes = deserialize_from_buffer<Commitment>(Transcript::proof_data, num_frs_read);
avm_binary_bin_ib_bytes = deserialize_from_buffer<Commitment>(Transcript::proof_data, num_frs_read);
avm_binary_bin_ic_bytes = deserialize_from_buffer<Commitment>(Transcript::proof_data, num_frs_read);
avm_binary_bin_sel = deserialize_from_buffer<Commitment>(Transcript::proof_data, num_frs_read);
avm_binary_clk = deserialize_from_buffer<Commitment>(Transcript::proof_data, num_frs_read);
avm_binary_ia_bytes = deserialize_from_buffer<Commitment>(Transcript::proof_data, num_frs_read);
avm_binary_ib_bytes = deserialize_from_buffer<Commitment>(Transcript::proof_data, num_frs_read);
avm_binary_ic_bytes = deserialize_from_buffer<Commitment>(Transcript::proof_data, num_frs_read);
avm_binary_in_tag = deserialize_from_buffer<Commitment>(Transcript::proof_data, num_frs_read);
avm_binary_mem_tag_ctr = deserialize_from_buffer<Commitment>(Transcript::proof_data, num_frs_read);
avm_binary_mem_tag_ctr_inv = deserialize_from_buffer<Commitment>(Transcript::proof_data, num_frs_read);
Expand Down Expand Up @@ -1427,11 +1427,11 @@ class AvmFlavor {
serialize_to_buffer<Commitment>(avm_binary_acc_ia, Transcript::proof_data);
serialize_to_buffer<Commitment>(avm_binary_acc_ib, Transcript::proof_data);
serialize_to_buffer<Commitment>(avm_binary_acc_ic, Transcript::proof_data);
serialize_to_buffer<Commitment>(avm_binary_bin_clk, Transcript::proof_data);
serialize_to_buffer<Commitment>(avm_binary_bin_ia_bytes, Transcript::proof_data);
serialize_to_buffer<Commitment>(avm_binary_bin_ib_bytes, Transcript::proof_data);
serialize_to_buffer<Commitment>(avm_binary_bin_ic_bytes, Transcript::proof_data);
serialize_to_buffer<Commitment>(avm_binary_bin_sel, Transcript::proof_data);
serialize_to_buffer<Commitment>(avm_binary_clk, Transcript::proof_data);
serialize_to_buffer<Commitment>(avm_binary_ia_bytes, Transcript::proof_data);
serialize_to_buffer<Commitment>(avm_binary_ib_bytes, Transcript::proof_data);
serialize_to_buffer<Commitment>(avm_binary_ic_bytes, Transcript::proof_data);
serialize_to_buffer<Commitment>(avm_binary_in_tag, Transcript::proof_data);
serialize_to_buffer<Commitment>(avm_binary_mem_tag_ctr, Transcript::proof_data);
serialize_to_buffer<Commitment>(avm_binary_mem_tag_ctr_inv, Transcript::proof_data);
Expand Down
Loading

0 comments on commit 30f7af2

Please sign in to comment.