Skip to content

refactor: Improved FPE mon, extend to macOS#5231

Merged
kodiakhq[bot] merged 25 commits intoacts-project:mainfrom
paulgessinger:refactor/fpemon
Mar 17, 2026
Merged

refactor: Improved FPE mon, extend to macOS#5231
kodiakhq[bot] merged 25 commits intoacts-project:mainfrom
paulgessinger:refactor/fpemon

Conversation

@paulgessinger
Copy link
Copy Markdown
Member

@paulgessinger paulgessinger commented Mar 11, 2026

This pull request introduces significant improvements to the FPE (Floating Point Exception) monitoring plugin, focusing on cross-platform support, improved exception handling, and enhanced stack trace recording. The main themes are platform abstraction, improved signal handling, and more robust stack trace deduplication.

Platform abstraction and cross-platform support:

  • Added platform-specific source files and logic in CMakeLists.txt to support Darwin (macOS) and Linux architectures, enabling FPE monitoring on more systems. (Plugins/FpeMonitoring/CMakeLists.txt)
  • Introduced FpeMonitorPlatform.hpp and refactored code to use platform abstraction functions for exception handling, signal masking, and stack trace capture. (Plugins/FpeMonitoring/src/FpeMonitorPlatform.hpp, Plugins/FpeMonitoring/src/FpeMonitor.cpp) [1] [2]

Improved signal handling and exception processing:

  • Refactored signal handler to decode exception type, handle unknown signals robustly, and record faulting instruction addresses. Platform-specific masking and enabling/disabling of exceptions are now abstracted. (Plugins/FpeMonitoring/src/FpeMonitor.cpp) [1] [2]
  • Added isSupported() method to FpeMonitor to check runtime support for trapping-based FPE monitoring. (Plugins/FpeMonitoring/include/ActsPlugins/FpeMonitoring/FpeMonitor.hpp, Plugins/FpeMonitoring/src/FpeMonitor.cpp) [1] [2]

Enhanced stack trace recording and deduplication:

  • Modified stack trace recording to include the faulting instruction address, improving deduplication and merging of FPE events. (Plugins/FpeMonitoring/include/ActsPlugins/FpeMonitoring/FpeMonitor.hpp, Plugins/FpeMonitoring/src/FpeMonitor.cpp) [1] [2] [3] [4]
  • Improved deduplication logic to consider both stack trace and faulting address, reducing duplicate records and improving accuracy. (Plugins/FpeMonitoring/src/FpeMonitor.cpp)

Build system and configuration improvements:

  • Updated CMake logic to use CMAKE_DL_LIBS for linking, improved detection and setup for stacktrace support, and added platform-specific source selection. (Plugins/FpeMonitoring/CMakeLists.txt) [1] [2] [3]

Minor fixes and improvements:

  • Fixed buffer offset advancement in pushOffset and added missing header includes for portability. (Plugins/FpeMonitoring/include/ActsPlugins/FpeMonitoring/FpeMonitor.hpp) [1] [2]
  • Removed unused macros and headers, and improved code clarity. (Plugins/FpeMonitoring/src/FpeMonitor.cpp) [1] [2]

Platform abstraction and cross-platform support

  • Added platform-specific source files and CMake logic for Darwin and Linux architectures, improving cross-platform FPE monitoring. (Plugins/FpeMonitoring/CMakeLists.txt)
  • Introduced FpeMonitorPlatform.hpp and refactored code to use platform abstraction for exception handling, signal masking, and stack trace capture. (Plugins/FpeMonitoring/src/FpeMonitorPlatform.hpp, Plugins/FpeMonitoring/src/FpeMonitor.cpp) [1] [2]

Improved signal handling and exception processing

  • Refactored signal handler to decode exception type, handle unknown signals robustly, and record faulting instruction addresses; platform-specific masking and enabling/disabling of exceptions are now abstracted. (Plugins/FpeMonitoring/src/FpeMonitor.cpp) [1] [2]
  • Added isSupported() method to FpeMonitor to check runtime support for trapping-based FPE monitoring. (Plugins/FpeMonitoring/include/ActsPlugins/FpeMonitoring/FpeMonitor.hpp, Plugins/FpeMonitoring/src/FpeMonitor.cpp) [1] [2]

Enhanced stack trace recording and deduplication

  • Modified stack trace recording to include faulting instruction address, improving deduplication and merging of FPE events. (Plugins/FpeMonitoring/include/ActsPlugins/FpeMonitoring/FpeMonitor.hpp, Plugins/FpeMonitoring/src/FpeMonitor.cpp) [1] [2] [3] [4]
  • Improved deduplication logic to consider both stack trace and faulting address, reducing duplicate records and improving accuracy. (Plugins/FpeMonitoring/src/FpeMonitor.cpp)

Build system and configuration improvements

  • Updated CMake logic to use CMAKE_DL_LIBS for linking, improved detection and setup for stacktrace support, and added platform-specific source selection. (Plugins/FpeMonitoring/CMakeLists.txt) [1] [2] [3]

Minor fixes and improvements

  • Fixed buffer offset advancement in pushOffset and added missing header includes for portability. (Plugins/FpeMonitoring/include/ActsPlugins/FpeMonitoring/FpeMonitor.hpp) [1] [2]
  • Removed unused macros and headers, and improved code clarity. (Plugins/FpeMonitoring/src/FpeMonitor.cpp) [1] [2]

@github-actions github-actions bot added this to the next milestone Mar 11, 2026
@github-actions github-actions bot added the Component - Plugins Affects one or more Plugins label Mar 11, 2026
- Remove verbose try_compile block, use find_package(Backtrace)
- Consolidate backtrace setup logic
- Use consistent COMPILE_DEFINITIONS syntax (no leading -D)
- Add FpeMonitorPlatformDarwinCommon.hpp with shared exceptMaskForType, fpeTypeFromSiCode
- Deduplicate between Darwin arm64 and x86_64
- Move from DarwinCommon to FpeMonitorPlatform.hpp for shared use
- Darwin arm64 uses platform header, DarwinCommon keeps darwin-specific helpers
Enable ACTS_BUILD_PLUGIN_FPEMON in shared and CI-specific presets.
Remove ACTS_SEQUENCER_DISABLE_FPEMON runtime opt-outs from GitHub and GitLab jobs.
Drop redundant macOS-only configure override now covered by presets.
@github-actions github-actions bot added the Infrastructure Changes to build tools, continous integration, ... label Mar 11, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 11, 2026

📊: Physics performance monitoring for 9c9f7db

Full contents

physmon summary

@github-actions github-actions bot added the Component - Examples Affects the Examples module label Mar 11, 2026
@paulgessinger paulgessinger marked this pull request as ready for review March 11, 2026 17:01
andiwand
andiwand previously approved these changes Mar 14, 2026
Copy link
Copy Markdown
Member

@stephenswat stephenswat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am no expert on ARM but this looks sensible to me. 👍

@sonarqubecloud
Copy link
Copy Markdown

@kodiakhq kodiakhq bot merged commit 04ccaa9 into acts-project:main Mar 17, 2026
42 checks passed
@andiwand andiwand modified the milestones: next, v46.0.0 Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component - Examples Affects the Examples module Component - Plugins Affects one or more Plugins Infrastructure Changes to build tools, continous integration, ...

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants