From 3e48db2b4fb615d48bdd6f5b1c4cc31d4d1f0e43 Mon Sep 17 00:00:00 2001 From: ledwards2225 Date: Fri, 15 Nov 2024 23:03:57 +0000 Subject: [PATCH 1/7] WiP; cant use correct datbus range for some reason --- .../client_ivc/client_ivc.test.cpp | 2 +- .../execution_trace_usage_tracker.hpp | 47 ++++++++++++------- .../protogalaxy_prover_internal.hpp | 12 +++++ 3 files changed, 43 insertions(+), 18 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.test.cpp b/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.test.cpp index f61a6d786b3..be8b3e86bea 100644 --- a/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.test.cpp +++ b/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.test.cpp @@ -282,7 +282,7 @@ TEST_F(ClientIVCTests, BasicStructured) MockCircuitProducer circuit_producer; - size_t NUM_CIRCUITS = 4; + size_t NUM_CIRCUITS = 2; // Construct and accumulate some circuits of varying size size_t log2_num_gates = 5; diff --git a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/arithmetization/execution_trace_usage_tracker.hpp b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/arithmetization/execution_trace_usage_tracker.hpp index f1798fa3c76..e807473649d 100644 --- a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/arithmetization/execution_trace_usage_tracker.hpp +++ b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/arithmetization/execution_trace_usage_tracker.hpp @@ -21,7 +21,7 @@ struct ExecutionTraceUsageTracker { MegaTraceBlockSizes max_sizes; // max utilization of each block MegaTraceFixedBlockSizes fixed_sizes; // fixed size of each block prescribed by structuring - MegaTraceActiveRanges active_ranges; // ranges utlized by the accumulator within the ambient structured trace + std::vector active_ranges; std::vector thread_ranges; // ranges within the ambient space over which utilized space is evenly distibuted @@ -57,21 +57,23 @@ struct ExecutionTraceUsageTracker { max_tables_size = std::max(max_tables_size, circuit.get_tables_size()); // Update the active ranges of the trace based on max block utilization - for (auto [max_size, fixed_block, active_range] : - zip_view(max_sizes.get(), fixed_sizes.get(), active_ranges.get())) { + active_ranges.clear(); + for (auto [max_size, fixed_block] : zip_view(max_sizes.get(), fixed_sizes.get())) { size_t start_idx = fixed_block.trace_offset; size_t end_idx = start_idx + max_size; - active_range = Range{ start_idx, end_idx }; + active_ranges.push_back(Range{ start_idx, end_idx }); } // The active ranges for the databus and lookup relations (both based on log-deriv lookup argument) must // incorporate both the lookup/read gate blocks as well as the rows containing the data that is being read. // Update the corresponding ranges accordingly. (Note: tables are constructed at the 'bottom' of the trace). size_t dyadic_circuit_size = fixed_sizes.get_structured_dyadic_size(); - active_ranges.busread.first = 0; // databus data is stored at the top of the trace - active_ranges.busread.second = std::max(max_databus_size, active_ranges.busread.second); - active_ranges.lookup.first = std::min(dyadic_circuit_size - max_tables_size, active_ranges.lookup.first); - active_ranges.lookup.second = dyadic_circuit_size; // lookups are stored at the bottom of the trace + + // WORKTODO: should be able to use Range{ 0, max_databus_size } but this breaks for certain num_threads.. why + active_ranges.push_back( + Range{ 0, std::max(max_databus_size, fixed_sizes.busread.trace_offset + max_sizes.busread) }); + // active_ranges.push_back(Range{ 0, max_databus_size }); + active_ranges.push_back(Range{ dyadic_circuit_size - max_tables_size, dyadic_circuit_size }); } // Check whether an index is contained within the active ranges @@ -81,7 +83,7 @@ struct ExecutionTraceUsageTracker { if (trace_settings.structure == TraceStructure::NONE) { return true; } - for (auto& range : active_ranges.get()) { + for (auto& range : active_ranges) { if (idx >= range.first && idx < range.second) { return true; } @@ -114,7 +116,7 @@ struct ExecutionTraceUsageTracker { void print_active_ranges() { info("Active regions of accumulator: "); - for (auto [label, range] : zip_view(block_labels, active_ranges.get())) { + for (auto [label, range] : zip_view(block_labels, active_ranges)) { std::cout << std::left << std::setw(20) << (label + ":") << "(" << range.first << ", " << range.second << ")" << std::endl; } @@ -139,23 +141,32 @@ struct ExecutionTraceUsageTracker { */ void construct_thread_ranges(const size_t num_threads, const size_t full_domain_size) { - // Copy the ranges into a simple std container for processing by subsequent methods (cheap) - std::vector active_ranges_copy; - for (const auto& range : active_ranges.get()) { - active_ranges_copy.push_back(range); - } - // Convert the active ranges for each gate type into a set of sorted non-overlapping ranges (union of the input) std::vector simplified_active_ranges; if (trace_settings.structure == TraceStructure::NONE) { // If not using a structured trace, set the active range to the whole domain simplified_active_ranges.push_back(Range{ 0, full_domain_size }); } else { - simplified_active_ranges = construct_union_of_ranges(active_ranges_copy); + simplified_active_ranges = construct_union_of_ranges(active_ranges); } + // info("Active ranges: "); + // for (auto range : active_ranges) { + // std::cout << "(" << range.first << ", " << range.second << ")" << std::endl; + // } + // info(""); + // info("Simplified ranges: "); + // for (auto range : simplified_active_ranges) { + // std::cout << "(" << range.first << ", " << range.second << ")" << std::endl; + // } + // info(""); // Determine ranges in the structured trace that even distibute the active content across threads thread_ranges = construct_ranges_for_equal_content_distribution(simplified_active_ranges, num_threads); + // info("Thread ranges: "); + // for (auto range : thread_ranges) { + // std::cout << "(" << range.first << ", " << range.second << ")" << std::endl; + // } + // info(""); } /** @@ -209,6 +220,8 @@ struct ExecutionTraceUsageTracker { } size_t content_per_thread = total_content / num_threads; + // info("CONTENT PER THREAD = ", content_per_thread); + std::vector thread_ranges; size_t start_idx = union_ranges.front().first; size_t thread_space_remaining = content_per_thread; // content space remaining in current thread diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_internal.hpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_internal.hpp index d02e63b4776..59e80c6d493 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_internal.hpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_internal.hpp @@ -381,6 +381,8 @@ template class ProtogalaxyProverInternal { const FF pow_challenge = gate_separators[idx]; + // auto prev_accum = thread_univariate_accumulators[thread_idx]; + // Accumulate the i-th row's univariate contribution. Note that the relation parameters passed to // this function have already been folded. Moreover, linear-dependent relations that act over the // entire execution trace rather than on rows, will not be multiplied by the pow challenge. @@ -389,6 +391,11 @@ template class ProtogalaxyProverInternal { relation_parameters, // these parameters have already been folded pow_challenge); } + + // bool manual_active = prev_accum != thread_univariate_accumulators[thread_idx]; + // if (manual_active && !trace_usage_tracker.check_is_active(idx)) { + // info("Missed active row at idx: ", idx); + // } } }); @@ -598,6 +605,11 @@ template class ProtogalaxyProverInternal { size_t num_threads = std::min(desired_num_threads, max_num_threads); // fewer than max if justified num_threads = num_threads > 0 ? num_threads : 1; // ensure num threads is >= 1 + // // DEBUG + // num_threads = 128; + + info("NUM THREADS = ", num_threads); + return num_threads; } }; From 64198cfa8508f22a1def0de1406d84393102ffa9 Mon Sep 17 00:00:00 2001 From: ledwards2225 Date: Fri, 15 Nov 2024 23:08:42 +0000 Subject: [PATCH 2/7] fix build --- .../execution_trace/execution_trace_usage_tracker.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/execution_trace/execution_trace_usage_tracker.hpp b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/execution_trace/execution_trace_usage_tracker.hpp index c6005b3147c..7b62b7c6c55 100644 --- a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/execution_trace/execution_trace_usage_tracker.hpp +++ b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/execution_trace/execution_trace_usage_tracker.hpp @@ -73,8 +73,9 @@ struct ExecutionTraceUsageTracker { size_t dyadic_circuit_size = fixed_sizes.get_structured_dyadic_size(); // WORKTODO: should be able to use Range{ 0, max_databus_size } but this breaks for certain num_threads.. why - active_ranges.push_back( - Range{ 0, std::max(max_databus_size, fixed_sizes.busread.trace_offset + max_sizes.busread) }); + size_t databus_end = + std::max(max_databus_size, static_cast(fixed_sizes.busread.trace_offset + max_sizes.busread)); + active_ranges.push_back(Range{ 0, databus_end }); // active_ranges.push_back(Range{ 0, max_databus_size }); active_ranges.push_back(Range{ dyadic_circuit_size - max_tables_size, dyadic_circuit_size }); } From 0122526d97dfda9fe78c96e1999239903bb5ba89 Mon Sep 17 00:00:00 2001 From: ledwards2225 Date: Mon, 18 Nov 2024 14:40:02 +0000 Subject: [PATCH 3/7] updates --- .../execution_trace_usage_tracker.hpp | 14 +++++--------- .../protogalaxy/protogalaxy_prover_internal.hpp | 2 +- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/execution_trace/execution_trace_usage_tracker.hpp b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/execution_trace/execution_trace_usage_tracker.hpp index 7b62b7c6c55..c0e2f358ee6 100644 --- a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/execution_trace/execution_trace_usage_tracker.hpp +++ b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/execution_trace/execution_trace_usage_tracker.hpp @@ -67,9 +67,8 @@ struct ExecutionTraceUsageTracker { active_ranges.push_back(Range{ start_idx, end_idx }); } - // The active ranges for the databus and lookup relations (both based on log-deriv lookup argument) must - // incorporate both the lookup/read gate blocks as well as the rows containing the data that is being read. - // Update the corresponding ranges accordingly. (Note: tables are constructed at the 'bottom' of the trace). + // The active ranges must also include the rows where the actual databus and lookup table data are stored. + // (Note: lookup tables are constructed at the end of the trace; databus data is constructed at the start). size_t dyadic_circuit_size = fixed_sizes.get_structured_dyadic_size(); // WORKTODO: should be able to use Range{ 0, max_databus_size } but this breaks for certain num_threads.. why @@ -87,12 +86,9 @@ struct ExecutionTraceUsageTracker { if (!trace_settings.structure) { return true; } - for (auto& range : active_ranges) { - if (idx >= range.first && idx < range.second) { - return true; - } - } - return false; + return std::any_of(active_ranges.begin(), active_ranges.end(), [idx](const auto& range) { + return idx >= range.first && idx < range.second; + }); } // For printing only. Must match the order of the members in the arithmetization diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_internal.hpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_internal.hpp index 2baad65c0a6..3ff7f24122d 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_internal.hpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_internal.hpp @@ -606,7 +606,7 @@ template class ProtogalaxyProverInternal { num_threads = num_threads > 0 ? num_threads : 1; // ensure num threads is >= 1 // // DEBUG - // num_threads = 128; + // num_threads = 127; info("NUM THREADS = ", num_threads); From 466c712c914bcf4d3b18c23443e50fbe0602073f Mon Sep 17 00:00:00 2001 From: ledwards2225 Date: Mon, 18 Nov 2024 15:08:21 +0000 Subject: [PATCH 4/7] use prev accum in perturbatopr --- .../execution_trace_usage_tracker.hpp | 21 +++++++++++++------ .../protogalaxy_prover_internal.hpp | 4 ++-- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/execution_trace/execution_trace_usage_tracker.hpp b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/execution_trace/execution_trace_usage_tracker.hpp index c0e2f358ee6..a7ff86c8358 100644 --- a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/execution_trace/execution_trace_usage_tracker.hpp +++ b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/execution_trace/execution_trace_usage_tracker.hpp @@ -20,7 +20,10 @@ struct ExecutionTraceUsageTracker { TraceStructure max_sizes; // max utilization of each block MegaTraceFixedBlockSizes fixed_sizes; // fixed size of each block prescribed by structuring + // Store active ranges based on the most current accumulator and those based on all but the most recently + // accumulated circuit. The former is needed for the combiner calculation and the latter for the perturbator. std::vector active_ranges; + std::vector previous_active_ranges; std::vector thread_ranges; // ranges within the ambient space over which utilized space is evenly distibuted @@ -60,6 +63,7 @@ struct ExecutionTraceUsageTracker { max_tables_size = std::max(max_tables_size, circuit.get_tables_size()); // Update the active ranges of the trace based on max block utilization + previous_active_ranges = active_ranges; // store active ranges based on all but the present circuit active_ranges.clear(); for (auto [max_size, fixed_block] : zip_view(max_sizes.get(), fixed_sizes.get())) { size_t start_idx = fixed_block.trace_offset; @@ -79,14 +83,15 @@ struct ExecutionTraceUsageTracker { active_ranges.push_back(Range{ dyadic_circuit_size - max_tables_size, dyadic_circuit_size }); } - // Check whether an index is contained within the active ranges - bool check_is_active(const size_t idx) + // Check whether an index is contained within the active ranges (or previous active ranges; needed for perturbator) + bool check_is_active(const size_t idx, bool use_prev_accumulator = false) { // If structured trace is not in use, assume the whole trace is active if (!trace_settings.structure) { return true; } - return std::any_of(active_ranges.begin(), active_ranges.end(), [idx](const auto& range) { + std::vector ranges_to_check = use_prev_accumulator ? previous_active_ranges : active_ranges; + return std::any_of(ranges_to_check.begin(), ranges_to_check.end(), [idx](const auto& range) { return idx >= range.first && idx < range.second; }); } @@ -133,13 +138,16 @@ struct ExecutionTraceUsageTracker { } /** - * @brief Construct ranges of execution trace rows that evenly distribute the active content of the trace across a + * @brief Construct ranges of execution trace rows that evenly distribute the active content of the trace across a * given number of threads. * * @param num_threads Num ranges over which to distribute the data * @param full_domain_size Size of full domain; needed only for unstructured case + * @param use_prev_accumulator Base ranges on previous or current accumulator */ - void construct_thread_ranges(const size_t num_threads, const size_t full_domain_size) + void construct_thread_ranges(const size_t num_threads, + const size_t full_domain_size, + bool use_prev_accumulator = false) { // Convert the active ranges for each gate type into a set of sorted non-overlapping ranges (union of the input) std::vector simplified_active_ranges; @@ -147,7 +155,8 @@ struct ExecutionTraceUsageTracker { // If not using a structured trace, set the active range to the whole domain simplified_active_ranges.push_back(Range{ 0, full_domain_size }); } else { - simplified_active_ranges = construct_union_of_ranges(active_ranges); + simplified_active_ranges = use_prev_accumulator ? construct_union_of_ranges(previous_active_ranges) + : construct_union_of_ranges(active_ranges); } // info("Active ranges: "); // for (auto range : active_ranges) { diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_internal.hpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_internal.hpp index 3ff7f24122d..7f071a6c77d 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_internal.hpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_internal.hpp @@ -135,7 +135,7 @@ template class ProtogalaxyProverInternal { std::vector linearly_dependent_contribution_accumulators(num_threads); // Distribute the execution trace rows across threads so that each handles an equal number of active rows - trace_usage_tracker.construct_thread_ranges(num_threads, polynomial_size); + trace_usage_tracker.construct_thread_ranges(num_threads, polynomial_size, /*use_prev_accumulator=*/true); parallel_for(num_threads, [&](size_t thread_idx) { const size_t start = trace_usage_tracker.thread_ranges[thread_idx].first; @@ -143,7 +143,7 @@ template class ProtogalaxyProverInternal { for (size_t idx = start; idx < end; idx++) { // The contribution is only non-trivial at a given row if the accumulator is active at that row - if (trace_usage_tracker.check_is_active(idx)) { + if (trace_usage_tracker.check_is_active(idx, /*use_prev_accumulator=*/true)) { const AllValues row = polynomials.get_row(idx); // Evaluate all subrelations on given row. Separator is 1 since we are not summing across rows here. const RelationEvaluations evals = From f5cf20c8684b7a522bb37a74dbff22ea628b5d97 Mon Sep 17 00:00:00 2001 From: ledwards2225 Date: Mon, 18 Nov 2024 16:32:31 +0000 Subject: [PATCH 5/7] cleanup --- .../client_ivc/client_ivc.test.cpp | 2 +- .../execution_trace_usage_tracker.hpp | 19 ++----------------- .../protogalaxy_prover_internal.hpp | 12 ------------ 3 files changed, 3 insertions(+), 30 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.test.cpp b/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.test.cpp index 2cc93f4428c..8cc6d540c6a 100644 --- a/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.test.cpp +++ b/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.test.cpp @@ -276,7 +276,7 @@ TEST_F(ClientIVCTests, BasicStructured) MockCircuitProducer circuit_producer; - size_t NUM_CIRCUITS = 2; + size_t NUM_CIRCUITS = 4; // Construct and accumulate some circuits of varying size size_t log2_num_gates = 5; diff --git a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/execution_trace/execution_trace_usage_tracker.hpp b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/execution_trace/execution_trace_usage_tracker.hpp index a7ff86c8358..7854ef49af4 100644 --- a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/execution_trace/execution_trace_usage_tracker.hpp +++ b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/execution_trace/execution_trace_usage_tracker.hpp @@ -75,11 +75,11 @@ struct ExecutionTraceUsageTracker { // (Note: lookup tables are constructed at the end of the trace; databus data is constructed at the start). size_t dyadic_circuit_size = fixed_sizes.get_structured_dyadic_size(); - // WORKTODO: should be able to use Range{ 0, max_databus_size } but this breaks for certain num_threads.. why + // TODO(https://github.com/AztecProtocol/barretenberg/issues/1152): should be able to use simply Range{ 0, + // max_databus_size } but this breaks for certain choices of num_threads. size_t databus_end = std::max(max_databus_size, static_cast(fixed_sizes.busread.trace_offset + max_sizes.busread)); active_ranges.push_back(Range{ 0, databus_end }); - // active_ranges.push_back(Range{ 0, max_databus_size }); active_ranges.push_back(Range{ dyadic_circuit_size - max_tables_size, dyadic_circuit_size }); } @@ -158,24 +158,9 @@ struct ExecutionTraceUsageTracker { simplified_active_ranges = use_prev_accumulator ? construct_union_of_ranges(previous_active_ranges) : construct_union_of_ranges(active_ranges); } - // info("Active ranges: "); - // for (auto range : active_ranges) { - // std::cout << "(" << range.first << ", " << range.second << ")" << std::endl; - // } - // info(""); - // info("Simplified ranges: "); - // for (auto range : simplified_active_ranges) { - // std::cout << "(" << range.first << ", " << range.second << ")" << std::endl; - // } - // info(""); // Determine ranges in the structured trace that even distibute the active content across threads thread_ranges = construct_ranges_for_equal_content_distribution(simplified_active_ranges, num_threads); - // info("Thread ranges: "); - // for (auto range : thread_ranges) { - // std::cout << "(" << range.first << ", " << range.second << ")" << std::endl; - // } - // info(""); } /** diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_internal.hpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_internal.hpp index 7f071a6c77d..4c5d6a9a57a 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_internal.hpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_internal.hpp @@ -381,8 +381,6 @@ template class ProtogalaxyProverInternal { const FF pow_challenge = gate_separators[idx]; - // auto prev_accum = thread_univariate_accumulators[thread_idx]; - // Accumulate the i-th row's univariate contribution. Note that the relation parameters passed to // this function have already been folded. Moreover, linear-dependent relations that act over the // entire execution trace rather than on rows, will not be multiplied by the pow challenge. @@ -391,11 +389,6 @@ template class ProtogalaxyProverInternal { relation_parameters, // these parameters have already been folded pow_challenge); } - - // bool manual_active = prev_accum != thread_univariate_accumulators[thread_idx]; - // if (manual_active && !trace_usage_tracker.check_is_active(idx)) { - // info("Missed active row at idx: ", idx); - // } } }); @@ -605,11 +598,6 @@ template class ProtogalaxyProverInternal { size_t num_threads = std::min(desired_num_threads, max_num_threads); // fewer than max if justified num_threads = num_threads > 0 ? num_threads : 1; // ensure num threads is >= 1 - // // DEBUG - // num_threads = 127; - - info("NUM THREADS = ", num_threads); - return num_threads; } }; From 7a86247563577bbd3f70ba61cd0e91c39e198679 Mon Sep 17 00:00:00 2001 From: ledwards2225 Date: Mon, 18 Nov 2024 16:35:03 +0000 Subject: [PATCH 6/7] missed info --- .../execution_trace/execution_trace_usage_tracker.hpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/execution_trace/execution_trace_usage_tracker.hpp b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/execution_trace/execution_trace_usage_tracker.hpp index 7854ef49af4..34e2895b045 100644 --- a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/execution_trace/execution_trace_usage_tracker.hpp +++ b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/execution_trace/execution_trace_usage_tracker.hpp @@ -214,8 +214,6 @@ struct ExecutionTraceUsageTracker { } size_t content_per_thread = total_content / num_threads; - // info("CONTENT PER THREAD = ", content_per_thread); - std::vector thread_ranges; size_t start_idx = union_ranges.front().first; size_t thread_space_remaining = content_per_thread; // content space remaining in current thread From e106a710714cbe5aa2137d12e08ec35482d98efe Mon Sep 17 00:00:00 2001 From: ledwards2225 Date: Tue, 19 Nov 2024 17:48:47 +0000 Subject: [PATCH 7/7] revert to old lookup range model --- .../execution_trace/execution_trace_usage_tracker.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/execution_trace/execution_trace_usage_tracker.hpp b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/execution_trace/execution_trace_usage_tracker.hpp index 34e2895b045..7b9b1fadb6b 100644 --- a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/execution_trace/execution_trace_usage_tracker.hpp +++ b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/execution_trace/execution_trace_usage_tracker.hpp @@ -80,7 +80,9 @@ struct ExecutionTraceUsageTracker { size_t databus_end = std::max(max_databus_size, static_cast(fixed_sizes.busread.trace_offset + max_sizes.busread)); active_ranges.push_back(Range{ 0, databus_end }); - active_ranges.push_back(Range{ dyadic_circuit_size - max_tables_size, dyadic_circuit_size }); + size_t lookups_start = + std::min(dyadic_circuit_size - max_tables_size, static_cast(fixed_sizes.lookup.trace_offset)); + active_ranges.push_back(Range{ lookups_start, dyadic_circuit_size }); } // Check whether an index is contained within the active ranges (or previous active ranges; needed for perturbator)