Thanks @shramee for the PR. I completely agree currently debugging emulated circuits is a bit cumbersome particularly because we do the deferred checks and the actual failing constraints do not match the call site in the circuit definition.
However, on the other hand we try to be not opinionated for circuit definition and solving, i.e. we want the users to be able to define unsolvable witness.
I think for debugging purposes we would have to make the emulated gadget a bit more helpful, i.e. we should track the call stack instead in -tags debug mode which points to concrete failing place in the circuit. This is for example how API works for native computation. And when we don't use the debug tag we still get the meaningless "constraint failed" without call stack information.
Originally posted by @ivokub in #1749 (comment)
Thanks @shramee for the PR. I completely agree currently debugging emulated circuits is a bit cumbersome particularly because we do the deferred checks and the actual failing constraints do not match the call site in the circuit definition.
However, on the other hand we try to be not opinionated for circuit definition and solving, i.e. we want the users to be able to define unsolvable witness.
I think for debugging purposes we would have to make the emulated gadget a bit more helpful, i.e. we should track the call stack instead in
-tags debugmode which points to concrete failing place in the circuit. This is for example how API works for native computation. And when we don't use the debug tag we still get the meaningless "constraint failed" without call stack information.Originally posted by @ivokub in #1749 (comment)