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
Update FuzzingBitGen to reduce possible infinite loops.
The old FuzzingBitGen algorithm would pull a byte from the head of the data stream to determine whether to return a min or a max, and then it would attempt to pull variate data from the tail of the stream. Once the data stream was expired it would return minimum values from the distributions, which could lead to infinite loops in rejection sampling algorithms.
The updated FuzzingBitGen now takes the following.
1. Separate control and a data streams (as absl::Span<uint8_t>).
The control stream indicates whether the distribution functions will return boundary values (min, max, mean) or a value derived from the data stream.
The data stream provides the actual byte data for generating random values.
2. A seed for an internal LCG PRNG (as uint64_t).
When the data stream is exhausted, FuzzingBitGen uses the internal LCG to generate random variates. While the old version had an internal LCG PRNG, those values were not used by the distribution functions.
The basic flow of each variate generation is:
1. Read a byte from the control stream (in fuzzing_bit_gen).
2. Depending on the byte, return a min/max/mean/variate, etc.
3. Once the data stream is expired, use an internal LCG to generate variates.
This update also calls c++ distribution functions in more cases, so that outputs are more aligned with actual distribution behavior.
Adds a test to demonstrate that std::shuffle() is properly manipulated by the fuzzing framework.
Also add additional tests to FuzzingBitGen for the distribution functions.
NOTE: This will change the variates generated by FuzzingBitGen from prior versions.
PiperOrigin-RevId: 873431571
0 commit comments