Commit c183108
committed
perf(whir_zk): drop linear_forms after covector build
Take linear_forms by value in prepare_and_sumcheck / prove_blinded_polynomial
and drop it as soon as the combined covector has been built. Each Covector
in linear_forms holds num_witnesses field elements; for R1CS circuits with
3 matrices (A, B, C) and millions of witnesses this is ~100 MB freed
before the WHIR commit phase, where peak memory is hit.
Measured peak reduction on provekit (m=20 circuits):
- complete_age_check: 880 -> 805 MB (-8.5%)
- t_add_dsc_1850: 533 -> 497 MB (-6.8%)
- t_add_id_data_1850: 222 -> 203 MB (-8.6%)
- poseidon-rounds: 467 -> 467 MB (no change, small linear forms)
Protocol-equivalent. Transcript byte-identical. E2E prove+verify passes.1 parent 0a68627 commit c183108
1 file changed
Lines changed: 6 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
| 162 | + | |
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
| 250 | + | |
| 251 | + | |
250 | 252 | | |
251 | 253 | | |
252 | 254 | | |
| |||
475 | 477 | | |
476 | 478 | | |
477 | 479 | | |
478 | | - | |
| 480 | + | |
479 | 481 | | |
480 | 482 | | |
481 | 483 | | |
| |||
682 | 684 | | |
683 | 685 | | |
684 | 686 | | |
685 | | - | |
| 687 | + | |
686 | 688 | | |
687 | 689 | | |
688 | 690 | | |
689 | 691 | | |
690 | 692 | | |
691 | | - | |
692 | 693 | | |
693 | 694 | | |
694 | 695 | | |
| |||
0 commit comments