-
Notifications
You must be signed in to change notification settings - Fork 607
feat: swap polys to facilitate dynamic trace overflow #9976
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
Changes from all commits
560373c
981074c
090e720
2eded0b
d06c1e8
b4cb9de
a7231ef
0cf3757
f7e8fc7
35c15a0
515fe8b
e07eb4d
7d4ba63
ba7bfd5
559bb2e
916fc98
b23cd91
864ee3a
bfb2a70
2494af1
531c0d1
0b582eb
d781974
0b714d2
c9e6af0
90277ab
0891578
9f05f0b
c13923b
48052d0
681c1e6
1f79b46
e7d8499
1f4df0f
cd92b66
067cbb0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,21 @@ struct ExecutionTraceUsageTracker { | |
| size_t max_databus_size = 0; | ||
| size_t max_tables_size = 0; | ||
|
|
||
| // For printing only. Must match the order of the members in the arithmetization | ||
| static constexpr std::array<std::string_view, 13> block_labels{ "ecc_op", | ||
| "pub_inputs", | ||
| "busread", | ||
| "arithmetic", | ||
| "delta_range", | ||
| "elliptic", | ||
| "aux", | ||
| "poseidon2_external", | ||
| "poseidon2_internal", | ||
| "lookup", | ||
| "overflow", | ||
| "databus_table_data", | ||
| "lookup_table_data" }; | ||
|
|
||
| TraceSettings trace_settings; | ||
|
|
||
| ExecutionTraceUsageTracker(const TraceSettings& trace_settings = TraceSettings{}) | ||
|
|
@@ -72,8 +87,12 @@ struct ExecutionTraceUsageTracker { | |
| } | ||
|
|
||
| // 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(); | ||
| // (Note: lookup tables are constructed at the end of the trace; databus data is constructed at the start) so we | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment will break if the ordering in the trace structure ever changes--there's little chance that the person changing the structure remembers this comment exists, if they ever knew. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. a way to make this more robust is to update the active ranges as we are constructing the DeciderProvingKey so if the position of the rows changes it is obvious that the tracker's active ranges also need to be updated, will add an issue. |
||
| // need to determine the dyadic size for this. We call the size function on the current circuit which will have | ||
| // the same fixed block sizes but might also have an overflow block potentially influencing the dyadic circuit | ||
| // size. | ||
| // TODO(https://github.com/AztecProtocol/barretenberg/issues/1160) | ||
| const size_t dyadic_circuit_size = circuit.blocks.get_structured_dyadic_size(); | ||
|
|
||
| // 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. | ||
|
|
@@ -98,24 +117,13 @@ struct ExecutionTraceUsageTracker { | |
| }); | ||
| } | ||
|
|
||
| // For printing only. Must match the order of the members in the arithmetization | ||
| std::vector<std::string> block_labels{ "ecc_op", | ||
| "pub_inputs", | ||
| "busread", | ||
| "arithmetic", | ||
| "delta_range", | ||
| "elliptic", | ||
| "aux", | ||
| "poseidon2_external", | ||
| "poseidon2_internal", | ||
| "lookup", | ||
| "overflow" }; | ||
|
|
||
| void print() | ||
| { | ||
| info("Minimum required block sizes for structured trace: "); | ||
| for (auto [label, max_size] : zip_view(block_labels, max_sizes.get())) { | ||
| std::cout << std::left << std::setw(20) << (label + ":") << max_size << std::endl; | ||
| size_t idx = 0; | ||
| for (auto max_size : max_sizes.get()) { | ||
| std::cout << std::left << std::setw(20) << block_labels[idx] << ": " << max_size << std::endl; | ||
| idx++; | ||
| } | ||
| info(""); | ||
| } | ||
|
|
@@ -124,8 +132,18 @@ struct ExecutionTraceUsageTracker { | |
| { | ||
| info("Active regions of accumulator: "); | ||
| for (auto [label, range] : zip_view(block_labels, active_ranges)) { | ||
| std::cout << std::left << std::setw(20) << (label + ":") << "(" << range.first << ", " << range.second | ||
| << ")" << std::endl; | ||
| std::cout << std::left << std::setw(20) << label << ": (" << range.first << ", " << range.second << ")" | ||
| << std::endl; | ||
| } | ||
| info(""); | ||
| } | ||
|
|
||
| void print_previous_active_ranges() | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. when i was printing the active ranges it wasn't reflecting everything due to the lookup and databus caveat so I think it made sense to refine the labels |
||
| { | ||
| info("Active regions of previous accumulator: "); | ||
| for (auto [label, range] : zip_view(block_labels, previous_active_ranges)) { | ||
| std::cout << std::left << std::setw(20) << label << ": (" << range.first << ", " << range.second << ")" | ||
| << std::endl; | ||
| } | ||
| info(""); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| #include "relation_checker.hpp" | ||
|
|
||
| // Hack to make the module compile. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the caveat with overflowing circuits and having a single CIVC commitment key, maybe this could be refined in a follow up PR but seemed the easiest solution as it is. In the ideal case when we never overflow we still can benefit from having a single commitment key