-
Notifications
You must be signed in to change notification settings - Fork 549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[o1js-main] Add missing runtime table commits in wrap verifier. #14662
Conversation
!ci-build-me |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor changes suggested
let table_ids = Array.init 5 ~f:(fun i -> Int32.of_int_exn i) in | ||
let size = 10 in | ||
let first_column = Array.init size ~f:Field.Constant.of_int in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3 mini points here:
- pick one style indirect
let size = ... in Array.init size
or the directArray.init <size>
(indirect is ok) - why 5 or 10? could they be optional labeled parameters?
- prefer
Int32.of_int_exn
to`(fun i -> Int32.of_int_exn i)
if i = n then () | ||
else | ||
let table_id = 3 in | ||
add_plonk_constraint | ||
(Lookup | ||
{ w0 = fresh_int table_id | ||
; w1 = fresh_int 1 | ||
; w2 = fresh_int 1 | ||
; w3 = fresh_int 2 | ||
; w4 = fresh_int 2 | ||
; w5 = fresh_int 3 | ||
; w6 = fresh_int 3 | ||
} ) ; | ||
make_lookup (i + 1) n |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
simpler code is possible
if i = n then () | |
else | |
let table_id = 3 in | |
add_plonk_constraint | |
(Lookup | |
{ w0 = fresh_int table_id | |
; w1 = fresh_int 1 | |
; w2 = fresh_int 1 | |
; w3 = fresh_int 2 | |
; w4 = fresh_int 2 | |
; w5 = fresh_int 3 | |
; w6 = fresh_int 3 | |
} ) ; | |
make_lookup (i + 1) n | |
if i <> n then | |
let table_id = 3 in | |
add_plonk_constraint | |
(Lookup | |
{ w0 = fresh_int table_id | |
; w1 = fresh_int 1 | |
; w2 = fresh_int 1 | |
; w3 = fresh_int 2 | |
; w4 = fresh_int 2 | |
; w5 = fresh_int 3 | |
; w6 = fresh_int 3 | |
} ) ; | |
make_lookup (i + 1) n |
Also
What did we change wrt to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to have a fix ready for failing nix build
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me, but better for someone familiar with runtime tables to approve.
src/lib/pickles/test/optional_custom_gates/pickles_test_optional_custom_gates.ml
Outdated
Show resolved
Hide resolved
src/lib/pickles/test/optional_custom_gates/pickles_test_optional_custom_gates.ml
Outdated
Show resolved
Hide resolved
let rec make_lookup i n = | ||
if i = n then () | ||
else | ||
let table_id = 3 in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's 3?
@@ -390,6 +416,9 @@ let () = | |||
, Plonk_types.Features.{ none_bool with foreign_field_mul = true } ) | |||
; ( "Fixed lookup tables" | |||
, Plonk_types.Features.{ none_bool with lookup = true } ) | |||
; ( "Runtime lookup tables" | |||
, Plonk_types.Features. | |||
{ none_bool with lookup = true; runtime_tables = true } ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
let runtime_comm = | ||
match messages.lookup with | ||
| Nothing | ||
| Maybe (_, { runtime = Nothing; _ }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe is for nondeterminism?
match messages.lookup with | ||
| Nothing | ||
| Maybe (_, { runtime = Nothing; _ }) | ||
| Just { runtime = Nothing; _ } -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's Just
?
| Maybe (_, { runtime = Nothing; _ }) | ||
| Just { runtime = Nothing; _ } -> | ||
Pickles_types.Opt.Nothing | ||
| Maybe (b_lookup, { runtime = Maybe (b_runtime, runtime); _ }) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For future, can you explain (to me here) the format / what's going on here?
() | ||
| Maybe (b, runtime) -> | ||
let z = Array.map runtime ~f:(fun z -> (b, z)) in | ||
absorb sponge Without_degree_bound z |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why without degree bound?
Closing as it is in develop. |
Orthogonal to the issue raised by o1-labs/o1js#1284, but there is a discrepancy between o1js-main and develop for Pickles. In particular this one.
Explain your changes:
Explain how you tested your changes:
cd src/lib/pickles && dune build @runtest
Checklist: