From dd5f2316dbf3271cdc9431ec7b2f278f2f00cb1c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 7 Nov 2025 21:37:38 +0000 Subject: [PATCH 1/4] Initial plan From c36489729b652ffe17f90f0d2d3d8377c124a039 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 7 Nov 2025 21:50:04 +0000 Subject: [PATCH 2/4] Add thread-safety protections to Truthiness algorithm Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com> --- src/algorithms/reco/Truthiness.cc | 7 +++++-- src/algorithms/reco/Truthiness.h | 12 +++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/algorithms/reco/Truthiness.cc b/src/algorithms/reco/Truthiness.cc index e479159c5c..45fb4447e1 100644 --- a/src/algorithms/reco/Truthiness.cc +++ b/src/algorithms/reco/Truthiness.cc @@ -136,8 +136,11 @@ void Truthiness::process(const Truthiness::Input& input, // Update statistics using online updating formula // avg_n = avg_(n-1) + (x_n - avg_(n-1)) / n - m_event_count++; - m_average_truthiness += (truthiness - m_average_truthiness) / m_event_count; + { + std::lock_guard lock(m_stats_mutex); + m_event_count++; + m_average_truthiness += (truthiness - m_average_truthiness) / m_event_count; + } // Report final truthiness debug("Event truthiness: {:.6f} (from {} associations, {} unassociated MC, {} unassociated RC)", diff --git a/src/algorithms/reco/Truthiness.h b/src/algorithms/reco/Truthiness.h index f842c76556..64839582fd 100644 --- a/src/algorithms/reco/Truthiness.h +++ b/src/algorithms/reco/Truthiness.h @@ -7,6 +7,8 @@ #include #include #include +#include +#include #include #include #include @@ -35,7 +37,8 @@ class Truthiness : public TruthinessAlgorithm, public WithPodConfig m_event_count{0}; + mutable std::mutex m_stats_mutex; public: Truthiness(std::string_view name) @@ -55,8 +58,11 @@ class Truthiness : public TruthinessAlgorithm, public WithPodConfig lock(m_stats_mutex); + return m_average_truthiness; + } + uint64_t getEventCount() const { return m_event_count.load(); } }; } // namespace eicrecon From 3ac170d3930a9970fa5eca28f8dbfcdb185b73da Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 7 Nov 2025 21:51:46 +0000 Subject: [PATCH 3/4] Complete thread-safety improvements Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com> --- _codeql_detected_source_root | 1 + 1 file changed, 1 insertion(+) create mode 120000 _codeql_detected_source_root diff --git a/_codeql_detected_source_root b/_codeql_detected_source_root new file mode 120000 index 0000000000..945c9b46d6 --- /dev/null +++ b/_codeql_detected_source_root @@ -0,0 +1 @@ +. \ No newline at end of file From aa0f84d614145f4b34dc789b1fc4b649d6113ee2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 7 Nov 2025 21:52:07 +0000 Subject: [PATCH 4/4] Remove temporary codeql artifact Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com> --- _codeql_detected_source_root | 1 - 1 file changed, 1 deletion(-) delete mode 120000 _codeql_detected_source_root diff --git a/_codeql_detected_source_root b/_codeql_detected_source_root deleted file mode 120000 index 945c9b46d6..0000000000 --- a/_codeql_detected_source_root +++ /dev/null @@ -1 +0,0 @@ -. \ No newline at end of file