From 43057d1e40a56ef77304eb0186902425b520a6f8 Mon Sep 17 00:00:00 2001 From: Matthias Goergens Date: Thu, 25 Apr 2024 12:55:21 +0800 Subject: [PATCH] Fix CTL grouping See https://github.com/0xPolygonZero/plonky2/issues/1582 --- starky/src/cross_table_lookup.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/starky/src/cross_table_lookup.rs b/starky/src/cross_table_lookup.rs index 73caf28cc8..dc662fcd36 100644 --- a/starky/src/cross_table_lookup.rs +++ b/starky/src/cross_table_lookup.rs @@ -396,14 +396,14 @@ fn ctl_helper_zs_cols( challenge: GrandProductChallenge, constraint_degree: usize, ) -> Vec<(usize, Vec>)> { - let grouped_lookups = looking_tables.iter().group_by(|a| a.table); - - grouped_lookups + looking_tables + .iter() + .map(|a| (a.table, (&a.columns[..], &a.filter))) + .into_group_map() .into_iter() - .map(|(table, group)| { - let columns_filters = group - .map(|table| (&table.columns[..], &table.filter)) - .collect::], &Filter)>>(); + // We sort for determinism: + .sorted_by_key(|(table, _)| *table) + .map(|(table, columns_filters)| { ( table, partial_sums(