Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.

Commit e73a66f

Browse files
committed
Testing rig now uses all empty constant columns for lookup table packing.
1 parent f49b3f6 commit e73a66f

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

test/test_plonk_component.hpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -289,14 +289,6 @@ namespace nil {
289289
}
290290

291291
if constexpr (nil::blueprint::use_lookups<component_type>()) {
292-
// Components with lookups may use constant columns.
293-
// But now all constants are placed in the first column.
294-
// So we reserve the first column for non-lookup constants.
295-
// Rather universal for testing
296-
// We may start from zero if component doesn't use ordinary constants.
297-
std::vector<size_t> lookup_columns_indices;
298-
for( std::size_t i = 1; i < ArithmetizationParams::constant_columns; i++ ) lookup_columns_indices.push_back(i);
299-
300292
std::size_t cur_selector_id = 0;
301293
for(const auto &gate: bp.gates()){
302294
cur_selector_id = std::max(cur_selector_id, gate.selector_index);
@@ -305,6 +297,13 @@ namespace nil {
305297
cur_selector_id = std::max(cur_selector_id, lookup_gate.tag_index);
306298
}
307299
cur_selector_id++;
300+
// Use all of the unused constant columns for lookups
301+
std::vector<size_t> lookup_columns_indices;
302+
for(std::size_t i = 0; i < ArithmetizationParams::constant_columns; i++) {
303+
if(assignment.constants()[i].size() == 0) {
304+
lookup_columns_indices.push_back(i);
305+
}
306+
}
308307
desc.usable_rows_amount = zk::snark::pack_lookup_tables_horizontal(
309308
bp.get_reserved_indices(),
310309
bp.get_reserved_tables(),

0 commit comments

Comments
 (0)