Skip to main content
QUICK REVIEW

[Paper Review] Fast and flexible data structures for the LHCb Run 3 software trigger

D. J. Lange|arXiv (Cornell University)|Jul 6, 2023
Particle Detector Development and PerformancePhysics and Astronomy3 citations
TL;DR

This paper presents a redesigned event model for the LHCb Run 3 software trigger, using Struct-of-Arrays (SOA) data structures and native SIMD vectorization to achieve high throughput and low latency. The new model enables ~2x speedup with SIMD versus scalar execution and supports full offline-quality reconstruction across 1,000+ trigger lines at 10 GB/s output, significantly improving performance and flexibility over Run 1+2 architectures.

ABSTRACT

Complete set of all proceedings contributed and reviewed for the 2022 Connecting the Dots workshop. The Connecting The Dots workshop series brings together experts on track reconstruction and other problems involving pattern recognition in sparsely sampled data. While the main focus will be on High Energy Physics (HEP) detectors, the Connecting The Dots workshop is intended to be inclusive across other scientific disciplines wherever similar problems or solutions arise.

Motivation & Objective

  • To redesign the LHCb HLT2 event model for Run 3 to handle 30 MHz input rates and 10 GB/s output with full offline-quality reconstruction.
  • To overcome performance bottlenecks in the Run 1+2 event model, which used slow AOS containers and inefficient memory access patterns.
  • To enable efficient vectorization and high-throughput data processing using modern CPU SIMD instructions.
  • To support flexible, extensible, and backward-compatible data structures that allow runtime resizing and decay tree traversal.
  • To simplify data persistency by integrating packing logic directly into SOA field definitions for versioned, compact storage.

Proposed method

  • Adopted an SOA (Struct-of-Arrays) memory layout for event data, replacing the legacy AOS (Array-of-Structs) model to improve data locality and vectorization.
  • Designed SOACollection templates that encapsulate multiple fields (e.g., momentum, hits) as independent arrays, each with customizable packing and persistence behavior.
  • Enabled runtime selection of SIMD or scalar backends via compile-time dispatch, abstracting hardware differences and enabling automatic vectorization.
  • Introduced proxy-based access to chunks of N elements, allowing efficient parallel operations such as filtering via masking during insertion.
  • Used functor caching instead of JIT compilation for Python-defined algorithms, improving performance by compiling functors at build time.
  • Integrated versioned persistence via field-specific packers, allowing selective packing (e.g., float, short) or exclusion of fields, with conditional persistence based on version.
Figure 1: A comparison of AOS and SOA layouts. Taken from Ref. [ 11 ] .
Figure 1: A comparison of AOS and SOA layouts. Taken from Ref. [ 11 ] .

Experimental results

Research questions

  • RQ1How can the LHCb HLT2 event model be redesigned to achieve sufficient throughput for 10 GB/s output while maintaining full offline-quality reconstruction?
  • RQ2What performance gains can be achieved by migrating from AOS to SOA data structures and enabling native SIMD vectorization?
  • RQ3How can data structures be made flexible enough to support dynamic resizing, decay tree traversal, and efficient I/O persistency?
  • RQ4What is the impact of replacing JIT compilation with pre-compiled functor caches on algorithm execution speed?
  • RQ5How can backward compatibility with the Run 1+2 event model be maintained during the transition without breaking the reconstruction workflow?

Key findings

  • The new SOA-based event model achieved a ~2x throughput improvement when using AVX2 SIMD instructions compared to scalar execution in the HLT1 CPU prototype.
  • A combined optimization of SOA layout, SIMD usage, and improved reconstruction algorithms led to a ~4x overall throughput gain in the HLT1 prototype between 2018 and 2020.
  • The use of pre-compiled functor caches eliminated runtime interpretation overhead, enabling fast and portable execution across different architectures.
  • The SOA design allowed seamless integration of field-specific packing logic, enabling compact storage with versioned persistence (e.g., only persisting newer fields).
  • The new event model supports full offline-quality reconstruction for more than 1,000 trigger lines in real time, eliminating the need for post-processing.
  • The redesign enabled efficient vectorization and memory access patterns, reducing cache misses and improving performance on modern CPUs with wide SIMD units.
Figure 2: An example zip combining track, particle ID and RICH PID to a charged particle. Taken from Ref. [ 17 ] .
Figure 2: An example zip combining track, particle ID and RICH PID to a charged particle. Taken from Ref. [ 17 ] .

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.