package tezt-tezos

  1. Overview
  2. Docs

Run octez-snoop commands.

type t

octez-snoop states.

val create : ?path:string -> ?color:Tezt_wrapper.Log.Color.t -> unit -> t

Create a octez-snoop state

val benchmark : bench_name:string -> bench_num:int -> nsamples:int -> save_to:string -> ?seed:int -> ?config_file:string -> ?csv_dump:string -> t -> unit Lwt.t

Runs the benchmark command.

This performs benchmark bench_name, asking for bench_num points. Each point is obtained by measuring execution time nsamples times. The result of benchmarking is saved to save_to.

For the meaning of the other optional parameters, see the documentation of octez-snoop.

type regression_method =
  1. | Lasso of {
    1. positive : bool;
    }
  2. | Ridge of {
    1. positive : bool;
    }
  3. | NNLS

Several regression methods are proposed. Lasso gives good result. When the variables to be inferred must be constrained to be positive (as is typical with cost models that are monotonically increasing in the size of the inputs) then the positive field can be set to true.

val infer_parameters : workload_data:string -> regression_method:regression_method -> dump_csv:string -> solution:string -> ?report:string -> ?graph:string -> t -> unit Lwt.t

Infers parameters for a model on some benchmark data.

val sapling_generate : ?protocol:Protocol.t -> tx_count:int -> max_inputs:int -> max_outputs:int -> file:string -> ?max_nullifiers:int -> ?max_additional_commitments:int -> ?seed:int -> t -> unit Lwt.t

Generate a bunch of sapling transactions

type michelson_term_kind =
  1. | Data
  2. | Code
val spawn_michelson_generate : ?protocol:Protocol.t -> terms_count:int -> kind:michelson_term_kind -> file:string -> ?min_size:int -> ?max_size:int -> ?burn_in:int -> ?seed:int -> t -> Tezt_wrapper.Process.t

Generate a bunch of Michelson terms

val michelson_generate : ?protocol:Protocol.t -> terms_count:int -> kind:michelson_term_kind -> file:string -> ?min_size:int -> ?max_size:int -> ?burn_in:int -> ?seed:int -> t -> unit Lwt.t
val michelson_concat : ?protocol:Protocol.t -> file1:string -> file2:string -> target:string -> t -> unit Lwt.t

Concatenate files containing Michelson terms

List all benchmarks matching provided tags according to the chosen mode.

type tag =
  1. | Proto of Protocol.t
  2. | Interpreter
  3. | Translator
  4. | Sapling
  5. | Encoding
  6. | Io
  7. | Misc
  8. | Builtin
  9. | Global_constants
  10. | Cache
  11. | Carbonated_map
  12. | Tickets
  13. | Big_map
  14. | Skip_list
  15. | Sc_rollup
  16. | Shell
  17. | Apply
  18. | Example
  19. | Micheline
  20. | Dal
type list_mode =
  1. | All
  2. | Any
  3. | Exactly
val list_benchmarks : mode:list_mode -> tags:tag list -> t -> string list Lwt.t
val write_config : benchmark:string -> bench_config:string -> file:string -> t -> unit Lwt.t
val generate_code_for_solutions : solution:string -> ?save_to:string -> ?split_to:string -> ?fixed_point:string -> t -> string Lwt.t

Execute octez-snoop generate code for <solutions-dir> comamnd and returns its stdout output.

If fixed_point is specified --fixed-point <fixed_point> option is added.

val check_definitions : files:string list -> t -> unit Lwt.t

Execute octez-snoop check definitions of files

OCaml

Innovation. Community. Security.