Module Mavryk_benchmarks_proto_alpha.Interpreter_workload

type id = string
val pp_id : Stdlib.Format.formatter -> string -> unit
type instruction_name =
  1. | N_IDrop
  2. | N_IDup
  3. | N_ISwap
  4. | N_IPush
  5. | N_IUnit
  6. | N_ICons_pair
  7. | N_ICar
  8. | N_ICdr
  9. | N_IUnpair
  10. | N_ICons_some
  11. | N_ICons_none
  12. | N_IIf_none
  13. | N_IOpt_map_none
  14. | N_IOpt_map_some
  15. | N_ILeft
  16. | N_IRight
  17. | N_IIf_left
  18. | N_ICons_list
  19. | N_INil
  20. | N_IIf_cons
  21. | N_IList_map
  22. | N_IList_iter
  23. | N_IIter
  24. | N_IList_size
  25. | N_IEmpty_set
  26. | N_ISet_iter
  27. | N_ISet_mem
  28. | N_ISet_update
  29. | N_ISet_size
  30. | N_IEmpty_map
  31. | N_IMap_map
  32. | N_IMap_iter
  33. | N_IMap_mem
  34. | N_IMap_get
  35. | N_IMap_update
  36. | N_IMap_get_and_update
  37. | N_IMap_size
  38. | N_IEmpty_big_map
  39. | N_IBig_map_mem
  40. | N_IBig_map_get
  41. | N_IBig_map_update
  42. | N_IBig_map_get_and_update
  43. | N_IConcat_string
  44. | N_IConcat_string_pair
  45. | N_ISlice_string
  46. | N_IString_size
  47. | N_IConcat_bytes
  48. | N_IConcat_bytes_pair
  49. | N_ISlice_bytes
  50. | N_IBytes_size
  51. | N_IOr_bytes
  52. | N_IAnd_bytes
  53. | N_IXor_bytes
  54. | N_INot_bytes
  55. | N_ILsl_bytes
  56. | N_ILsr_bytes
  57. | N_IBytes_nat
  58. | N_INat_bytes
  59. | N_IBytes_int
  60. | N_IInt_bytes
  61. | N_IAdd_seconds_to_timestamp
  62. | N_IAdd_timestamp_to_seconds
  63. | N_ISub_timestamp_seconds
  64. | N_IDiff_timestamps
  65. | N_IAdd_tez
  66. | N_ISub_tez
  67. | N_ISub_tez_legacy
  68. | N_IMul_teznat
  69. | N_IMul_nattez
  70. | N_IEdiv_teznat
  71. | N_IEdiv_tez
  72. | N_IOr
  73. | N_IAnd
  74. | N_IXor
  75. | N_INot
  76. | N_IIs_nat
  77. | N_INeg
  78. | N_IAbs_int
  79. | N_IInt_nat
  80. | N_IAdd_int
  81. | N_IAdd_nat
  82. | N_ISub_int
  83. | N_IMul_int
  84. | N_IMul_nat
  85. | N_IEdiv_int
  86. | N_IEdiv_nat
  87. | N_ILsl_nat
  88. | N_ILsr_nat
  89. | N_IOr_nat
  90. | N_IAnd_nat
  91. | N_IAnd_int_nat
  92. | N_IXor_nat
  93. | N_INot_int
  94. | N_IIf
  95. | N_ILoop_in
  96. | N_ILoop_out
  97. | N_ILoop_left_in
  98. | N_ILoop_left_out
  99. | N_IDip
  100. | N_IExec
  101. | N_IApply
  102. | N_ILambda_lam
  103. | N_ILambda_lamrec
  104. | N_IFailwith
  105. | N_ICompare
  106. | N_IEq
  107. | N_INeq
  108. | N_ILt
  109. | N_IGt
  110. | N_ILe
  111. | N_IGe
  112. | N_IAddress
  113. | N_IContract
  114. | N_ITransfer_tokens
  115. | N_IImplicit_account
  116. | N_ICreate_contract
  117. | N_ISet_delegate
  118. | N_INow
  119. | N_IMin_block_time
  120. | N_IBalance
  121. | N_ILevel
  122. | N_IView
  123. | N_ICheck_signature_ed25519
  124. | N_ICheck_signature_secp256k1
  125. | N_ICheck_signature_p256
  126. | N_ICheck_signature_bls
  127. | N_IHash_key
  128. | N_IPack
  129. | N_IUnpack
  130. | N_IBlake2b
  131. | N_ISha256
  132. | N_ISha512
  133. | N_ISource
  134. | N_ISender
  135. | N_ISelf
  136. | N_ISelf_address
  137. | N_IAmount
  138. | N_ISapling_empty_state
  139. | N_ISapling_verify_update
  140. | N_IDig
  141. | N_IDug
  142. | N_IDipN
  143. | N_IDropN
  144. | N_IChainId
  145. | N_INever
  146. | N_IVoting_power
  147. | N_ITotal_voting_power
  148. | N_IKeccak
  149. | N_ISha3
  150. | N_IAdd_bls12_381_g1
  151. | N_IAdd_bls12_381_g2
  152. | N_IAdd_bls12_381_fr
  153. | N_IMul_bls12_381_g1
  154. | N_IMul_bls12_381_g2
  155. | N_IMul_bls12_381_fr
  156. | N_INeg_bls12_381_g1
  157. | N_INeg_bls12_381_g2
  158. | N_INeg_bls12_381_fr
  159. | N_IMul_bls12_381_fr_z
  160. | N_IMul_bls12_381_z_fr
  161. | N_IInt_bls12_381_z_fr
  162. | N_IPairing_check_bls12_381
  163. | N_IComb
  164. | N_IUncomb
  165. | N_IComb_get
  166. | N_IComb_set
  167. | N_IDupN
  168. | N_ITicket
  169. | N_IRead_ticket
  170. | N_ISplit_ticket
  171. | N_IJoin_tickets
  172. | N_IHalt
  173. | N_ILog
  174. | N_IOpen_chest
  175. | N_IEmit
type continuation_name =
  1. | N_KNil
  2. | N_KCons
  3. | N_KReturn
  4. | N_KView_exit
  5. | N_KMap_head
  6. | N_KUndip
  7. | N_KLoop_in
  8. | N_KLoop_in_left
  9. | N_KIter_empty
  10. | N_KIter_nonempty
  11. | N_KList_enter_body
  12. | N_KList_exit_body
  13. | N_KMap_enter_body
  14. | N_KMap_exit_body
  15. | N_KLog
and instr_or_cont_name =
  1. | Instr_name of instruction_name
  2. | Cont_name of continuation_name
val string_of_instruction_name : instruction_name -> string
val string_of_continuation_name : continuation_name -> string
val string_of_instr_or_cont : instr_or_cont_name -> string
type args = arg list
and arg = {
  1. name : id;
  2. arg : Size.t;
}
val nullary : args
val unary : id -> Size.t -> args
val binary : id -> Size.t -> id -> Size.t -> args
val ternary : id -> Size.t -> id -> Size.t -> id -> Size.t -> args
val quaternary : id -> Size.t -> id -> Size.t -> id -> Size.t -> id -> Size.t -> args
val pp_arg : Stdlib.Format.formatter -> arg -> unit
val pp_args : Stdlib.Format.formatter -> arg list -> unit
type ir_sized_step = {
  1. name : instr_or_cont_name;
  2. args : args;
}
type t = ir_sized_step list
val ir_sized_step : instruction_name -> args -> ir_sized_step
val cont_sized_step : continuation_name -> args -> ir_sized_step
val all_instructions : instruction_name list
val all_continuations : continuation_name list
val instruction_name_encoding : instruction_name Mavryk_base.TzPervasives.Data_encoding.encoding
val continuation_name_encoding : continuation_name Mavryk_base.TzPervasives.Data_encoding.encoding
val args_encoding : arg list Mavryk_base.TzPervasives.Data_encoding.encoding
val instr_or_cont_name_encoding : instr_or_cont_name Mavryk_base.TzPervasives.Data_encoding.encoding
val ir_sized_step_encoding : ir_sized_step Mavryk_base.TzPervasives.Data_encoding.encoding
val encoding : ir_sized_step list Mavryk_base.TzPervasives.Data_encoding.encoding
module Instructions : sig ... end
module Control : sig ... end
val extract_compare_sized_step : 'a. 'a Mavryk_protocol_alpha.Protocol.Script_typed_ir.comparable_ty -> 'a -> 'a -> ir_sized_step
val extract_ir_sized_step : 'bef_top 'bef 'res_top 'res. Mavryk_protocol_alpha.Protocol.Alpha_context.t -> ('bef_top, 'bef, 'res_top, 'res) Mavryk_protocol_alpha.Protocol.Script_typed_ir.kinstr -> ('bef_top * 'bef) -> ir_sized_step
val extract_control_trace : ('bef_top, 'bef, 'aft_top, 'aft) Mavryk_protocol_alpha.Protocol.Script_typed_ir.continuation -> ir_sized_step
exception Stop_bench

Stop_bench gets raised when a IFailwith would be the next instruction. This allows us to recover the full execution trace, including the trace of the IFailwith.

The actual benchmark will follow the same execution branch, but instead will raise an error which will be ignored. Thus it is safe to end a benchmark with IFailwith, but timings are expected to be different from ending with IHalt. This means that, if we choose to include this behavior in any benchmark, IFailwith must be benched.

val sized_step_to_sparse_vec : ir_sized_step -> Mavryk_benchmark.Sparse_vec.String.t
val trace_to_sparse_vec : ir_sized_step list -> Mavryk_benchmark.Sparse_vec.String.t