Skip to content

Add the MWCX generators to the RNG guide - #104

Open
vigna wants to merge 1 commit into
rust-random:masterfrom
vigna:mwcx
Open

vigna wants to merge 1 commit into
rust-random:masterfrom
vigna:mwcx

Conversation

@vigna

@vigna vigna commented Nov 5, 2026

Copy link
Copy Markdown

This adds to the RNG guide the generators of rand_mwcx (rust-random/rngs#125), as suggested in rust-random/rngs#124, and fixes a few things along the way.

  • Rows for Mwc128X, Mwc192X, and Mwc128X32; the xoshiro website link now reads xoshiro/MWCX, as the site covers both. Mwc64X32 is left out, as it is meant for GPUs. The docs.rs links will work once rand_mwcx is published.
  • A row for Pcg64Dxsm, which rand_pcg exports but the table did not list.
  • A note in "Extra features": for generators based on an LCG with a power-of-two modulus, jumping ahead by a large power of two yields correlated streams (after advance(1 << 127), the outputs of Pcg64 are the original ones with their 32-bit halves swapped and one bit flipped).
  • Fixes: the size of ChaCha20Rng in the text (136 bytes) disagreed with the table (320 bytes, which is size_of::<ChaCha20Rng>() today); the text said that no performance figures are given; the xoshiro links pointed to an old domain; the unused references to FromEntropy and EntropyRng are gone.

The performance column of the new rows is TBD: the current figures were measured on a Ryzen 9 9950X3D, and figures from a different machine or harness would not be comparable. I think all figures should be recomputed uniformly, with the same harness on the same machine; I'd be happy to help with that.

@dhardy dhardy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. (Waiting on rand_mwcx release.)

I still have the same machine (Ryzen 5800X), but feel free to replace the benchmark results.

@vigna

vigna commented Nov 8, 2026

Copy link
Copy Markdown
Author

Actually, I think it's better if the reported figures are altered as little as possible (e.g., is better if you rerun them).

This branch has not been deployed

No deployments
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