From 41bd4f84e5840b61c5754b565516526a8bfe5e8e Mon Sep 17 00:00:00 2001
From: beomki-yeo <beomki.yeo@gmail.com>
Date: Thu, 15 Aug 2024 16:39:17 +0200
Subject: [PATCH] Add a workflow for double precision build

---
 .github/workflows/builds.yml                  |   7 ++
 .../benchmarks/toy_detector_benchmark.hpp     |   2 +-
 .../traccc/finding/finding_algorithm.hpp      |   4 +-
 .../include/traccc/finding/finding_config.hpp |   6 +-
 .../traccc/seeding/detail/seeding_config.hpp  | 100 +++++++++---------
 .../traccc/cuda/finding/finding_algorithm.hpp |   4 +-
 .../include/traccc/options/track_finding.hpp  |   7 +-
 examples/options/src/track_finding.cpp        |  18 +---
 .../traccc/simulation/measurement_smearer.hpp |  18 ++--
 .../traccc/simulation/smearing_writer.hpp     |  40 +++----
 tests/common/tests/kalman_fitting_test.cpp    |   3 +-
 tests/cpu/compare_with_acts_seeding.cpp       |   2 +-
 .../cpu/test_ckf_sparse_tracks_telescope.cpp  |   4 +-
 tests/cpu/test_kalman_fitter_telescope.cpp    |   4 +-
 tests/cpu/test_kalman_fitter_wire_chamber.cpp |   5 +-
 tests/cpu/test_simulation.cpp                 |   4 +-
 tests/cpu/test_spacepoint_formation.cpp       |  12 +--
 tests/cuda/test_kalman_fitter_telescope.cpp   |   4 +-
 18 files changed, 118 insertions(+), 126 deletions(-)

diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml
index 04aea9d4c4..e178e5d5c1 100644
--- a/.github/workflows/builds.yml
+++ b/.github/workflows/builds.yml
@@ -58,6 +58,13 @@ jobs:
           - Release
           - Debug
         include:
+          - platform:
+              name: CUDA
+              container: ghcr.io/acts-project/ubuntu2404_cuda:56
+              cxx_standard: "20"
+              options: -DTRACCC_CUSTOM_SCALARTYPE=double -DDETRAY_CUSTOM_SCALARTYPE=double -DTRACCC_BUILD_CUDA=TRUE -DCMAKE_CUDA_FLAGS="-std=c++20"
+              run_tests: false
+            build: Release
           - platform:
               name: "SYCL"
               container: ghcr.io/acts-project/ubuntu2404_cuda_oneapi:56
diff --git a/benchmarks/common/benchmarks/toy_detector_benchmark.hpp b/benchmarks/common/benchmarks/toy_detector_benchmark.hpp
index f7f6f3b516..88e21d71d0 100644
--- a/benchmarks/common/benchmarks/toy_detector_benchmark.hpp
+++ b/benchmarks/common/benchmarks/toy_detector_benchmark.hpp
@@ -52,7 +52,7 @@ class ToyDetectorBenchmark : public benchmark::Fixture {
     traccc::seedfinder_config seeding_cfg;
     traccc::seedfilter_config filter_cfg;
     traccc::spacepoint_grid_config grid_cfg{seeding_cfg};
-    traccc::finding_config<float> finding_cfg;
+    traccc::finding_config finding_cfg;
     traccc::fitting_config fitting_cfg;
 
     static constexpr std::array<float, 2> phi_range{
diff --git a/core/include/traccc/finding/finding_algorithm.hpp b/core/include/traccc/finding/finding_algorithm.hpp
index a95cb7ae83..d61e7df701 100644
--- a/core/include/traccc/finding/finding_algorithm.hpp
+++ b/core/include/traccc/finding/finding_algorithm.hpp
@@ -72,7 +72,7 @@ class finding_algorithm
 
     public:
     /// Configuration type
-    using config_type = finding_config<scalar_type>;
+    using config_type = finding_config;
 
     /// Constructor for the finding algorithm
     ///
@@ -81,7 +81,7 @@ class finding_algorithm
     finding_algorithm(const config_type& cfg) : m_cfg(cfg) {}
 
     /// Get config object (const access)
-    const finding_config<scalar_type>& get_config() const { return m_cfg; }
+    const finding_config& get_config() const { return m_cfg; }
 
     /// Run the algorithm
     ///
diff --git a/core/include/traccc/finding/finding_config.hpp b/core/include/traccc/finding/finding_config.hpp
index f92884f0d7..1d33a666df 100644
--- a/core/include/traccc/finding/finding_config.hpp
+++ b/core/include/traccc/finding/finding_config.hpp
@@ -14,7 +14,6 @@
 namespace traccc {
 
 /// Configuration struct for track finding
-template <typename scalar_t>
 struct finding_config {
     /// Maxmimum number of branches per seed
     unsigned int max_num_branches_per_seed = 10;
@@ -32,13 +31,12 @@ struct finding_config {
     /// Minimum step length that track should make to reach the next surface. It
     /// should be set higher than the overstep tolerance not to make it stay on
     /// the same surface
-    scalar_t min_step_length_for_next_surface =
-        0.5f * detray::unit<scalar_t>::mm;
+    float min_step_length_for_next_surface = 0.5f * detray::unit<float>::mm;
     /// Maximum step counts that track can make to reach the next surface
     unsigned int max_step_counts_for_next_surface = 100;
 
     /// Maximum Chi-square that is allowed for branching
-    scalar_t chi2_max = 30.f;
+    float chi2_max = 30.f;
 
     /// Propagation configuration
     detray::propagation::config propagation{};
diff --git a/core/include/traccc/seeding/detail/seeding_config.hpp b/core/include/traccc/seeding/detail/seeding_config.hpp
index 3f7b49ebc5..f296cc222e 100644
--- a/core/include/traccc/seeding/detail/seeding_config.hpp
+++ b/core/include/traccc/seeding/detail/seeding_config.hpp
@@ -23,34 +23,34 @@ struct seedfinder_config {
     // without any spacepoints
     // m_config.zMin = -2800.;
     // m_config.zMax = 2800.;
-    scalar zMin = -1186 * unit<scalar>::mm;
-    scalar zMax = 1186 * unit<scalar>::mm;
-    scalar rMax = 200 * unit<scalar>::mm;
+    float zMin = -1186.f * unit<float>::mm;
+    float zMax = 1186.f * unit<float>::mm;
+    float rMax = 200.f * unit<float>::mm;
     // WARNING: if rMin is smaller than impactMax, the bin size will be 2*pi,
     // which will make seeding very slow!
-    scalar rMin = 33 * unit<scalar>::mm;
+    float rMin = 33.f * unit<float>::mm;
 
     // Geometry Settings
     // Detector ROI
     // limiting location of collision region in z
-    scalar collisionRegionMin = -250 * unit<scalar>::mm;
-    scalar collisionRegionMax = +250 * unit<scalar>::mm;
-    scalar phiMin = static_cast<scalar>(-M_PI);
-    scalar phiMax = static_cast<scalar>(M_PI);
+    float collisionRegionMin = -250 * unit<float>::mm;
+    float collisionRegionMax = +250 * unit<float>::mm;
+    float phiMin = static_cast<float>(-M_PI);
+    float phiMax = static_cast<float>(M_PI);
 
     // Seed Cuts
     // lower cutoff for seeds in MeV
-    scalar minPt = 500.f * unit<scalar>::MeV;
+    float minPt = 500.f * unit<float>::MeV;
     // cot of maximum theta angle
     // equivalent to 2.7 eta (pseudorapidity)
-    scalar cotThetaMax = 7.40627f;
+    float cotThetaMax = 7.40627f;
     // minimum distance in mm in r between two measurements within one seed
-    scalar deltaRMin = 1 * unit<scalar>::mm;
+    float deltaRMin = 1 * unit<float>::mm;
     // maximum distance in mm in r between two measurements within one seed
-    scalar deltaRMax = 60 * unit<scalar>::mm;
+    float deltaRMax = 60 * unit<float>::mm;
 
     // FIXME: this is not used yet
-    //        scalar upperPtResolutionPerSeed = 20* Acts::GeV;
+    //        float upperPtResolutionPerSeed = 20* Acts::GeV;
 
     // the delta for inverse helix radius up to which compared seeds
     // are considered to have a compatible radius. delta of inverse radius
@@ -59,43 +59,43 @@ struct seedfinder_config {
     // compatible
 
     // impact parameter in mm
-    scalar impactMax = 10. * unit<scalar>::mm;
+    float impactMax = 10. * unit<float>::mm;
     // how many sigmas of scattering angle should be considered?
-    scalar sigmaScattering = 1.0;
+    float sigmaScattering = 1.0;
     // Upper pt limit for scattering calculation
-    scalar maxPtScattering = 10 * unit<scalar>::GeV;
+    float maxPtScattering = 10 * unit<float>::GeV;
 
     // for how many seeds can one SpacePoint be the middle SpacePoint?
     int maxSeedsPerSpM = 20;
 
-    scalar bFieldInZ = 1.99724f * unit<scalar>::T;
+    float bFieldInZ = 1.99724f * unit<float>::T;
     // location of beam in x,y plane.
     // used as offset for Space Points
-    vector2 beamPos{-.0 * unit<scalar>::mm, -.0 * unit<scalar>::mm};
+    vector2 beamPos{-.0 * unit<float>::mm, -.0 * unit<float>::mm};
 
     // average radiation lengths of material on the length of a seed. used for
     // scattering.
     // default is 5%
     // TODO: necessary to make amount of material dependent on detector region?
-    scalar radLengthPerSeed = 0.05f;
+    float radLengthPerSeed = 0.05f;
     // alignment uncertainties, used for uncertainties in the
     // non-measurement-plane of the modules
     // which otherwise would be 0
     // will be added to spacepoint measurement uncertainties (and therefore also
     // multiplied by sigmaError)
     // FIXME: call align1 and align2
-    scalar zAlign = 0 * unit<scalar>::mm;
-    scalar rAlign = 0 * unit<scalar>::mm;
+    float zAlign = 0 * unit<float>::mm;
+    float rAlign = 0 * unit<float>::mm;
     // used for measurement (+alignment) uncertainties.
     // find seeds within 5sigma error ellipse
-    scalar sigmaError = 5;
+    float sigmaError = 5;
 
     // derived values, set on Seedfinder construction
-    scalar highland = 0;
-    scalar maxScatteringAngle2 = 0;
-    scalar pTPerHelixRadius = 0;
-    scalar minHelixDiameter2 = 0;
-    scalar pT2perRadius = 0;
+    float highland = 0;
+    float maxScatteringAngle2 = 0;
+    float pTPerHelixRadius = 0;
+    float minHelixDiameter2 = 0;
+    float pT2perRadius = 0;
 
     // Multiplicator for the number of phi-bins. The minimum number of phi-bins
     // depends on min_pt, magnetic field: 2*M_PI/(minPT particle
@@ -121,11 +121,11 @@ struct seedfinder_config {
     // Configure unset parameters
     TRACCC_HOST_DEVICE
     void setup() {
-        highland = 13.6f * traccc::unit<traccc::scalar>::MeV *
+        highland = 13.6f * traccc::unit<float>::MeV *
                    std::sqrt(radLengthPerSeed) *
                    (1.f + 0.038f * std::log(radLengthPerSeed));
 
-        scalar maxScatteringAngle = highland / minPt;
+        float maxScatteringAngle = highland / minPt;
         maxScatteringAngle2 = maxScatteringAngle * maxScatteringAngle;
 
         pTPerHelixRadius = bFieldInZ;
@@ -155,29 +155,29 @@ struct spacepoint_grid_config {
           phiBinDeflectionCoverage(finder_config.phiBinDeflectionCoverage) {}
 
     // magnetic field in kTesla
-    scalar bFieldInZ;
+    float bFieldInZ;
     // minimum pT to be found by seedfinder in MeV
-    scalar minPt;
+    float minPt;
     // maximum extension of sensitive detector layer relevant for seeding as
     // distance from x=y=0 (i.e. in r) in mm
-    scalar rMax;
+    float rMax;
     // maximum extension of sensitive detector layer relevant for seeding in
     // positive direction in z in mm
-    scalar zMax;
+    float zMax;
     // maximum extension of sensitive detector layer relevant for seeding in
     // negative direction in z in mm
-    scalar zMin;
+    float zMin;
     // maximum distance in r from middle space point to bottom or top spacepoint
     // in mm
-    scalar deltaRMax;
+    float deltaRMax;
     // maximum forward direction expressed as cot(theta)
-    scalar cotThetaMax;
+    float cotThetaMax;
     // impact parameter in mm
-    scalar impactMax;
+    float impactMax;
     // minimum phi value for phiAxis construction
-    scalar phiMin = static_cast<scalar>(-M_PI);
+    float phiMin = static_cast<float>(-M_PI);
     // maximum phi value for phiAxis construction
-    scalar phiMax = static_cast<scalar>(M_PI);
+    float phiMax = static_cast<float>(M_PI);
     // Multiplicator for the number of phi-bins. The minimum number of phi-bins
     // depends on min_pt, magnetic field: 2*M_PI/(minPT particle
     // phi-deflection). phiBinDeflectionCoverage is a multiplier for this
@@ -190,15 +190,15 @@ struct spacepoint_grid_config {
 struct seedfilter_config {
     // the allowed delta between two inverted seed radii for them to be
     // considered compatible.
-    scalar deltaInvHelixDiameter = 0.00003f / unit<scalar>::mm;
+    float deltaInvHelixDiameter = 0.00003f / unit<float>::mm;
     // the impact parameters (d0) is multiplied by this factor and subtracted
     // from weight
-    scalar impactWeightFactor = 1.f;
+    float impactWeightFactor = 1.f;
     // seed weight increased by this value if a compatible seed has been found.
-    scalar compatSeedWeight = 200.f;
+    float compatSeedWeight = 200.f;
     // minimum distance between compatible seeds to be considered for weight
     // boost
-    scalar deltaRMin = 5.f * unit<scalar>::mm;
+    float deltaRMin = 5.f * unit<float>::mm;
     // in dense environments many seeds may be found per middle space point.
     // only seeds with the highest weight will be kept if this limit is reached.
     unsigned int maxSeedsPerSpM = 20;
@@ -210,17 +210,17 @@ struct seedfilter_config {
     size_t max_triplets_per_spM = 5;
 
     // seed weight increase
-    scalar good_spB_min_radius = 150.f * unit<scalar>::mm;
-    scalar good_spB_weight_increase = 400.f;
-    scalar good_spT_max_radius = 150.f * unit<scalar>::mm;
-    scalar good_spT_weight_increase = 200.f;
+    float good_spB_min_radius = 150.f * unit<float>::mm;
+    float good_spB_weight_increase = 400.f;
+    float good_spT_max_radius = 150.f * unit<float>::mm;
+    float good_spT_weight_increase = 200.f;
 
     // bottom sp cut
-    scalar good_spB_min_weight = 380.f;
+    float good_spB_min_weight = 380.f;
 
     // seed cut
-    scalar seed_min_weight = 200.f;
-    scalar spB_min_radius = 43.f * unit<scalar>::mm;
+    float seed_min_weight = 200.f;
+    float spB_min_radius = 43.f * unit<float>::mm;
 };
 
 }  // namespace traccc
diff --git a/device/cuda/include/traccc/cuda/finding/finding_algorithm.hpp b/device/cuda/include/traccc/cuda/finding/finding_algorithm.hpp
index b048a04c36..0e250fff2f 100644
--- a/device/cuda/include/traccc/cuda/finding/finding_algorithm.hpp
+++ b/device/cuda/include/traccc/cuda/finding/finding_algorithm.hpp
@@ -73,7 +73,7 @@ class finding_algorithm
 
     public:
     /// Configuration type
-    using config_type = finding_config<scalar_type>;
+    using config_type = finding_config;
 
     /// Constructor for the finding algorithm
     ///
@@ -85,7 +85,7 @@ class finding_algorithm
                       vecmem::copy& copy, stream& str);
 
     /// Get config object (const access)
-    const finding_config<scalar_type>& get_config() const { return m_cfg; }
+    const finding_config& get_config() const { return m_cfg; }
 
     /// Run the algorithm
     ///
diff --git a/examples/options/include/traccc/options/track_finding.hpp b/examples/options/include/traccc/options/track_finding.hpp
index a0dbc1ebd8..03b2835836 100644
--- a/examples/options/include/traccc/options/track_finding.hpp
+++ b/examples/options/include/traccc/options/track_finding.hpp
@@ -22,17 +22,14 @@
 namespace traccc::opts {
 
 /// Configuration for track finding
-class track_finding : public interface,
-                      public config_provider<finding_config<float>>,
-                      public config_provider<finding_config<double>> {
+class track_finding : public interface, public config_provider<finding_config> {
 
     public:
     /// Constructor
     track_finding();
 
     /// Configuration conversion operators
-    operator finding_config<float>() const override;
-    operator finding_config<double>() const override;
+    operator finding_config() const override;
 
     private:
     /// @name Options
diff --git a/examples/options/src/track_finding.cpp b/examples/options/src/track_finding.cpp
index 468a81c941..98b8c5bac0 100644
--- a/examples/options/src/track_finding.cpp
+++ b/examples/options/src/track_finding.cpp
@@ -58,22 +58,8 @@ track_finding::track_finding() : interface("Track Finding Options") {
         "Maximum allowed number of skipped steps per candidate");
 }
 
-track_finding::operator finding_config<float>() const {
-    finding_config<float> out;
-    out.max_num_branches_per_seed = max_num_branches_per_seed;
-    out.max_num_branches_per_surface = max_num_branches_per_surface;
-    out.min_track_candidates_per_track = track_candidates_range[0];
-    out.max_track_candidates_per_track = track_candidates_range[1];
-    out.min_step_length_for_next_surface = min_step_length_for_next_surface;
-    out.max_step_counts_for_next_surface = max_step_counts_for_next_surface;
-    out.chi2_max = chi2_max;
-    out.max_num_branches_per_seed = nmax_per_seed;
-    out.max_num_skipping_per_cand = max_num_skipping_per_cand;
-    return out;
-}
-
-track_finding::operator finding_config<double>() const {
-    finding_config<double> out;
+track_finding::operator finding_config() const {
+    finding_config out;
     out.max_num_branches_per_seed = max_num_branches_per_seed;
     out.max_num_branches_per_surface = max_num_branches_per_surface;
     out.min_track_candidates_per_track = track_candidates_range[0];
diff --git a/simulation/include/traccc/simulation/measurement_smearer.hpp b/simulation/include/traccc/simulation/measurement_smearer.hpp
index f6cd926d82..26465f72d9 100644
--- a/simulation/include/traccc/simulation/measurement_smearer.hpp
+++ b/simulation/include/traccc/simulation/measurement_smearer.hpp
@@ -96,24 +96,26 @@ struct measurement_smearer {
             if constexpr (std::is_same_v<
                               typename mask_t::local_frame_type,
                               detray::line2D<traccc::default_algebra>>) {
-                iomeas.local0 =
+                iomeas.local0 = static_cast<float>(
                     std::max(std::abs(matrix_operator().element(meas, 0u, 0u)) +
                                  offset[0],
-                             static_cast<scalar_type>(0.f));
+                             scalar_type(0.f)));
             } else if constexpr (std::is_same_v<typename mask_t::shape,
                                                 detray::annulus2D>) {
-                iomeas.local1 =
-                    matrix_operator().element(meas, 0u, 0u) + offset[0];
+                iomeas.local1 = static_cast<float>(
+                    matrix_operator().element(meas, 0u, 0u) + offset[0]);
             } else {
-                iomeas.local0 =
-                    matrix_operator().element(meas, 0u, 0u) + offset[0];
+                iomeas.local0 = static_cast<float>(
+                    matrix_operator().element(meas, 0u, 0u) + offset[0]);
             }
         } else if (meas_dim == 2u) {
             const auto proj = subs.projector<2u>();
             matrix_type<2u, 1u> meas = proj * bound_params.vector();
 
-            iomeas.local0 = matrix_operator().element(meas, 0u, 0u) + offset[0];
-            iomeas.local1 = matrix_operator().element(meas, 1u, 0u) + offset[1];
+            iomeas.local0 = static_cast<float>(
+                matrix_operator().element(meas, 0u, 0u) + offset[0]);
+            iomeas.local1 = static_cast<float>(
+                matrix_operator().element(meas, 1u, 0u) + offset[1]);
         }
 
         return;
diff --git a/simulation/include/traccc/simulation/smearing_writer.hpp b/simulation/include/traccc/simulation/smearing_writer.hpp
index 5aaeb6fa2c..89f4722f55 100644
--- a/simulation/include/traccc/simulation/smearing_writer.hpp
+++ b/simulation/include/traccc/simulation/smearing_writer.hpp
@@ -74,14 +74,14 @@ struct smearing_writer : detray::actor {
             const auto mom = track.mom();
 
             particle.particle_id = particle_id;
-            particle.vx = pos[0];
-            particle.vy = pos[1];
-            particle.vz = pos[2];
-            particle.vt = track.time();
-            particle.px = mom[0];
-            particle.py = mom[1];
-            particle.pz = mom[2];
-            particle.q = track.charge();
+            particle.vx = static_cast<float>(pos[0]);
+            particle.vy = static_cast<float>(pos[1]);
+            particle.vz = static_cast<float>(pos[2]);
+            particle.vt = static_cast<float>(track.time());
+            particle.px = static_cast<float>(mom[0]);
+            particle.py = static_cast<float>(mom[1]);
+            particle.pz = static_cast<float>(mom[2]);
+            particle.q = static_cast<float>(track.charge());
 
             m_particle_writer.append(particle);
         }
@@ -122,13 +122,13 @@ struct smearing_writer : detray::actor {
 
             hit.particle_id = writer_state.particle_id;
             hit.geometry_id = sf.barcode().value();
-            hit.tx = pos[0];
-            hit.ty = pos[1];
-            hit.tz = pos[2];
-            hit.tt = track.time();
-            hit.tpx = mom[0];
-            hit.tpy = mom[1];
-            hit.tpz = mom[2];
+            hit.tx = static_cast<float>(pos[0]);
+            hit.ty = static_cast<float>(pos[1]);
+            hit.tz = static_cast<float>(pos[2]);
+            hit.tt = static_cast<float>(track.time());
+            hit.tpx = static_cast<float>(mom[0]);
+            hit.tpy = static_cast<float>(mom[1]);
+            hit.tpz = static_cast<float>(mom[2]);
 
             writer_state.m_hit_writer.append(hit);
 
@@ -140,11 +140,11 @@ struct smearing_writer : detray::actor {
             meas.geometry_id = hit.geometry_id;
             auto stddev_0 = writer_state.m_meas_smearer.stddev[0];
             auto stddev_1 = writer_state.m_meas_smearer.stddev[1];
-            meas.var_local0 = stddev_0 * stddev_0;
-            meas.var_local1 = stddev_1 * stddev_1;
-            meas.phi = bound_params.phi();
-            meas.theta = bound_params.theta();
-            meas.time = bound_params.time();
+            meas.var_local0 = static_cast<float>(stddev_0 * stddev_0);
+            meas.var_local1 = static_cast<float>(stddev_1 * stddev_1);
+            meas.phi = static_cast<float>(bound_params.phi());
+            meas.theta = static_cast<float>(bound_params.theta());
+            meas.time = static_cast<float>(bound_params.time());
 
             // Set local_key and smeared_local
             sf.template visit_mask<measurement_kernel>(
diff --git a/tests/common/tests/kalman_fitting_test.cpp b/tests/common/tests/kalman_fitting_test.cpp
index 5a0359e410..ef1bb97d43 100644
--- a/tests/common/tests/kalman_fitting_test.cpp
+++ b/tests/common/tests/kalman_fitting_test.cpp
@@ -99,7 +99,8 @@ void KalmanFittingTests::ndf_tests(
 
     // Check if the number of degree of freedoms is equal to (the sum of
     // measurement dimensions - 5)
-    ASSERT_FLOAT_EQ(fit_res.ndf, dim_sum - 5.f);
+    ASSERT_FLOAT_EQ(static_cast<float>(fit_res.ndf),
+                    static_cast<float>(dim_sum) - 5.f);
 
     // The number of track states is supposed to be eqaul to the number
     // of measurements unless KF failes in the middle of propagation
diff --git a/tests/cpu/compare_with_acts_seeding.cpp b/tests/cpu/compare_with_acts_seeding.cpp
index dfca45c448..9b041a40a9 100644
--- a/tests/cpu/compare_with_acts_seeding.cpp
+++ b/tests/cpu/compare_with_acts_seeding.cpp
@@ -142,7 +142,7 @@ TEST_P(CompareWithActsSeedingTests, Run) {
     acts_config.rMin = traccc_config.rMin;
     acts_config.rMax = traccc_config.rMax;
     acts_config.rMinMiddle = 0.f;
-    acts_config.rMaxMiddle = std::numeric_limits<traccc::scalar>::max();
+    acts_config.rMaxMiddle = std::numeric_limits<float>::max();
     acts_config.deltaRMin = traccc_config.deltaRMin;
     acts_config.deltaRMinTopSP = traccc_config.deltaRMin;
     acts_config.deltaRMinBottomSP = traccc_config.deltaRMin;
diff --git a/tests/cpu/test_ckf_sparse_tracks_telescope.cpp b/tests/cpu/test_ckf_sparse_tracks_telescope.cpp
index d4ed7e683c..102c302f5a 100644
--- a/tests/cpu/test_ckf_sparse_tracks_telescope.cpp
+++ b/tests/cpu/test_ckf_sparse_tracks_telescope.cpp
@@ -191,8 +191,8 @@ TEST_P(CkfSparseTrackTelescopeTests, Run) {
      * Success rate test
      ********************/
 
-    scalar success_rate =
-        static_cast<scalar>(n_success) / (n_truth_tracks * n_events);
+    float success_rate =
+        static_cast<float>(n_success) / (n_truth_tracks * n_events);
 
     ASSERT_FLOAT_EQ(success_rate, 1.00f);
 }
diff --git a/tests/cpu/test_kalman_fitter_telescope.cpp b/tests/cpu/test_kalman_fitter_telescope.cpp
index 39c508ef61..05eb98a9d4 100644
--- a/tests/cpu/test_kalman_fitter_telescope.cpp
+++ b/tests/cpu/test_kalman_fitter_telescope.cpp
@@ -165,8 +165,8 @@ TEST_P(KalmanFittingTelescopeTests, Run) {
      * Success rate test
      ********************/
 
-    scalar success_rate =
-        static_cast<scalar>(n_success) / (n_truth_tracks * n_events);
+    float success_rate =
+        static_cast<float>(n_success) / (n_truth_tracks * n_events);
 
     ASSERT_FLOAT_EQ(success_rate, 1.00f);
 }
diff --git a/tests/cpu/test_kalman_fitter_wire_chamber.cpp b/tests/cpu/test_kalman_fitter_wire_chamber.cpp
index 9fc1890fa4..642a0b93f5 100644
--- a/tests/cpu/test_kalman_fitter_wire_chamber.cpp
+++ b/tests/cpu/test_kalman_fitter_wire_chamber.cpp
@@ -104,7 +104,7 @@ TEST_P(KalmanFittingWireChamberTests, Run) {
     // Set constrained step size to 1 mm
     sim.get_config().propagation.stepping.step_constraint = step_constraint;
     sim.get_config().propagation.navigation.min_mask_tolerance =
-        25.f * detray::unit<scalar>::um;
+        25.f * detray::unit<float>::um;
     sim.get_config().propagation.navigation.search_window = search_window;
 
     sim.run();
@@ -118,7 +118,8 @@ TEST_P(KalmanFittingWireChamberTests, Run) {
 
     // Fitting algorithm object
     typename traccc::fitting_algorithm<host_fitter_type>::config_type fit_cfg;
-    fit_cfg.propagation.navigation.min_mask_tolerance = mask_tolerance;
+    fit_cfg.propagation.navigation.min_mask_tolerance =
+        static_cast<float>(mask_tolerance);
     fit_cfg.propagation.navigation.search_window = search_window;
     fitting_algorithm<host_fitter_type> fitting(fit_cfg);
 
diff --git a/tests/cpu/test_simulation.cpp b/tests/cpu/test_simulation.cpp
index db9f2a65c1..4025965b2f 100644
--- a/tests/cpu/test_simulation.cpp
+++ b/tests/cpu/test_simulation.cpp
@@ -116,7 +116,7 @@ GTEST_TEST(traccc_simulation, toy_detector_simulation) {
 
     // Lift step size constraints
     sim.get_config().propagation.stepping.step_constraint =
-        std::numeric_limits<scalar>::max();
+        std::numeric_limits<float>::max();
     sim.get_config().propagation.navigation.search_window = {3u, 3u};
 
     // Do the simulation
@@ -269,7 +269,7 @@ TEST_P(TelescopeDetectorSimulation, telescope_detector_simulation) {
 
     // Lift step size constraints
     sim.get_config().propagation.stepping.step_constraint =
-        std::numeric_limits<scalar>::max();
+        std::numeric_limits<float>::max();
 
     // Run simulation
     sim.run();
diff --git a/tests/cpu/test_spacepoint_formation.cpp b/tests/cpu/test_spacepoint_formation.cpp
index e92aa01ce1..b7aade5b6f 100644
--- a/tests/cpu/test_spacepoint_formation.cpp
+++ b/tests/cpu/test_spacepoint_formation.cpp
@@ -65,10 +65,10 @@ TEST(spacepoint_formation, cpu) {
 
     // Check the results
     EXPECT_EQ(spacepoints.size(), 2u);
-    EXPECT_FLOAT_EQ(spacepoints[0].global[0], 20.f);
-    EXPECT_FLOAT_EQ(spacepoints[0].global[1], 7.f);
-    EXPECT_FLOAT_EQ(spacepoints[0].global[2], 2.f);
-    EXPECT_FLOAT_EQ(spacepoints[1].global[0], 180.f);
-    EXPECT_FLOAT_EQ(spacepoints[1].global[1], 10.f);
-    EXPECT_FLOAT_EQ(spacepoints[1].global[2], 15.f);
+    EXPECT_FLOAT_EQ(static_cast<float>(spacepoints[0].global[0]), 20.f);
+    EXPECT_FLOAT_EQ(static_cast<float>(spacepoints[0].global[1]), 7.f);
+    EXPECT_FLOAT_EQ(static_cast<float>(spacepoints[0].global[2]), 2.f);
+    EXPECT_FLOAT_EQ(static_cast<float>(spacepoints[1].global[0]), 180.f);
+    EXPECT_FLOAT_EQ(static_cast<float>(spacepoints[1].global[1]), 10.f);
+    EXPECT_FLOAT_EQ(static_cast<float>(spacepoints[1].global[2]), 15.f);
 }
diff --git a/tests/cuda/test_kalman_fitter_telescope.cpp b/tests/cuda/test_kalman_fitter_telescope.cpp
index 2c9fe5f4f3..30a4395fcb 100644
--- a/tests/cuda/test_kalman_fitter_telescope.cpp
+++ b/tests/cuda/test_kalman_fitter_telescope.cpp
@@ -210,8 +210,8 @@ TEST_P(KalmanFittingTelescopeTests, Run) {
      * Success rate test
      ********************/
 
-    scalar success_rate =
-        static_cast<scalar>(n_success) / (n_truth_tracks * n_events);
+    float success_rate =
+        static_cast<float>(n_success) / (n_truth_tracks * n_events);
 
     ASSERT_FLOAT_EQ(success_rate, 1.00f);
 }