You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems there will be a lot of wasted cycles when we use ArbitraryGenerator and ForcedRng. IIUC, ForcedRng will be called again if the generation function returns a None, which seems to me is under the assumption that generation failures result from insufficient random bytes. This assumption may not hold for users of the Arbitrary crate. For example, if we want to generate values under certain constraints using the arbitrary trait method, one strategy is to generate a weaker value and return an Err if that value doesn't satisfy the constraints. The rationale is that the fuzzer should keep the values satisfying the constraints as they lead to deeper code coverage. In other words, we save the trouble of generating values guaranteed to satisfy the constraints. So, let's say we adopt the strategy and then ForcedRng's generate_from_bytes method will be called again and again until the number of bytes generated is above the upper bound specified by the argument, which could be unbounded.
The text was updated successfully, but these errors were encountered:
It seems there will be a lot of wasted cycles when we use
ArbitraryGenerator
andForcedRng
. IIUC,ForcedRng
will be called again if the generation function returns aNone
, which seems to me is under the assumption that generation failures result from insufficient random bytes. This assumption may not hold for users of theArbitrary
crate. For example, if we want to generate values under certain constraints using thearbitrary
trait method, one strategy is to generate a weaker value and return anErr
if that value doesn't satisfy the constraints. The rationale is that the fuzzer should keep the values satisfying the constraints as they lead to deeper code coverage. In other words, we save the trouble of generating values guaranteed to satisfy the constraints. So, let's say we adopt the strategy and thenForcedRng
'sgenerate_from_bytes
method will be called again and again until the number of bytes generated is above the upper bound specified by the argument, which could be unbounded.The text was updated successfully, but these errors were encountered: