Dieharder Statistical Test Battery

Robert G. Brown's Dieharder battery — a modern, rigorous extension of Marsaglia's original Diehard tests. Evaluates random number generators across 12 tests spanning spatial, runs, template, frequency, complexity, and distribution dimensions.

Marsaglia Legacy Extended: Dieharder is Robert G. Brown’s rigorous re-implementation and extension of George Marsaglia’s classic Diehard battery. It applies multiple p-value levels across repeated trials to detect subtle biases that single-pass tests miss.

Dieharder Test Battery

All 12 Dieharder tests apply a significance level of $\alpha = 0.005$ — stricter than NIST’s 0.01 — with the KS-test over multiple sub-sequences to reduce false positives:

IDTest NameCategoryPass CriteriaDescription
DH01Birthday SpacingsSpatial$p \ge 0.005$Detects clustering in large sparse random distributions (planned).
DH02Parking LotSpatial$p \ge 0.005$2D random point placement and adjacency collision test (planned).
DH03Minimum Distance 2DSpatial$p \ge 0.005$Nearest-neighbor distance distribution in a 2D unit square (planned).
DH043D SpheresSpatial$p \ge 0.005$Minimum sphere radius enclosing random 3D points (planned).
DH05Runs Up/DownRuns$p \ge 0.005$Detects monotonic subsequences in value ordering.
DH06OPERM5Runs$p \ge 0.005$Distribution of ordinal patterns in groups of 5 (planned).
DH07OQSOTemplate$p \ge 0.005$Overlapping-Quadruples-Sparse-Occupancy: 4-letter word occupancy (planned).
DH08DNATemplate$p \ge 0.005$Overlapping 10-letter DNA word occupancy test (planned).
DH09Count Ones in StreamFrequency$p \ge 0.005$Bit frequency across successive byte streams.
DH10SqueezeComplexity$p \ge 0.005$Multiplications required to reduce $2^{31}$ to 1 (planned).
DH11Overlapping SumsDistribution$p \ge 0.005$Distribution of overlapping 100-element sums via KS-test.
DH12CrapsDistribution$p \ge 0.005$Win probability and throw count in simulated craps games (planned).

[!NOTE]
DH05, DH09, DH11 are fully implemented. DH01–DH04, DH06–DH08, DH10, DH12 are specification stubs shown as NOT IMPLEMENTED in the dashboard.

Significance Level

Dieharder uses $\alpha = 0.005$ and applies the Kolmogorov-Smirnov test over multiple independent sub-sequences to produce a composite p-value — significantly more sensitive to subtle periodic or structural biases than single-pass tests.

When to Use Dieharder

  1. PRNG Algorithm Validation: Comprehensive vetting of software PRNG algorithms (Mersenne Twister, PCG, Xoroshiro, LCG variants) for game engines, Monte Carlo simulations, and scientific computing where statistical quality matters but cryptographic strength is not required.
  2. Hardware RNG Burn-in Testing: Long-running stress tests for physical entropy sources during production burn-in — Dieharder’s multi-trial approach catches intermittent bias that single-pass NIST tests may miss.
  3. FPGA / ASIC Entropy Core Qualification: Evaluating ring-oscillator or chaos-based entropy cores implemented in FPGAs before deployment in embedded security controllers.
  4. Comparative RNG Benchmarking: Side-by-side comparison of competing PRNG families for simulation workloads requiring high-volume, high-quality pseudo-randomness without cryptographic overhead.

George Marsaglia’s Legacy: The original Diehard battery (1995) was groundbreaking but had fixed sample sizes and test dependencies. Dieharder by Robert G. Brown (GPL, Duke University) reframed each test as a proper p-value measurement with configurable sample sizes, fixing the correlation issues in the original suite.

Data Volume: Dieharder’s spatial tests (DH01–DH04) require hundreds of millions of random values to achieve statistical power. When implemented, these will require files of at least 50 MB for meaningful results. The currently implemented tests (DH05, DH09, DH11) work effectively from 1 MB upward.