Refactor: mathematical_optimization namespace#1446
Conversation
Mechanical rename of the umbrella namespace and public include path (include/cuopt/linear_programming -> include/cuopt/math_optimization). No structural or behavioral change. Python package cuopt.linear_programming intentionally unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Miles Lubin <mlubin@nvidia.com>
Out of the overloaded ::detail namespace; folds pdlp_hyper_params in. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Miles Lubin <mlubin@nvidia.com>
Out of dual_simplex; barrier now owns its own cusparse_view_t cleanly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Miles Lubin <mlubin@nvidia.com>
'1' and 'best_results.txt' are solver/benchmark stdout captures that a broad 'git add -A' swept into the umbrella-rename commit. Not source. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Miles Lubin <mlubin@nvidia.com>
Branch-and-bound, cuts, and heuristics were split across ::dual_simplex and ::detail; unify them in one ::mip namespace. The shared problem_t representation (used by pdlp/barrier too) moves to ::mip as well. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Miles Lubin <mlubin@nvidia.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Miles Lubin <mlubin@nvidia.com>
Generic GPU helpers moved to the cuopt namespace; module-specific helpers into their module namespace; file-local helpers into anonymous namespaces. detail no longer used for organization (routing's cuopt::detail and the third-party cxxopts detail are unrelated and untouched). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Miles Lubin <mlubin@nvidia.com>
The C API is unchanged (same symbols, C linkage); only its header path moved to <cuopt/math_optimization/cuopt_c.h>. Add a forwarding shim at the legacy path (with a deprecation #pragma message) so existing C/C++ consumers keep compiling. Installs via the existing include/cuopt/ directory rule. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Miles Lubin <mlubin@nvidia.com>
|
/ok to test 57a51ee |
Kh4ster
left a comment
There was a problem hiding this comment.
No problem on the pdlp side, thanks for the cleaning up!
The namespace holds a full simplex solver -- primal and dual algorithms plus shared basis/LU/crossover infrastructure -- so 'simplex' is accurate. Namespace only; the src/dual_simplex/ directory and include paths are unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Miles Lubin <mlubin@nvidia.com>
|
/ok to test 59336da |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis PR retargets cuOpt optimization namespaces, includes, and public APIs from linear-programming paths to mathematical-optimization paths. It adds a new C ABI header, preserves the legacy C ABI path as a forwarding header, and updates simplex, barrier, branch-and-bound, cuts, MIP heuristics, PDLP, I/O, gRPC, CLI, benchmarks, and runtime wiring. Changes
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 9
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
cpp/include/cuopt/math_optimization/solve.hpp (1)
61-74:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winRefresh the stale Doxygen parameter descriptions.
These overloads now take
io::mps_data_model_t;batch_pdlp_solveno longer has auser_problemparameter, and the MIP overload should not describe its input as a linear-programoptimization_problem_t.Proposed documentation fix
- * `@param`[in] mps_data_model An optimization_problem_t<i_t, f_t> object with a + * `@param`[in] mps_data_model An io::mps_data_model_t<i_t, f_t> object with a * representation of a linear program ... - * `@param`[in] user_problem A simplex::user_problem_t<i_t, f_t> object with a - * representation of a linear program. + * `@param`[in] handle_ptr A raft::handle_t object with its corresponding CUDA stream. + * `@param`[in] mps_data_model An io::mps_data_model_t<i_t, f_t> object with a + * representation of a linear program. ... - * `@param`[in] mps_data_model An optimization_problem_t<i_t, f_t> object with a - * representation of a linear program + * `@param`[in] mps_data_model An io::mps_data_model_t<i_t, f_t> object with a + * representation of a mixed-integer problemAs per coding guidelines, public header parameter descriptions should match actual types and behavior.
Also applies to: 96-110, 136-143
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cpp/include/cuopt/math_optimization/solve.hpp` around lines 61 - 74, Update the Doxygen parameter descriptions in the solve_lp function documentation to match the actual implementation types. The description currently references the input parameter type but needs to accurately reflect that it takes io::mps_data_model_t. Additionally, apply the same fix to the batch_pdlp_solve function around lines 96-110 by removing any reference to a user_problem parameter that no longer exists, and to the MIP solver overload around lines 136-143 by correcting its documentation to not describe the input as a linear-program optimization_problem_t. Ensure all public header Doxygen documentation accurately reflects the actual parameter types and behavior of these function overloads.Source: Coding guidelines
🧹 Nitpick comments (24)
cpp/src/barrier/dense_matrix.hpp (1)
17-18: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winAvoid a namespace-wide using-directive in this header.
This injects all
simplexsymbols intobarrierscope and increases collision risk as both modules evolve. Prefer explicitsimplex::...qualification (or narrowusingdeclarations for only required symbols).Suggested direction
-using namespace cuopt::math_optimization::simplex; // shared simplex types (lp_problem_t, inf, - // etc.) +// Keep imports narrow in headers; qualify simplex types at use sites. +// Example: simplex::csc_matrix_t<i_t, f_t>As per coding guidelines,
**/*.{hpp,cpp,cuh,cu,inl}should avoidusing namespaceat file scope and keep scope narrow.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cpp/src/barrier/dense_matrix.hpp` around lines 17 - 18, Remove the namespace-wide `using namespace cuopt::math_optimization::simplex;` directive from the header file dense_matrix.hpp. Instead, replace it with explicit `simplex::` qualification where simplex types like lp_problem_t and inf are used throughout the header, or alternatively add narrow `using` declarations for only the specific symbols required (e.g., `using cuopt::math_optimization::simplex::lp_problem_t;`). This prevents polluting the barrier namespace scope and reduces symbol collision risks as both modules evolve.Source: Coding guidelines
cpp/src/branch_and_bound/branch_and_bound.hpp (1)
50-51: 🧹 Nitpick | 🔵 Trivial | 🏗️ Heavy liftReplace the header-level
using namespacewith narrower imports.This pulls the entire
simplexnamespace intomipscope and makes future symbol conflicts harder to control. Prefer explicitsimplex::...usage (or tightly scopedusingdeclarations for specific symbols only).Suggested direction
-using namespace cuopt::math_optimization::simplex; // shared simplex types (lp_problem_t, - // etc.) +// Prefer explicit simplex:: qualification or narrowly-scoped using declarations.As per coding guidelines,
**/*.{hpp,cpp,cuh,cu,inl}should avoidusing namespaceat file scope and use the narrowest scope.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cpp/src/branch_and_bound/branch_and_bound.hpp` around lines 50 - 51, Remove the file-scoped using namespace directive for cuopt::math_optimization::simplex at the header level in branch_and_bound.hpp. Instead, replace implicit references to simplex types (such as lp_problem_t referenced in the comment) with explicit qualified names using the simplex:: prefix, or alternatively use tightly scoped using declarations for only the specific symbols needed (such as using simplex::lp_problem_t;) within the narrowest appropriate scope rather than at the file level.Source: Coding guidelines
cpp/src/barrier/pinned_host_allocator.cu (1)
15-16: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winRemove namespace-scope
using namespaceimport.Line 15 introduces a broad namespace import in a
.cutranslation unit; please replace it with explicit qualification (or a narrow alias) to avoid symbol pollution.Suggested adjustment
-using namespace cuopt::math_optimization::simplex; // shared simplex types (lp_problem_t, inf, - // etc.) +namespace simplex = cuopt::math_optimization::simplex; // use simplex::... at call sitesAs per coding guidelines, "
**/*.{hpp,cpp,cuh,cu,inl}: Avoid using namespace at file scope; use unnamed namespaces for internal linkage; use narrowest scope for local variables (Google C++ Scoping rule)."🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cpp/src/barrier/pinned_host_allocator.cu` around lines 15 - 16, The broad namespace import using namespace cuopt::math_optimization::simplex at file scope in the .cu file violates the coding guidelines by creating symbol pollution. Replace this using namespace directive with either explicit qualification where the types are used (e.g., cuopt::math_optimization::simplex::lp_problem_t) or create a narrow namespace alias (e.g., namespace simp = cuopt::math_optimization::simplex;) and use the alias prefix when referencing types from that namespace. Remove the using namespace directive entirely and update all references to simplex types throughout the file accordingly.Source: Coding guidelines
cpp/src/branch_and_bound/branch_and_bound.cpp (1)
49-50: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winAvoid file-scope
using namespacein this translation unit.Please replace the file-scope
using namespace cuopt::math_optimization::simplex;with explicit qualification (or narrow aliases) to keep symbol scope controlled.As per coding guidelines, "
**/*.{hpp,cpp,cuh,cu,inl}: Avoid using namespace at file scope; use unnamed namespaces for internal linkage; use narrowest scope for local variables."🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cpp/src/branch_and_bound/branch_and_bound.cpp` around lines 49 - 50, Remove the file-scope `using namespace cuopt::math_optimization::simplex;` statement to avoid polluting the translation unit's global namespace. Instead, use explicit qualification when referencing types from that namespace (e.g., cuopt::math_optimization::simplex::lp_problem_t) throughout the file, or create narrow type aliases using `using` declarations for only the specific types that are frequently used. This keeps the symbol scope controlled and follows the coding guidelines that prohibit file-scope `using namespace` directives.Source: Coding guidelines
cpp/src/branch_and_bound/worker.hpp (1)
25-26: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winAvoid
using namespaceat header namespace scope.Line 25 introduces a file-scope
using namespacedirective in a.hpp, which broadens symbol lookup and can create ambiguity as this header evolves. Prefer explicit qualification or targetedusingdeclarations for only required symbols.♻️ Suggested change
-using namespace cuopt::math_optimization::simplex; // shared simplex types (lp_problem_t, - // etc.) +using simplex::basis_update_mpf_t; +using simplex::bounds_strengthening_t; +using simplex::lp_problem_t; +using simplex::lp_solution_t; +using simplex::simplex_solver_settings_t; +using simplex::variable_status_t;As per coding guidelines,
**/*.{hpp,cpp,cuh,cu,inl}should “Avoid using namespace at file scope; use unnamed namespaces for internal linkage; use narrowest scope for local variables”.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cpp/src/branch_and_bound/worker.hpp` around lines 25 - 26, Remove the file-scope using namespace directive for cuopt::math_optimization::simplex at the top of the header file. Instead, either use explicit qualification (fully qualify types like cuopt::math_optimization::simplex::lp_problem_t when referencing them) or add targeted using declarations (using cuopt::math_optimization::simplex::lp_problem_t;) for only the specific symbols that are actually used in this header file. This prevents namespace pollution and avoids symbol ambiguity for headers that include this file.Source: Coding guidelines
cpp/src/barrier/dense_vector.hpp (1)
17-18: 🧹 Nitpick | 🔵 TrivialAvoid
using namespaceat namespace scope in header files.The
using namespace cuopt::math_optimization::simplex;at line 17 leaks all simplex symbols into the header's namespace scope, propagating them to all includers. Replace with explicitusingdeclarations for only the symbols actually used in this file (onlyinf).♻️ Proposed fix
-using namespace cuopt::math_optimization::simplex; // shared simplex types (lp_problem_t, inf, - // etc.) +using cuopt::math_optimization::simplex::inf;🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cpp/src/barrier/dense_vector.hpp` around lines 17 - 18, The `using namespace cuopt::math_optimization::simplex;` declaration at namespace scope in dense_vector.hpp pollutes the namespace for all files that include this header. Replace this broad using namespace directive with explicit using declarations for only the symbols actually used in this file. According to the comment, only the `inf` symbol is used, so replace the entire using namespace statement with a specific using declaration for just `inf` from the cuopt::math_optimization::simplex namespace.Source: Coding guidelines
cpp/src/barrier/device_sparse_matrix.cu (1)
13-17: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winFix stale namespace wording in the file comment.
The comment still says these instantiations must live in
dual_simplex, but the translation unit now openscuopt::math_optimization::simplex. Please align the comment with the renamed namespace to prevent future confusion.Suggested edit
-// PinnedHostAllocator. They must live in the dual_simplex namespace (where the +// PinnedHostAllocator. They must live in the simplex namespace (where the // templates are declared), even though the file resides under barrier/.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cpp/src/barrier/device_sparse_matrix.cu` around lines 13 - 17, Update the file comment at the beginning of device_sparse_matrix.cu to correct the stale namespace reference. Replace the mention of `dual_simplex` namespace with the actual namespace that the translation unit opens, which is `cuopt::math_optimization::simplex`. This ensures the comment accurately reflects where the explicit instantiations of the sparse-matrix templates actually reside and prevents future confusion about the correct namespace.cpp/src/cuts/objective_step.hpp (1)
17-18: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winAvoid namespace-wide import in this header.
using namespace cuopt::math_optimization::simplex;in a header leaks names into all translation units that include it. Prefer explicit qualification or narrow using-declarations for only required symbols.As per coding guidelines,
**/*.{hpp,cpp,cuh,cu,inl}should avoid broadusing namespaceand keep scope narrow.Proposed fix
-using namespace cuopt::math_optimization::simplex; // shared simplex types (objective_step_t, - // etc.) +using cuopt::math_optimization::simplex::objective_step_t;🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cpp/src/cuts/objective_step.hpp` around lines 17 - 18, Remove the broad `using namespace cuopt::math_optimization::simplex;` declaration from the header file objective_step.hpp as it pollutes the global namespace for all translation units that include this header. Instead, either qualify the required types explicitly with the full namespace path (e.g., cuopt::math_optimization::simplex::objective_step_t) at their usage points, or use narrow using-declarations for only the specific symbols needed (e.g., using cuopt::math_optimization::simplex::objective_step_t;). This approach keeps the namespace scope narrow and follows the coding guidelines for header files.Source: Coding guidelines
cpp/src/branch_and_bound/node_queue.hpp (1)
18-19: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winAvoid
using namespaceat header namespace scope.Line 18 introduces a broad namespace import in a
.hppfile, which leaks names to all translation units including this header.Suggested change
-using namespace cuopt::math_optimization::simplex; // shared simplex types (lp_problem_t, - // etc.) +// Avoid broad namespace imports in headers; qualify simplex types at use sites.// Example update at use site: bool diving_init(const cuopt::math_optimization::simplex::lp_problem_t<i_t, f_t>& lp, mip_node_t<i_t, f_t>& start_node, std::vector<f_t>& start_lower, std::vector<f_t>& start_upper, std::vector<bool>& bounds_changed);As per coding guidelines,
**/*.{hpp,cpp,cuh,cu,inl}should avoid file-scopeusing namespaceand keep the narrowest possible scope.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cpp/src/branch_and_bound/node_queue.hpp` around lines 18 - 19, Remove the `using namespace cuopt::math_optimization::simplex;` statement from the header namespace scope in node_queue.hpp. Then, locate all usages of types from the simplex namespace throughout this header file (such as lp_problem_t, etc.) and replace them with their fully qualified names prefixed with cuopt::math_optimization::simplex::. This prevents namespace pollution and keeps names scoped narrowly to avoid conflicts in translation units that include this header.Source: Coding guidelines
cpp/src/branch_and_bound/diving_heuristics.hpp (1)
21-22: 🧹 Nitpick | 🔵 TrivialReplace namespace-wide import with explicit symbol imports.
using namespacein a header injects all simplex names intomipscope for every includer. Prefer targetedusingdeclarations (or explicit qualification).♻️ Suggested change
-using namespace cuopt::math_optimization::simplex; // shared simplex types (lp_problem_t, - // etc.) +using cuopt::math_optimization::simplex::BEST_FIRST; +using cuopt::math_optimization::simplex::COEFFICIENT_DIVING; +using cuopt::math_optimization::simplex::FARKAS_DIVING; +using cuopt::math_optimization::simplex::GUIDED_DIVING; +using cuopt::math_optimization::simplex::LINE_SEARCH_DIVING; +using cuopt::math_optimization::simplex::PSEUDOCOST_DIVING; +using cuopt::math_optimization::simplex::VECTOR_LENGTH_DIVING; +using cuopt::math_optimization::simplex::branch_variable_t; +using cuopt::math_optimization::simplex::logger_t; +using cuopt::math_optimization::simplex::lp_problem_t; +using cuopt::math_optimization::simplex::pseudo_costs_t; +using cuopt::math_optimization::simplex::search_strategy_t;Per coding guidelines,
**/*.{hpp,cpp,cuh,cu,inl}must avoidusing namespaceat file/namespace scope and keep scope narrow.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cpp/src/branch_and_bound/diving_heuristics.hpp` around lines 21 - 22, Replace the `using namespace cuopt::math_optimization::simplex;` statement with explicit `using` declarations for only the specific symbols that are actually used from that namespace (such as `lp_problem_t` and any other types or functions referenced in the diving_heuristics.hpp file). This prevents polluting the global scope for all includers of this header and keeps imports narrow and explicit as required by coding guidelines.Source: Coding guidelines
cpp/src/branch_and_bound/diving_heuristics.cpp (1)
12-13: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winReplace file-scope namespace import with explicit symbol imports.
Line 12 introduces a broad
using namespacein translation-unit scope, which increases collision risk as symbols continue moving acrosssimplex/mip.♻️ Suggested change
-using namespace cuopt::math_optimization::simplex; // shared simplex types (lp_problem_t, - // etc.) +using cuopt::math_optimization::simplex::branch_direction_t; +using cuopt::math_optimization::simplex::branch_variable_t; +using cuopt::math_optimization::simplex::inf; +using cuopt::math_optimization::simplex::logger_t; +using cuopt::math_optimization::simplex::lp_problem_t; +using cuopt::math_optimization::simplex::pseudo_costs_t;As per coding guidelines,
**/*.{hpp,cpp,cuh,cu,inl}should avoidusing namespaceat file scope and keep the narrowest possible scope.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cpp/src/branch_and_bound/diving_heuristics.cpp` around lines 12 - 13, Remove the file-scope `using namespace cuopt::math_optimization::simplex;` statement at line 12. Instead, replace it with explicit imports of only the needed symbols (such as lp_problem_t mentioned in the comment) using individual `using` declarations, or use fully qualified names (cuopt::math_optimization::simplex::lp_problem_t) throughout the file where these symbols are referenced. Keep any necessary using declarations in the narrowest possible scope, preferably within function blocks rather than file scope, to minimize symbol collision risk.Source: Coding guidelines
cpp/src/cuts/objective_step.cpp (1)
19-20: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winAvoid namespace-wide
using namespacehere.Please import only the required simplex symbols (or qualify usages) instead of a namespace-wide
using namespacedirective.As per coding guidelines, "
**/*.{hpp,cpp,cuh,cu,inl}: Avoid using namespace at file scope; use unnamed namespaces for internal linkage; use narrowest scope for local variables."🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cpp/src/cuts/objective_step.cpp` around lines 19 - 20, Remove the namespace-wide `using namespace cuopt::math_optimization::simplex` directive at file scope. Instead, either explicitly import only the specific simplex symbols you need (such as objective_step_t and others actually used in this file) with individual `using` declarations, or qualify all simplex type usages with the full namespace prefix `cuopt::math_optimization::simplex::` throughout the file. This follows the coding guideline to avoid namespace-wide using directives at file scope and use only necessary symbols.Source: Coding guidelines
cpp/src/barrier/conjugate_gradient.hpp (1)
21-22: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winAvoid
using namespaceat namespace scope in this header.This directive widens symbol visibility for all includers. Prefer narrow using-declarations (or explicit qualification) for only the needed simplex symbols.
♻️ Suggested change
-using namespace cuopt::math_optimization::simplex; // shared simplex types (lp_problem_t, inf, - // etc.) +using cuopt::math_optimization::simplex::dense_vector_t; +using cuopt::math_optimization::simplex::simplex_solver_settings_t;As per coding guidelines,
**/*.{hpp,cpp,cuh,cu,inl}should avoidusing namespaceat file scope and use the narrowest scope.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cpp/src/barrier/conjugate_gradient.hpp` around lines 21 - 22, Remove the broad using namespace directive for cuopt::math_optimization::simplex at file scope in the header. Instead, replace it with specific using-declarations for only the symbols actually needed from that namespace (such as lp_problem_t and inf as mentioned in the comment). This ensures that only the required symbols are brought into scope for all includers of this header, rather than polluting the entire namespace with potentially conflicting symbols.Source: Coding guidelines
cpp/src/barrier/cusparse_view.cu (1)
27-28: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winAvoid file-scope
using namespacein this CUDA translation unit.Please replace the broad using-directive with narrow using-declarations (or explicit qualification) for only the simplex symbols this file uses.
♻️ Suggested change
-using namespace cuopt::math_optimization::simplex; // shared simplex types (lp_problem_t, inf, - // etc.) +using cuopt::math_optimization::simplex::csc_matrix_t; +using cuopt::math_optimization::simplex::csr_matrix_t;As per coding guidelines,
**/*.{hpp,cpp,cuh,cu,inl}should avoidusing namespaceat file scope and use the narrowest scope.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cpp/src/barrier/cusparse_view.cu` around lines 27 - 28, Remove the file-scope using-directive for cuopt::math_optimization::simplex at the beginning of the file. Instead, identify which specific symbols from this namespace are actually used in the cusparse_view.cu file (such as lp_problem_t and inf) and replace the broad using-directive with narrow using-declarations for only those symbols (e.g., using cuopt::math_optimization::simplex::lp_problem_t;), or alternatively use explicit qualification throughout the file when referencing symbols from that namespace.Source: Coding guidelines
cpp/src/mip_heuristics/local_search/local_search.cuh (1)
18-21: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winFix stale forward declaration namespace for
branch_and_bound_t.Line 18 forward-declares
simplex::branch_and_bound_t, but Line 91 usesmip::branch_and_bound_t. This mismatch is stale and makes this header rely on transitive includes for the actual type.Suggested diff
-namespace cuopt::math_optimization::simplex { +namespace cuopt::math_optimization::mip { template <typename i_t, typename f_t> class branch_and_bound_t; }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cpp/src/mip_heuristics/local_search/local_search.cuh` around lines 18 - 21, The forward declaration of branch_and_bound_t at lines 18-21 is in the wrong namespace. The class is declared within namespace cuopt::math_optimization::simplex, but it is actually used in namespace cuopt::math_optimization::mip elsewhere in the code. Update the forward declaration to use the correct namespace by changing the namespace wrapper from simplex to mip so that the forward declaration matches the actual location of branch_and_bound_t.cpp/src/branch_and_bound/symmetry.hpp (1)
25-26: 🧹 Nitpick | 🔵 TrivialMove the
using namespacestatement to an unnamed namespace or qualify symbols.Line 25 has a file-scope
using namespace cuopt::math_optimization::simplex;that violates the guideline requiring unnamed namespaces for internal linkage. The file uses many unqualified simplex symbols (lp_problem_t, simplex_solver_settings_t, dualize_info_t, convert_user_problem, variable_type_t, csr_matrix_t) throughout, which increases collision risk and hides ownership. Wrap the using statement in an unnamed namespace or qualify the symbols directly.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cpp/src/branch_and_bound/symmetry.hpp` around lines 25 - 26, The file-scope using namespace statement for cuopt::math_optimization::simplex violates internal linkage guidelines. To fix this, either wrap the using namespace cuopt::math_optimization::simplex; statement in an unnamed namespace block, or qualify all the simplex symbols used throughout the file (including lp_problem_t, simplex_solver_settings_t, dualize_info_t, convert_user_problem, variable_type_t, and csr_matrix_t) with their full namespace prefix cuopt::math_optimization::simplex::.Source: Coding guidelines
cpp/src/barrier/device_sparse_matrix.cuh (1)
28-29: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winAvoid a broad namespace import in this header scope (Line 28).
Please replace the
using namespacedirective with explicit qualification (or narrowusingdeclarations for specific symbols) to prevent namespace pollution in includers.Suggested change
-using namespace cuopt::math_optimization::simplex; // shared simplex types (lp_problem_t, inf, - // etc.) +// Prefer explicit qualification (or narrow using-declarations for specific symbols) +// to avoid broad namespace imports in headers.As per coding guidelines:
**/*.{hpp,cpp,cuh,cu,inl}asks to avoid broadusing namespaceat file/header scope and use narrower scope.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cpp/src/barrier/device_sparse_matrix.cuh` around lines 28 - 29, Remove the broad `using namespace cuopt::math_optimization::simplex;` directive at file scope in the device_sparse_matrix.cuh header. Replace it with either explicit qualification of the specific types like lp_problem_t and inf when they are used throughout the file, or add narrow using declarations for only those specific symbols that are actually needed (using cuopt::math_optimization::simplex::symbol_name;). This prevents namespace pollution in files that include this header.Source: Coding guidelines
cpp/src/grpc/server/grpc_server_types.hpp (1)
63-63: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winRemove the broad
using namespacedirective from this header (Line 63).Prefer explicit qualification (or narrow
usingdeclarations for specific symbols) to keep this header’s namespace surface tight.As per coding guidelines:
**/*.{hpp,cpp,cuh,cu,inl}advises against broadusing namespaceat file/header scope.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cpp/src/grpc/server/grpc_server_types.hpp` at line 63, Remove the broad `using namespace cuopt::math_optimization;` directive at the header scope in grpc_server_types.hpp. Instead of this blanket using directive, replace all unqualified references to symbols from the cuopt::math_optimization namespace with explicit namespace qualification (e.g., cuopt::math_optimization::SymbolName), or if the same symbols are used frequently, add narrow using declarations for specific symbols only (e.g., using cuopt::math_optimization::SymbolName;) to keep the namespace pollution minimal in this header file.Source: Coding guidelines
cpp/src/barrier/sparse_cholesky.cuh (1)
23-26: 🧹 Nitpick | 🔵 Trivial | 🏗️ Heavy liftAvoid namespace-wide imports in this header.
Because this is a
.cuhheader, theusing namespacedirective is transitively visible to includers and can broaden lookup/ambiguity across the file. Prefer explicitsimplex::...qualifiers or narrowusingdeclarations for only the shared types needed here.As per coding guidelines, avoid using namespace at file scope.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cpp/src/barrier/sparse_cholesky.cuh` around lines 23 - 26, The `using namespace cuopt::math_optimization::simplex;` directive at file scope in this header file transitively exposes the entire simplex namespace to all includers, which can cause name lookup ambiguities. Replace this namespace-wide using directive with either explicit namespace qualifiers (e.g., `cuopt::math_optimization::simplex::lp_problem_t`) when referencing shared types, or use narrow using declarations that import only the specific types needed from simplex (e.g., `using cuopt::math_optimization::simplex::lp_problem_t;` for each required type). This ensures only the necessary symbols are in scope rather than the entire namespace.Source: Coding guidelines
cpp/src/cuts/cuts.hpp (1)
35-38: 🧹 Nitpick | 🔵 Trivial | 🏗️ Heavy liftKeep the simplex names qualified in this header.
This namespace-wide import pulls all simplex names into
mipfor every includer after this point. Please replace it with explicitsimplex::...qualifications or narrowusingdeclarations for the specific shared types used here.As per coding guidelines, avoid using namespace at file scope.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cpp/src/cuts/cuts.hpp` around lines 35 - 38, The using namespace cuopt::math_optimization::simplex directive in the mip namespace at file scope in cuts.hpp violates coding guidelines by polluting the namespace for all includers. Replace this namespace-wide import with either explicit qualifications using simplex:: prefix when referencing shared types like lp_problem_t, or use narrow using declarations (e.g., using cuopt::math_optimization::simplex::lp_problem_t) for only the specific types that are actually needed in this header file.Source: Coding guidelines
cpp/src/barrier/barrier.cu (2)
55-56: 🧹 Nitpick | 🔵 Trivial | 🏗️ Heavy liftAvoid importing the simplex namespace at file scope.
This pulls all simplex symbols into
barrierfor the whole translation unit; prefer a namespace alias plus explicitsimplex::qualifications for the shared types used below. As per coding guidelines, "**/*.{hpp,cpp,cuh,cu,inl}: Avoid using namespace at file scope; use unnamed namespaces for internal linkage; use narrowest scope for local variables."🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cpp/src/barrier/barrier.cu` around lines 55 - 56, Remove the file-scope `using namespace cuopt::math_optimization::simplex;` declaration to avoid polluting the global namespace. Replace it with a namespace alias (such as `namespace simplex = cuopt::math_optimization::simplex;`) and then explicitly qualify all simplex types with the `simplex::` prefix where they are used throughout the file (e.g., change references to `lp_problem_t` to `simplex::lp_problem_t`). This follows the coding guidelines that prefer narrowest scope for namespace declarations and explicit qualification for shared types.Source: Coding guidelines
1731-1737: 🧹 Nitpick | 🔵 Trivial | 🏗️ Heavy liftAvoid making barrier depend on PDLP-owned cuSPARSE wrappers.
barriernow stores and acceptspdlp::cusparse_dn_vec_descr_wrapper_t, which creates a solver-domain dependency for a generic descriptor wrapper. Consider moving this wrapper to a shared namespace or into the barrier cuSPARSE layer so PDLP and barrier remain independent solver modules.Also applies to: 1976-1989
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cpp/src/barrier/barrier.cu` around lines 1731 - 1737, The barrier module is depending on the PDLP-owned cuSPARSE wrapper class pdlp::cusparse_dn_vec_descr_wrapper_t in its function parameters (cusparse_y, cusparse_v, cusparse_u) and logic, creating an inappropriate cross-module dependency. Move the cusparse_dn_vec_descr_wrapper_t wrapper class definition to a shared namespace that both barrier and PDLP can access independently, then update all references to this wrapper throughout barrier.cu (including the additional locations around lines 1976-1989) to use the wrapper from the shared namespace instead of the pdlp namespace prefix.cpp/src/branch_and_bound/worker_pool.hpp (1)
15-16: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winDon’t put a
using namespacedirective in this header.Every include of
worker_pool.hppinherits this lookup pollution insidemip; qualify the few simplex types instead. As per coding guidelines, "**/*.{hpp,cpp,cuh,cu,inl}: Avoid using namespace at file scope; use unnamed namespaces for internal linkage; use narrowest scope for local variables."Proposed fix
namespace cuopt::math_optimization::mip { -using namespace cuopt::math_optimization::simplex; // shared simplex types (lp_problem_t, - // etc.) +namespace simplex = cuopt::math_optimization::simplex; @@ void init(i_t num_workers, - const lp_problem_t<i_t, f_t>& original_lp, - const csr_matrix_t<i_t, f_t>& Arow, - const std::vector<variable_type_t>& var_type, + const simplex::lp_problem_t<i_t, f_t>& original_lp, + const simplex::csr_matrix_t<i_t, f_t>& Arow, + const std::vector<simplex::variable_type_t>& var_type, mip_symmetry_t<i_t, f_t>* symmetry, - const simplex_solver_settings_t<i_t, f_t>& settings, + const simplex::simplex_solver_settings_t<i_t, f_t>& settings, const uint64_t rng_offset = 0)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cpp/src/branch_and_bound/worker_pool.hpp` around lines 15 - 16, Remove the using namespace directive for cuopt::math_optimization::simplex from the header file worker_pool.hpp to avoid polluting the namespace for all files that include this header. Instead, qualify the simplex types that are used throughout this header file (such as lp_problem_t and any other types from that namespace) by prefixing them with their full namespace path cuopt::math_optimization::simplex:: at their points of use within worker_pool.hpp.Source: Coding guidelines
cpp/src/branch_and_bound/pseudo_costs.cpp (1)
30-31: 🧹 Nitpick | 🔵 Trivial | 🏗️ Heavy liftAvoid importing the entire
simplexnamespace at file scope.This blurs the new
mip/simplexboundary and can hide collisions during the namespace split. Prefer a namespace alias plus explicitsimplex::...qualifiers for the imported types/functions.As per coding guidelines, "
**/*.{hpp,cpp,cuh,cu,inl}: Avoid using namespace at file scope; use unnamed namespaces for internal linkage; use narrowest scope for local variables."🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cpp/src/branch_and_bound/pseudo_costs.cpp` around lines 30 - 31, Replace the `using namespace cuopt::math_optimization::simplex;` directive at file scope with a namespace alias to maintain clear boundaries and avoid namespace pollution. Remove the using namespace statement and instead create a namespace alias that allows you to reference simplex types and functions with explicit `simplex::` qualifiers throughout the file. This approach makes the origin of imported symbols explicit and prevents collisions during namespace reorganization.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cpp/include/cuopt/math_optimization/cuopt_c.h`:
- Around line 933-979: Fix the Doxygen documentation for the solution getter
functions. In cuOptGetTerminationStatus, change the documented parameter name
from termination_reason_ptr to termination_status_ptr to match the actual
parameter. For the three subsequent functions cuOptGetErrorStatus,
cuOptGetErrorString, and cuOptGetPrimalSolution, change their comment delimiters
from /* to /** at the start of each documentation block so Doxygen will
recognize and process these public API documentation comments.
- Around line 82-87: The function declarations cuOptGetFloatSize() and
cuOptGetIntSize() use empty parentheses which in C does not explicitly specify
no arguments and allows invalid calls with arbitrary parameters. Update both
function prototypes to use (void) instead of empty parentheses to create an
explicit no-argument function signature that is ABI-safe for the C API surface.
In `@cpp/include/cuopt/math_optimization/pdlp/pdlp_hyper_params.cuh`:
- Line 10: The C++ type pdlp_hyper_params_t has been migrated from
cuopt::linear_programming to cuopt::math_optimization::pdlp namespace, but
unlike the C API which has a compatibility forwarder in
cpp/include/cuopt/linear_programming/cuopt_c.h, there is no documented migration
path or backward-compatibility header for C++ users. Either add a note to
docs/cuopt/source/transition.rst documenting that C++ users must update their
includes and namespace qualifiers when using pdlp_hyper_params_t, or create a
backward-compatibility header file at
cpp/include/cuopt/linear_programming/pdlp_hyper_params.cuh that provides a
forwarding include to the new location in cuopt::math_optimization::pdlp,
similar to how the C API shim is structured.
In `@cpp/src/barrier/barrier.hpp`:
- Around line 21-22: Remove the file-scope `using namespace
cuopt::math_optimization::simplex;` statement from the header file barrier.hpp.
Instead, qualify the simplex types (lp_problem_t, inf, etc.) with their full
namespace path `cuopt::math_optimization::simplex::` throughout the header, or
use narrow using declarations for only the specific types that are actually
needed in this file. This prevents symbol collisions across all includers of
this header.
In `@cpp/src/barrier/cusparse_view.hpp`:
- Around line 26-27: Remove the file-scope `using namespace
cuopt::math_optimization::simplex;` statement from the header file
cusparse_view.hpp (currently at lines 26-27) to prevent namespace pollution in
all includers. After removal, search through the file for any unqualified uses
of types or functions from that namespace (such as lp_problem_t and inf
mentioned in the comment) and replace them with explicit qualification using the
`simplex::` prefix (e.g., `simplex::lp_problem_t`, `simplex::inf`), or
alternatively create narrow local `using` declarations for specific types as
needed within function scopes.
In `@cpp/src/branch_and_bound/branch_and_bound.cpp`:
- Around line 150-173: The function convert_lp_status_to_dual_status is missing
a case for lp_status_t::UNBOUNDED, causing it to incorrectly fall through to the
default case and return dual_status_t::NUMERICAL. Add an explicit case to handle
lp_status_t::UNBOUNDED before the final else clause in the
convert_lp_status_to_dual_status function, mapping it to the appropriate
dual_status_t value that represents an unbounded state (likely
dual_status_t::UNBOUNDED or similar).
In `@cpp/src/branch_and_bound/deterministic_workers.hpp`:
- Around line 27-28: Replace the broad `using namespace
cuopt::math_optimization::simplex;` declaration with explicit `using`
declarations for only the specific types that are actually referenced in this
header file. Identify which types from the cuopt::math_optimization::simplex
namespace are used (such as lp_problem_t mentioned in the comment) and create
individual `using` declarations for each of them, removing the entire namespace
import statement.
In `@cpp/src/branch_and_bound/pseudo_costs.cpp`:
- Around line 34-37: The is_dual_simplex_done function does not include
WORK_LIMIT as a valid dual-simplex status, which is inconsistent with how
WORK_LIMIT is treated at line 688 where it is considered a usable result. Add
WORK_LIMIT to the return statement condition in is_dual_simplex_done alongside
the existing DUAL_UNBOUNDED, OPTIMAL, ITERATION_LIMIT, and CUTOFF statuses.
Apply this same change to the other similar status checks mentioned at lines
374-379, 522-529, and 687-690 to ensure consistent handling of WORK_LIMIT across
all dual-simplex result validation paths.
In `@cpp/src/cuts/cuts.cpp`:
- Around line 32-33: Remove the file-scoped `using namespace
cuopt::math_optimization::simplex;` statement. Replace it with targeted using
declarations for the specific types actually used in the file (such as `using
simplex::lp_problem_t;` for each type), or alternatively remove the namespace
import entirely and qualify all references to simplex types throughout the file
with the `simplex::` prefix where they are used.
---
Outside diff comments:
In `@cpp/include/cuopt/math_optimization/solve.hpp`:
- Around line 61-74: Update the Doxygen parameter descriptions in the solve_lp
function documentation to match the actual implementation types. The description
currently references the input parameter type but needs to accurately reflect
that it takes io::mps_data_model_t. Additionally, apply the same fix to the
batch_pdlp_solve function around lines 96-110 by removing any reference to a
user_problem parameter that no longer exists, and to the MIP solver overload
around lines 136-143 by correcting its documentation to not describe the input
as a linear-program optimization_problem_t. Ensure all public header Doxygen
documentation accurately reflects the actual parameter types and behavior of
these function overloads.
---
Nitpick comments:
In `@cpp/src/barrier/barrier.cu`:
- Around line 55-56: Remove the file-scope `using namespace
cuopt::math_optimization::simplex;` declaration to avoid polluting the global
namespace. Replace it with a namespace alias (such as `namespace simplex =
cuopt::math_optimization::simplex;`) and then explicitly qualify all simplex
types with the `simplex::` prefix where they are used throughout the file (e.g.,
change references to `lp_problem_t` to `simplex::lp_problem_t`). This follows
the coding guidelines that prefer narrowest scope for namespace declarations and
explicit qualification for shared types.
- Around line 1731-1737: The barrier module is depending on the PDLP-owned
cuSPARSE wrapper class pdlp::cusparse_dn_vec_descr_wrapper_t in its function
parameters (cusparse_y, cusparse_v, cusparse_u) and logic, creating an
inappropriate cross-module dependency. Move the cusparse_dn_vec_descr_wrapper_t
wrapper class definition to a shared namespace that both barrier and PDLP can
access independently, then update all references to this wrapper throughout
barrier.cu (including the additional locations around lines 1976-1989) to use
the wrapper from the shared namespace instead of the pdlp namespace prefix.
In `@cpp/src/barrier/conjugate_gradient.hpp`:
- Around line 21-22: Remove the broad using namespace directive for
cuopt::math_optimization::simplex at file scope in the header. Instead, replace
it with specific using-declarations for only the symbols actually needed from
that namespace (such as lp_problem_t and inf as mentioned in the comment). This
ensures that only the required symbols are brought into scope for all includers
of this header, rather than polluting the entire namespace with potentially
conflicting symbols.
In `@cpp/src/barrier/cusparse_view.cu`:
- Around line 27-28: Remove the file-scope using-directive for
cuopt::math_optimization::simplex at the beginning of the file. Instead,
identify which specific symbols from this namespace are actually used in the
cusparse_view.cu file (such as lp_problem_t and inf) and replace the broad
using-directive with narrow using-declarations for only those symbols (e.g.,
using cuopt::math_optimization::simplex::lp_problem_t;), or alternatively use
explicit qualification throughout the file when referencing symbols from that
namespace.
In `@cpp/src/barrier/dense_matrix.hpp`:
- Around line 17-18: Remove the namespace-wide `using namespace
cuopt::math_optimization::simplex;` directive from the header file
dense_matrix.hpp. Instead, replace it with explicit `simplex::` qualification
where simplex types like lp_problem_t and inf are used throughout the header, or
alternatively add narrow `using` declarations for only the specific symbols
required (e.g., `using cuopt::math_optimization::simplex::lp_problem_t;`). This
prevents polluting the barrier namespace scope and reduces symbol collision
risks as both modules evolve.
In `@cpp/src/barrier/dense_vector.hpp`:
- Around line 17-18: The `using namespace cuopt::math_optimization::simplex;`
declaration at namespace scope in dense_vector.hpp pollutes the namespace for
all files that include this header. Replace this broad using namespace directive
with explicit using declarations for only the symbols actually used in this
file. According to the comment, only the `inf` symbol is used, so replace the
entire using namespace statement with a specific using declaration for just
`inf` from the cuopt::math_optimization::simplex namespace.
In `@cpp/src/barrier/device_sparse_matrix.cu`:
- Around line 13-17: Update the file comment at the beginning of
device_sparse_matrix.cu to correct the stale namespace reference. Replace the
mention of `dual_simplex` namespace with the actual namespace that the
translation unit opens, which is `cuopt::math_optimization::simplex`. This
ensures the comment accurately reflects where the explicit instantiations of the
sparse-matrix templates actually reside and prevents future confusion about the
correct namespace.
In `@cpp/src/barrier/device_sparse_matrix.cuh`:
- Around line 28-29: Remove the broad `using namespace
cuopt::math_optimization::simplex;` directive at file scope in the
device_sparse_matrix.cuh header. Replace it with either explicit qualification
of the specific types like lp_problem_t and inf when they are used throughout
the file, or add narrow using declarations for only those specific symbols that
are actually needed (using cuopt::math_optimization::simplex::symbol_name;).
This prevents namespace pollution in files that include this header.
In `@cpp/src/barrier/pinned_host_allocator.cu`:
- Around line 15-16: The broad namespace import using namespace
cuopt::math_optimization::simplex at file scope in the .cu file violates the
coding guidelines by creating symbol pollution. Replace this using namespace
directive with either explicit qualification where the types are used (e.g.,
cuopt::math_optimization::simplex::lp_problem_t) or create a narrow namespace
alias (e.g., namespace simp = cuopt::math_optimization::simplex;) and use the
alias prefix when referencing types from that namespace. Remove the using
namespace directive entirely and update all references to simplex types
throughout the file accordingly.
In `@cpp/src/barrier/sparse_cholesky.cuh`:
- Around line 23-26: The `using namespace cuopt::math_optimization::simplex;`
directive at file scope in this header file transitively exposes the entire
simplex namespace to all includers, which can cause name lookup ambiguities.
Replace this namespace-wide using directive with either explicit namespace
qualifiers (e.g., `cuopt::math_optimization::simplex::lp_problem_t`) when
referencing shared types, or use narrow using declarations that import only the
specific types needed from simplex (e.g., `using
cuopt::math_optimization::simplex::lp_problem_t;` for each required type). This
ensures only the necessary symbols are in scope rather than the entire
namespace.
In `@cpp/src/branch_and_bound/branch_and_bound.cpp`:
- Around line 49-50: Remove the file-scope `using namespace
cuopt::math_optimization::simplex;` statement to avoid polluting the translation
unit's global namespace. Instead, use explicit qualification when referencing
types from that namespace (e.g.,
cuopt::math_optimization::simplex::lp_problem_t) throughout the file, or create
narrow type aliases using `using` declarations for only the specific types that
are frequently used. This keeps the symbol scope controlled and follows the
coding guidelines that prohibit file-scope `using namespace` directives.
In `@cpp/src/branch_and_bound/branch_and_bound.hpp`:
- Around line 50-51: Remove the file-scoped using namespace directive for
cuopt::math_optimization::simplex at the header level in branch_and_bound.hpp.
Instead, replace implicit references to simplex types (such as lp_problem_t
referenced in the comment) with explicit qualified names using the simplex::
prefix, or alternatively use tightly scoped using declarations for only the
specific symbols needed (such as using simplex::lp_problem_t;) within the
narrowest appropriate scope rather than at the file level.
In `@cpp/src/branch_and_bound/diving_heuristics.cpp`:
- Around line 12-13: Remove the file-scope `using namespace
cuopt::math_optimization::simplex;` statement at line 12. Instead, replace it
with explicit imports of only the needed symbols (such as lp_problem_t mentioned
in the comment) using individual `using` declarations, or use fully qualified
names (cuopt::math_optimization::simplex::lp_problem_t) throughout the file
where these symbols are referenced. Keep any necessary using declarations in the
narrowest possible scope, preferably within function blocks rather than file
scope, to minimize symbol collision risk.
In `@cpp/src/branch_and_bound/diving_heuristics.hpp`:
- Around line 21-22: Replace the `using namespace
cuopt::math_optimization::simplex;` statement with explicit `using` declarations
for only the specific symbols that are actually used from that namespace (such
as `lp_problem_t` and any other types or functions referenced in the
diving_heuristics.hpp file). This prevents polluting the global scope for all
includers of this header and keeps imports narrow and explicit as required by
coding guidelines.
In `@cpp/src/branch_and_bound/node_queue.hpp`:
- Around line 18-19: Remove the `using namespace
cuopt::math_optimization::simplex;` statement from the header namespace scope in
node_queue.hpp. Then, locate all usages of types from the simplex namespace
throughout this header file (such as lp_problem_t, etc.) and replace them with
their fully qualified names prefixed with cuopt::math_optimization::simplex::.
This prevents namespace pollution and keeps names scoped narrowly to avoid
conflicts in translation units that include this header.
In `@cpp/src/branch_and_bound/pseudo_costs.cpp`:
- Around line 30-31: Replace the `using namespace
cuopt::math_optimization::simplex;` directive at file scope with a namespace
alias to maintain clear boundaries and avoid namespace pollution. Remove the
using namespace statement and instead create a namespace alias that allows you
to reference simplex types and functions with explicit `simplex::` qualifiers
throughout the file. This approach makes the origin of imported symbols explicit
and prevents collisions during namespace reorganization.
In `@cpp/src/branch_and_bound/symmetry.hpp`:
- Around line 25-26: The file-scope using namespace statement for
cuopt::math_optimization::simplex violates internal linkage guidelines. To fix
this, either wrap the using namespace cuopt::math_optimization::simplex;
statement in an unnamed namespace block, or qualify all the simplex symbols used
throughout the file (including lp_problem_t, simplex_solver_settings_t,
dualize_info_t, convert_user_problem, variable_type_t, and csr_matrix_t) with
their full namespace prefix cuopt::math_optimization::simplex::.
In `@cpp/src/branch_and_bound/worker_pool.hpp`:
- Around line 15-16: Remove the using namespace directive for
cuopt::math_optimization::simplex from the header file worker_pool.hpp to avoid
polluting the namespace for all files that include this header. Instead, qualify
the simplex types that are used throughout this header file (such as
lp_problem_t and any other types from that namespace) by prefixing them with
their full namespace path cuopt::math_optimization::simplex:: at their points of
use within worker_pool.hpp.
In `@cpp/src/branch_and_bound/worker.hpp`:
- Around line 25-26: Remove the file-scope using namespace directive for
cuopt::math_optimization::simplex at the top of the header file. Instead, either
use explicit qualification (fully qualify types like
cuopt::math_optimization::simplex::lp_problem_t when referencing them) or add
targeted using declarations (using
cuopt::math_optimization::simplex::lp_problem_t;) for only the specific symbols
that are actually used in this header file. This prevents namespace pollution
and avoids symbol ambiguity for headers that include this file.
In `@cpp/src/cuts/cuts.hpp`:
- Around line 35-38: The using namespace cuopt::math_optimization::simplex
directive in the mip namespace at file scope in cuts.hpp violates coding
guidelines by polluting the namespace for all includers. Replace this
namespace-wide import with either explicit qualifications using simplex:: prefix
when referencing shared types like lp_problem_t, or use narrow using
declarations (e.g., using cuopt::math_optimization::simplex::lp_problem_t) for
only the specific types that are actually needed in this header file.
In `@cpp/src/cuts/objective_step.cpp`:
- Around line 19-20: Remove the namespace-wide `using namespace
cuopt::math_optimization::simplex` directive at file scope. Instead, either
explicitly import only the specific simplex symbols you need (such as
objective_step_t and others actually used in this file) with individual `using`
declarations, or qualify all simplex type usages with the full namespace prefix
`cuopt::math_optimization::simplex::` throughout the file. This follows the
coding guideline to avoid namespace-wide using directives at file scope and use
only necessary symbols.
In `@cpp/src/cuts/objective_step.hpp`:
- Around line 17-18: Remove the broad `using namespace
cuopt::math_optimization::simplex;` declaration from the header file
objective_step.hpp as it pollutes the global namespace for all translation units
that include this header. Instead, either qualify the required types explicitly
with the full namespace path (e.g.,
cuopt::math_optimization::simplex::objective_step_t) at their usage points, or
use narrow using-declarations for only the specific symbols needed (e.g., using
cuopt::math_optimization::simplex::objective_step_t;). This approach keeps the
namespace scope narrow and follows the coding guidelines for header files.
In `@cpp/src/grpc/server/grpc_server_types.hpp`:
- Line 63: Remove the broad `using namespace cuopt::math_optimization;`
directive at the header scope in grpc_server_types.hpp. Instead of this blanket
using directive, replace all unqualified references to symbols from the
cuopt::math_optimization namespace with explicit namespace qualification (e.g.,
cuopt::math_optimization::SymbolName), or if the same symbols are used
frequently, add narrow using declarations for specific symbols only (e.g., using
cuopt::math_optimization::SymbolName;) to keep the namespace pollution minimal
in this header file.
In `@cpp/src/mip_heuristics/local_search/local_search.cuh`:
- Around line 18-21: The forward declaration of branch_and_bound_t at lines
18-21 is in the wrong namespace. The class is declared within namespace
cuopt::math_optimization::simplex, but it is actually used in namespace
cuopt::math_optimization::mip elsewhere in the code. Update the forward
declaration to use the correct namespace by changing the namespace wrapper from
simplex to mip so that the forward declaration matches the actual location of
branch_and_bound_t.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
| dual_status_t convert_lp_status_to_dual_status(lp_status_t status) | ||
| { | ||
| if (status == lp_status_t::OPTIMAL) { | ||
| return dual::status_t::OPTIMAL; | ||
| return dual_status_t::OPTIMAL; | ||
| } else if (status == lp_status_t::INFEASIBLE) { | ||
| return dual::status_t::DUAL_UNBOUNDED; | ||
| return dual_status_t::DUAL_UNBOUNDED; | ||
| } else if (status == lp_status_t::ITERATION_LIMIT) { | ||
| return dual::status_t::ITERATION_LIMIT; | ||
| return dual_status_t::ITERATION_LIMIT; | ||
| } else if (status == lp_status_t::TIME_LIMIT) { | ||
| return dual::status_t::TIME_LIMIT; | ||
| return dual_status_t::TIME_LIMIT; | ||
| } else if (status == lp_status_t::WORK_LIMIT) { | ||
| return dual::status_t::WORK_LIMIT; | ||
| return dual_status_t::WORK_LIMIT; | ||
| } else if (status == lp_status_t::NUMERICAL_ISSUES) { | ||
| return dual::status_t::NUMERICAL; | ||
| return dual_status_t::NUMERICAL; | ||
| } else if (status == lp_status_t::CUTOFF) { | ||
| return dual::status_t::CUTOFF; | ||
| return dual_status_t::CUTOFF; | ||
| } else if (status == lp_status_t::CONCURRENT_LIMIT) { | ||
| return dual::status_t::CONCURRENT_LIMIT; | ||
| return dual_status_t::CONCURRENT_LIMIT; | ||
| } else if (status == lp_status_t::UNSET) { | ||
| return dual::status_t::UNSET; | ||
| return dual_status_t::UNSET; | ||
| } else { | ||
| return dual::status_t::NUMERICAL; | ||
| return dual_status_t::NUMERICAL; | ||
| } | ||
| } |
There was a problem hiding this comment.
Missing lp_status_t::UNBOUNDED mapping causes status misclassification.
convert_lp_status_to_dual_status does not handle lp_status_t::UNBOUNDED, so it falls into the default NUMERICAL path. That can incorrectly treat an unbounded result as a numerical failure in fallback solve paths.
Suggested fix
dual_status_t convert_lp_status_to_dual_status(lp_status_t status)
{
if (status == lp_status_t::OPTIMAL) {
return dual_status_t::OPTIMAL;
} else if (status == lp_status_t::INFEASIBLE) {
return dual_status_t::DUAL_UNBOUNDED;
+ } else if (status == lp_status_t::UNBOUNDED) {
+ return dual_status_t::DUAL_UNBOUNDED;
} else if (status == lp_status_t::ITERATION_LIMIT) {
return dual_status_t::ITERATION_LIMIT;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| dual_status_t convert_lp_status_to_dual_status(lp_status_t status) | |
| { | |
| if (status == lp_status_t::OPTIMAL) { | |
| return dual::status_t::OPTIMAL; | |
| return dual_status_t::OPTIMAL; | |
| } else if (status == lp_status_t::INFEASIBLE) { | |
| return dual::status_t::DUAL_UNBOUNDED; | |
| return dual_status_t::DUAL_UNBOUNDED; | |
| } else if (status == lp_status_t::ITERATION_LIMIT) { | |
| return dual::status_t::ITERATION_LIMIT; | |
| return dual_status_t::ITERATION_LIMIT; | |
| } else if (status == lp_status_t::TIME_LIMIT) { | |
| return dual::status_t::TIME_LIMIT; | |
| return dual_status_t::TIME_LIMIT; | |
| } else if (status == lp_status_t::WORK_LIMIT) { | |
| return dual::status_t::WORK_LIMIT; | |
| return dual_status_t::WORK_LIMIT; | |
| } else if (status == lp_status_t::NUMERICAL_ISSUES) { | |
| return dual::status_t::NUMERICAL; | |
| return dual_status_t::NUMERICAL; | |
| } else if (status == lp_status_t::CUTOFF) { | |
| return dual::status_t::CUTOFF; | |
| return dual_status_t::CUTOFF; | |
| } else if (status == lp_status_t::CONCURRENT_LIMIT) { | |
| return dual::status_t::CONCURRENT_LIMIT; | |
| return dual_status_t::CONCURRENT_LIMIT; | |
| } else if (status == lp_status_t::UNSET) { | |
| return dual::status_t::UNSET; | |
| return dual_status_t::UNSET; | |
| } else { | |
| return dual::status_t::NUMERICAL; | |
| return dual_status_t::NUMERICAL; | |
| } | |
| } | |
| dual_status_t convert_lp_status_to_dual_status(lp_status_t status) | |
| { | |
| if (status == lp_status_t::OPTIMAL) { | |
| return dual_status_t::OPTIMAL; | |
| } else if (status == lp_status_t::INFEASIBLE) { | |
| return dual_status_t::DUAL_UNBOUNDED; | |
| } else if (status == lp_status_t::UNBOUNDED) { | |
| return dual_status_t::DUAL_UNBOUNDED; | |
| } else if (status == lp_status_t::ITERATION_LIMIT) { | |
| return dual_status_t::ITERATION_LIMIT; | |
| } else if (status == lp_status_t::TIME_LIMIT) { | |
| return dual_status_t::TIME_LIMIT; | |
| } else if (status == lp_status_t::WORK_LIMIT) { | |
| return dual_status_t::WORK_LIMIT; | |
| } else if (status == lp_status_t::NUMERICAL_ISSUES) { | |
| return dual_status_t::NUMERICAL; | |
| } else if (status == lp_status_t::CUTOFF) { | |
| return dual_status_t::CUTOFF; | |
| } else if (status == lp_status_t::CONCURRENT_LIMIT) { | |
| return dual_status_t::CONCURRENT_LIMIT; | |
| } else if (status == lp_status_t::UNSET) { | |
| return dual_status_t::UNSET; | |
| } else { | |
| return dual_status_t::NUMERICAL; | |
| } | |
| } |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@cpp/src/branch_and_bound/branch_and_bound.cpp` around lines 150 - 173, The
function convert_lp_status_to_dual_status is missing a case for
lp_status_t::UNBOUNDED, causing it to incorrectly fall through to the default
case and return dual_status_t::NUMERICAL. Add an explicit case to handle
lp_status_t::UNBOUNDED before the final else clause in the
convert_lp_status_to_dual_status function, mapping it to the appropriate
dual_status_t value that represents an unbounded state (likely
dual_status_t::UNBOUNDED or similar).
There was a problem hiding this comment.
This is pre-existing. Open an issue to track it.
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
repo="NVIDIA/cuopt"
title="Track pre-existing LP unbounded status misclassification in B&B fallback mapping"
body=$(cat <<'EOF'
A pre-existing status-mapping issue was identified in the branch-and-bound fallback LP status conversion path.
Context:
- The conversion helper in `cpp/src/branch_and_bound/branch_and_bound.cpp` maps `lp_status_t` values into dual-simplex status values for fallback solve paths.
- `lp_status_t::UNBOUNDED` is not handled explicitly and can fall through to the generic numerical-status path.
- This can cause an unbounded LP status to be reported or handled as a numerical issue in affected fallback paths.
Backlinks:
- PR: https://github.com/NVIDIA/cuopt/pull/1446
- Review discussion: https://github.com/NVIDIA/cuopt/pull/1446#discussion_r3453442458
Requested by: `@mlubin`
EOF
)
gh issue create \
--repo "$repo" \
--title "$title" \
--body "$body" \
--assignee "mlubin"Length of output: 1029
@mlubin Opened the follow-up issue: #1447
🧠 Learnings used
Learnt from: aliceb-nv
Repo: NVIDIA/cuopt PR: 922
File: cpp/src/branch_and_bound/pseudo_costs.cpp:85-87
Timestamp: 2026-03-03T15:03:14.218Z
Learning: In cuOpt, the dual simplex method is dual-feasible throughout execution in the files under cpp/src/dual_simplex/ and cpp/src/branch_and_bound/. When a solver terminates early with status ITERATION_LIMIT, the current objective value is still a valid (lower) bound for minimization, though looser than the optimum. Treat ITERATION_LIMIT results as safe for strong branching bound tightening, fixings, and cutoff logic in these modules. Apply this guideline to all cpp/src/branch_and_bound and related dual_simplex implementations (i.e., all .cpp files under cpp/src/branch_and_bound and cpp/src/dual_simplex).
Learnt from: aliceb-nv
Repo: NVIDIA/cuopt PR: 986
File: cpp/src/branch_and_bound/branch_and_bound.cpp:8-8
Timestamp: 2026-03-23T11:33:23.998Z
Learning: In this repo (NVIDIA/cuopt), treat nvcc as the supported CUDA toolchain; clang-based compilation/support is not required and may fail/break. During code reviews, do NOT request code changes or add blocking comments for errors that appear only under clang (e.g., header-resolution failures such as 'utilities/determinism_log.hpp not found')—these can be toolchain-related rather than real source issues.
Learnt from: bdice
Repo: NVIDIA/cuopt PR: 1035
File: cpp/tests/utilities/base_fixture.hpp:29-47
Timestamp: 2026-04-19T16:49:17.616Z
Learning: In NVIDIA/cuopt (and the upstream rapidsai/rmm) after the RMM → CCCL migration, the rmm::mr resource adaptors (e.g., rmm::mr::pool_memory_resource and rmm::mr::binning_memory_resource) are now owning: they take/hold their upstream resources by value instead of non-owning references. Therefore, direct construction of adaptor chains from temporaries/local values (e.g., pool_memory_resource(make_async(), size)) is safe and should NOT be flagged as potential dangling/lifetime bugs. Also, rmm::mr::make_owning_wrapper is no longer needed/available for this owning design, so do not suggest it in this codepath.
| static bool is_dual_simplex_done(dual_status_t status) | ||
| { | ||
| return status == dual::status_t::DUAL_UNBOUNDED || status == dual::status_t::OPTIMAL || | ||
| status == dual::status_t::ITERATION_LIMIT || status == dual::status_t::CUTOFF; | ||
| return status == dual_status_t::DUAL_UNBOUNDED || status == dual_status_t::OPTIMAL || | ||
| status == dual_status_t::ITERATION_LIMIT || status == dual_status_t::CUTOFF; |
There was a problem hiding this comment.
Keep WORK_LIMIT handling consistent with the merge rule.
Line 688 treats WORK_LIMIT as a usable dual-simplex result, but the objective paths omit it, so a work-limited DS solve can be merged as DUAL_SIMPLEX with a NaN objective and skipped pseudo-cost updates.
Proposed consistency fix
static bool is_dual_simplex_done(dual_status_t status)
{
return status == dual_status_t::DUAL_UNBOUNDED || status == dual_status_t::OPTIMAL ||
- status == dual_status_t::ITERATION_LIMIT || status == dual_status_t::CUTOFF;
+ status == dual_status_t::ITERATION_LIMIT || status == dual_status_t::CUTOFF ||
+ status == dual_status_t::WORK_LIMIT;
}
@@
- } else if (status == dual_status_t::OPTIMAL || status == dual_status_t::ITERATION_LIMIT ||
- status == dual_status_t::CUTOFF) {
+ } else if (status == dual_status_t::OPTIMAL || status == dual_status_t::ITERATION_LIMIT ||
+ status == dual_status_t::CUTOFF || status == dual_status_t::WORK_LIMIT) {
obj = compute_objective(child_problem, solution.x);
@@
- } else if (status == dual_status_t::OPTIMAL || status == dual_status_t::ITERATION_LIMIT ||
- status == dual_status_t::CUTOFF) {
+ } else if (status == dual_status_t::OPTIMAL || status == dual_status_t::ITERATION_LIMIT ||
+ status == dual_status_t::CUTOFF || status == dual_status_t::WORK_LIMIT) {
return {compute_objective(child_problem, solution.x), status};Also applies to: 374-379, 522-529, 687-690
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@cpp/src/branch_and_bound/pseudo_costs.cpp` around lines 34 - 37, The
is_dual_simplex_done function does not include WORK_LIMIT as a valid
dual-simplex status, which is inconsistent with how WORK_LIMIT is treated at
line 688 where it is considered a usable result. Add WORK_LIMIT to the return
statement condition in is_dual_simplex_done alongside the existing
DUAL_UNBOUNDED, OPTIMAL, ITERATION_LIMIT, and CUTOFF statuses. Apply this same
change to the other similar status checks mentioned at lines 374-379, 522-529,
and 687-690 to ensure consistent handling of WORK_LIMIT across all dual-simplex
result validation paths.
There was a problem hiding this comment.
Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!
There was a problem hiding this comment.
Currently, no. This function is called only for dual simplex + Batch PDLP which are disabled with the deterministic mode. In any case, we should patch it. @Kh4ster wrote that code path.
Header-scope 'using namespace' leaks into every including TU. Replace with explicit qualification in the affected barrier/branch_and_bound/cuts headers (and grpc_server_types.hpp). TU-local directives in .cpp/.cu are left as-is. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Miles Lubin <mlubin@nvidia.com>
5eab332 to
d5726ae
Compare
The dual_simplex namespace was renamed to simplex; update two barrier explicit-instantiation comments that still named the old namespace. The dual_simplex/ include paths and DUAL_SIMPLEX_* macros are unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Miles Lubin <mlubin@nvidia.com>
|
/ok to test 801d31c |
chris-maes
left a comment
There was a problem hiding this comment.
Let's not merge until we have more discussion.
…mization Umbrella namespace + public include path rename (per team naming decision). include/cuopt/math_optimization -> include/cuopt/mathematical_optimization. No structural change; sub-namespaces (pdlp/simplex/barrier/mip/io) ride along. Python package cuopt.linear_programming unchanged; C API shim forward target updated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Miles Lubin <mlubin@nvidia.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
cpp/src/cuts/objective_step.cpp (1)
19-20: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winReplace namespace-wide import with narrow symbol imports.
Line 19 introduces a namespace-scope
using namespace, which widens symbol visibility for the full TU. Please switch to explicitusingdeclarations (or fully-qualified names) for only the needed simplex symbols.As per coding guidelines, avoid
using namespaceat file scope and keep linkage/import scope narrow.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cpp/src/cuts/objective_step.cpp` around lines 19 - 20, Replace the namespace-wide using directive for cuopt::mathematical_optimization::simplex with explicit using declarations for only the specific symbols needed from that namespace (such as objective_step_t and others referenced in the file). Remove the `using namespace cuopt::mathematical_optimization::simplex;` statement and add individual `using` declarations like `using cuopt::mathematical_optimization::simplex::objective_step_t;` for each required symbol, or alternatively use fully-qualified names throughout the file for these symbols.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@cpp/src/cuts/objective_step.cpp`:
- Around line 19-20: Replace the namespace-wide using directive for
cuopt::mathematical_optimization::simplex with explicit using declarations for
only the specific symbols needed from that namespace (such as objective_step_t
and others referenced in the file). Remove the `using namespace
cuopt::mathematical_optimization::simplex;` statement and add individual `using`
declarations like `using
cuopt::mathematical_optimization::simplex::objective_step_t;` for each required
symbol, or alternatively use fully-qualified names throughout the file for these
symbols.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 35830f90-0d55-4785-8c5b-dfeb23e46523
📒 Files selected for processing (300)
.coderabbit.yaml.github/.coderabbit_review_guide.mdbenchmarks/linear_programming/cuopt/benchmark_helper.hppbenchmarks/linear_programming/cuopt/initial_problem_check.hppbenchmarks/linear_programming/cuopt/run_mip.cppbenchmarks/linear_programming/cuopt/run_pdlp.cuci/test_doc_examples.shcpp/cuopt_cli.cppcpp/doxygen/Doxyfilecpp/include/cuopt/error.hppcpp/include/cuopt/linear_programming/cuopt_c.hcpp/include/cuopt/mathematical_optimization/backend_selection.hppcpp/include/cuopt/mathematical_optimization/constants.hcpp/include/cuopt/mathematical_optimization/cpu_optimization_problem.hppcpp/include/cuopt/mathematical_optimization/cpu_optimization_problem_solution.hppcpp/include/cuopt/mathematical_optimization/cpu_pdlp_warm_start_data.hppcpp/include/cuopt/mathematical_optimization/csr_matrix_utils.hppcpp/include/cuopt/mathematical_optimization/cuopt_c.hcpp/include/cuopt/mathematical_optimization/io/data_model_view.hppcpp/include/cuopt/mathematical_optimization/io/mps_data_model.hppcpp/include/cuopt/mathematical_optimization/io/mps_writer.hppcpp/include/cuopt/mathematical_optimization/io/parser.hppcpp/include/cuopt/mathematical_optimization/io/utilities/cython_parser.hppcpp/include/cuopt/mathematical_optimization/io/writer.hppcpp/include/cuopt/mathematical_optimization/mip/diving_hyper_params.hppcpp/include/cuopt/mathematical_optimization/mip/heuristics_hyper_params.hppcpp/include/cuopt/mathematical_optimization/mip/solver_settings.hppcpp/include/cuopt/mathematical_optimization/mip/solver_solution.hppcpp/include/cuopt/mathematical_optimization/mip/solver_stats.hppcpp/include/cuopt/mathematical_optimization/optimization_problem.hppcpp/include/cuopt/mathematical_optimization/optimization_problem_interface.hppcpp/include/cuopt/mathematical_optimization/optimization_problem_solution.hppcpp/include/cuopt/mathematical_optimization/optimization_problem_solution_interface.hppcpp/include/cuopt/mathematical_optimization/optimization_problem_utils.hppcpp/include/cuopt/mathematical_optimization/pdlp/pdlp_hyper_params.cuhcpp/include/cuopt/mathematical_optimization/pdlp/pdlp_warm_start_data.hppcpp/include/cuopt/mathematical_optimization/pdlp/solver_settings.hppcpp/include/cuopt/mathematical_optimization/pdlp/solver_solution.hppcpp/include/cuopt/mathematical_optimization/solve.hppcpp/include/cuopt/mathematical_optimization/solve_remote.hppcpp/include/cuopt/mathematical_optimization/solver_settings.hppcpp/include/cuopt/mathematical_optimization/utilities/callbacks_implems.hppcpp/include/cuopt/mathematical_optimization/utilities/cython_solve.hppcpp/include/cuopt/mathematical_optimization/utilities/cython_types.hppcpp/include/cuopt/mathematical_optimization/utilities/internals.hppcpp/include/cuopt/mathematical_optimization/utilities/segmented_sum_handler.cuhcpp/src/barrier/barrier.cucpp/src/barrier/barrier.hppcpp/src/barrier/conjugate_gradient.hppcpp/src/barrier/cusparse_info.hppcpp/src/barrier/cusparse_view.cucpp/src/barrier/cusparse_view.hppcpp/src/barrier/dense_matrix.hppcpp/src/barrier/dense_vector.hppcpp/src/barrier/device_sparse_matrix.cucpp/src/barrier/device_sparse_matrix.cuhcpp/src/barrier/iterative_refinement.hppcpp/src/barrier/pinned_host_allocator.cucpp/src/barrier/pinned_host_allocator.hppcpp/src/barrier/second_order_cone_kernels.cuhcpp/src/barrier/second_order_cone_reduction.cuhcpp/src/barrier/sparse_cholesky.cuhcpp/src/barrier/sparse_matrix_kernels.cuhcpp/src/barrier/translate_soc.hppcpp/src/branch_and_bound/bb_event.hppcpp/src/branch_and_bound/branch_and_bound.cppcpp/src/branch_and_bound/branch_and_bound.hppcpp/src/branch_and_bound/constants.hppcpp/src/branch_and_bound/deterministic_workers.hppcpp/src/branch_and_bound/diving_heuristics.cppcpp/src/branch_and_bound/diving_heuristics.hppcpp/src/branch_and_bound/mip_node.hppcpp/src/branch_and_bound/node_queue.hppcpp/src/branch_and_bound/pseudo_costs.cppcpp/src/branch_and_bound/pseudo_costs.hppcpp/src/branch_and_bound/shared_strong_branching_context.hppcpp/src/branch_and_bound/symmetry.hppcpp/src/branch_and_bound/worker.hppcpp/src/branch_and_bound/worker_pool.hppcpp/src/cuts/cuts.cppcpp/src/cuts/cuts.hppcpp/src/cuts/objective_step.cppcpp/src/cuts/objective_step.hppcpp/src/cuts/rational.hppcpp/src/dual_simplex/basis_solves.cppcpp/src/dual_simplex/basis_solves.hppcpp/src/dual_simplex/basis_updates.cppcpp/src/dual_simplex/basis_updates.hppcpp/src/dual_simplex/bound_flipping_ratio_test.cppcpp/src/dual_simplex/bound_flipping_ratio_test.hppcpp/src/dual_simplex/bounds_strengthening.cppcpp/src/dual_simplex/bounds_strengthening.hppcpp/src/dual_simplex/crossover.cppcpp/src/dual_simplex/crossover.hppcpp/src/dual_simplex/folding.cppcpp/src/dual_simplex/folding.hppcpp/src/dual_simplex/initial_basis.cppcpp/src/dual_simplex/initial_basis.hppcpp/src/dual_simplex/logger.hppcpp/src/dual_simplex/phase1.cppcpp/src/dual_simplex/phase1.hppcpp/src/dual_simplex/phase2.cppcpp/src/dual_simplex/phase2.hppcpp/src/dual_simplex/presolve.cppcpp/src/dual_simplex/presolve.hppcpp/src/dual_simplex/primal.cppcpp/src/dual_simplex/primal.hppcpp/src/dual_simplex/random.hppcpp/src/dual_simplex/right_looking_lu.cppcpp/src/dual_simplex/right_looking_lu.hppcpp/src/dual_simplex/scaling.cppcpp/src/dual_simplex/scaling.hppcpp/src/dual_simplex/simplex_solver_settings.hppcpp/src/dual_simplex/singletons.cppcpp/src/dual_simplex/singletons.hppcpp/src/dual_simplex/solution.hppcpp/src/dual_simplex/solve.cppcpp/src/dual_simplex/solve.hppcpp/src/dual_simplex/sparse_matrix.cppcpp/src/dual_simplex/sparse_matrix.hppcpp/src/dual_simplex/sparse_vector.cppcpp/src/dual_simplex/sparse_vector.hppcpp/src/dual_simplex/tic_toc.cppcpp/src/dual_simplex/tic_toc.hppcpp/src/dual_simplex/triangle_solve.cppcpp/src/dual_simplex/triangle_solve.hppcpp/src/dual_simplex/types.hppcpp/src/dual_simplex/user_problem.hppcpp/src/dual_simplex/vector_math.cppcpp/src/dual_simplex/vector_math.cuhcpp/src/dual_simplex/vector_math.hppcpp/src/grpc/client/grpc_client.cppcpp/src/grpc/client/grpc_client.hppcpp/src/grpc/client/solve_remote.cppcpp/src/grpc/codegen/field_registry.yamlcpp/src/grpc/grpc_chunk_key.hppcpp/src/grpc/grpc_problem_mapper.cppcpp/src/grpc/grpc_problem_mapper.hppcpp/src/grpc/grpc_service_mapper.cppcpp/src/grpc/grpc_service_mapper.hppcpp/src/grpc/grpc_settings_mapper.cppcpp/src/grpc/grpc_settings_mapper.hppcpp/src/grpc/grpc_solution_mapper.cppcpp/src/grpc/grpc_solution_mapper.hppcpp/src/grpc/server/grpc_pipe_serialization.hppcpp/src/grpc/server/grpc_server_types.hppcpp/src/grpc/server/grpc_service_impl.cppcpp/src/grpc/server/grpc_worker.cppcpp/src/io/data_model_view.cppcpp/src/io/file_to_string.cppcpp/src/io/file_to_string.hppcpp/src/io/lp_parser.cppcpp/src/io/lp_parser.hppcpp/src/io/mps_data_model.cppcpp/src/io/mps_parser.cppcpp/src/io/mps_parser_internal.hppcpp/src/io/mps_writer.cppcpp/src/io/parser.cppcpp/src/io/utilities/cython_parser.cppcpp/src/io/utilities/error.hppcpp/src/io/writer.cppcpp/src/math_optimization/solution_reader.cucpp/src/math_optimization/solution_reader.hppcpp/src/math_optimization/solution_writer.cucpp/src/math_optimization/solution_writer.hppcpp/src/math_optimization/solver_settings.cucpp/src/mip_heuristics/diversity/assignment_hash_map.cucpp/src/mip_heuristics/diversity/assignment_hash_map.cuhcpp/src/mip_heuristics/diversity/diversity_config.hppcpp/src/mip_heuristics/diversity/diversity_manager.cucpp/src/mip_heuristics/diversity/diversity_manager.cuhcpp/src/mip_heuristics/diversity/lns/rins.cucpp/src/mip_heuristics/diversity/lns/rins.cuhcpp/src/mip_heuristics/diversity/multi_armed_bandit.cucpp/src/mip_heuristics/diversity/multi_armed_bandit.cuhcpp/src/mip_heuristics/diversity/population.cucpp/src/mip_heuristics/diversity/population.cuhcpp/src/mip_heuristics/diversity/recombiners/bound_prop_recombiner.cuhcpp/src/mip_heuristics/diversity/recombiners/fp_recombiner.cuhcpp/src/mip_heuristics/diversity/recombiners/line_segment_recombiner.cuhcpp/src/mip_heuristics/diversity/recombiners/recombiner.cuhcpp/src/mip_heuristics/diversity/recombiners/recombiner_configs.hppcpp/src/mip_heuristics/diversity/recombiners/recombiner_stats.hppcpp/src/mip_heuristics/diversity/recombiners/sub_mip.cuhcpp/src/mip_heuristics/diversity/weights.cuhcpp/src/mip_heuristics/early_heuristic.cuhcpp/src/mip_heuristics/feasibility_jump/cpu_fj_thread.cuhcpp/src/mip_heuristics/feasibility_jump/early_cpufj.cucpp/src/mip_heuristics/feasibility_jump/early_cpufj.cuhcpp/src/mip_heuristics/feasibility_jump/early_gpufj.cucpp/src/mip_heuristics/feasibility_jump/early_gpufj.cuhcpp/src/mip_heuristics/feasibility_jump/feasibility_jump.cucpp/src/mip_heuristics/feasibility_jump/feasibility_jump.cuhcpp/src/mip_heuristics/feasibility_jump/feasibility_jump_impl_common.cuhcpp/src/mip_heuristics/feasibility_jump/feasibility_jump_kernels.cucpp/src/mip_heuristics/feasibility_jump/feasibility_jump_kernels.cuhcpp/src/mip_heuristics/feasibility_jump/fj_cpu.cucpp/src/mip_heuristics/feasibility_jump/fj_cpu.cuhcpp/src/mip_heuristics/feasibility_jump/utils.cuhcpp/src/mip_heuristics/local_search/feasibility_pump/feasibility_pump.cucpp/src/mip_heuristics/local_search/feasibility_pump/feasibility_pump.cuhcpp/src/mip_heuristics/local_search/lagrangian.cuhcpp/src/mip_heuristics/local_search/line_segment_search/line_segment_search.cucpp/src/mip_heuristics/local_search/line_segment_search/line_segment_search.cuhcpp/src/mip_heuristics/local_search/local_search.cucpp/src/mip_heuristics/local_search/local_search.cuhcpp/src/mip_heuristics/local_search/local_search_config.hppcpp/src/mip_heuristics/local_search/rounding/bounds_repair.cucpp/src/mip_heuristics/local_search/rounding/bounds_repair.cuhcpp/src/mip_heuristics/local_search/rounding/constraint_prop.cucpp/src/mip_heuristics/local_search/rounding/constraint_prop.cuhcpp/src/mip_heuristics/local_search/rounding/lb_bounds_repair.cucpp/src/mip_heuristics/local_search/rounding/lb_bounds_repair.cuhcpp/src/mip_heuristics/local_search/rounding/lb_constraint_prop.cucpp/src/mip_heuristics/local_search/rounding/lb_constraint_prop.cuhcpp/src/mip_heuristics/local_search/rounding/simple_rounding.cucpp/src/mip_heuristics/local_search/rounding/simple_rounding.cuhcpp/src/mip_heuristics/local_search/rounding/simple_rounding_kernels.cuhcpp/src/mip_heuristics/logger.cuhcpp/src/mip_heuristics/mip_constants.hppcpp/src/mip_heuristics/mip_scaling_strategy.cucpp/src/mip_heuristics/mip_scaling_strategy.cuhcpp/src/mip_heuristics/presolve/bounds_presolve.cucpp/src/mip_heuristics/presolve/bounds_presolve.cuhcpp/src/mip_heuristics/presolve/bounds_presolve_helpers.cuhcpp/src/mip_heuristics/presolve/bounds_update_data.cucpp/src/mip_heuristics/presolve/bounds_update_data.cuhcpp/src/mip_heuristics/presolve/bounds_update_helpers.cuhcpp/src/mip_heuristics/presolve/conditional_bound_strengthening.cucpp/src/mip_heuristics/presolve/conditional_bound_strengthening.cuhcpp/src/mip_heuristics/presolve/conflict_graph/clique_table.cucpp/src/mip_heuristics/presolve/conflict_graph/clique_table.cuhcpp/src/mip_heuristics/presolve/gf2_presolve.cppcpp/src/mip_heuristics/presolve/gf2_presolve.hppcpp/src/mip_heuristics/presolve/lb_probing_cache.cucpp/src/mip_heuristics/presolve/load_balanced_bounds_presolve.cucpp/src/mip_heuristics/presolve/load_balanced_bounds_presolve.cuhcpp/src/mip_heuristics/presolve/load_balanced_bounds_presolve_helpers.cuhcpp/src/mip_heuristics/presolve/load_balanced_bounds_presolve_kernels.cuhcpp/src/mip_heuristics/presolve/load_balanced_partition_helpers.cuhcpp/src/mip_heuristics/presolve/multi_probe.cucpp/src/mip_heuristics/presolve/multi_probe.cuhcpp/src/mip_heuristics/presolve/probing_cache.cucpp/src/mip_heuristics/presolve/probing_cache.cuhcpp/src/mip_heuristics/presolve/semi_continuous.cucpp/src/mip_heuristics/presolve/semi_continuous.cuhcpp/src/mip_heuristics/presolve/third_party_presolve.cppcpp/src/mip_heuristics/presolve/third_party_presolve.hppcpp/src/mip_heuristics/presolve/trivial_presolve.cucpp/src/mip_heuristics/presolve/trivial_presolve.cuhcpp/src/mip_heuristics/presolve/trivial_presolve_helpers.cuhcpp/src/mip_heuristics/presolve/utils.cuhcpp/src/mip_heuristics/problem/host_helper.cuhcpp/src/mip_heuristics/problem/load_balanced_problem.cucpp/src/mip_heuristics/problem/load_balanced_problem.cuhcpp/src/mip_heuristics/problem/presolve_data.cucpp/src/mip_heuristics/problem/presolve_data.cuhcpp/src/mip_heuristics/problem/problem.cucpp/src/mip_heuristics/problem/problem.cuhcpp/src/mip_heuristics/problem/problem_fixing.cuhcpp/src/mip_heuristics/problem/problem_helpers.cuhcpp/src/mip_heuristics/problem/problem_kernels.cuhcpp/src/mip_heuristics/problem/write_mps.cucpp/src/mip_heuristics/relaxed_lp/lp_state.cuhcpp/src/mip_heuristics/relaxed_lp/relaxed_lp.cucpp/src/mip_heuristics/relaxed_lp/relaxed_lp.cuhcpp/src/mip_heuristics/solution/feasibility_test.cuhcpp/src/mip_heuristics/solution/solution.cucpp/src/mip_heuristics/solution/solution.cuhcpp/src/mip_heuristics/solution/solution_kernels.cuhcpp/src/mip_heuristics/solve.cucpp/src/mip_heuristics/solver.cucpp/src/mip_heuristics/solver.cuhcpp/src/mip_heuristics/solver_context.cuhcpp/src/mip_heuristics/solver_settings.cucpp/src/mip_heuristics/solver_solution.cucpp/src/mip_heuristics/utilities/sort_csr.cuhcpp/src/mip_heuristics/utils.cuhcpp/src/pdlp/backend_selection.cppcpp/src/pdlp/cpu_optimization_problem.cppcpp/src/pdlp/cpu_pdlp_warm_start_data.cucpp/src/pdlp/cuopt_c.cppcpp/src/pdlp/cuopt_c_internal.hppcpp/src/pdlp/cusparse_view.cucpp/src/pdlp/cusparse_view.hppcpp/src/pdlp/initial_scaling_strategy/initial_scaling.cucpp/src/pdlp/initial_scaling_strategy/initial_scaling.cuhcpp/src/pdlp/optimal_batch_size_handler/optimal_batch_size_handler.cucpp/src/pdlp/optimal_batch_size_handler/optimal_batch_size_handler.hppcpp/src/pdlp/optimization_problem.cucpp/src/pdlp/pdhg.cucpp/src/pdlp/pdhg.hppcpp/src/pdlp/pdlp.cucpp/src/pdlp/pdlp.cuhcpp/src/pdlp/pdlp_constants.hppcpp/src/pdlp/pdlp_warm_start_data.cucpp/src/pdlp/restart_strategy/localized_duality_gap_container.cucpp/src/pdlp/restart_strategy/localized_duality_gap_container.hppcpp/src/pdlp/restart_strategy/pdlp_restart_strategy.cucpp/src/pdlp/restart_strategy/pdlp_restart_strategy.cuh
💤 Files with no reviewable changes (1)
- cpp/include/cuopt/mathematical_optimization/utilities/segmented_sum_handler.cuh
✅ Files skipped from review due to trivial changes (49)
- cpp/src/mip_heuristics/diversity/recombiners/line_segment_recombiner.cuh
- cpp/src/mip_heuristics/presolve/multi_probe.cuh
- cpp/include/cuopt/mathematical_optimization/backend_selection.hpp
- cpp/src/mip_heuristics/utilities/sort_csr.cuh
- cpp/src/dual_simplex/user_problem.hpp
- cpp/src/dual_simplex/basis_updates.hpp
- cpp/src/dual_simplex/basis_solves.hpp
- cpp/src/dual_simplex/initial_basis.cpp
- cpp/src/mip_heuristics/problem/load_balanced_problem.cu
- cpp/src/mip_heuristics/local_search/rounding/constraint_prop.cu
- cpp/src/mip_heuristics/diversity/diversity_config.hpp
- cpp/src/mip_heuristics/relaxed_lp/lp_state.cuh
- cpp/src/mip_heuristics/diversity/assignment_hash_map.cu
- cpp/src/mip_heuristics/local_search/line_segment_search/line_segment_search.cuh
- cpp/src/mip_heuristics/logger.cuh
- cpp/src/mip_heuristics/presolve/utils.cuh
- .github/.coderabbit_review_guide.md
- cpp/src/mip_heuristics/presolve/load_balanced_partition_helpers.cuh
- cpp/src/barrier/second_order_cone_kernels.cuh
- cpp/src/branch_and_bound/shared_strong_branching_context.hpp
- cpp/src/dual_simplex/initial_basis.hpp
- cpp/src/dual_simplex/vector_math.cuh
- cpp/src/mip_heuristics/solution/feasibility_test.cuh
- cpp/src/mip_heuristics/presolve/load_balanced_bounds_presolve_kernels.cuh
- cpp/src/mip_heuristics/local_search/rounding/lb_bounds_repair.cuh
- cpp/src/dual_simplex/phase1.cpp
- cpp/src/grpc/grpc_solution_mapper.cpp
- cpp/src/mip_heuristics/presolve/gf2_presolve.cpp
- cpp/src/cuts/rational.hpp
- cpp/src/mip_heuristics/diversity/recombiners/fp_recombiner.cuh
- cpp/src/grpc/codegen/field_registry.yaml
- cpp/src/mip_heuristics/local_search/rounding/lb_constraint_prop.cuh
- cpp/src/mip_heuristics/diversity/recombiners/recombiner.cuh
- cpp/src/dual_simplex/sparse_vector.hpp
- cpp/src/mip_heuristics/feasibility_jump/early_cpufj.cu
- cpp/src/mip_heuristics/solution/solution_kernels.cuh
- cpp/src/mip_heuristics/problem/write_mps.cu
- cpp/src/mip_heuristics/presolve/bounds_update_data.cu
- cpp/src/mip_heuristics/local_search/line_segment_search/line_segment_search.cu
- cpp/src/mip_heuristics/feasibility_jump/early_gpufj.cu
- cpp/src/dual_simplex/singletons.cpp
- cpp/src/mip_heuristics/local_search/rounding/simple_rounding.cu
- cpp/src/branch_and_bound/diving_heuristics.cpp
- cpp/src/mip_heuristics/diversity/assignment_hash_map.cuh
- cpp/src/pdlp/backend_selection.cpp
- cpp/doxygen/Doxyfile
- cpp/src/pdlp/cpu_pdlp_warm_start_data.cu
- cpp/src/grpc/grpc_service_mapper.cpp
- cpp/src/mip_heuristics/relaxed_lp/relaxed_lp.cu
🚧 Files skipped from review as they are similar to previous changes (141)
- cpp/src/mip_heuristics/local_search/lagrangian.cuh
- cpp/src/dual_simplex/scaling.hpp
- cpp/src/mip_heuristics/presolve/trivial_presolve.cu
- cpp/src/mip_heuristics/local_search/rounding/simple_rounding_kernels.cuh
- cpp/src/dual_simplex/sparse_vector.cpp
- cpp/src/dual_simplex/singletons.hpp
- cpp/src/grpc/server/grpc_service_impl.cpp
- cpp/src/mip_heuristics/diversity/multi_armed_bandit.cu
- cpp/src/barrier/conjugate_gradient.hpp
- cpp/src/dual_simplex/logger.hpp
- cpp/src/mip_heuristics/presolve/bounds_presolve.cuh
- cpp/src/mip_heuristics/local_search/rounding/constraint_prop.cuh
- cpp/src/mip_heuristics/presolve/bounds_update_data.cuh
- cpp/src/mip_heuristics/presolve/load_balanced_bounds_presolve_helpers.cuh
- cpp/src/pdlp/pdlp_warm_start_data.cu
- cpp/src/barrier/cusparse_view.hpp
- cpp/src/io/utilities/cython_parser.cpp
- cpp/src/dual_simplex/vector_math.cpp
- cpp/src/mip_heuristics/presolve/bounds_presolve.cu
- cpp/src/dual_simplex/triangle_solve.hpp
- cpp/src/pdlp/pdlp_constants.hpp
- cpp/src/dual_simplex/solve.hpp
- cpp/src/mip_heuristics/presolve/bounds_presolve_helpers.cuh
- cpp/src/grpc/client/grpc_client.hpp
- cpp/src/mip_heuristics/local_search/local_search.cuh
- cpp/src/mip_heuristics/feasibility_jump/early_cpufj.cuh
- cpp/src/mip_heuristics/diversity/recombiners/recombiner_stats.hpp
- benchmarks/linear_programming/cuopt/initial_problem_check.hpp
- benchmarks/linear_programming/cuopt/run_pdlp.cu
- cpp/src/mip_heuristics/feasibility_jump/feasibility_jump_kernels.cuh
- cpp/src/mip_heuristics/presolve/load_balanced_bounds_presolve.cu
- cpp/include/cuopt/linear_programming/cuopt_c.h
- cpp/src/mip_heuristics/presolve/multi_probe.cu
- cpp/src/mip_heuristics/local_search/feasibility_pump/feasibility_pump.cuh
- cpp/src/math_optimization/solution_writer.hpp
- cpp/src/dual_simplex/phase1.hpp
- cpp/src/dual_simplex/bound_flipping_ratio_test.hpp
- cpp/src/grpc/grpc_problem_mapper.hpp
- cpp/src/io/lp_parser.hpp
- cpp/src/grpc/grpc_solution_mapper.hpp
- cpp/src/dual_simplex/presolve.cpp
- cpp/src/mip_heuristics/feasibility_jump/cpu_fj_thread.cuh
- cpp/src/mip_heuristics/diversity/multi_armed_bandit.cuh
- cpp/src/mip_heuristics/problem/problem_kernels.cuh
- cpp/src/grpc/server/grpc_pipe_serialization.hpp
- cpp/src/dual_simplex/triangle_solve.cpp
- cpp/src/dual_simplex/bounds_strengthening.cpp
- cpp/src/grpc/server/grpc_worker.cpp
- cpp/src/dual_simplex/random.hpp
- cpp/src/mip_heuristics/local_search/local_search.cu
- cpp/src/mip_heuristics/problem/problem_fixing.cuh
- cpp/src/grpc/server/grpc_server_types.hpp
- cpp/src/mip_heuristics/problem/load_balanced_problem.cuh
- cpp/src/mip_heuristics/presolve/load_balanced_bounds_presolve.cuh
- cpp/src/mip_heuristics/problem/presolve_data.cuh
- cpp/src/mip_heuristics/feasibility_jump/feasibility_jump.cuh
- cpp/src/branch_and_bound/node_queue.hpp
- cpp/src/mip_heuristics/presolve/gf2_presolve.hpp
- cpp/src/barrier/second_order_cone_reduction.cuh
- cpp/src/mip_heuristics/local_search/rounding/lb_bounds_repair.cu
- cpp/src/mip_heuristics/early_heuristic.cuh
- cpp/src/mip_heuristics/feasibility_jump/early_gpufj.cuh
- cpp/src/pdlp/restart_strategy/localized_duality_gap_container.hpp
- cpp/src/io/writer.cpp
- cpp/src/dual_simplex/primal.cpp
- cpp/src/mip_heuristics/local_search/rounding/bounds_repair.cu
- cpp/src/io/file_to_string.cpp
- cpp/src/dual_simplex/basis_solves.cpp
- cpp/src/dual_simplex/solution.hpp
- ci/test_doc_examples.sh
- cpp/src/branch_and_bound/worker.hpp
- cpp/src/mip_heuristics/diversity/diversity_manager.cuh
- cpp/src/mip_heuristics/diversity/lns/rins.cuh
- cpp/src/io/file_to_string.hpp
- cpp/src/mip_heuristics/presolve/conflict_graph/clique_table.cuh
- cpp/src/mip_heuristics/solution/solution.cu
- cpp/src/pdlp/optimal_batch_size_handler/optimal_batch_size_handler.hpp
- cpp/src/mip_heuristics/solver_context.cuh
- cpp/src/dual_simplex/sparse_matrix.hpp
- cpp/src/mip_heuristics/feasibility_jump/feasibility_jump.cu
- cpp/src/mip_heuristics/problem/problem.cuh
- cpp/src/grpc/grpc_problem_mapper.cpp
- cpp/src/mip_heuristics/feasibility_jump/utils.cuh
- cpp/src/io/mps_data_model.cpp
- cpp/src/barrier/pinned_host_allocator.cu
- cpp/src/mip_heuristics/solver.cuh
- cpp/src/dual_simplex/sparse_matrix.cpp
- cpp/src/mip_heuristics/mip_constants.hpp
- cpp/src/mip_heuristics/local_search/feasibility_pump/feasibility_pump.cu
- cpp/src/io/data_model_view.cpp
- cpp/src/pdlp/pdlp.cuh
- cpp/src/barrier/device_sparse_matrix.cuh
- cpp/src/branch_and_bound/deterministic_workers.hpp
- cpp/src/mip_heuristics/presolve/semi_continuous.cu
- cpp/src/mip_heuristics/problem/presolve_data.cu
- cpp/src/pdlp/cuopt_c.cpp
- cpp/src/io/mps_parser_internal.hpp
- benchmarks/linear_programming/cuopt/run_mip.cpp
- cpp/src/pdlp/restart_strategy/localized_duality_gap_container.cu
- cpp/src/mip_heuristics/presolve/third_party_presolve.cpp
- cpp/src/dual_simplex/tic_toc.hpp
- cpp/src/mip_heuristics/relaxed_lp/relaxed_lp.cuh
- cpp/src/grpc/client/solve_remote.cpp
- cpp/src/dual_simplex/crossover.cpp
- cpp/src/mip_heuristics/mip_scaling_strategy.cu
- cpp/src/mip_heuristics/diversity/lns/rins.cu
- cpp/src/pdlp/optimization_problem.cu
- cpp/src/cuts/cuts.cpp
- cpp/src/mip_heuristics/diversity/population.cu
- cpp/src/barrier/cusparse_view.cu
- cpp/src/mip_heuristics/solver_settings.cu
- cpp/src/branch_and_bound/mip_node.hpp
- cpp/src/mip_heuristics/presolve/conflict_graph/clique_table.cu
- cpp/src/pdlp/optimal_batch_size_handler/optimal_batch_size_handler.cu
- cpp/src/io/lp_parser.cpp
- cpp/src/branch_and_bound/pseudo_costs.cpp
- cpp/include/cuopt/error.hpp
- cpp/src/dual_simplex/phase2.hpp
- cpp/src/dual_simplex/solve.cpp
- cpp/src/pdlp/pdhg.hpp
- cpp/src/pdlp/restart_strategy/pdlp_restart_strategy.cu
- cpp/src/pdlp/restart_strategy/pdlp_restart_strategy.cuh
- cpp/src/mip_heuristics/diversity/recombiners/sub_mip.cuh
- cpp/src/dual_simplex/basis_updates.cpp
- cpp/src/mip_heuristics/feasibility_jump/fj_cpu.cu
- cpp/src/mip_heuristics/problem/problem_helpers.cuh
- cpp/src/pdlp/initial_scaling_strategy/initial_scaling.cu
- cpp/src/pdlp/cuopt_c_internal.hpp
- cpp/src/pdlp/cusparse_view.cu
- cpp/src/branch_and_bound/branch_and_bound.hpp
- cpp/src/mip_heuristics/solver.cu
- cpp/src/barrier/translate_soc.hpp
- cpp/src/barrier/sparse_cholesky.cuh
- cpp/src/mip_heuristics/solve.cu
- cpp/src/barrier/barrier.cu
- cpp/src/pdlp/initial_scaling_strategy/initial_scaling.cuh
- cpp/src/dual_simplex/phase2.cpp
- cpp/src/pdlp/pdlp.cu
- cpp/src/cuts/cuts.hpp
- cpp/src/mip_heuristics/problem/problem.cu
- cpp/src/branch_and_bound/branch_and_bound.cpp
|
/ok to test 58dc479 |
local_search.cuh forward-declared branch_and_bound_t in the simplex namespace, but the type lives in ::mip (the file's actual use is mip::branch_and_bound_t, reachable via solver_context.cuh). The stray decl was a leftover: Task moving B&B to ::mip updated the usage but missed this forward declaration, which the dual_simplex->simplex rename then renamed. Dead (nothing referenced simplex::branch_and_bound_t); removed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Miles Lubin <mlubin@nvidia.com>
|
/ok to test 342ec39 |
chris-maes
left a comment
There was a problem hiding this comment.
I did a spot check of the files. A few comments.
Inside MIP (branch and bound / cuts) things are now quite verbose. This is because MIP builds on Dual Simplex types quite a bit (before they shared a namespace). The following are used all over the place and read very verbose to me (that is they would be better without having to specify the simplex namespace:
- simplex::tic/simplex::toc
- simplex::inf
- simplex::variable_types_t
- simplex::csc_matrix_t/simplex::csr_matrix_t
- simplex::simplex_solver_settings_t
What I don't understand is that sometimes I see a
using namespace cuopt::mathematical_optimization::simplex
inside the mip namespace. If we have that using do we still need the simplex qualifier in mip? If not, why do I see all the above simplex qualifiers? Is it just that we are not applying using namespace simplex in all files?
Also in phase2.cpp the phase2 local namespace was removed. One purpose of this namespace was to distinguish routines in phase 2 of dual simplex, from routines with similar names in crossover and primal simplex. Is it possible to restore the phase2 namespace in phase2.cpp?
Replace the inconsistent mix of 'using namespace simplex' directives and scattered full qualification with per-file 'using simplex::NAME;' declarations for names used 2+ times (bare thereafter); single uses stay qualified. Headers remain fully-qualified; the shadowed vector_norm* family stays simplex::-qualified. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Miles Lubin <mlubin@nvidia.com>
…using-declarations grpc server glue and the C API impl kept file-scope 'using namespace cuopt::mathematical_optimization[::io]'; replace with targeted using-declarations (>=2 uses) / full qualification (single use), per the repo style rule. cpp/src is now free of file-scope using-namespace directives. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Miles Lubin <mlubin@nvidia.com>
…ation-namespace Signed-off-by: Miles Lubin <mlubin@nvidia.com> # Conflicts: # cpp/src/grpc/server/grpc_worker.cpp
|
/ok to test c57b2e9 |
Per PR review: the phase2 namespace was intentional, scoping the generically named dual-simplex phase-2 helpers (compute_reduced_costs, steepest_edge_pricing, flip_bounds, ...) away from same-named routines in primal/crossover (which use anonymous namespaces). An earlier phase had folded it into the parent namespace. Restore the exact original set (48 helpers + phase2_timers_t) under namespace phase2; the dual_phase2 entry points stay in the parent and call the helpers via phase2::. File-internal; no header or other-file changes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Miles Lubin <mlubin@nvidia.com>
|
/ok to test e5fe2a0 |
I restored the |
| residual = original_lp.rhs; | ||
| matrix_vector_multiply(original_lp.A, 1.0, guess, -1.0, residual); | ||
| primal_error = vector_norm_inf<i_t, f_t>(residual); | ||
| simplex::matrix_vector_multiply(original_lp.A, 1.0, guess, -1.0, residual); |
There was a problem hiding this comment.
using simplex::matrix_vector_multiply
using simplex::vector_norm_inf
?
There was a problem hiding this comment.
using simplex::mip_solution_t;
| using simplex::simplex_solver_settings_t; | ||
| using simplex::tic; | ||
| using simplex::toc; | ||
|
|
There was a problem hiding this comment.
We could reduce a lot of changes to this file by adding:
using simplex::vector_norm2;
using simplex::vector_norm_inf;
using simplex::vector_norm1;
There was a problem hiding this comment.
vector_norm2 and vector_norm_inf have different versions in simplex and barrier that shadow each other, so these calls need to be explicitly qualified. Clearly these functions are good candidates to pull one level up. vector_norm1 got swept up with these but isn't actually problematic, I'll add using simplex::vector_norm1.
chris-maes
left a comment
There was a problem hiding this comment.
A few minor suggestions to improve readability.
We should have a follow up PR that moves some standard functions and types like: inf, tic/toc, csc_matrix_t, csr_matrix_t, vector_norm_*, etc into the base mathematical_optimization namespace, so we can eliminate the giant using blocks at the beginning of the files.
Thanks for making this change, and bearing with the reviews, @mlubin !
Address reviewer suggestions: import frequently-/singly-used shared simplex names via 'using simplex::NAME;' instead of repeated qualification, in barrier.cu (vector_norm1 only -- vector_norm2/vector_norm_inf stay qualified since barrier defines shadowing device overloads), branch_and_bound.cpp, pseudo_costs.cpp, and cuts.cpp. Single-use imports included (bar lowered to 1). Header sparse_cholesky.cuh intentionally left fully-qualified. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Miles Lubin <mlubin@nvidia.com>
|
/ok to test ab50cfe |
|
/ok to test 2a531c3 |
Claude-assisted refactor.
Renames the
cuopt::linear_programmingumbrella namespace tocuopt::mathematical_optimizationand reorganizes its internals to match the actual architecture. The old name had outgrown its scope (it houses MILP, QP, and conic/barrier solving, not just LP).The public C++ include path moves accordingly:
include/cuopt/linear_programming/→include/cuopt/mathematical_optimization/.New internal structure — one namespace per clash domain, no more
detail:Note
The old
cuopt::linear_programmingnamespace is gone, so C++ consumers mustupdate qualifiers and
#includes. The C API is unchanged (same symbols), and aforwarding shim at
<cuopt/linear_programming/cuopt_c.h>keeps the legacyinclude path working (with a deprecation warning) — C consumers need no changes.
cuopt.linear_programmingPython package keeps its name — only the C++ side is renamed. This leaves a deliberate, temporary cross-language mismatch (C++mathematical_optimizationvs Pythonlinear_programming); renaming the Python package is a separate follow-up and requires more care given it's a public API.problem_t→mip. The core problem representation is used by both PDLP and MIP but defined undermip_heuristics/, so it landed in::mip— meaningpdlpnow referencesmip::problem_t. Accepted for now; a shared-infra home could be revisited later.detailfully eliminated under the umbrella: generic GPU helpers (hashing, launch-dims, double-buffer, segmented-sum) moved to the top-levelcuoptnamespace; module-specific helpers to their module's namespace; file-local helpers to anonymous namespaces.cuopt::detail(different namespace, out of scope), the global-scope::detailin a gRPC serialization header, the vendoredcxxoptslibrary's owndetail, thecpp/tests/linear_programming/directory, and the Cython bridge typecuopt::cython::linear_programming_ret_t.simplexblock /using namespace simplexwhere they instantiate or call genuine simplex templates (explicit template instantiations must live in the template's own namespace).