fix: test engine does not differentiate between constants and variables #650
Labels
bug
Something isn't working
consolidate
strengthen an existing feature
good first issue
Good for newcomers
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 theSetAllVariablesAsConstants
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.
The text was updated successfully, but these errors were encountered: