Snarky_log.Constraints
Create flamechart events for Snarky_backendless constraints.
This creates a chart of labels, associating each label with a 'timestamp' equal to the number of constraints at its start and end.
val log :
?weight:( Snarky_backendless.Constraint.t -> int ) ->
( unit -> 'a Snarky_backendless.Checked.t ) ->
Webkit_trace_event.events
Generate a flamechart for the labels of a checked computation.
val log_func :
input_typ:( 'a, 'b ) Snarky_backendless.Typ.t ->
return_typ:( 'c, 'd ) Snarky_backendless.Typ.t ->
apply_args:( ( 'b -> 'e ) -> 'f Snarky_backendless.Checked.t ) ->
( 'a -> 'g ) ->
Webkit_trace_event.events
Same as log
, but for functions which take Var.t
arguments. Use apply_args
to apply the corresponding OCaml-typed arguments. For example:
open Snarky_backendless
module Snark = Snark.Make (Backends.Bn128.Default)
open Snark
module Constraints = Snarky_log.Constraints (Snark)
let () = Snarky_log.to_file "output.json" @@
Constraints.log_func ~input:Data_spec.[Field.typ; Field.typ] Field.Checked.mul
~apply_args:(fun mul -> mul Field.one Field.one)
}]