Commit Graph
491 Commits
Author SHA1 Message Date
kferjaoui a42d71cf42 Graph-based CUDA ClusterFinder (ClusterFinderCUDAGraph)
- CUDA Graph variant of ClusterFinderCUDA: one pre-recorded graph per stream
  (memset + H2D + kernel + D2H), with per-frame src/dst pointers swapped via
  cudaGraphExecMemcpyNodeSetParams to cut per-frame launch overhead.
- Exposed through the _aare_cuda bindings and a ClusterFinderCUDAGraph factory.
2026-08-03 11:53:51 +02:00
kferjaoui 1bf317f42a CUDA: double-precision device path, local-max fix, pedestal introspection
- DEVICE_PED_TYPE for device pedestal/variance (shipped double/double to match
    the double CPU ClusterFinder).
- Local-max suppression in Test 1/Test 3: non-peak pixels no longer store or
    update, mirroring ClusterFinder's `value < max -> continue`.
- device_pedestal()/device_noise() accessors (+ bindings) for the in-kernel
    decision-time pedestal.
2026-08-03 11:39:02 +02:00
kferjaoui 156667efde Merge 'origin/main' into feature/cuda_clusterfinder 2026-07-21 15:21:49 +02:00
mazzol_a 533ecb8a4a removed patch for minuit2 CMakeLists.txt (#336)
Build on RHEL9 / build (push) Successful in 2m57s
Build on RHEL8 / build (push) Successful in 3m35s
Run tests using data on local RHEL8 / build (push) Successful in 3m57s
Build on local RHEL8 / build (push) Successful in 2m46s
- patch no longer needed for minuit2 as CMakeLists.txt has been updated:
https://github.com/GooFit/Minuit2/commit/46716e516e34a95e1f4effa95705a9e0c3425839
2026-07-16 10:39:06 +02:00
Erik Fröjdh db67e870d9 readme
Build on RHEL9 / build (push) Successful in 2m42s
Build on RHEL8 / build (push) Successful in 3m15s
Run tests using data on local RHEL8 / build (push) Successful in 3m58s
Build on local RHEL8 / build (push) Successful in 2m46s
2026.7.2
2026-07-02 17:00:45 +02:00
Erik Fröjdh 7804e3a35b bumped version 2026-07-02 16:51:44 +02:00
4aadb6f7f0 refactor: hide Minuit2 from aare's public API (#331)
Build on RHEL9 / build (push) Successful in 3m13s
Build on RHEL8 / build (push) Successful in 3m52s
Run tests using data on local RHEL8 / build (push) Successful in 3m56s
Build on local RHEL8 / build (push) Successful in 2m45s
- Move Chi2.hpp from include/aare/ to src/ (private)
- Pimpl on FitModel<Model>: MnUserParameters/MnStrategy behind opaque
src/FitModelImpl.hpp, no Minuit2 includes in public headers
- Move fit_pixel/fit_3d bodies to Fit.cpp with explicit instantiations
for all 8 models; drop FCN template param from public API
- CMake: aare::Minuit2 wrapped in $<BUILD_INTERFACE:...> (hidden from
exported targets, same pattern as lmfit), MINUIT2_INSTALL OFF, Chi2.hpp
removed from PUBLICHEADERS
- Update python bindings and benchmark callsites accordingly

---------

Co-authored-by: Erik Fröjdh <erik.frojdh@psi.ch>
Co-authored-by: Alice <alice.mazzoleni@psi.ch>
2026-07-02 16:04:22 +02:00
mazzol_a b4686e6b85 added moench05 defs (#333)
Build on RHEL9 / build (push) Successful in 2m37s
Build on RHEL8 / build (push) Successful in 3m16s
Run tests using data on local RHEL8 / build (push) Successful in 3m56s
Build on local RHEL8 / build (push) Successful in 2m42s
- add moench05 chip/chiptestboard defs
2026-06-26 17:43:06 +02:00
maliakal_d 8c9f4ca763 cmake: treat warnings as errors (#330)
Build on RHEL9 / build (push) Successful in 2m33s
Build on RHEL8 / build (push) Successful in 3m13s
Run tests using data on local RHEL8 / build (push) Successful in 3m59s
Build on local RHEL8 / build (push) Successful in 2m44s
- treating warnings as errors during github and gitea workflows
2026-06-16 12:32:28 +02:00
mazzol_a 982419149d Merge branch 'main' into dev/treat_errors_as_warnings
Build on RHEL9 / build (push) Successful in 2m50s
Build on RHEL8 / build (push) Successful in 3m30s
Run tests using data on local RHEL8 / build (push) Successful in 3m53s
2026-06-15 14:44:13 +02:00
mazzol_a 0a4c4f5ec1 change AxisType to float for pixelhistogram tests 2026-06-15 14:27:26 +02:00
mazzol_a 559c822a02 change AxisType to float for pixelhistogram tests
Build on RHEL9 / build (push) Successful in 2m29s
Build on RHEL8 / build (push) Successful in 3m40s
Run tests using data on local RHEL8 / build (push) Successful in 3m58s
2026-06-15 14:22:24 +02:00
mazzol_a b71fcb1d1a fixed apple clang warning 2026-06-15 14:03:36 +02:00
mazzol_a 85833cebb3 fixed unsued warning in PedestalTrackingHistogram 2026-06-15 11:52:44 +02:00
Erik Fröjdh b4b28fc9e0 len() and pedestal subtraction (#328)
Build on RHEL9 / build (push) Successful in 2m57s
Build on RHEL8 / build (push) Successful in 3m28s
Run tests using data on local RHEL8 / build (push) Successful in 4m0s
Build on local RHEL8 / build (push) Successful in 2m44s
Collection of small improvements in usability: 

- NDView works for large arrays
- Direct subtraction of Pedestal from np.array
- len() support for python bindings of files
2026-06-15 11:38:06 +02:00
mazzol_a ae8744358a cmake format 2026-06-15 11:36:03 +02:00
mazzol_aandErik Fröjdh ee7503082d Dev/matterhorn decoder (#324)
Build on RHEL9 / build (push) Successful in 2m49s
Build on RHEL8 / build (push) Successful in 3m35s
Run tests using data on local RHEL8 / build (push) Successful in 4m1s
Build on local RHEL8 / build (push) Successful in 3m9s
- reshape image directly in decoder such that first dimension is num
counters
- take into account chip artefact in decoder.

---------

Co-authored-by: Erik Fröjdh <erik.frojdh@psi.ch>
2026-06-11 15:04:20 +02:00
Erik Fröjdh 2041c7310a Fixed usage of fmt::format and fmt::print for C++20 (#323)
Build on RHEL8 / build (push) Successful in 3m5s
Build on RHEL9 / build (push) Successful in 3m4s
Run tests using data on local RHEL8 / build (push) Successful in 3m57s
Build on local RHEL8 / build (push) Successful in 2m41s
With C++20 `fmt::print(s)` expects a compile time format string and
otherwise fails complaining about consteval. To get runtime formatting
use `fmt::print(fmt::runtime(s))`
2026-06-11 08:01:03 +02:00
Erik Fröjdh 17d04083a7 Bugfix: NDArary/NDView overflow in calculating number of elements (#322)
Build on RHEL9 / build (push) Successful in 2m38s
Build on RHEL8 / build (push) Successful in 3m10s
Run tests using data on local RHEL8 / build (push) Successful in 3m59s
Build on local RHEL8 / build (push) Successful in 2m45s
Fixed number of elements calculation that caused integer overflow. Now
return size_t instead of int.
2026-06-10 12:24:18 +02:00
Erik Fröjdh b78ea64ea7 Conditional use of Minuit2 (#320)
Build on RHEL9 / build (push) Successful in 2m31s
Build on RHEL8 / build (push) Successful in 3m9s
Run tests using data on local RHEL8 / build (push) Successful in 3m56s
Build on local RHEL8 / build (push) Successful in 2m44s
If AARE_FETCH_MINUIT is set to OFF we first look for a standalone
Minuit2 and if that is not found we try to find Minuit2 as a part of
ROOT.

In both cases we make an alias to allow for simpler use of the target
later.

It still doesn't solve the issue that we install Minuit to when we fetch
it but that can be addressed in a separate PR.

closes #316
2026-06-10 08:30:03 +02:00
Erik FröjdhandLars Erik Fröjd f670ba77a2 PixelHistogram (#317)
Build on RHEL9 / build (push) Successful in 2m31s
Build on RHEL8 / build (push) Successful in 3m6s
Run tests using data on local RHEL8 / build (push) Successful in 3m55s
Build on local RHEL8 / build (push) Successful in 2m42s
Multi threaded filling of per pixel histograms for example for detector calibration

1. PixelHistogram - Generic variant expects already pedestal subtracted
data
2. PedestalTrackingHistogram - Terrible name, useful class. Keeps it's
own pedestal and does conversion and pedestal tracking in the worker
threads.

---------

Co-authored-by: Lars Erik Fröjd <froejdh_e@pc-jungfrau-02.psi.ch>
2026-06-09 09:08:48 +02:00
maliakal_d 8e69b498e5 Fix version (#319)
Build on RHEL9 / build (push) Successful in 2m34s
Build on RHEL8 / build (push) Successful in 3m2s
Run tests using data on local RHEL8 / build (push) Successful in 3m45s
Build on local RHEL8 / build (push) Successful in 2m38s
- install VERSION file and copy to build
- fix lookup for VERSION file in case of error
- update documentation for installing python bindings
2026-06-03 12:10:58 +02:00
kferjaoui 5922c73c07 feat(ClusterFinderCUDA): async submit_batch/collect API
Build on RHEL8 / build (push) Successful in 3m16s
Build on RHEL9 / build (push) Successful in 3m26s
Run tests using data on local RHEL8 / build (push) Successful in 9m42s
- Eliminate the ~200–300 µs inter-batch idle gap by allowing two batches
to be in-flight simultaneously:
  - submit_batch() enqueues H2D+kernel+D2H without blocking
  - collect() syncs via cudaEventSynchronize (not
  cudaStreamSynchronize) so a queued second batch runs uninterrupted.

- Two ping-pong output slots (NUM_SLOTS=2) with per-slot pinned buffers
and cudaEventDisableTiming sync events.
- find_clusters_batched() keeps its direct implementation.

* Measured: 0.026 -> 0.022 ms/frame (~18%).
2026-05-28 16:23:37 +02:00
lunin_landmazzol_a 282debcc94 Add __version__ variable for python library (#308)
Build on RHEL9 / build (push) Successful in 2m23s
Build on RHEL8 / build (push) Successful in 3m5s
Run tests using data on local RHEL8 / build (push) Successful in 3m56s
Build on local RHEL8 / build (push) Successful in 2m38s
[PEP 396](https://peps.python.org/pep-0396/)

---------

Co-authored-by: AliceMazzoleni99 <alice.mazzoleni@psi.ch>
2026-05-27 14:38:35 +02:00
mazzol_a 41c47cb54b dont reinstall fmt (#314)
Build on RHEL9 / build (push) Successful in 2m24s
Build on RHEL8 / build (push) Successful in 2m58s
Run tests using data on local RHEL8 / build (push) Successful in 3m43s
Build on local RHEL8 / build (push) Successful in 2m37s
- dont reinstall fmt/nlohmann
2026-05-22 15:44:35 +02:00
mazzol_a 502c37a00a number of clusters is always uint32_t (#313)
Build on RHEL9 / build (push) Successful in 2m45s
Build on RHEL8 / build (push) Successful in 3m21s
Run tests using data on local RHEL8 / build (push) Successful in 3m55s
Build on local RHEL8 / build (push) Successful in 2m37s
2026-05-22 09:22:29 +02:00
kferjaoui 4c66802980 perf(ClusterFinderCUDA): FP32 device pedestal and bulk memcpy drain
Build on RHEL8 / build (push) Successful in 3m0s
Build on RHEL9 / build (push) Successful in 3m41s
Run tests using data on local RHEL8 / build (push) Successful in 3m47s
- Device pedestal arrays (mean/sum/sum2) are now float instead of
  double: halves global-memory bandwidth for pedestal reads/writes and
  eliminates FP64 arithmetic in the kernel (3.3x kernel speedup,
  15µs -> 4.6µs).

- Replace the per-cluster push_back loop in the D2H drain with a
  single resize()+memcpy().
2026-05-21 14:12:02 +02:00
Khalil Ferjaoui 52b5cf6b9f Feature/gauss+plateau (#312)
Build on RHEL9 / build (push) Successful in 2m27s
Build on RHEL8 / build (push) Successful in 3m1s
Run tests using data on local RHEL8 / build (push) Successful in 3m54s
Build on local RHEL8 / build (push) Successful in 2m36s
Adds three Minuit2-backed spectrum models to the Python-exposed fitting
API:

- `GaussianErfcPlateau`
- `GaussianChargeSharing`
- `GaussianChargeSharingKb`

Closes #297
2026-05-21 08:33:02 +02:00
kferjaoui 6a12e3de24 Refactor ClusterFinderCUDA
Build on RHEL9 / build (push) Successful in 3m22s
Build on RHEL8 / build (push) Successful in 3m28s
Run tests using data on local RHEL8 / build (push) Successful in 3m37s
Rework the multi-stream pipeline to eliminate per-frame sync barriers and
fix the D2H staging architecture.

Sync reduction:
- Replace one cudaStreamSynchronize per frame with one per stream per batch,
  cutting synchronisation calls from O(n_frames x n_streams) to O(n_streams)
- Introduce a unified per-frame D2H output layout [uint32_t count | clusters[max]]
  stored in a single class-level lazy-allocated pinned pool (h_output_pinned),
  replacing the per-stream separate cluster/count device buffers
- Move CUDA event pool from per-stream fixed-size to per-frame-slot lazy-allocated,
  enabling correct kernel timing across any batch size

Pinned H2D without CPU-side copy:
- Add register_input_buffer(ptr, bytes) / unregister_input_buffer() wrapping
  cudaHostRegister so callers can pin their existing batch buffer once; all
  find_clusters_batched() slices then transfer at DMA speed (~22 GB/s) instead
  of ~15 GB/s for pageable, with no extra memcpy or WC-memory penalty

Result (RTX 4090, 400x400 uint16, 3x3 clusters, batch=2000, 5 streams):
  Before: ~34 µs/frame  ->  After: ~28 µs/frame  (−18 %)
2026-05-18 16:30:13 +02:00
Xiangyu Xieandxie_x1 de74f12640 Dev var cluster finder (#310)
Build on RHEL9 / build (push) Successful in 2m30s
Build on RHEL8 / build (push) Successful in 3m36s
Run tests using data on local RHEL8 / build (push) Successful in 3m51s
Build on local RHEL8 / build (push) Successful in 2m36s
Add options for var cluster_finder_X:
1. number of neighbors (for better segmentation of clusters)
2. option to empty the surrounding pixels

---------

Co-authored-by: xiangyu.xie <xiangyu.xie@psi.ch>
2026-05-18 16:16:09 +02:00
lunin_l 4e3b70140a CI/CD: add conda build installation (#309)
Build on RHEL8 / build (push) Successful in 2m59s
Build on RHEL9 / build (push) Successful in 2m56s
Run tests using data on local RHEL8 / build (push) Successful in 3m41s
Build on local RHEL8 / build (push) Successful in 2m37s
Build conda pkgs workflows
[failing](https://github.com/slsdetectorgroup/aare/actions/runs/25800676450/job/75789547058#step:5:10)
due to the missing `conda build` command.

This PR fixes the issue.
2026-05-13 16:32:02 +02:00
Khalil Ferjaouiandlunin_l 5cfc888567 Eliminate duplicated code in CMakeLists.txt
Build on RHEL8 / build (push) Successful in 2m52s
Build on RHEL9 / build (push) Successful in 3m13s
Run tests using data on local RHEL8 / build (push) Successful in 3m52s
Co-authored-by: Leonid Lunin <lunin.leonid@gmail.com>
2026-05-07 15:54:30 +02:00
kferjaoui 82e5e60f43 ci: install conda-build in base env before conda build step
Build on RHEL8 / build (push) Successful in 2m50s
Build on RHEL9 / build (push) Successful in 3m16s
Run tests using data on local RHEL8 / build (push) Successful in 3m48s
2026-05-06 11:51:53 +02:00
kferjaoui 41d5184e1b Fix ClusterVector move semantics 2026-05-06 11:30:59 +02:00
kferjaoui 88e0e8d678 Optimize CUDA cluster finder transfers and kernel hot path
Build on RHEL8 / build (push) Successful in 2m51s
Build on RHEL9 / build (push) Successful in 3m15s
Run tests using data on local RHEL8 / build (push) Successful in 3m47s
- Use per-stream pinned host staging buffers for truly async CUDA transfers.
- Avoid reserving full device capacity per result frame.
- Reduce kernel work by delaying cluster payload construction.
- Use squared comparisons and removing per-pixel sqrtf() ops.
2026-04-30 18:23:31 +02:00
kferjaoui 34e69a8065 Add per-frame kernel timing via CUDA events
Build on RHEL8 / build (push) Successful in 3m13s
Build on RHEL9 / build (push) Successful in 3m37s
Run tests using data on local RHEL8 / build (push) Successful in 3m51s
2026-04-28 13:09:25 +02:00
kferjaoui ac96d1f688 Implement mixed precision: f32 stencil, f64 pedestal
Build on RHEL8 / build (push) Successful in 2m53s
Build on RHEL9 / build (push) Successful in 3m15s
Run tests using data on local RHEL8 / build (push) Successful in 3m47s
- Stencil arithmetic and shared memory use float (COMPUTE_TYPE alias).
- Pedestal accumulation stays double to preserve variance accuracy.

Notes:
- On RTX 4090, FP32 throughput is ~64× higher than FP64, so moving
  stencil math to float improves performance.
- Using float also avoids shared memory bank conflicts: stride-18 maps
  to distinct banks for 32-bit values, but caused conflicts with 64-bit.
2026-04-27 14:56:40 +02:00
kferjaoui 40f08fad92 Apply cmake-format to build files
Build on RHEL8 / build (push) Successful in 2m52s
Build on RHEL9 / build (push) Successful in 3m13s
Run tests using data on local RHEL8 / build (push) Successful in 3m49s
2026-04-27 11:53:56 +02:00
kferjaoui fddef977af Exclude notebooks from JSON check 2026-04-27 11:53:15 +02:00
kferjaoui a086cbb897 Format CUDA cluster finder files
Build on RHEL8 / build (push) Successful in 3m13s
Build on RHEL9 / build (push) Successful in 3m34s
Run tests using data on local RHEL8 / build (push) Successful in 3m48s
2026-04-27 11:27:47 +02:00
mazzol_a 2736d975c5 Dev/enable custom etas (#305)
Build on local RHEL8 / build (push) Successful in 2m32s
Build on RHEL9 / build (push) Successful in 2m29s
Build on RHEL8 / build (push) Successful in 2m52s
Run tests using data on local RHEL8 / build (push) Successful in 3m49s
- Allowing the users more flexibility to play around with custom eta
functions without touching the c++ code

- passing vector of eta values to ``transform_eta_values`` 

```
from aare import Interpolator, ClusterVector, Etai, Cluster
import numpy as np 

def custom_eta(cluster_pixel_coordinate_x, cluster_pixel_coordinate_y, cluster_data):
    # dummy custom eta function that just returns the sum of the cluster data
    eta = Etai()
    eta.x = 0.1 # dummy x value
    eta.y = 0.1 # dummy y value
    eta.sum = np.sum(cluster_data) # sum of the cluster data as the "energy
    return eta

# Create a dummy eta distribution and bins
eta_distribution = np.zeros((10, 10, 1)) # dummy eta distribution
etax_bins = np.linspace(0, 1.0, 11)
etay_bins = np.linspace(0, 1.0, 11)
e_bins = np.array([0., 10.]) # dummy energy bins

# Create the interpolator
interpolator = Interpolator(eta_distribution, etax_bins, etay_bins, e_bins)

# Create a dummy cluster vector
cluster_vector = ClusterVector()
cluster_vector.push_back(Cluster(10, 5, np.ones(shape=9, dtype = np.int32)))
cluster_vector.push_back(Cluster(20, 10, np.ones(shape=9, dtype = np.int32)))

# Create dummy etas for the clusters
cluster_array = np.array(cluster_vector)
etas = np.array([custom_eta(cluster["x"], cluster["y"], cluster["data"]) for cluster in cluster_array])

# transform eta values to uniform coordinates 
uniform_coordinates = interpolator.transform_eta_values(etas)

# Interpolate to get the photon coordinates e.g. apply interpolation logic 
photon_coordinates_x = cluster_array["x"] + uniform_coordinates["x"] # add to pixel coordinate 
photon_coordinates_y = cluster_array["y"] + uniform_coordinates["y"] # add to pixel coordinate 

```
advantage: full control over interpolation logic, 
downside: inefficient quite some loops in python
- passing pre computed eta values to interpolate function 
```
Interpolator.interpolate(cluster_vector, etas) 
```
downside: less flexibility in interpolation logic. 
downside: People might misuse it instead of using interpolate directly
with a pre compiled eta function implemented in c++
2026-04-24 14:01:13 +02:00
kferjaoui 133cedf755 pybind: make Cluster and ClusterVector bindings module-local
Build on RHEL8 / build (push) Successful in 2m52s
Build on RHEL9 / build (push) Successful in 3m15s
Run tests using data on local RHEL8 / build (push) Successful in 3m47s
- After upgrading to pybind11 3, duplicate registration of cluster-related
  types across `_aare` and `_aare_cuda` started failing.
- Mark the `Cluster` and `ClusterVector` bindings as `py::module_local()` so
each extension owns its local registration.

Note: cluster objects from CPU and CUDA bindings are now distinct Python types.
2026-04-23 14:03:47 +02:00
Khalil Ferjaoui 7c91ce99c2 Merge branch 'main' into feature/cuda_clusterfinder
Build on RHEL8 / build (push) Successful in 3m15s
Build on RHEL9 / build (push) Successful in 3m39s
Run tests using data on local RHEL8 / build (push) Successful in 3m51s
2026-04-23 13:52:52 +02:00
kferjaoui b9caf2d53e minor: use helper for frame packing
Build on RHEL8 / build (push) Successful in 2m47s
Build on RHEL9 / build (push) Successful in 2m56s
Run tests using data on local RHEL8 / build (push) Successful in 3m26s
2026-04-23 12:03:32 +02:00
kferjaoui e894bdac9b Add Python bindings for CUDA cluster finder
Build on RHEL8 / build (push) Successful in 2m50s
Build on RHEL9 / build (push) Successful in 2m57s
Run tests using data on local RHEL8 / build (push) Successful in 3m38s
- Add bind_ClusterFinderCUDA.hpp with pybind11 bindings for
  ClusterFinderCUDA
- Build CUDA bindings as separate _aare_cuda.so to avoid
  segfaults from mixing nvcc and gcc compiled code in the
  same shared object
- Re-export CUDA classes onto _aare in __init__.py so user
  code uses `from aare import ClusterFinderCUDA` regardless
  of which .so hosts the class
- Factory in ClusterFinder.py selects backend; RuntimeError
  if GPU requested on CPU-only build
- Update python/CMakeLists.txt: _aare_cuda module gated
  behind AARE_CUDA and AARE_PYTHON_BINDINGS
- Add validation notebook: ~20x speedup vs sequential ClusterFinder
2026-04-23 11:43:40 +02:00
kferjaoui 3ed773e520 Add multi-stream ClusterFinderCUDA with batched processing
- Wrap per-stream CUDA resources (device buffers, stream handle)
  in StreamContext struct; ClusterFinderCUDA owns a vector of
  n_streams contexts with independent pedestal arrays
- Split ClusterFinderCUDA.cuh into clusterfinder_kernel.cuh
  (device kernel) and ClusterFinderCUDA.hpp (host RAII wrapper)
- Add find_clusters_batched(): processes N frames round-robin
  across streams, returns per-frame cluster vectors.
- Update ClusterFinderCUDA.test.cu
- Update Makefile for new file layout.
2026-04-23 11:26:29 +02:00
mazzol_aandErik Fröjdh 6ff664f812 allow passing mask to clustervector (#304)
Build on RHEL9 / build (push) Successful in 2m24s
Build on RHEL8 / build (push) Successful in 2m54s
Run tests using data on local RHEL8 / build (push) Successful in 3m52s
Build on local RHEL8 / build (push) Successful in 2m34s
- passing mask to ClusterVector 
- creates a copy of the ClusterVector

Co-authored-by: Erik Fröjdh <erik.frojdh@psi.ch>
2026-04-17 17:13:02 +02:00
Erik Fröjdh 4875c31513 bumped pybind version, cmake fixes (#300)
Build on RHEL9 / build (push) Successful in 2m25s
Build on RHEL8 / build (push) Successful in 2m57s
Run tests using data on local RHEL8 / build (push) Successful in 3m37s
Build on local RHEL8 / build (push) Successful in 2m33s
- Bumped pybind11 version
- Bumped libfmt version
- Patch  Minuit to avoid messing around with CMake policy
2026-04-17 15:50:49 +02:00
lunin_l 8f8173feb6 CI/CD: Integrate pre-commit hooks and GitHub Actions workflow (#303)
Build on RHEL8 / build (push) Successful in 2m48s
Build on RHEL9 / build (push) Successful in 3m8s
Run tests using data on local RHEL8 / build (push) Successful in 3m34s
Build on local RHEL8 / build (push) Successful in 2m24s
To improve codebase quality and reduce human error, this PR introduces
the pre-commit framework. This ensures that all code adheres to project
standards before it is even committed, maintaining a consistent style
and catching common mistakes early.

Key Changes:

- Code Formatting: Automated C++ formatting using clang-format (based on
the project's .clang-format file).
- Syntax Validation: Basic checks for file integrity and syntax.
- Spell Check: Automated scanning for typos in source code and comments.
- CMake Formatting: Standardization of CMakeLists.txt and .cmake
configuration files.
- GitHub Workflow: Added a CI action that validates every Pull Request
against the pre-commit configuration to ensure compliance.

The configuration includes a [ci] block to handle automated fixes within
the PR. Currently, this is disabled. If we want the CI to automatically
commit formatting fixes back to the PR branch, this can be toggled to
true in .pre-commit-config.yaml.

```yaml
ci:
  autofix_commit_msg: [pre-commit] auto fixes from pre-commit hooks
  autofix_prs: false
  autoupdate_schedule: monthly
```

The last large commit with the fit functions, for example, was not
formatted according to the clang-format rules. This PR would allow to
avoid similar mistakes in the future.

Python fomat with `ruff` for tests and sanitiser for `.ipynb` notebooks
can be added as well.
2026-04-14 11:52:23 +02:00
kferjaoui 69151de3c7 Add in-kernel pedestal update, disable quadrant test
Build on RHEL8 / build (push) Successful in 2m48s
Build on RHEL9 / build (push) Successful in 3m4s
Run tests using data on local RHEL8 / build (push) Successful in 3m35s
- Non-photon pixels now update pedestal (push_fast equivalent)
  directly in the kernel, no atomics needed
- Commented out quadrant significance test (c2): absent from
  sequential CPU code, was producing GPU-only clusters.
- Added d_pd_sum to device allocations and host upload

Build (sm_89): 46 registers, 0 spills, 100% occupancy.

Verified on 256x256 Jungfrau data, 5000 frames, nSigma=5.0:
  CPU 8428 vs GPU 8471 clusters, 99.8% match
  0.63 ms/frame CPU vs 0.04 ms/frame GPU (~16x)
2026-04-13 11:28:03 +02:00