Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 4 additions & 8 deletions pkg/cmd/corset/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"os"
"runtime"
"runtime/pprof"
"slices"

cmd_util "github.com/LFDT-Lineth/zkc/pkg/cmd/corset/util"
"github.com/LFDT-Lineth/zkc/pkg/cmd/corset/view"
Expand Down Expand Up @@ -221,21 +220,18 @@ func CheckTrace[F field.Element[F]](ir string, schema sc.AnySchema[F], builder i
cfg CheckConfig, trace tr.Trace[F]) bool {
// begin performance measurement
var (
mapping = module.IdentityMap[F](schema.Modules().Collect()...)
stats = util.NewPerfStats()
recoverable bool
errs []error
mapping = module.IdentityMap[F](schema.Modules().Collect()...)
stats = util.NewPerfStats()
errs []error
)
//
trace, errs = builder.Build(schema, trace)
// Check whether any invalid traces
recoverable = !slices.Contains(trace, nil)
// Log cost of expansion
stats.Log("Expanding trace columns")
// Report any errors
reportErrors(ir, errs)
// Check whether considered unrecoverable
if !recoverable || len(errs) > 0 {
if len(errs) > 0 {
return false
}
//
Expand Down
6 changes: 3 additions & 3 deletions pkg/cmd/corset/debug/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func printStaticContents[F field.Element[F]](module schema.Module[F], verbose bo
}
}

func printRegisters[F any](module schema.Module[F], prefix string, filter func(register.Register) bool) {
func printRegisters[F field.Element[F]](module schema.Module[F], prefix string, filter func(register.Register) bool) {
var (
regT string
)
Expand Down Expand Up @@ -190,7 +190,7 @@ func printRegisters[F any](module schema.Module[F], prefix string, filter func(r
}
}

func countRegisters[F any](module schema.Module[F], filter func(register.Register) bool) uint {
func countRegisters[F field.Element[F]](module schema.Module[F], filter func(register.Register) bool) uint {
var count = uint(0)
//
for _, r := range module.Registers() {
Expand All @@ -212,7 +212,7 @@ func requiresSpacing[F field.Element[F]](c schema.Constraint[F]) bool {
return false
}

func isEmptyModule[F any](module schema.Module[F]) bool {
func isEmptyModule[F field.Element[F]](module schema.Module[F]) bool {
return len(module.Registers()) == 0 &&
module.Constraints().Count() == 0 &&
module.Assignments().Count() == 0
Expand Down
Loading