PractRand High-Throughput PRNG Suite
Chris Doty-Humphrey's PractRand — a high-throughput PRNG testing framework designed to run continuously and detect failure at arbitrary data volumes. Evaluates generators across gap, folding floating-point, Bayesian count frequency, differential count, binary matrix rank, and autocorrelation tests.
PractRand Test Battery (PR01–PR10)
PractRand applies tests at three bit-level extraction planes — Low1/8, Low4/8, and Low8/8 — to expose generators that pass on full-width output but fail when only the lowest bits are examined:
| ID | Test Name | Extraction | Pass Criteria | Description |
|---|---|---|---|---|
| PR01 | Gap-16:B | Low1/8 | Uncorrelated gaps | Gap distribution between matching 16-bit values at lowest byte (planned). |
| PR02 | FPF-16:B | Low1/8 | Folding floating point | Folded floating-point frequency test at 16-bit low-byte (planned). |
| PR03 | BCFN(2+0,13/64) | Low1/8 | Bayesian count freq | Bayesian count-frequency normality test, base configuration (planned). |
| PR04 | BCFN(2+1,13/64) | Low1/8 | Shifted count freq | Bayesian count-frequency test with 1-bit shift (planned). |
| PR05 | DC6-9x1Bytes-1 | Low4/8 | Differential count | Differential count test across 9 single-byte channels (planned). |
| PR06 | BRank(12) | Low4/8 | Binary matrix rank | Binary matrix rank of 12-row sub-matrices (planned). |
| PR07 | FPF-8:all64k | Low8/8 | Full stream FPF | Folded floating-point across full 64K 8-bit output range (planned). |
| PR08 | Dist-64x2:g | Low8/8 | Distribution metric | 2D distribution metric of 64-element groups (planned). |
| PR09 | Gap-8:all64k | Low8/8 | Extended gap counts | Extended gap counts across full 8-bit output range (planned). |
| PR10 | AutoCor-64 | Low8/8 | Autocorrelation lag | Lag-64 autocorrelation test on full output stream (planned). |
[!NOTE]
All 10 tests are currently in specification stage and display asNOT IMPLEMENTED. The WebAssembly backend for PractRand’s multi-plane extraction algorithms is planned for an upcoming release.
Bit-Plane Extraction
PractRand’s defining feature is its bit-plane stratification. Many generators pass full-width tests but carry detectable structure in their lowest bits:
- Low1/8 — tests only the lowest 1-of-8 bits per byte
- Low4/8 — tests the lowest 4-of-8 bits per byte
- Low8/8 — full-width test on all 8 bits per byte
When to Use PractRand
- Ultra-High-Volume PRNG Stress Testing: Running generators through terabytes of output to find failure points — Mersenne Twister typically fails PractRand around 32 GB; xoshiro256** passes beyond 32 TB. This is the industry standard for PRNG period exhaustion testing.
- Low-Bit Quality Auditing: Many simulation frameworks (Monte Carlo, molecular dynamics) only use the lower bits of 64-bit generator output for efficiency. PractRand’s Low1/8 and Low4/8 tests directly verify the quality of these truncated outputs.
- Game Engine PRNG Certification: Validating that PRNG outputs used for procedural generation, physics simulation noise, and AI decision-making remain statistically uniform even after billions of calls without reseed.
- Custom PRNG Research: Evaluating novel LCG, LFSR, or cellular automaton-based generators as part of academic research — PractRand’s continuous streaming model naturally fits iterative generator evaluation.