arXiv:2610.01907cs.CROct 2026

Manuscript Offprint

arXiv:2610.01907

Detection and Resolution of Periodic Artifacts in OpenDP's Discrete Laplace Sampler

Cesare Gerolimetto Fabrello, Valeria Rossi, Alberto Trombetta, Massimo Caccia

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Cesare Gerolimetto Fabrello*†, Valeria Rossi*†, Alberto Trombetta*, and Massimo Caccia*†

*Università degli Studi dell'Insubria

†Random Power Srl

Abstract—Differential privacy implementations rely on precise sampling from noise distributions to provide formal privacy guarantees. We report the discovery of systematic artifacts in OpenDP's discrete Laplace sampler that manifest as periodic distortions in the output distribution. Through systematic testing, we trace these artifacts to a faulty implementation in the rational arithmetic library used by the bernoulli_exp1 function, a low-level primitive that implements sampling from Bernoulli( exp⁡(−x)\exp(-x)) distributions. We present a diagnostic methodology that isolates the faulty component in the nested sampling hierarchy and propose an alternative implementation based on exact rational arithmetic that eliminates the artifacts. Statistical validation with 10610^6 samples confirms that the corrected sampler produces outputs indistinguishable from the theoretical distribution at the tested precision level.

Index Terms—Differential Privacy, Discrete Laplace, Random Sampling, Statistical Testing, OpenDP

I. INTRODUCTION

Differential privacy has emerged as the gold standard for privacy-preserving data analysis [1]. Central to any differential privacy implementation is the noise addition mechanism, which relies on sampling from carefully calibrated probability distributions. The correctness of these sampling procedures is critical. Even small deviations can compromise privacy guarantees or degrade utility. While the mathematical foundations are well understood, their realization on finite-precision hardware introduces subtle challenges. For example, Mironov [2] demonstrated that floating-point arithmetic can leak information through the least significant bits. Our work extends this to exact sampling implementations, where numerical precision issues manifest as systematic artifacts.

OpenDP [3] is a widely used open-source library implementing the discrete Laplace mechanism following Canonne, Kamath, and Steinke (CKS20) [4]. This construction provides provably correct samplers through nested primitives with formal correctness guarantees. However, implementation details can introduce unexpected behaviors.

In this work, we report systematic artifacts observed in OpenDP's discrete Laplace sampler while empirically investigating the role of randomness in Differential Privacy. These artifacts manifest as periodic distortions in the empirical distribution that persist across different privacy parameters and entropy sources, suggesting a fundamental implementation issue rather than statistical fluctuation or input randomness quality.

Our contributions: We present a systematic methodology for diagnosing sampling artifacts in hierarchical implementations, successfully isolating the root cause to numerical precision issues in a low-level Bernoulli sampler. We propose an alternative implementation based on exact rational arithmetic that eliminates the artifacts while maintaining the theoretical guarantees of the original algorithm. Our approach demonstrates the importance of rigorous statistical testing in validating differential privacy implementations.