From 0bd5368edf556cb7acc5a73c793670ae79702ce7 Mon Sep 17 00:00:00 2001 From: Iluvmagick Date: Thu, 16 Nov 2023 19:17:43 +0400 Subject: [PATCH] Testing rig now uses all empty constant columns for lookup table packing. --- test/test_plonk_component.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/test_plonk_component.hpp b/test/test_plonk_component.hpp index a1e5c8c51..2045b9bf0 100644 --- a/test/test_plonk_component.hpp +++ b/test/test_plonk_component.hpp @@ -277,13 +277,13 @@ namespace nil { } if constexpr (nil::blueprint::use_lookups()) { - // Components with lookups may use constant columns. - // But now all constants are placed in the first column. - // So we reserve the first column for non-lookup constants. - // Rather universal for testing - // We may start from zero if component doesn't use ordinary constants. + // Use all of the unused constant columns for lookups std::vector lookup_columns_indices; - for( std::size_t i = 1; i < ArithmetizationParams::constant_columns; i++ ) lookup_columns_indices.push_back(i); + for(std::size_t i = 0; i < ArithmetizationParams::constant_columns; i++) { + if(assignment.constants()[i].size() == 0) { + lookup_columns_indices.push_back(i); + } + } desc.usable_rows_amount = zk::snark::pack_lookup_tables_horizontal( bp.get_reserved_indices(), bp.get_reserved_tables(),