696 Commits

Author SHA1 Message Date
Nicholas Ward
3944c5e68e added eval_unfiltered_recursively 2021-07-27 13:29:57 -07:00
Nicholas Ward
044eb597c2 added eval_unfiltered_base 2021-07-27 13:18:42 -07:00
Nicholas Ward
21ec75335a fix: power bits in test now LE 2021-07-27 13:09:28 -07:00
Nicholas Ward
b5418bffb3 added output wire 2021-07-27 13:09:15 -07:00
Nicholas Ward
9f4cf9f3d9
Merge pull request #130 from mir-protocol/exp_gate_nits
nits
2021-07-27 12:59:14 -07:00
Daniel Lubarov
54626be7ce comment 2021-07-27 12:48:52 -07:00
Daniel Lubarov
1e9845afcf nits 2021-07-27 12:47:15 -07:00
Nicholas Ward
b66ad6c96a added debug assert 2021-07-27 12:34:47 -07:00
Nicholas Ward
34d59305a1 Merge branch 'main' into exp_gate 2021-07-27 12:29:24 -07:00
Nicholas Ward
7e5e4fc682 updated num_constraints 2021-07-27 12:18:09 -07:00
Nicholas Ward
59bfc52f9c removed extraneous constraint 2021-07-27 11:55:25 -07:00
Nicholas Ward
695e5bc98c fix? 2021-07-27 11:04:16 -07:00
Nicholas Ward
0b8f5860f5 removed if statement 2021-07-27 10:46:10 -07:00
Nicholas Ward
af62688bd7 fixes 2021-07-27 10:19:46 -07:00
Daniel Lubarov
9081ae7337
Reduce noise in FRI logging (#129)
* Reduce noise in FRI logging

Previously, all logs related to gate counts were at the `Debug` log level. This PR gives us more flexibility to adjust the log levels of particular scopes.

In particular, our circuit checks 40 FRI queries, and we log a bunch of steps for each query, creating a lot of noise. With this change, we log just a single FRI query at the `Debug` level, and demote others to the `Trace` level.

With `RUST_LOG=debug`, our logs now look like

```
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] 17631 gates to root
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | 8 gates to observe proof and generates challenges
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | 4150 gates to evaluate the vanishing polynomial at our challenge point, zeta.
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | 3184 gates to evaluate gate constraints
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | | 227 gates to evaluate InterpolationGate { num_points: 4, _phantom: PhantomData }<D=4> constraints
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | | 867 gates to evaluate <R=101> GMiMCGate { ... } constraints
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | | 576 gates to evaluate BaseSumGate { num_limbs: 63 } + Base: 2 constraints
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | | 78 gates to evaluate ArithmeticExtensionGate constraints
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | | 288 gates to evaluate BaseSumGate { num_limbs: 31 } + Base: 2 constraints
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | | 115 gates to evaluate InsertionGate { vec_size: 3, _phantom: PhantomData }<D=4> constraints
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | | 26 gates to evaluate BaseSumGate { num_limbs: 2 } + Base: 2 constraints
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | | 633 gates to evaluate ReducingGate { num_coeffs: 21 } constraints
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | | 4 gates to evaluate ConstantGate constraints
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | | 11 gates to evaluate PublicInputGate constraints
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | | 2 gates to evaluate NoopGate constraints
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | 16 gates to check vanishing and quotient polynomials.
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | 13336 gates to verify FRI proof
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | 6 gates to recover the random betas used in the FRI reductions.
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | 4 gates to check PoW
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | 104 gates to precompute reduced evaluations
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | 330 gates to verify one (of 40) query rounds
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | | 95 gates to check FRI initial proof
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | | | 22 gates to verify 0'th initial Merkle proof
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | | | 33 gates to verify 1'th initial Merkle proof
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | | | 20 gates to verify 2'th initial Merkle proof
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | | | 20 gates to verify 3'th initial Merkle proof
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | | 34 gates to compute x from its index
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | | 32 gates to combine initial oracles
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | | 17 gates to verify FRI round Merkle proof.
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | | 10 gates to infer evaluation using interpolation
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | | 15 gates to verify FRI round Merkle proof.
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | | 10 gates to infer evaluation using interpolation
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | | 13 gates to verify FRI round Merkle proof.
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | | 10 gates to infer evaluation using interpolation
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | | 11 gates to verify FRI round Merkle proof.
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | | 10 gates to infer evaluation using interpolation
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | | 9 gates to verify FRI round Merkle proof.
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | | 10 gates to infer evaluation using interpolation
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | | 7 gates to verify FRI round Merkle proof.
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | | 10 gates to infer final evaluation using interpolation
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | | 8 gates to evaluate final polynomial
```

This bit corresponds to the single FRI query being shown:

```
[2021-07-26T21:07:45Z DEBUG plonky2::context_tree] | | 330 gates to verify one (of 40) query rounds
```

* Minor cleanup

* Address feedback
2021-07-26 16:21:14 -07:00
Daniel Lubarov
3fc02c76bc
Couple fixes to ReducingGate (#128) 2021-07-25 09:34:51 -07:00
wborgeaud
1e5a503a14
Merge pull request #127 from mir-protocol/reducing_gate
Add `ReducingGate` to compute reductions by `alpha` of base field elements
2021-07-25 18:14:40 +02:00
wborgeaud
deea1c979b PR feedback 2021-07-25 18:12:26 +02:00
wborgeaud
5fbeb8742e
Merge pull request #126 from mir-protocol/remove_exp_from_complement
Replace `exp_from_complement_bits` with simpler method
2021-07-25 17:50:08 +02:00
Nicholas Ward
d7a9274fef updated for add_gate changes 2021-07-23 20:06:00 -07:00
Nicholas Ward
da9017bcbc Merge branch 'main' into exp_gate 2021-07-23 20:01:58 -07:00
Nicholas Ward
b06d7bc8f5 cargo fmt 2021-07-23 15:56:25 -07:00
Nicholas Ward
0c4a1bc5af fixes 2021-07-23 15:56:14 -07:00
Nicholas Ward
8e2f33bd42 fix 2021-07-23 15:52:37 -07:00
Nicholas Ward
64d8a44320 cargo fmt 2021-07-23 15:47:03 -07:00
Nicholas Ward
1c8015b93d finished tests (don't pass yet) 2021-07-23 15:46:52 -07:00
Nicholas Ward
9932517e86 cargo fmt 2021-07-23 15:11:53 -07:00
Nicholas Ward
40055dc45d basic tests 2021-07-23 15:11:42 -07:00
Nicholas Ward
6d22ad6ee0 initial version of exponentiation gate 2021-07-23 15:08:54 -07:00
wborgeaud
d509f03b1b Implement eval_unfiltered_base 2021-07-23 18:32:59 +02:00
wborgeaud
c0f09591ee Recursive recursive verifier test 2021-07-23 18:24:09 +02:00
wborgeaud
8f18089aac Implement eval_unfiltered_recursively for ReducingGate 2021-07-23 18:06:14 +02:00
wborgeaud
2ea35bd9e4 Comments 2021-07-23 17:38:24 +02:00
wborgeaud
5a16d7c555 Change number of coeffs supported in ReducingGate depending on config 2021-07-23 17:35:23 +02:00
wborgeaud
c16d93ab33 scaling.rs -> reducing.rs 2021-07-23 17:31:00 +02:00
wborgeaud
ca540a8475 Working fri_combine_initial 2021-07-23 17:29:31 +02:00
wborgeaud
0526a9e149 Working ReducingGate 2021-07-23 17:16:53 +02:00
wborgeaud
19140e39b2 Update comment 2021-07-23 15:01:45 +02:00
wborgeaud
f325586beb Replace exp_from_complement_bits with simpler method 2021-07-23 14:58:41 +02:00
wborgeaud
6f8053cc37 Forgot to exponentiate from bits in computation of subgroup_x. Saves 80 gates. 2021-07-23 08:53:00 +02:00
Daniel Lubarov
bcf524bed0
Have add_gate take a generic type instead of GateRef (#125)
* Have add_gate take a generic type instead of GateRef

There are a couple advantages
- Users writing their own gates won't need to know about the `GateRef` wrapper; it's more of an internal thing now.
- Easier access to gate methods requiring `self` -- for example, `split_le_base` can just call `gate_type.limbs()` now.

* Update comment

* Always insert
2021-07-22 23:48:03 -07:00
wborgeaud
d435720d04
Merge pull request #123 from mir-protocol/remove_acc_in_gmimc
Remove accumulator in `GMiMCGate` and only use bits in the recursive FRI verifier
2021-07-23 08:22:16 +02:00
wborgeaud
a70e97befc Fix merge issues 2021-07-23 08:21:55 +02:00
wborgeaud
9a1c289f8e Merge branch 'main' into remove_acc_in_gmimc
# Conflicts:
#	src/gadgets/arithmetic.rs
2021-07-23 08:16:23 +02:00
wborgeaud
47b9936487 PR feedback 2021-07-23 08:15:13 +02:00
wborgeaud
d8b8161cb9
Merge pull request #122 from mir-protocol/eval_unfilterd_base
Manually implement `eval_unfiltered_base` for all gates
2021-07-23 08:12:01 +02:00
wborgeaud
981ed47867
Merge pull request #121 from mir-protocol/simplify_interpolation_test
Simplify overly complicated function in interpolation test
2021-07-23 08:11:02 +02:00
wborgeaud
a625774984
Merge pull request #120 from mir-protocol/clean_select
Remove rotation gadgets and clean up selection gadgets.
2021-07-23 08:04:11 +02:00
Nicholas Ward
907f1e9147
Merge pull request #124 from mir-protocol/order_bigint
Field order as BigUint
2021-07-22 14:50:14 -07:00
Nicholas Ward
0af5c3bdb8 addressed nit 2021-07-22 14:49:24 -07:00