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

fix: test engine does not differentiate between constants and variables #650

Open
ivokub opened this issue Apr 18, 2023 · 1 comment
Open
Labels
bug Something isn't working consolidate strengthen an existing feature good first issue Good for newcomers

Comments

@ivokub
Copy link
Collaborator

ivokub commented Apr 18, 2023

In addition to being able to solve the witness for the circuit and run the prover, gnark has a feature where we represent all witness values as *big.Int and just run the computations. This feature (called the test engine) is very useful for writing and debugging complex circuits as we can compare the intermediate results to natively computed results.

Right now however, as the variables in test engines are vanilla *big.Int, we lose a bit of context - is the input a variable or a constant. In the frontend and gadgets we frequently take different paths depending on this bit. In order to ensure that the different computation paths are compatible, we have the SetAllVariablesAsConstants option. But this doesn't capture the situation where some of the inputs are variables and some constants.

It would be good to embed the variables in test engine which allows to capture the constantness bit.

@ivokub ivokub added bug Something isn't working good first issue Good for newcomers consolidate strengthen an existing feature labels Apr 18, 2023
@Vijay-K-2003
Copy link

I would like to try to solve this issue. @ivokub Is this a good issue to start with if I am new to OS ? How can I reproduce this bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working consolidate strengthen an existing feature good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants