Skip to content

Commit 244080c

Browse files
test(full-recursion): adds a test for double full-recursion (overflowing memory)
1 parent b1697f4 commit 244080c

File tree

1 file changed

+61
-16
lines changed

1 file changed

+61
-16
lines changed

prover/protocol/compiler/fullrecursion/full_recursion_test.go

Lines changed: 61 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
11
package fullrecursion_test
22

33
import (
4+
"fmt"
45
"testing"
56

67
"github.com/consensys/linea-monorepo/prover/crypto/ringsis"
78
"github.com/consensys/linea-monorepo/prover/maths/common/smartvectors"
89
"github.com/consensys/linea-monorepo/prover/protocol/compiler/fullrecursion"
910
"github.com/consensys/linea-monorepo/prover/protocol/compiler/globalcs"
11+
"github.com/consensys/linea-monorepo/prover/protocol/compiler/innerproduct"
1012
"github.com/consensys/linea-monorepo/prover/protocol/compiler/localcs"
1113
"github.com/consensys/linea-monorepo/prover/protocol/compiler/lookup"
14+
"github.com/consensys/linea-monorepo/prover/protocol/compiler/mimc"
15+
"github.com/consensys/linea-monorepo/prover/protocol/compiler/permutation"
16+
"github.com/consensys/linea-monorepo/prover/protocol/compiler/specialqueries"
17+
"github.com/consensys/linea-monorepo/prover/protocol/compiler/splitter"
18+
"github.com/consensys/linea-monorepo/prover/protocol/compiler/splitter/sticker"
1219
"github.com/consensys/linea-monorepo/prover/protocol/compiler/univariates"
1320
"github.com/consensys/linea-monorepo/prover/protocol/compiler/vortex"
1421
"github.com/consensys/linea-monorepo/prover/protocol/ifaces"
@@ -35,21 +42,59 @@ func TestLookup(t *testing.T) {
3542
run.AssignColumn("B", smartvectors.ForTest(1, 2, 3, 4, 5, 6, 7, 8))
3643
}
3744

38-
comp := wizard.Compile(
39-
define,
40-
lookup.CompileLogDerivative,
41-
localcs.Compile,
42-
globalcs.Compile,
43-
univariates.CompileLocalOpening,
44-
univariates.Naturalize,
45-
univariates.MultiPointToSinglePoint(8),
46-
vortex.Compile(2, vortex.ForceNumOpenedColumns(4), vortex.WithSISParams(&ringsis.StdParams)),
47-
fullrecursion.FullRecursion(true),
48-
)
49-
50-
proof := wizard.Prove(comp, prove)
51-
52-
if err := wizard.Verify(comp, proof); err != nil {
53-
t.Fatalf("verifier failed: %v", err)
45+
suites := [][]func(*wizard.CompiledIOP){
46+
{
47+
lookup.CompileLogDerivative,
48+
localcs.Compile,
49+
globalcs.Compile,
50+
univariates.CompileLocalOpening,
51+
univariates.Naturalize,
52+
univariates.MultiPointToSinglePoint(8),
53+
vortex.Compile(2, vortex.ForceNumOpenedColumns(4), vortex.WithSISParams(&ringsis.StdParams)),
54+
fullrecursion.FullRecursion(true),
55+
},
56+
{
57+
lookup.CompileLogDerivative,
58+
localcs.Compile,
59+
globalcs.Compile,
60+
univariates.CompileLocalOpening,
61+
univariates.Naturalize,
62+
univariates.MultiPointToSinglePoint(8),
63+
vortex.Compile(2, vortex.ForceNumOpenedColumns(4), vortex.WithSISParams(&ringsis.StdParams)),
64+
fullrecursion.FullRecursion(true),
65+
mimc.CompileMiMC,
66+
specialqueries.RangeProof,
67+
lookup.CompileLogDerivative,
68+
specialqueries.CompileFixedPermutations,
69+
permutation.CompileGrandProduct,
70+
innerproduct.Compile,
71+
sticker.Sticker(1<<8, 1<<16),
72+
splitter.SplitColumns(1 << 16),
73+
localcs.Compile,
74+
globalcs.Compile,
75+
univariates.CompileLocalOpening,
76+
univariates.Naturalize,
77+
univariates.MultiPointToSinglePoint(1 << 16),
78+
vortex.Compile(2, vortex.ForceNumOpenedColumns(4), vortex.WithSISParams(&ringsis.StdParams)),
79+
fullrecursion.FullRecursion(true),
80+
},
81+
}
82+
83+
for i, s := range suites {
84+
85+
t.Run(fmt.Sprintf("case-%v", i), func(t *testing.T) {
86+
87+
comp := wizard.Compile(
88+
define,
89+
s...,
90+
)
91+
92+
proof := wizard.Prove(comp, prove)
93+
94+
if err := wizard.Verify(comp, proof); err != nil {
95+
t.Fatalf("verifier failed: %v", err)
96+
}
97+
})
98+
5499
}
55100
}

0 commit comments

Comments
 (0)