Seed the PRNG: --seed N, default random, printed for reproducibility - #7
Open
spinkham wants to merge 1 commit into
Open
Seed the PRNG: --seed N, default random, printed for reproducibility#7spinkham wants to merge 1 commit into
spinkham wants to merge 1 commit into
Conversation
…ility) rand() was never seeded, so every pathsim invocation produced bit-identical fading and noise (verified byte-identical across separate process runs): N runs intended as independent Monte-Carlo trials replay one realization N times, silently. Seed from std::random_device by default, accept --seed N for exact reproduction, and print the seed used to stderr (stderr so a future stdout streaming mode stays clean). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
rand()is never seeded anywhere in the tree, so it runs from C's default seed and every pathsim invocation produces bit-identical fading and noise — verified byte-identical output across separate process runs. Anyone running the simulator N times to gather fade-ensemble statistics (BER curves, modem robustness trials) gets one realization replayed N times, silently.This adds a
--seed Noption:std::random_deviceseed, so back-to-back runs are independent trials;--seed.Verified (on master + the
<cstring>build fix from #6, needed to compile on modern GCC):One commit, ~15 lines, no change to any DSP path — only when the shared PRNG is seeded.
🤖 Generated with Claude Code