- 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>
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.
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>
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>
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>