Skip to content
Merged
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
6 changes: 4 additions & 2 deletions barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3766,7 +3766,9 @@ std::vector<Row> AvmTraceBuilder::finalize(uint32_t min_trace_size, bool range_c
// If the bin_trace_size has entries, we need the main_trace to be as big as our byte lookup table (3 *
// 2**16 long)
size_t const lookup_table_size = (bin_trace_size > 0 && range_check_required) ? 3 * (1 << 16) : 0;
size_t const range_check_size = range_check_required ? UINT16_MAX + 1 : 0;
// Range check size is 1 less than it needs to be since we insert a "first row" at the top of the trace at the end,
// with clk 0 (this doubles as our range check)
size_t const range_check_size = range_check_required ? UINT16_MAX : 0;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@IlyasRidhuan Isn't it the same for lookup_table_size ? Any other "trace_size" that we should adapt?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it's true for other lookups like the binary trace, I've left that for now since we will do a larger refactor to finalize.

Plus it's less of a concern because they do not create a table whose rows are near boundary of a power of 2 (so we dont gain any performance benefits).

std::vector<size_t> trace_sizes = { mem_trace_size, main_trace_size, alu_trace_size,
range_check_size, conv_trace_size, lookup_table_size,
sha256_trace_size, poseidon2_trace_size, pedersen_trace_size,
Expand All @@ -3781,7 +3783,7 @@ std::vector<Row> AvmTraceBuilder::finalize(uint32_t min_trace_size, bool range_c
"\n\talu_trace_size: ",
alu_trace_size,
"\n\trange_check_size: ",
range_check_size,
range_check_size + 1, // The manually inserted first row is part of the range check
"\n\tconv_trace_size: ",
conv_trace_size,
"\n\tlookup_table_size: ",
Expand Down