Commit Graph

46 Commits

Author SHA1 Message Date
Steve Wang
98029727e0 merge main 2023-06-09 16:33:43 +08:00
Leo Lara
5f935dedb6 Fix examples clippy 2023-06-07 14:18:43 +07:00
Leo Lara
efddd6c05c Make witness generation more generic 2023-06-07 09:22:02 +07:00
Leo Lara
f379cd1e0e Put setup in its own indentation level 2023-05-30 13:44:21 +07:00
Leo Lara
afd0238a77 Remove bytecode example 2023-05-26 15:17:04 +02:00
Leo Lara
31a6ec16ba Update halo2 version to v2023_04_20 2023-05-25 16:07:37 +02:00
Steve Wang
db25e2c811 modified the rust doc yml file to auto generate CNAME file (#30) 2023-05-18 07:19:25 +00:00
Steve Wang
c377da9359 Removed leading zeroes for the debug msg of Expr and PolyExpr (#26)
- Only done for Const enum types, because other types don't involve
leading zeroes (they can be composed of Const type though)
- Wrote test cases as well

I think the debug msg for the entire circuit is still from Halo2 native,
and it doesn't remove leading zeroes. There's probably no way we can fix
that unless we change the dependencies ourselves.

---------

Co-authored-by: Leo Lara <leolara@users.noreply.github.com>
2023-05-08 11:43:23 +00:00
Leo Lara
fb2985f242 Fix clippy 2023-05-08 17:40:18 +07:00
Steve Wang
93616fb460 updated fibo example to use new cell manager with customizable column width 2023-05-08 13:30:18 +08:00
Leo Lara
902de292aa Test for MaxWidthCellManager 2023-05-07 12:45:58 +07:00
Leo Lara
f5178e2fc4 Cell Manager only needs compilation unit as input 2023-05-07 12:02:55 +07:00
Leo Lara
52db0acfa2 Draft of max width cell manager 2023-05-07 11:41:25 +07:00
Steve Wang
f6e71fbbb2 finished all tests for constraint builder functions; not for lookups yet (#19)
Identified a few potential issues:
1. Input for `not` should be 0 or 1, but there's no enforcement of that
2. `xor` takes Into Expr and returns Into Expr, while almost all other
functions take Into Constraint and return Into Constraint

Next steps:
1. I think annotations are broadly testable, it's just that the numbers
are currently in hex format with padded zeroes, which are quite hard to
read in the annotation messages as well. I think I should be able to fix
it if you'd like to.
2023-05-04 10:02:32 +00:00
Leo Lara
e4b66d169e Small test for cb::and 2023-05-04 11:09:28 +07:00
Steve Wang
6de148b32d steve/issue_17-fix_ci_and_doc_format (#18)
Co-authored-by: Steve Wang <qwang97@wharton.upenn.edu>
2023-05-04 02:27:26 +00:00
Steve Wang
08788f754c Steve/issue 6 api documentation v2 (#13)
see commit message :)

API documentation deployed on fork here:
https://qwang98.github.io/chiquito/chiquito/index.html

---------

Co-authored-by: Steve Wang <qwang97@wharton.upenn.edu>
2023-05-03 07:38:53 +00:00
Steve Wang
656362bc08 steve/issue 7 ci (#15)
rustfmt and clippy check, with skip check option for markdown files and
docs

rustfmt check taken from zkEVM

@leolara These edits change the source code (by fixing warnings and
conforming to rustfmt). Most are cosmetic, but I'd still suggest you
review them. Thanks!

---------

Co-authored-by: Steve Wang <qwang97@wharton.upenn.edu>
Co-authored-by: Chih Cheng Liang <chihchengliang@gmail.com>
2023-05-03 05:46:39 +00:00
Steve Wang
5a4e87753e Steve/issue 5 readme (#12)
see commit message :)

Please read fibonacci example from files changed of this PR. The link in
README refers to main which doesn't include changes yet

API doc links are deployed from fork, and will be re-deployed from main
once docs are approved and merged

---------

Co-authored-by: Steve Wang <qwang97@wharton.upenn.edu>
Co-authored-by: Chih Cheng Liang <chihchengliang@gmail.com>
2023-05-03 03:52:59 +00:00
Steve Wang
0fdf135b3f Mimc7 example with lookup table implementation (#11)
Co-authored-by: 10to4 <even@secbit.io>
Co-authored-by: Steve Wang <qwang97@wharton.upenn.edu>
Co-authored-by: Leo Lara <leolara@users.noreply.github.com>
2023-05-03 03:51:48 +00:00
Leo Lara
3e655f1d20 Use default trait for lookups 2023-04-29 20:22:44 +07:00
Leo Lara
3a64e34329 Add when and unless v2023_04_26 2023-04-26 12:56:24 +07:00
Steve Wang
c5097d09d0 lookup column implementation (#3)
High Level Description
Simplified syntax for adding and building lookup columns. 
- Adding lookup: call add_lookup in step_type_def to modify StepTypeContext
- Building lookup: call lookup() without a parameter to initialize; call add(source_column, lookup_column) to build lookup match constraints; call enable(enabler_column) to add an enabler column
- Example: add_lookup(lookup().add(source_col_1, lookup_col_1).enable(enabler_col).add(source_col_2, lookup_col2)

Technical Details (from a user -> dsl -> ast -> ir perspective):
1. Added LookupBuilder to dsl/cb with exposed methods to update Lookup in ast
2. Modified Lookup in ast to include an annotation field, which is now auto generated, as well as an enabler column field
3. Lookup now takes (Constraint, Expr) for (LHS, RHS), where LHS is the source column and RHS is the lookup column; Lookup takes Constraint for the enabler column
4. In ir, PolyLookup takes the auto-generated annotation from Lookup in ast and Halo2 backend takes annotation from PolyLookup in ir.

Next Step
1. Test the new lookup syntax on zkEVM bytecode circuit

---------
(With lots of inspirations and guidance from Leo Lara)
Co-authored-by: Steve Wang <qian.wang.wg24@wharton.upenn.edu>
v2023_04_24_2
2023-04-24 14:00:41 +07:00
Leo Lara
975d09576b Add next_step_must_be and next_step_must_not_be v2023_04_24 2023-04-24 13:57:57 +07:00
Leo Lara
25882817f6 Add stdlib v2023_04_13_2 2023-04-13 22:59:17 +07:00
Leo Lara
3237f567e3 Remove deprecated 2023-04-13 22:53:55 +07:00
Leo Lara
20d47021f2 Improve auto annotations v2023_04_13 2023-04-13 22:12:08 +07:00
Leo Lara
73662ff594 Fix TwoStepsSelectorBuilder 2023-04-13 19:33:51 +07:00
Leo Lara
1c5b13a156 Not necessary to add annotations to constraints anymore 2023-04-13 18:39:50 +07:00
Leo Lara
f6097970f4 Move cb to its own file 2023-04-13 15:23:05 +07:00
Leo Lara
34733eae88 Add fibonacci example 2023-04-13 15:13:33 +07:00
Leo Lara
ae40739f88 Remove unnecesary mut borrow 2023-04-12 19:45:20 +07:00
Leo Lara
0cdbb6749e Add two step selector 2023-04-12 07:13:42 +07:00
Leo Lara
caf45bf65a More cb expressions 2023-04-12 07:12:06 +07:00
Leo Lara
5da02a3b07 Merge pull request #1 from ChihChengLiang/fix-examples
Fix examples and make the code build
2023-04-12 06:24:34 +07:00
ChihChengLiang
37e6b49b6e add CI 2023-04-11 19:36:36 +09:00
ChihChengLiang
60f296dcf7 fix examples and compiles 2023-04-11 19:32:31 +09:00
Leo Lara
7fc5f97ac1 Move IR to its own module 2023-04-11 12:03:01 +07:00
Leo Lara
74a64b2bbe Deprecate .signal in favor of .internal 2023-04-11 11:47:39 +07:00
Leo Lara
9a54b830e6 Cleaning v2023_04_04 2023-04-04 17:41:40 +07:00
Leo Lara
4308e34855 Add README 2023-04-04 16:57:17 +07:00
Leo Lara
3b660dfa83 Set height 2023-04-04 14:15:43 +07:00
Leo Lara
6ba8fdb61b Chiquito working implementation 2023-04-04 10:47:09 +07:00
Leo Lara
7f5d90ab25 3rd commit 2023-03-27 09:39:05 +07:00
Leo Lara
ac87e74706 2nd commit 2023-03-22 10:37:40 +07:00
Leo Lara
bde4455a45 Initial commit 2023-03-20 19:20:56 +07:00