Skip to content

Adding setting/getting seed for MOIRE - #51

Merged
m-murphy merged 7 commits into
masterfrom
feature/make_moire_seedable
Sep 10, 2026
Merged

m-murphy merged 7 commits into
masterfrom
feature/make_moire_seedable

Conversation

@nickjhathaway

@nickjhathaway nickjhathaway commented Sep 9, 2026 •

Copy link
Copy Markdown
Member

run_mcmc(seed =) sets the sampler seed. NULL draws from the current R RNG a value that still fits after per-chain offsets.

The seed used is returned as $seed (printed if the run errors). Per-chain offsets are $chain_seeds. A seed (or num_chains) that cannot fit those offsets is rejected.

Replay needs the same sampler settings; num_cores does not affect the draws, because parallel-tempering swaps use the C++ sampler rather than R's RNG.

…was used is reported either way so if a run fails or produces an odd results this can be reproduced
nickjhathaway and others added 6 commits September 8, 2026 18:39
NULL seeds now leave room for per-chain offsets, and tempering swaps draw from the C++ sampler instead of R's RNG.
Child RNG offsets now live in src/seed.h, and examples/NEWS describe the seed that is actually used.
A fixed stride of 1000 silently overlapped streams once a temperature ladder reached that length.
The default constructor only existed so vector<Chain> could resize, and it pulled in random_device plus dead engines.
parallel::mclapply does not allow mc.cores > 1 there, so the num_cores comparison cannot run.
@m-murphy
m-murphy merged commit f5ae4bf into master Sep 10, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants