libiop icon indicating copy to clipboard operation
libiop copied to clipboard

"unknown file: Failure" when using Aurora

Open guipublic opened this issue 6 years ago • 5 comments

I have a simple r1cs that works well with Ligero but fails with Aurora. I tried the Aurora snark example (generate_r1cs_example, using alt_bn128 curve) with the same number of inputs and this example is also failing with the same error: unknown file: Failure Unknown C++ exception thrown in the test body.

My inputs to generate_r1cs_example are: number of constraints = 3 number of inputs = 3 number of variables = 5 With the same parameters, Ligero is working fine. When I use 4 as the number of constraints, then it is working for Aurora.

guipublic avatar Oct 18 '19 12:10 guipublic

With Aurora, the number of constraints and the number of variables must be a power of 2. The number of inputs must be 1 less than a power of 2. (i.e. 2^2 - 1) I'll improve the error message for this. It is fine to just pad the number of constraints, variables and inputs though.

ValarDragon avatar Oct 18 '19 19:10 ValarDragon

Are there also some constraints on the variable numbers for the Fractal scheme? I have an example which now works fine with Ligero and Aurora but not with Fractal: number of constraints = 6111 (padded to 8192) number of inputs = 12 (padded to 15) number of variables = 5975 I have a crash when creating the parameters (fractal_snark_parameters), whether I 'pad' or not.

guipublic avatar Oct 22 '19 15:10 guipublic

I'm surprised Ligero/Aurora work with a non-power of 2 number of variables. I think that has to be a power of 2 as well.

Fractal also needs the number of non-zero indices in a matrix to be a power of 2, but I believe that we pad this. I'll double check the code for this case.

I think the ideal solution here would be to pad all of these things internally, so you don't have to think about these when using the library. This is what the Marlin implementation does

ValarDragon avatar Oct 28 '19 22:10 ValarDragon

Fractal also needs the number of non-zero indices in a matrix to be a power of 2, but I believe that we pad this. I'll double check the code for this case.

What did you mean by indices? I already know num_constraints has to be a power of two. Do we also need each matrix has 2^x non-zero coefficients for some integer x?

vherbert avatar Jul 24 '20 14:07 vherbert

What did you mean by indices? I already know num_constraints has to be a power of two. Do we also need each matrix has 2^x non-zero coefficients for some integer x?

Sorry for the late response, yes you previously did need this. I've now added a commit to master that removes the need for this padding. I'm working on a commit to pad the number of constraints/variables, so users of the library no longer have to think about that either

ValarDragon avatar Aug 28 '20 03:08 ValarDragon