File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
crates/prover/src/constraint_framework Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -96,13 +96,17 @@ impl TraceLocationAllocator {
9696 & self . preprocessed_columns
9797 }
9898
99- // validates that `self.preprocessed_columns` is consistent with
99+ // Validates that `self.preprocessed_columns` is a permutation of
100100 // `preprocessed_columns`.
101- // I.e. preprocessed_columns[i] == self.preprocessed_columns[i].
102- // TODO(Gali): Change to only validating that this is a permutation (not necessarily the same
103- // order).
104101 pub fn validate_preprocessed_columns ( & self , preprocessed_columns : & [ PreProcessedColumnId ] ) {
105- assert_eq ! ( self . preprocessed_columns, preprocessed_columns) ;
102+ let mut self_columns = self . preprocessed_columns . clone ( ) ;
103+ let mut input_columns = preprocessed_columns. to_vec ( ) ;
104+ self_columns. sort_by_key ( |col| col. id . clone ( ) ) ;
105+ input_columns. sort_by_key ( |col| col. id . clone ( ) ) ;
106+ assert_eq ! (
107+ self_columns, input_columns,
108+ "Preprocessed columns are not a permutation."
109+ ) ;
106110 }
107111}
108112
You can’t perform that action at this time.
0 commit comments