← Back to section · Research & Analysis
Experiment Design: An Environment-Control Checklist for Benchmark Reproduction
The same post-quantum benchmark code produces numbers thirty percent apart on two machines — who is right? This article treats benchmark reproduction as an experimental discipline: what the environment record must contain, which variables to lock, and how results must be reported before anyone's numbers deserve citation.
The research question: what exactly is being reproduced?
The most common quarrel in post-quantum performance discussions is two sets of numbers fighting: same algorithm, same parameter set, yet operations-per-second figures twenty or thirty percent apart. Usually neither side measured wrong — they measured two different machines, two sets of compiler options, two instruction-set paths of the implementation, and the reports omitted all of it, leaving bare numbers to contradict each other.
So the reproduction experiment’s question should be put this way: with the environment fully recorded, can an independent party reproduce the performance figures of the same implementation under the same workload, on another machine, within reasonable error? This promotes the environment record from an appendix to the experiment’s main subject: what is being verified is not only the code, but whether the record is complete enough for someone else to rebuild the same measurement conditions.
The environment record: what must be written down
For the processor: model, microarchitecture, base and boost frequencies, and the operating system’s frequency-governor setting. Post-quantum implementations are acutely sensitive to instruction sets: the same NTT code with an AVX2 or AVX-512 path versus a scalar-only path can differ several-fold, so the record must state which code path the run actually took, not what the CPU theoretically supports — runtime dispatch picking the wrong path is not rare, and writing the record is itself an audit.
For the software stack: compiler and version, optimisation flags, linked library versions, and the implementation’s own version or commit hash. Minor compiler versions change inlining and vectorisation decisions and are a frequent source of cross-machine divergence. For memory: capacity, frequency, and whether all channels are populated — bandwidth-hungry operations such as bulk hash-tree processing differ markedly across memory configurations. Also record the power mode, the broad thermal class (desktop, laptop, server, virtual machine), and in virtualised settings the host type: cycles stolen by the hypervisor appear in no log, and only a recorded scenario warns the reader to discount.
Variable control and measurement discipline
First discipline, counting: prefer cycle counters and report cycles, with wall-clock time as a supplement. Cycle counts are immune to frequency drift; cross-machine comparisons should compare cycles first and convert by frequency second. Second, batched amortisation: when a single operation is too short, timer resolution and call overhead take a significant share, so repeat the operation in batches, divide total time by count, and report the batch size. Third, separate warm-up from steady state: discard the first rounds as warm-up, gather steady-state statistics separately, and if the implementation’s first call involves path dispatch or lazy initialisation, report cold-start figures on their own — never blended into the steady-state mean.
The workload itself must be locked down: input sizes, how keys and data are generated, and whether key generation is included — many benchmarks amortise key generation into every operation and some do not, a classic source of fighting numbers. Statistical reporting must give at least a median and a dispersion measure; a benchmark that reports only a best value has measured the machine’s luck ceiling, not its performance.
The reproduction experiment’s deliverable is more than a verdict. A complete delivery has four parts: the exact version of the benchmark code and workload (commit hash or archive), the filled-in environment record, the raw measurement data (cycle counts for every round, not just summary statistics), and the analysis script that produced the summary figures. With all four, others can actually attempt reproduction; without the raw data, reproduction can only reproduce the conclusion’s surface and cannot audit the statistical conventions — if one side reported a best value and you computed a median, that class of difference only becomes visible in front of the raw data. Package the four parts into an archivable reproduction bundle and publish it with the paper or report; it is usually small, yet it lifts a set of numbers from “author’s self-report” to “independently checkable”.
Interpretation: how much divergence counts as failed reproduction?
Set the tolerance in advance. On the same microarchitecture and instruction-set path, a cycle-count divergence beyond five percent should trigger investigation; across microarchitectures, compare only magnitudes and relative rankings, not numerical closeness. The investigation order matters too: instruction-set path first, then compiler options, then frequency policy, and only lastly the implementation itself — ordered by frequency of occurrence, this finds most discrepancies fastest.
The reproduction experiment’s second deliverable is ranking stability: whether the relative speed of two algorithms or two parameter sets keeps the same direction across environments. Absolute numbers are fragile; relative rankings are usually far more robust. When citing others’ benchmarks for selection decisions, cite the ranking conclusions first, with the environment range in which they hold.
Common pitfalls
First, citing numbers without conditions: a report that says only “implementation X does N operations per second”, with no machine or code path, should be treated in review as unsourced. Second, benchmarking on a laptop: power policies and thermal walls make figures drift with battery level and room temperature, so even same-machine reruns may disagree. Third, mixing release and debug builds: assertions and checking code can eat multiples of the performance. Fourth, charging memory allocation to the algorithm: a benchmark that reallocates large buffers every round measures the allocator, not the algorithm. Fifth, running one round and taking the best: a number with no repetitions and no dispersion cannot be compared with any other number. A benchmark’s dignity comes from reproducibility, and reproducibility’s dignity from the record — that is this experiment’s single claim from start to finish.
Tags: BenchmarkingReproducibilityEnvironment ControlExperiment Design