27 Commits

Author SHA1 Message Date
Nicholas Ward
166ab77ee3 biguint_cmp test 2021-11-10 09:58:15 -08:00
Nicholas Ward
b045afbb8a biguint methods in fields, and biguint gadget progress 2021-11-10 09:58:00 -08:00
Daniel Lubarov
ac97412667 Renaming 2021-09-29 12:07:27 -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
Daniel Lubarov
d2dcc31a6c
Fix witness generation performance (#269)
See #266. This avoids the quadratic costs (w.r.t. partition size), as we will now only enumerate watchers the first time a representative is assigned.
2021-09-22 23:45:16 -07:00
Daniel Lubarov
e8cb2bbd22
Witness generation fix (#266)
When we went through newly-populated values, as in

    for &(watch, _) in &buffer.target_values

`watch` was not necessarily a representative, because it came from a `GeneratedValues`, whose `set_target` doesn't know about representatives.
2021-09-22 13:43:11 -07:00
Daniel Lubarov
b3008b9475
Some changes to generator_indices_by_watches (#234)
* Some changes to generator_indices_by_watches

- Index generators by the representatives (in disjoint-set forest terminology) of their watched targets, rather than the watched targets themselves.  Enqueuing generators based on their watch lists then works correctly, so we no longer need the step where we reenqueue all generators.
- In #195, it was pointed out that this slows down witness generation a bit. I moved the indexing code to preprocessing, so the prover is a bit faster (~7ms for me).

* Outdated comment

* Panic instead of infinite loop if we get stuck

* BTree

* fmt
2021-09-13 16:38:55 -07:00
Daniel Lubarov
f89f49249a wip 2021-09-04 16:27:40 -07:00
wborgeaud
a61d7bc0cc Typo 2021-08-20 13:00:40 +02:00
wborgeaud
507577b7ad Comments 2021-08-20 12:55:59 +02:00
wborgeaud
e81001b9ba Clippy 2021-08-20 11:13:40 +02:00
wborgeaud
c53d050408 More cleaning 2021-08-20 11:03:55 +02:00
wborgeaud
6584734928 Cleaning 2021-08-20 10:44:19 +02:00
wborgeaud
c6cf5cf130 Move PartitionWitness 2021-08-20 09:55:49 +02:00
wborgeaud
a44bf9ffd8 Added witness trait 2021-08-20 09:50:07 +02:00
wborgeaud
98559c3256 Working 2021-08-20 09:20:03 +02:00
wborgeaud
af0ea25fc8 more trials 2021-08-19 15:59:05 +02:00
wborgeaud
74c2be5090 First pass 2021-08-19 14:54:11 +02:00
wborgeaud
896988ca30 Put back generator check 2021-08-17 09:12:40 +02:00
wborgeaud
5a9c5b295c Minor 2021-08-16 10:41:12 +02:00
wborgeaud
75ad055f40 First try 2021-08-13 14:28:05 +02:00
wborgeaud
a6490de7ad routed_wires -> wires 2021-08-06 11:30:56 +02:00
wborgeaud
99e399f661 Renaming 2021-08-06 11:10:15 +02:00
wborgeaud
8531cf042a Replace HashMap by Vec in generate_partial_witness 2021-08-06 10:52:11 +02:00
Daniel Lubarov
8b8e4d223d
Optimize witness generation a bit (#153)
Mainly storing pending generators in a Vec rather than a HashMap.  Requires an extra check to make sure we don't run one twice after adding it to the Vec twice.
2021-08-04 09:55:11 -07:00
Daniel Lubarov
d6211b8ab8
Reuse a buffer of generated values (#142)
* Reuse a buffer of generated values

To avoid allocating `GeneratedValues` all the time. Saves ~60ms or so.

* PR feedback
2021-08-02 10:55:10 -07:00
Daniel Lubarov
018fb005f8
Move stuff around (#135)
No functional changes here. The biggest change was moving certain files into new directories like `plonk` and `iop` (for things like `Challenger` that could be used in STARKs or other IOPs). I also split a few files, renames, etc, but again nothing functional, so I don't think a careful review is necessary (just a sanity check).
2021-07-29 22:00:29 -07:00