Skip to content
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

Auto-generated prover functions #2066

Open
1 of 9 tasks
chriseth opened this issue Nov 11, 2024 · 0 comments
Open
1 of 9 tasks

Auto-generated prover functions #2066

chriseth opened this issue Nov 11, 2024 · 0 comments
Assignees

Comments

@chriseth
Copy link
Member

chriseth commented Nov 11, 2024

It shouldn't be too difficult to auto-generate prover functions for witness generation.

We essentially loop over row deltas and identities like in runtime witgen, just that instead of computing values, we emit code that computes these values.

For each cell, we store:

  • Range constraints (might be constant)
  • If its known or not

Once each column has period many known cells, the code is complete.

In order to work with the fixed (and other) lookups, we need to know how many of the input values need to be known for the lookup to always succeed (remember, in this one, we cannot just try out if it works). For this we need an interface of the kind "Given these range constraints on those columns (and knowing the values at runtime), can the rest of the columns be uniquely determined?"

This interface is also the one we need to implement for the auto witgen code generation. We need to try to build the code and answer "yes" if we can generate code that uniquely determines all missing columns on the latch row.


TODO:

  • optimized impl for certain fields ( Specialized code for goldilocks. #2253 )
  • implement "can always answer call" for certain machines and use it for decision to perform call ( "can process fully" #2255 use can_process #2256 )
  • support non-rectangular block shapes
  • support branching
  • support dynamic machine
  • detect certain prover functions to be "ok" (especially the regular riscv query function)
  • annotate prover functions with inputs, outputs and conditions and jit-compile them from pil to rust.

IDEAS:

  • try compiling with 'no_std' to see if compilation is faster.
  • check if using add_no_canonicalize_trashing_input is really faster, esecially since we want to bring the result into canonical form again anyway.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant