Skip to main content

Module trace

Module trace 

Source
Expand description

An optional log of draws, to compare the port’s draws with the original’s.

The original’s draws are recorded in the emulator (tools/emu/rng_trace.py), and tools/triage/rngdiff.py finds the first draw that differs. Only the outermost draw of a call is recorded (rand_float calling rand logs once), with the location of the Rust caller.

Structs§

Draw
One recorded draw.

Functions§

replay
While recording, make skips[k] plain draws before the k-th recorded draw. They stand for draws the original made from the same generator outside the code being compared (its sounds), so both generators give the same numbers to the rest.
start
Start recording on this thread (clears any previous log).
take
Stop recording and return the draws.
write
Write draws as kind<TAB>caller lines (the format rngdiff.py reads).