21 Commits

Author SHA1 Message Date
wborgeaud
0f06a01ac1 Merge conflicts 2021-11-08 10:49:14 +01:00
wborgeaud
7482e7b613 Remove RichField 2021-11-05 15:43:58 +01:00
wborgeaud
fb18232efd Generic config 2021-11-05 10:56:23 +01:00
Daniel Lubarov
1450ffb29c
Small recursion optimizations (#338)
* Small recursion optimizations

Main thing is memoizing arithmetic operations. Overall savings is ~50 gates.

* feedback
2021-11-04 16:23:01 -07:00
Daniel Lubarov
fdce382af3
Standard configs (#337)
`large_config` was similar to `standard_recursion_config`; let's standardize on the latter.
2021-11-03 14:30:32 -07:00
Jakub Nabaglo
bc57a561e6 Delete CrandallField 2021-11-02 12:29:26 -07:00
Daniel Lubarov
c6f91148d5
PoseidonMdsGate (#330)
PoseidonGate's recursive evaluations were using a lot of gates, and the MDS layer was the main culprit.

The other issue is that `constant_layer_recursive` creates a bunch of `ArithmeticGate`s with unique constants. We could either change `ArithmeticGate` to support different constants per operation, or wire in constants from `ConstantGate`, and change `ConstantGate` to support several constants per gate.

This won't really help anything near term since we're still between 2^12 and 2^13, but could have some benefits later, depending on what recursion arities and security settings we end up using.

`PoseidonMdsGate` needs `2 * D * WIDTH = 48` routed wires, and the combination of adding a gate and increasing routed wires slows down the prover a bit. So for now, I kept it at 28 wires, and the old code path is still used.
2021-11-02 08:16:28 -07:00
Daniel Lubarov
806641d13f
Small optimizations (#319)
* Small optimizations

* Small optimizations

* feedback

* inline

* feedback

* fix unused import
2021-10-22 19:11:05 -07:00
Daniel Lubarov
7d45c80c03
Have eval_unfiltered_base call the normal Poseidon methods (#316)
* Have eval_unfiltered_base call the normal Poseidon methods

* fmt
2021-10-21 14:28:07 -07:00
Daniel Lubarov
22ce2da9e1
Add add_const, mul_const, mul_const_add methods (#312)
* Add mul_const, mul_const_add methods

To replace some arithmetic calls; I think it's easier to read.

* One more

* Couple more

* tweak

* tweak
2021-10-20 23:43:52 -07:00
Daniel Lubarov
3f22663296
Split up PartitionWitness data (#273)
* Split up `PartitionWitness` data

This addresses two minor inefficiencies:
- Some preprocessed forest data was being cloned during proving.
- Some of the `ForestNode` data (like node sizes) is only needed in preprocessing, not proving. It was taking up cache space during proving because it was interleaved with data that is used during proving (parents, values).

Now `Forest` contains the disjoint-set forest. `PartitionWitness` is now mainly a Vec of target values; it also holds a reference to the (preprocessed) representative map.

On my laptop, this speeds up witness generation ~12%, resulting in an overall ~0.5% speedup.

* Feedback

* No size data (#278)

* No size data

* feedback
2021-09-28 22:31:20 -07:00
wborgeaud
df9a211475 PR comments 2021-09-27 12:29:27 +02:00
wborgeaud
1a55538e23 8->SPONGE_WIDTH in most places 2021-09-24 15:50:48 +02:00
wborgeaud
42a7ff9cc2 Working 2021-09-24 13:06:07 +02:00
wborgeaud
0be8650bca PR feedback 2021-09-18 09:23:39 +02:00
wborgeaud
14bbf5ae11 Fix AVX2 conflict 2021-09-17 17:50:43 +02:00
wborgeaud
675f32835b Minor 2021-09-17 13:50:42 +02:00
wborgeaud
f83c587cc5 Comments 2021-09-17 13:47:08 +02:00
wborgeaud
5d7f4de2a6 Working recursively 2021-09-16 19:17:37 +02:00
wborgeaud
c508fe4362 Minor 2021-09-16 18:16:19 +02:00
wborgeaud
49ba7ccb52 Working 2021-09-16 18:16:05 +02:00