1109 Commits

Author SHA1 Message Date
Daniel Lubarov
90c7a72ceb
Remove some unused warnings (#192)
- Made some methods public, if they seemed like they'd be useful crates that depend on plonky2, and seemed like good/stable APIs
- Deleted a few things I didn't think seemed very useful
- Left a few for now that I was on the fence about
2021-08-19 08:23:45 -07: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
Nicholas Ward
94a0ad7846 switch gate (in progress) 2021-08-18 17:46:38 -07:00
Jakub Nabaglo
7c97751c13
Optimized transpose (#191)
* Start work on optimized transpose

* Optimized transpose: 12-14% improvement on benchmark

* Transpose: Avoid bounds checks and change order of loops dynamically

* Transpose: re-enable bounds checks
2021-08-18 16:45:17 -07:00
Daniel Lubarov
d41924dad3
Benchmark transpose (#190)
* Benchmark transpose

* fmt
2021-08-18 09:43:19 -07:00
wborgeaud
4dde45917b
Merge pull request #189 from mir-protocol/remove_reverse_bits
Remove reverse bits
2021-08-18 17:37:24 +02:00
Daniel Lubarov
c31c06d227
FFT/LDE benches (#188)
And expose FftStrategy so we can bench both
2021-08-18 08:36:40 -07:00
wborgeaud
01d745b627 Minor 2021-08-18 14:36:43 +02:00
wborgeaud
291e67bec5 Remove reverse_bits flag in Merkle trees 2021-08-18 14:32:24 +02:00
Daniel Lubarov
f2ed563da9
Try PoW seeds up to p (#186)
No point in going higher.
2021-08-18 00:53:20 -07:00
Daniel Lubarov
aae2c9d16f Reduce PoW bits
The PoW search was taking significant time sometimes.
2021-08-17 23:55:16 -07:00
wborgeaud
561228103f More scalar muls 2021-08-17 10:26:31 +02:00
Daniel Lubarov
722f99743a Use scalar_mul vs converting 2021-08-17 00:49:01 -07:00
Daniel Lubarov
69193a8dc2
Remove *_three methods (#182)
* Remove *_three methods

Since there's no longer a performance reason for them, and I think the *_many methods are about as short etc.

* PR feedback
2021-08-17 00:38:41 -07:00
wborgeaud
896988ca30 Put back generator check 2021-08-17 09:12:40 +02:00
wborgeaud
d9b0778eef Change zip order 2021-08-17 08:47:52 +02:00
wborgeaud
9a54540116 Minor 2021-08-16 11:08:26 +02:00
wborgeaud
5a9c5b295c Minor 2021-08-16 10:41:12 +02:00
wborgeaud
3d83d9ff42 Minor 2021-08-16 10:28:08 +02:00
wborgeaud
b366482866 The mother of all arithmetic optimizations 2021-08-16 10:18:10 +02:00
wborgeaud
6ba6201b94 Merge branch 'main' into push_to_8192
# Conflicts:
#	src/fri/recursive_verifier.rs
#	src/plonk/circuit_data.rs
#	src/plonk/recursive_verifier.rs
#	src/util/reducing.rs
2021-08-16 08:49:49 +02:00
Daniel Lubarov
e4cbee2b57
Disable ZK in large_config (#180)
* Disable ZK in large_config

Speeds up the tests from ~6m to ~1m (debug mode). `large_config` is crate-private so I don't think we need to worry about real users forgetting ZK, and I don't think ZK seems important in these tests, though we should probably have ZK enabled for a couple tests.

A couple tests need ZK or they fail; I added a TODO to look later.

This led to a few other changes:
- Fixed a bug where `trim` could truncate the final poly to a non-power-of-two length. This was improbable when ZK is on due to randomization.
- Gave a few methods access to the whole `CircuitConfig` vs `FriConfig` -- sort of necessary for the above fix, and I don't think there's much downside.
- Remove `cap_height` from `FriConfig` -- didn't really need it any more after giving more methods access to `CircuitConfig`, and having a single copy of the param feels cleaner/safer to me.

* PR feedback
2021-08-14 10:01:10 -07:00
Daniel Lubarov
f3bfd66657
Add a BoolTarget (#179)
It's just a wrapper around `Target`, which signifies that the wrapped `Target` has already been range checked. Should make it easier to audit code that expects bools.
2021-08-14 08:53:39 -07:00
Daniel Lubarov
8effaf76e9
eval_fns for PublicInputGate (#177)
And a small fix in eval_fns
2021-08-14 08:48:02 -07:00
Daniel Lubarov
9c42fef997
Little refactor (#178) 2021-08-14 08:47:03 -07:00
wborgeaud
47e9f5461e
Merge pull request #175 from mir-protocol/some_more_arithm_opt
Some more arithmetic optimizations
2021-08-14 11:48:28 +02:00
wborgeaud
8aaa9401ac Add comment for slope 2021-08-14 11:48:13 +02:00
Daniel Lubarov
08f0e0ff55 Remove unnecessary checks
They're out of date, and checked elsewhere
2021-08-13 19:36:21 -07:00
wborgeaud
630b7f2281 Smaller parameters 2021-08-13 22:42:22 +02:00
wborgeaud
bb548fe148 More cleaning 2021-08-13 20:31:04 +02:00
wborgeaud
ceae6b9588 Cleaning 2021-08-13 20:12:20 +02:00
wborgeaud
237ef4d0ec Change FRI params to get below 2^13 2021-08-13 18:24:46 +02:00
wborgeaud
43641174cb Comments 2021-08-13 18:00:40 +02:00
wborgeaud
68af28e9a2 Fix tests 2021-08-13 17:41:26 +02:00
wborgeaud
d0aae8c2a7 clean 2021-08-13 16:39:26 +02:00
wborgeaud
611c1767b1 add reducing ext gate 2021-08-13 16:04:31 +02:00
wborgeaud
1c78965763 better 2021-08-13 15:24:38 +02:00
wborgeaud
7da4412de5 working 2021-08-13 15:22:03 +02:00
wborgeaud
9547aa6382 minor 2021-08-13 14:30:48 +02:00
wborgeaud
75ad055f40 First try 2021-08-13 14:28:05 +02:00
wborgeaud
73ab11f420 More arithmetic optimizations 2021-08-13 11:35:20 +02:00
wborgeaud
71c392e935 More optim 2021-08-13 10:46:51 +02:00
wborgeaud
21669be246 Some arithm optims 2021-08-13 10:40:31 +02:00
Daniel Lubarov
bbfc0f8adc no mut 2021-08-12 13:56:45 -07:00
Daniel Lubarov
b20d6dc191
Minor optimizations (#174) 2021-08-12 13:32:49 -07:00
wborgeaud
5bce9ca90d
Merge pull request #173 from mir-protocol/minor_arithmetic_optim
Minor arithmetic optimizations
2021-08-12 18:27:46 +02:00
wborgeaud
2bfa454476 PR feedback 2021-08-12 18:21:21 +02:00
wborgeaud
7271af823b Optimize evaluate_gate_constraints_recurively 2021-08-12 16:48:13 +02:00
Daniel Lubarov
38505b71ae
FRI refactor (#172)
I sort of "shifted" the loop in `fri_verifier_query_round` so that `fri_combine_initial` is called before the loop, and all `compute_evaluation` calls are in the loop (rather than the final one being outside). This lines up with my mental model of FRI, and I think it's more natural as it results in a loop with no branches, no `i - 1`s, and less state stored between iterations. Also added some comments etc.

Should be functionally equivalent to the old version.
2021-08-12 07:27:33 -07:00