Published August 28, 2026 | Version v1

A High-Performance Rust-C++ Logging Interface for the EDAQ QPS System

  • 1. Universidad de Zaragoza

Contributors

  • 1. ROR icon European Organization for Nuclear Research

Description

The Quench Protection System (QPS) is critical for machine protection at the CERN Large Hadron Collider (LHC), monitoring superconducting magnets to detect potential quenches and trigger appropriate magnet protection strategies. To support the high-throughput data acquisition required by the new High-Luminosity LHC, the Ethernet-based Electronic Data Acquisition (EDAQ) architecture is being developed to provide high-bandwidth acquisition and transmission of diagnostic and operational data. The software stack includes a Rust-based client library (qps-client) embedded via C++ bindings into the DQAmEth FESA class, where it is responsible for decoding the EDAQ data stream. Previously, the Rust client was unable to use the intended logging system directly, requiring diagnostic information to be passed to the C++ layer through FFI. This additional indirection made diagnostics more complex and resulted in the loss of critical diagnostic context, limiting developers’ ability to identify and investigate the underlying causes of errors.

This report details the design and implementation of cmw-logger-wrapper, a high-performance FFI logging bridge connecting standard Rust macros directly to the CERN cmw-log framework. By implementing a low-overhead per-event error aggregation mechanism and thread-safe state management, the new architecture enables rich, more contextual diagnostic information while preserving real-time data acquisition performance. Crucially, repeated errors are aggregated into consolidated log messages to reduce the per-event CPU cost, while performance measurements were used to adjust verbose logging and minimize its impact on the real-time processing path. In the initial configuration, verbose line-by-line logging increased processing latency from 55 µs to over 300 µs; after adjustment, the measured overhead was approximately 1 µs relative to the no-logging baseline in the evaluated high-error scenario. Finally, cross-language linker dependencies and pipeline cache inconsistencies were resolved, resulting in a more deterministic CI/CD build process.

Files

Violeta_Veras_Summer_Student_Report.pdf

Files (476.7 kB)

Name Size Download all
md5:c14536a990ee2cf9d27c7eba7c295b69
476.7 kB Preview Download

Additional details

CERN

Department
TE - Technology Department
Administrative Unit
MPE-CB
Programme
No program participation

Linked records