Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: better initialization for permutation mapping components (#10750)
Constructing the permutation argument polynomials (sigmas/ids) involves constructing an intermediate object of type `PermutationMapping` which contains information about the copy constraints in the circuit. The initialization of this object was inefficient in two ways: (1) the components were zero initialized only to be immediately initialized to non-zero values, and (2) the initialization was not multithreaded. This PR introduces a minor refactor of the underlying structures in `PermutationMapping` so that the zero initialization can be avoided altogether and the initialization to non-zero values can be done in parallel. (In particular instead of vectors of a struct with components {uint32_t, uint8_t, bool, bool}, we now have shared pointers to arrays of the corresponding type {*uint32_t[], *uint8_t[], *bool[], *bool[]}. This structure allows for efficient use of the slab allocator and removes the need to default zero initialize). Benchmark highlights for the case of 2^17 circuits in a 2^20 trace: Master: ``` ClientIVCBench/Full/6 24684 ms 20203 ms DeciderProvingKey(Circuit&)(t) 2365 compute_permutation_argument_polynomials(t)=912.772M ``` Branch: ``` ClientIVCBench/Full/6 23955 ms 19680 ms DeciderProvingKey(Circuit&)(t) 1834 8.02% compute_permutation_argument_polynomials(t)=437.54M ```
- Loading branch information