999.specrand_r
SPEC CPU®2026 Benchmark Description

NOT-A-Benchmark Name

999.specrand_r

What do you mean NOT-A-Benchmark?

999.specrand_r is not timed; its purpose is primarily as a short, but important, diagnostic tool.

Although it is not timed, in all other respects, it behaves like an ordinary benchmark. Therefore the remainder of this description will assume that this is understood and will refer to it as if it were a benchmark.

Benchmark Authors

Cloyce D. Spradling <cloyce+specrand [at] headgear [dot] org>

Benchmark Program General Category

Mine Canary

Benchmark Description

999.specrand_r is a small harness for the verifying the consistency of output from the implementation of the Mersenne Twister algorithm that some of the candidate benchmarks use.

It also includes testing of a C++ header which provides deterministic implementations of random number distributions which were adapted from the LLVM libc++ standard library.

These are used in SPEC CPU benchmarks to ensure reproducible results across different platforms and compilers.

The benchmark simply generates a sequence of pseudorandom numbers starting with a known seed. This benchmark is not a timed component of SPEC CPU 2026; rather, it's there as an indicator of larger problems. Several of the benchmarks use the specrand code as their PRNG. Thus, a failure in 999.specrand_r would point out a source of error in those codes as well. This is cheap (in both time and space) insurance.

Executables

The benchmark builds two executables:

Input Description

Parameters for both executables are read from a control file. Each line of the control file contains two numbers: a seed value for the PRNG and a count of the numbers to generate. Lines beginning with # or empty lines are ignored.

Both executables are invoked with the same command-line arguments:

Output Description

specrand_r Output

The specrand_r executable generates random numbers and outputs them four times.

The first set is unscaled output from the spec_rand() function, output as a standard floating point number with no precision modifiers (using the standard printf '%f' format).

The second set is output from spec_rand() scaled to between 1 and 2^31-1 (0x7fffffff, or the maximum positive value that a signed 32-bit integer can hold), and is output as the original floating point number, the multiplier, and the scaled result as a standard integer (usijng the standard printf '%d' format).

The third set is the output from the spec_lrand48() function, scaled to between 0 and 1 and output using standard printf '%f' format.

The fourth sequence is unscaled output from the spec_lrand48() function using standard printf '%d' format.

The PRNG is re-seeded between sequences.

distributions_r Output

The distributions_r executable samples from each distribution type and outputs the results. For each distribution, it outputs a header line identifying the distribution and its parameters, followed by the specified number of samples.

The following distributions are exercised:

Each distribution uses a different seed derived from the base seed to ensure independent sequences.

Programming Language

Known Portability Issues

None.

Sources and Licensing

The specrand benchmark is a version of the Mersenne-Twister PRNG that is licensed to SPEC by its authors (Makoto Matsumoto, Takuji Nishimura, and Mutsuo Saito) under a BSD license.

The specrand-distribution random distribution classes are excerpted from the LLVM Project's libc++ implementation which is licensed under the Apache License v2.0 with LLVM Exceptions license.

Primary source files for specrand-distributions from LLVM:

References

None

Copyright © 2026 Standard Performance Evaluation Corporation (SPEC®)