13.7. Fuzzer

The FUZZER module implements fuzz testing infrastructure for daslang programs. It generates random inputs for functions and verifies they do not crash or produce unexpected errors, helping discover edge cases and robustness issues.

All functions and symbols are in “fuzzer” module, use require to get access to it.

require daslib/fuzzer

13.7.1. Fuzzer tests

13.7.1.1. fuzz

fuzzer::fuzz(fuzz_count: int; blk: block<():void>)

run block however many times ignore panic, so that we can see that runtime crashes

Arguments
  • fuzz_count : int

  • blk : block<void>

fuzzer::fuzz(blk: block<():void>)

fuzzer::fuzz_all_ints_op1(t: auto; fake: Faker; funcname: string) : auto()

fuzzes generic function that takes single numeric or vector argument. arguments are: int, uint, int64, uint64

Arguments
  • t : auto

  • fake : Faker

  • funcname : string

fuzzer::fuzz_all_unsigned_ints_op1(t: auto; fake: Faker; funcname: string) : auto()

fuzzes generic function that takes single numeric or vector argument. arguments are: uint, uint64

Arguments
  • t : auto

  • fake : Faker

  • funcname : string

fuzzer::fuzz_compareable_op2(t: auto; fake: Faker; funcname: string) : auto()

fuzzes generic function that takes two numeric or vector arguments. arguments are: int, uint, float, double, int64, uint64, string

Arguments
  • t : auto

  • fake : Faker

  • funcname : string

13.7.1.2. fuzz_debug

fuzzer::fuzz_debug(fuzz_count: int; blk: block<():void>)

run block however many times do not ignore panic, so that we can see where the runtime fails this is here so that fuzz can be easily replaced with fuzz_debug for the purpose of debugging

Arguments
  • fuzz_count : int

  • blk : block<void>

fuzzer::fuzz_debug(blk: block<():void>)

fuzzer::fuzz_eq_neq_op2(t: auto; fake: Faker; funcname: string) : auto()

fuzzes generic function that takes two numeric or vector arguments. arguments are: int, uint, int64, uint64, float, double, string, int2, int3, int4, uint2, uint3, uint4, float2, float3, float4

Arguments
  • t : auto

  • fake : Faker

  • funcname : string

fuzzer::fuzz_float_double_or_float_vec_op1(t: auto; fake: Faker; funcname: string) : auto()

fuzzes generic function that takes single numeric or vector argument. arguments are: float, double, float2, float3, float4

Arguments
  • t : auto

  • fake : Faker

  • funcname : string

fuzzer::fuzz_float_double_or_float_vec_op2(t: auto; fake: Faker; funcname: string) : auto()

fuzzes generic function that takes two numeric or vector arguments. arguments are: float, double, float2, float3, float4

Arguments
  • t : auto

  • fake : Faker

  • funcname : string

fuzzer::fuzz_float_double_or_float_vec_op3(t: auto; fake: Faker; funcname: string) : auto()

fuzzes generic function that takes three numeric or vector arguments. arguments are: float, double, float2, float3, float4

Arguments
  • t : auto

  • fake : Faker

  • funcname : string

fuzzer::fuzz_float_or_float_vec_op1(t: auto; fake: Faker; funcname: string) : auto()

fuzzes generic function that takes single numeric or vector argument. arguments are: float, float2, float3, float4

Arguments
  • t : auto

  • fake : Faker

  • funcname : string

fuzzer::fuzz_float_or_float_vec_op2(t: auto; fake: Faker; funcname: string) : auto()

fuzzes generic function that takes two numeric or vector arguments. arguments are: float, float2, float3, float4

Arguments
  • t : auto

  • fake : Faker

  • funcname : string

fuzzer::fuzz_int_vector_op2(t: auto; fake: Faker; funcname: string) : auto()

fuzzes generic function that takes two numeric or vector arguments. arguments are: int, uint, int2, int3, int4, uint2, uint3, uint4

Arguments
  • t : auto

  • fake : Faker

  • funcname : string

fuzzer::fuzz_numeric_and_storage_op1(t: auto; fake: Faker; funcname: string) : auto()

fuzzes generic function that takes single numeric or vector argument. arguments are: int, uint, int8, uint8, int16, uint16, int64, uint64, float, double

Arguments
  • t : auto

  • fake : Faker

  • funcname : string

fuzzer::fuzz_numeric_and_vector_op1(t: auto; fake: Faker; funcname: string) : auto()

fuzzes generic function that takes single numeric or vector argument. arguments are: int, uint, float, double, string, int2, int3, int4, uint2, uint3, uint4, float2, float3, float4

Arguments
  • t : auto

  • fake : Faker

  • funcname : string

fuzzer::fuzz_numeric_and_vector_op2(t: auto; fake: Faker; funcname: string) : auto()

fuzzes generic function that takes two numeric or vector arguments. arguments are: int, uint, float, double, int2, int3, int4, uint2, uint3, uint4, float2, float3, float4

Arguments
  • t : auto

  • fake : Faker

  • funcname : string

fuzzer::fuzz_numeric_and_vector_op2_no_unint_vec(t: auto; fake: Faker; funcname: string) : auto()

fuzzes generic function that takes two numeric or vector arguments. arguments are: int, uint, float, double, int2, int3, int4, float2, float3, float4

Arguments
  • t : auto

  • fake : Faker

  • funcname : string

fuzzer::fuzz_numeric_and_vector_signed_op1(t: auto; fake: Faker; funcname: string) : auto()

fuzzes generic function that takes single numeric or vector argument. arguments are: int, uint, float, double, string, int2, int3, int4, uint2, uint3, uint4, float2, float3, float4

Arguments
  • t : auto

  • fake : Faker

  • funcname : string

fuzzer::fuzz_numeric_op1(t: auto; fake: Faker; funcname: string) : auto()

fuzzes generic function that takes single numeric or vector argument. arguments are: int, uint, float, double

Arguments
  • t : auto

  • fake : Faker

  • funcname : string

fuzzer::fuzz_numeric_op2(t: auto; fake: Faker; funcname: string) : auto()

fuzzes generic function that takes two numeric or vector arguments. arguments are: int, uint, float, double

Arguments
  • t : auto

  • fake : Faker

  • funcname : string

fuzzer::fuzz_numeric_op3(t: auto; fake: Faker; funcname: string) : auto()

fuzzes generic function that takes three numeric or vector arguments. arguments are: int, uint, float, double

Arguments
  • t : auto

  • fake : Faker

  • funcname : string

fuzzer::fuzz_numeric_op4(t: auto; fake: Faker; funcname: string) : auto()

fuzzes generic function that takes four numeric or vector arguments. arguments are: int, uint, float, double

Arguments
  • t : auto

  • fake : Faker

  • funcname : string

fuzzer::fuzz_numeric_scal_vec_op2(t: auto; fake: Faker; funcname: string) : auto()

fuzzes generic function that takes vector and matching scalar on the left arguments pairs are: int2,int; int3,int; uint2,uint; uint3,uint; uint4,uint; int4,int; float2,float; float3,float; float4,float

Arguments
  • t : auto

  • fake : Faker

  • funcname : string

fuzzer::fuzz_numeric_vec_scal_op2(t: auto; fake: Faker; funcname: string) : auto()

fuzzes generic function that takes vector and matching scalar on the right arguments pairs are: int2,int; int3,int; uint2,uint; uint3,uint; uint4,uint; int4,int; float2,float; float3,float; float4,float

Arguments
  • t : auto

  • fake : Faker

  • funcname : string

fuzzer::fuzz_rotate_op2(t: auto; fake: Faker; funcname: string) : auto()

fuzzes generic function that takes numeric or vector argument, with matching rotate type on the right. arguments are: int, uint

Arguments
  • t : auto

  • fake : Faker

  • funcname : string

fuzzer::fuzz_shift_op2(t: auto; fake: Faker; funcname: string) : auto()

fuzzes generic function that takes numeric or vector argument, with matching shift type on the right. arguments are: int, uint, int2, int3, int4, uint2, uint3, uint4

Arguments
  • t : auto

  • fake : Faker

  • funcname : string

fuzzer::fuzz_vec_mad_op3(t: auto; fake: Faker; funcname: string) : auto()

fuzzes generic function that takes three numeric or vector arguments. arguments are: float2, float3, float4, int2, int3, int4, uint2, uint3, uint4 second argument is float, int, uint accordingly

Arguments
  • t : auto

  • fake : Faker

  • funcname : string

fuzzer::fuzz_vec_op3(t: auto; fake: Faker; funcname: string) : auto()

fuzzes generic function that takes three numeric or vector arguments. arguments are: float2, float3, float4, int2, int3, int4, uint2, uint3, uint4

Arguments
  • t : auto

  • fake : Faker

  • funcname : string