-
Notifications
You must be signed in to change notification settings - Fork 499
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
[WIP] Rebase dynamic lookups #715
base: main
Are you sure you want to change the base?
Conversation
halo2_proofs/src/dev.rs
Outdated
@@ -476,7 +491,7 @@ impl<F: Field> Assignment<F> for MockProver<F> { | |||
} | |||
} | |||
|
|||
impl<F: Field + Ord> MockProver<F> { | |||
impl<F: PrimeField + Ord> MockProver<F> { |
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.
Logically this shouldn't need to be a prime field because, for example, we might want to support proving systems that are not group-based, such as FRI. (For a group-based proving system, a non-prime scalar field would be insecure because discrete log on the group could be broken by Pohlig–Hellman.)
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.
1st pass! :)
} | ||
} | ||
|
||
/// Just like dynamic_lookup, but breaks the table into single row regions. |
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.
I don't see how we break the table into single row regions. Am I missing anything?
&|_| panic!("no instance columns in table expressions"), | ||
&|_| panic!("no negations in table expressions"), | ||
&|_, _| panic!("no sums in table expressions"), | ||
&|_, _| panic!("no products in table expressions"), | ||
&|a, b| format!("{} * {}", a, b), |
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 are products
now required? I presume because the Advice assigned into the DynamicLookupTable
can come from any expression result.
If so, sum
m negation
and scale
should be supported too.
halo2_proofs/src/dev/gates.rs
Outdated
&|virtual_col| { | ||
iter::once(format!("V{}", virtual_col.0.index())).collect() | ||
}, |
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 not in this PR. But if we plan to support Instance
cols too, we should change V
for virtual_col.0.col_type()
halo2_proofs/src/dev/graph/layout.rs
Outdated
@@ -82,7 +82,7 @@ impl CircuitLayout { | |||
} | |||
|
|||
/// Renders the given circuit on the given drawing area. | |||
pub fn render<F: Field, ConcreteCircuit: Circuit<F>, DB: DrawingBackend>( | |||
pub fn render<F: PrimeField, ConcreteCircuit: Circuit<F>, DB: DrawingBackend>( |
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.
I saw above. Nor sure neither. It doesn't seem that anything requires any function from the PrimeField
trait specifically right?
dba5db0
to
0fb457e
Compare
A book entry for the dynamic lookups feature has been added in 1de300f21ec84b119f82f04c3e7a2fabe4d40c82. |
1de300f
to
13889da
Compare
Co-authored-by: Avi Dessauer <[email protected]>
Co-authored-by: Avi Dessauer <[email protected]>
Co-authored-by: Avi Dessauer <[email protected]>
Co-authored-by: Avi Dessauer <[email protected]>
Co-authored-by: Avi Dessauer <[email protected]>
Co-authored-by: Avi Dessauer <[email protected]>
…ble() Co-authored-by: Avi Dessauer <[email protected]>
Co-authored-by: Avi Dessauer <[email protected]>
Co-authored-by: Avi Dessauer <[email protected]>
Co-authored-by: Avi Dessauer <[email protected]>
Co-authored-by: Avi Dessauer <[email protected]>
Co-authored-by: Avi Dessauer <[email protected]>
13889da
to
5421a4d
Compare
This feature currently does not seem to work when input columns are reused to assign dynamic table columns; similarly, when inputs/tables across multiple arguments share the same columns. (see 9ce8858#diff-faaf1a95220be5b9b73f935e6659140eac1bd000fbbccb6e102589b4c3ec49c5R1869) This seems like unexpected behaviour. |
Co-authored-by: Avi Dessauer <[email protected]>
Co-authored-by: Avi Dessauer <[email protected]>
Co-authored-by: Avi Dessauer <[email protected]>
Co-authored-by: Avi Dessauer <[email protected]>
Co-authored-by: Avi Dessauer <[email protected]>
9ce8858
to
eb938d7
Compare
As it stands now, this PR requires inputs and tables to be perfectly aligned by looking up these tuples: (selector.clone() * input, selector.clone() * table_query) Instead, we could either:
|
Recommended: review commit-by-commit.
cargo test --features unstable-dynamic-lookups dyn
cargo run --features unstable-dynamic-lookups --example dynamic-lookup
(This PR is a rebased version of #660.)