861 Commits

Author SHA1 Message Date
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
wborgeaud
702eab1583 Add wide_arithmetic 2021-08-12 16:03:13 +02:00
wborgeaud
08e457458d Comments 2021-08-12 15:48:45 +02:00
wborgeaud
9061335996 Some more arithmetic optimizations 2021-08-12 15:46:18 +02:00
wborgeaud
debc0e9cb3
Merge pull request #170 from mir-protocol/merkle_cap
Replace Merkle roots with Merkle caps
2021-08-11 08:40:12 +02:00
wborgeaud
9c01e1d942 PR feedback 2021-08-11 08:33:58 +02:00
Daniel Lubarov
090cf79787
Replace some old division code (#171)
- Delete unsafe methods
- Have related methods call the new div_add_extension method to simplify
2021-08-10 11:48:53 -07:00
wborgeaud
9f004c9664 Clippy 2021-08-10 16:18:42 +02:00
wborgeaud
e73c1d7769 Cleaning / Renaming 2021-08-10 15:53:27 +02:00
wborgeaud
ad8428f38f 12604 gates, 318637 bytes 2021-08-10 15:28:41 +02:00
wborgeaud
ec1147848a Minor 2021-08-10 15:05:21 +02:00
wborgeaud
684df1e057 Pass cap index 2021-08-10 15:03:29 +02:00
wborgeaud
f2c423ee61 save 13 gates 2021-08-10 14:19:12 +02:00
wborgeaud
57f2b5b763 working 2021-08-10 13:52:50 +02:00
wborgeaud
f91b9b60c6 debug 2021-08-10 13:43:25 +02:00
wborgeaud
ce71b536bf First pass 2021-08-10 13:33:44 +02:00
wborgeaud
2cf82636f8
Merge pull request #166 from mir-protocol/optimize_arithmetic_ops
Optimize some arithmetic operations
2021-08-10 09:25:59 +02:00
wborgeaud
94123c456e Fix merge conflict 2021-08-10 09:21:03 +02:00