From 31f7a8bbac64ad1e5063a9d50a547ef5da946817 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 23 Jul 2026 14:13:17 -0500 Subject: [PATCH 1/2] fix(quality): resolve SonarQube S3490 and S1186 critical findings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit S3490 — Use =default for empty special member functions (no behavior change): - cuts.hpp: mixed_integer_gomory_cut_t() = default - internals.hpp: virtual ~Callback() = default - initial_problem_check.hpp: violation() = default - waypoint_matrix_test.cpp: three test class default constructors S1186 — Add /* no-op */ comment to intentionally empty overrides: - branch_and_bound.cpp: on_node_completed, on_numerical_issue, graphviz, on_optimal_callback, update_objective_estimate - deterministic_workers.hpp: collect_worker_events - waypoint_matrix_test.cpp: TearDown (×3) - grpc_client_test.cpp: WaitForInitialMetadata Signed-off-by: Ramakrishna Prabhu --- .../cuopt/initial_problem_check.hpp | 2 +- .../utilities/internals.hpp | 2 +- cpp/src/branch_and_bound/branch_and_bound.cpp | 12 +++++++----- cpp/src/branch_and_bound/deterministic_workers.hpp | 2 +- cpp/src/cuts/cuts.hpp | 2 +- cpp/tests/distance_engine/waypoint_matrix_test.cpp | 12 ++++++------ .../linear_programming/grpc/grpc_client_test.cpp | 2 +- 7 files changed, 18 insertions(+), 16 deletions(-) diff --git a/benchmarks/linear_programming/cuopt/initial_problem_check.hpp b/benchmarks/linear_programming/cuopt/initial_problem_check.hpp index a90a6f2bc6..44071229e6 100644 --- a/benchmarks/linear_programming/cuopt/initial_problem_check.hpp +++ b/benchmarks/linear_programming/cuopt/initial_problem_check.hpp @@ -16,7 +16,7 @@ double combine_finite_abs_bounds(f_t lower, f_t upper) template struct violation { - violation() {} + violation() = default; violation(f_t* _scalar) {} __device__ __host__ f_t operator()(f_t value, f_t lower, f_t upper) { diff --git a/cpp/include/cuopt/mathematical_optimization/utilities/internals.hpp b/cpp/include/cuopt/mathematical_optimization/utilities/internals.hpp index aaec8ef842..25f3f34f7b 100644 --- a/cpp/include/cuopt/mathematical_optimization/utilities/internals.hpp +++ b/cpp/include/cuopt/mathematical_optimization/utilities/internals.hpp @@ -18,7 +18,7 @@ namespace internals { class Callback { public: - virtual ~Callback() {} + virtual ~Callback() = default; }; enum class base_solution_callback_type { GET_SOLUTION, SET_SOLUTION }; diff --git a/cpp/src/branch_and_bound/branch_and_bound.cpp b/cpp/src/branch_and_bound/branch_and_bound.cpp index e4ce4dfd7b..6fd30c86fb 100644 --- a/cpp/src/branch_and_bound/branch_and_bound.cpp +++ b/cpp/src/branch_and_bound/branch_and_bound.cpp @@ -1021,7 +1021,8 @@ struct nondeterministic_policy_t : tree_update_policy_t { } } - void on_node_completed(mip_node_t*, node_status_t, branch_direction_t) override {} + void on_node_completed(mip_node_t*, node_status_t, branch_direction_t) override + { /* no-op */ } }; template @@ -1049,9 +1050,10 @@ struct deterministic_policy_base_t : tree_update_policy_t { } } - void on_numerical_issue(mip_node_t*) override {} - void graphviz(search_tree_t&, mip_node_t*, const char*, f_t) override {} - void on_optimal_callback(const std::vector&, f_t) override {} + void on_numerical_issue(mip_node_t*) override { /* no-op */ } + void graphviz(search_tree_t&, mip_node_t*, const char*, f_t) override + { /* no-op */ } + void on_optimal_callback(const std::vector&, f_t) override { /* no-op */ } }; template @@ -1195,7 +1197,7 @@ struct deterministic_diving_policy_t void update_objective_estimate(mip_node_t* node, const std::vector& fractional, const std::vector& x) override - { + { /* no-op */ } void on_node_completed(mip_node_t* node, diff --git a/cpp/src/branch_and_bound/deterministic_workers.hpp b/cpp/src/branch_and_bound/deterministic_workers.hpp index 60d3436401..6753ad6e68 100644 --- a/cpp/src/branch_and_bound/deterministic_workers.hpp +++ b/cpp/src/branch_and_bound/deterministic_workers.hpp @@ -453,7 +453,7 @@ class deterministic_diving_worker_pool_t } void collect_worker_events(deterministic_diving_worker_t&, bb_event_batch_t&) - { + { /* no-op */ } }; diff --git a/cpp/src/cuts/cuts.hpp b/cpp/src/cuts/cuts.hpp index a302be2f3b..78091c85f6 100644 --- a/cpp/src/cuts/cuts.hpp +++ b/cpp/src/cuts/cuts.hpp @@ -794,7 +794,7 @@ class scratch_pad_t { template class mixed_integer_gomory_cut_t { public: - mixed_integer_gomory_cut_t() {} + mixed_integer_gomory_cut_t() = default; }; template diff --git a/cpp/tests/distance_engine/waypoint_matrix_test.cpp b/cpp/tests/distance_engine/waypoint_matrix_test.cpp index 2db3953c2f..88d4c53229 100644 --- a/cpp/tests/distance_engine/waypoint_matrix_test.cpp +++ b/cpp/tests/distance_engine/waypoint_matrix_test.cpp @@ -22,7 +22,7 @@ class waypoint_matrix_waypoints_sequence_test_t public ::testing::TestWithParam< waypoint_matrix_params_t, i_t, f_t>> { public: - waypoint_matrix_waypoints_sequence_test_t() {} + waypoint_matrix_waypoints_sequence_test_t() = default; void SetUp() override { @@ -44,7 +44,7 @@ class waypoint_matrix_waypoints_sequence_test_t this->expected_sequence_offsets = param.sequence_offsets; } - void TearDown() override {} + void TearDown() override { /* no-op */ } void test_compute_waypoint_sequence() { @@ -111,7 +111,7 @@ class waypoint_matrix_shortest_path_cost_t public ::testing::TestWithParam< waypoint_matrix_params_t, i_t, f_t>> { public: - waypoint_matrix_shortest_path_cost_t() {} + waypoint_matrix_shortest_path_cost_t() = default; void SetUp() override { @@ -131,7 +131,7 @@ class waypoint_matrix_shortest_path_cost_t this->weights.data()); } - void TearDown() override {} + void TearDown() override { /* no-op */ } void test_compute_shortest_path_costs() { @@ -173,7 +173,7 @@ class waypoint_matrix_cost_matrix_test_t : public base_test_t, public ::testing::TestWithParam, i_t, f_t>> { public: - waypoint_matrix_cost_matrix_test_t() {} + waypoint_matrix_cost_matrix_test_t() = default; void SetUp() override { @@ -192,7 +192,7 @@ class waypoint_matrix_cost_matrix_test_t this->weights.data()); } - void TearDown() override {} + void TearDown() override { /* no-op */ } void test_compute_cost_matrix() { diff --git a/cpp/tests/linear_programming/grpc/grpc_client_test.cpp b/cpp/tests/linear_programming/grpc/grpc_client_test.cpp index e468cef694..3f2dae038d 100644 --- a/cpp/tests/linear_programming/grpc/grpc_client_test.cpp +++ b/cpp/tests/linear_programming/grpc/grpc_client_test.cpp @@ -1460,7 +1460,7 @@ class MockLogStream : public grpc::ClientReaderInterface messages_; From 1dbe5c2c011a1450fcfa64f979a8fceef0b8e5c0 Mon Sep 17 00:00:00 2001 From: Max Buckley Date: Thu, 23 Jul 2026 10:46:57 +0200 Subject: [PATCH 2/2] fix(build): use rmm's device_uvector declaration, not a hand-rolled forward decl As of rmm 26.10, rmm::device_uvector is defined inside the ABI inline namespace rmm::RMM_ABI_NAMESPACE (rmm/detail/export.hpp). cuOpt's manual namespace rmm { template class device_uvector; } forward declaration in problem_checking.cuh injects a *second*, distinct rmm::device_uvector into the plain rmm namespace, so every use becomes ambiguous ('rmm::device_uvector is ambiguous'), which fails the build against rmm 26.10. Replace the hand-rolled forward declaration with #include so the correctly ABI-namespaced declaration is used. (cuOpt already disables the analogous thrust/cub ABI namespaces via -DTHRUST_DISABLE_ABI_NAMESPACE / -DCUB_DISABLE_NAMESPACE_MAGIC; rmm's ABI namespace is newer and has no such opt-out.) Co-Authored-By: Claude Opus 4.8 (1M context) Signed-off-by: Max Buckley --- cpp/src/pdlp/utilities/problem_checking.cuh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cpp/src/pdlp/utilities/problem_checking.cuh b/cpp/src/pdlp/utilities/problem_checking.cuh index 217080356c..5dc74808a2 100644 --- a/cpp/src/pdlp/utilities/problem_checking.cuh +++ b/cpp/src/pdlp/utilities/problem_checking.cuh @@ -10,10 +10,7 @@ #include #include -namespace rmm { -template -class device_uvector; -} // namespace rmm +#include namespace cuopt::mathematical_optimization {