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

Feat/gkr testing #740

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: cleanup
  • Loading branch information
Tabaie committed Jun 30, 2023
commit b0e6edf702e82795963add586850dff615e0d11a
17 changes: 0 additions & 17 deletions constraint/gkr.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,22 +191,5 @@ func SystemEqual(a, b System) bool {
}
}

/*if match := HintsEqual(s.MHintsDependencies, oHints); !match {
return false
}

//o.MHintsDependencies = s.MHintsDependencies
match := reflect.DeepEqual(s.field, o.field)
match = match && reflect.DeepEqual(s.CoeffTable, o.CoeffTable)
match = match && reflect.DeepEqual(s.System, o.System)
//match := reflect.DeepEqual(s, o)

fmt.Println(cmp.Diff(s.System, o.System, cmpopts.IgnoreUnexported(constraint.System{}, debug.SymbolTable{})))

o.MHintsDependencies = oHints
return match

return false*/

return reflect.DeepEqual(a, b)
}
17 changes: 3 additions & 14 deletions std/gkr/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package gkr

import (
"fmt"
"github.com/consensys/gnark/backend"
bn254r1cs "github.com/consensys/gnark/constraint/bn254"
"github.com/consensys/gnark/test"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -521,17 +520,10 @@ func (c *mimcNoDepCircuit) Define(api frontend.API) error {
return err
}

// cheat{
z = y
for i := 0; i < c.mimcDepth; i++ {
_gkr.toStore.Circuit = append(_gkr.toStore.Circuit, constraint.GkrWire{
Gate: "mimc",
Inputs: []int{int(x), int(z)},
})
_gkr.assignments = append(_gkr.assignments, nil)
z = constraint.GkrVariable(len(_gkr.toStore.Circuit) - 1)
z = _gkr.NamedGate("mimc", x, z)
}
// }

if solution, err = _gkr.Solve(api); err != nil {
return err
Expand Down Expand Up @@ -583,12 +575,9 @@ func BenchmarkMiMCNoGkrFullDepthSolve(b *testing.B) {
func TestMiMCFullDepthNoDepSolve(t *testing.T) {
registerMiMC()

for i := 5; i < 6; i++ { // TODO @Tabaie 0 -> 100
for i := 5; i < 100; i++ {
circuit, assignment := mimcNoDepCircuits(i, 1<<2)
test.NewAssert(t).SolvingSucceeded(circuit, assignment, test.WithBackends(backend.GROTH16), test.WithCurves(ecc.BN254))
//testGroth16(t, circuit, assignment)
//testPlonk(t, circuit, assignment)

test.NewAssert(t).SolvingSucceeded(circuit, assignment, test.WithCurves(ecc.BN254))
}
}

Expand Down