Skip to content

Refactor: mathematical_optimization namespace#1446

Open
mlubin wants to merge 19 commits into
NVIDIA:mainfrom
mlubin:refactor/math-optimization-namespace
Open

Refactor: mathematical_optimization namespace#1446
mlubin wants to merge 19 commits into
NVIDIA:mainfrom
mlubin:refactor/math-optimization-namespace

Conversation

@mlubin

@mlubin mlubin commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Claude-assisted refactor.

Renames the cuopt::linear_programming umbrella namespace to cuopt::mathematical_optimization and 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:

cuopt::mathematical_optimization        public surface (problem, solution, settings, solve) + io
  ::pdlp           GPU first-order LP      (was ::detail)
  ::simplex        CPU simplex             (folds in stray primal/dual/phase2)
  ::barrier        interior-point          (was ::dual_simplex)
  ::mip            B&B + cuts + heuristics  (was split across ::dual_simplex and ::detail)

Note

  • C++ namespace is a hard break (no alias); the C API is source-compatible.
    The old cuopt::linear_programming namespace is gone, so C++ consumers must
    update qualifiers and #includes. The C API is unchanged (same symbols), and a
    forwarding shim at <cuopt/linear_programming/cuopt_c.h> keeps the legacy
    include path working (with a deprecation warning) — C consumers need no changes.
  • Python is unchanged. The cuopt.linear_programming Python package keeps its name — only the C++ side is renamed. This leaves a deliberate, temporary cross-language mismatch (C++ mathematical_optimization vs Python linear_programming); renaming the Python package is a separate follow-up and requires more care given it's a public API.
  • Shared problem_tmip. The core problem representation is used by both PDLP and MIP but defined under mip_heuristics/, so it landed in ::mip — meaning pdlp now references mip::problem_t. Accepted for now; a shared-infra home could be revisited later.
  • detail fully eliminated under the umbrella: generic GPU helpers (hashing, launch-dims, double-buffer, segmented-sum) moved to the top-level cuopt namespace; module-specific helpers to their module's namespace; file-local helpers to anonymous namespaces.
  • Left intentionally untouched: routing's separate cuopt::detail (different namespace, out of scope), the global-scope ::detail in a gRPC serialization header, the vendored cxxopts library's own detail, the cpp/tests/linear_programming/ directory, and the Cython bridge type cuopt::cython::linear_programming_ret_t.
  • A few carved-out files keep a simplex block / using namespace simplex where they instantiate or call genuine simplex templates (explicit template instantiations must live in the template's own namespace).

mlubin and others added 7 commits June 20, 2026 18:37
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>
@copy-pr-bot

copy-pr-bot Bot commented Jun 21, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

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>
@mlubin mlubin added non-breaking Introduces a non-breaking change improvement Improves an existing functionality labels Jun 21, 2026
@mlubin

mlubin commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 57a51ee

@Kh4ster Kh4ster left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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>
@mlubin

mlubin commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 59336da

@mlubin mlubin marked this pull request as ready for review June 22, 2026 15:03
@mlubin mlubin requested review from a team as code owners June 22, 2026 15:03
@mlubin mlubin requested review from Iroy30, bdice, kaatish and nguidotti June 22, 2026 15:03
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This 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

Cohort / File(s) Summary
Public headers, C ABI, and review/tooling config
.coderabbit.yaml, .github/.coderabbit_review_guide.md, ci/test_doc_examples.sh, cpp/doxygen/Doxyfile, cpp/include/cuopt/linear_programming/cuopt_c.h, cpp/include/cuopt/mathematical_optimization/cuopt_c.h, cpp/include/cuopt/mathematical_optimization/*
Moves public headers and include paths to cuopt::mathematical_optimization, adds the new C ABI header, and turns the legacy C ABI header into a forwarding shim.
CLI, benchmarks, gRPC, and I/O
cpp/cuopt_cli.cpp, benchmarks/linear_programming/cuopt/*, cpp/src/grpc/*, cpp/src/io/*, cpp/include/cuopt/mathematical_optimization/io/*
Updates entry points, gRPC mappers, chunked transport types, parsers, writers, and benchmark helpers to use the new namespaces and type locations.
Simplex core migration
cpp/src/dual_simplex/*, cpp/include/cuopt/mathematical_optimization/solver_settings.hpp, cpp/include/cuopt/mathematical_optimization/optimization_problem*.hpp, cpp/include/cuopt/mathematical_optimization/utilities/*
Moves simplex implementation and declarations into cuopt::mathematical_optimization::simplex, renames status enums, and requalifies shared solver/problem helpers.
Barrier, cuts, and branch-and-bound
cpp/src/barrier/*, cpp/src/cuts/*, cpp/src/branch_and_bound/*, cpp/include/cuopt/mathematical_optimization/mip/*
Moves barrier and MIP tree/cut code into new namespaces, updates shared type references to simplex::..., and changes dual-status and clique-table references.
MIP heuristics, presolve, local search, and solution handling
cpp/src/mip_heuristics/*, cpp/include/cuopt/mathematical_optimization/mip/*
Renames heuristic, presolve, probing, rounding, local-search, solver, and solution code into cuopt::mathematical_optimization::mip, with broad type and callback retargeting.
PDLP and math_optimization runtime
cpp/src/pdlp/*, cpp/src/math_optimization/*, cpp/include/cuopt/mathematical_optimization/pdlp/*, cpp/include/cuopt/mathematical_optimization/*
Moves PDLP solver internals, warm-starts, restart strategies, backend selection, and math-optimization runtime types into the new namespace layout and updates their dependent type names.

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 15.09% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: refactoring the namespace to mathematical_optimization.
Description check ✅ Passed The description matches the changeset and accurately explains the namespace rename and internal reorganization.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 win

Refresh the stale Doxygen parameter descriptions.

These overloads now take io::mps_data_model_t; batch_pdlp_solve no longer has a user_problem parameter, and the MIP overload should not describe its input as a linear-program optimization_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 problem

As 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 win

Avoid a namespace-wide using-directive in this header.

This injects all simplex symbols into barrier scope and increases collision risk as both modules evolve. Prefer explicit simplex::... qualification (or narrow using declarations 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 avoid using namespace at 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 lift

Replace the header-level using namespace with narrower imports.

This pulls the entire simplex namespace into mip scope and makes future symbol conflicts harder to control. Prefer explicit simplex::... usage (or tightly scoped using declarations 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 avoid using namespace at 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 win

Remove namespace-scope using namespace import.

Line 15 introduces a broad namespace import in a .cu translation 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 sites

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 (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 win

Avoid file-scope using namespace in 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 win

Avoid using namespace at header namespace scope.

Line 25 introduces a file-scope using namespace directive in a .hpp, which broadens symbol lookup and can create ambiguity as this header evolves. Prefer explicit qualification or targeted using declarations 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 | 🔵 Trivial

Avoid using namespace at 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 explicit using declarations for only the symbols actually used in this file (only inf).

♻️ 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 win

Fix stale namespace wording in the file comment.

The comment still says these instantiations must live in dual_simplex, but the translation unit now opens cuopt::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 win

Avoid 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 broad using namespace and 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 win

Avoid using namespace at header namespace scope.

Line 18 introduces a broad namespace import in a .hpp file, 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-scope using namespace 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/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 | 🔵 Trivial

Replace namespace-wide import with explicit symbol imports.

using namespace in a header injects all simplex names into mip scope for every includer. Prefer targeted using declarations (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 avoid using namespace at 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 win

Replace file-scope namespace import with explicit symbol imports.

Line 12 introduces a broad using namespace in translation-unit scope, which increases collision risk as symbols continue moving across simplex/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 avoid using namespace at 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 win

Avoid namespace-wide using namespace here.

Please import only the required simplex symbols (or qualify usages) instead of a namespace-wide using namespace directive.

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 win

Avoid using namespace at 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 avoid using namespace at 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 win

Avoid file-scope using namespace in 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 avoid using namespace at 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 win

Fix stale forward declaration namespace for branch_and_bound_t.

Line 18 forward-declares simplex::branch_and_bound_t, but Line 91 uses mip::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 | 🔵 Trivial

Move the using namespace statement 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 win

Avoid a broad namespace import in this header scope (Line 28).

Please replace the using namespace directive with explicit qualification (or narrow using declarations 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 broad using namespace at 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 win

Remove the broad using namespace directive from this header (Line 63).

Prefer explicit qualification (or narrow using declarations for specific symbols) to keep this header’s namespace surface tight.

As per coding guidelines: **/*.{hpp,cpp,cuh,cu,inl} advises against broad using namespace at 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 lift

Avoid namespace-wide imports in this header.

Because this is a .cuh header, the using namespace directive is transitively visible to includers and can broaden lookup/ambiguity across the file. Prefer explicit simplex::... qualifiers or narrow using declarations 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 lift

Keep the simplex names qualified in this header.

This namespace-wide import pulls all simplex names into mip for every includer after this point. Please replace it with explicit simplex::... qualifications or narrow using declarations 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 lift

Avoid importing the simplex namespace at file scope.

This pulls all simplex symbols into barrier for the whole translation unit; prefer a namespace alias plus explicit simplex:: 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 lift

Avoid making barrier depend on PDLP-owned cuSPARSE wrappers.

barrier now stores and accepts pdlp::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 win

Don’t put a using namespace directive in this header.

Every include of worker_pool.hpp inherits this lookup pollution inside mip; 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 lift

Avoid importing the entire simplex namespace at file scope.

This blurs the new mip/simplex boundary and can hide collisions during the namespace split. Prefer a namespace alias plus explicit simplex::... 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

Comment thread cpp/include/cuopt/mathematical_optimization/cuopt_c.h
Comment thread cpp/include/cuopt/mathematical_optimization/cuopt_c.h
Comment thread cpp/include/cuopt/math_optimization/pdlp/pdlp_hyper_params.cuh Outdated
Comment thread cpp/src/barrier/barrier.hpp Outdated
Comment thread cpp/src/barrier/cusparse_view.hpp Outdated
Comment on lines +150 to 173
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;
}
}

@coderabbitai coderabbitai Bot Jun 22, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

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.

Suggested change
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).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is pre-existing. Open an issue to track it.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧩 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.

Comment thread cpp/src/branch_and_bound/deterministic_workers.hpp Outdated
Comment on lines +34 to +37
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;

@coderabbitai coderabbitai Bot Jun 22, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@nguidotti is this a real issue?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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!

@nguidotti nguidotti Jun 26, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread cpp/src/cuts/cuts.cpp Outdated
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>
@mlubin mlubin force-pushed the refactor/math-optimization-namespace branch from 5eab332 to d5726ae Compare June 22, 2026 15:56
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>
@mlubin

mlubin commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 801d31c

@chris-maes chris-maes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
cpp/src/cuts/objective_step.cpp (1)

19-20: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Replace 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 explicit using declarations (or fully-qualified names) for only the needed simplex symbols.

As per coding guidelines, avoid using namespace at 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

📥 Commits

Reviewing files that changed from the base of the PR and between 801d31c and 58dc479.

📒 Files selected for processing (300)
  • .coderabbit.yaml
  • .github/.coderabbit_review_guide.md
  • benchmarks/linear_programming/cuopt/benchmark_helper.hpp
  • benchmarks/linear_programming/cuopt/initial_problem_check.hpp
  • benchmarks/linear_programming/cuopt/run_mip.cpp
  • benchmarks/linear_programming/cuopt/run_pdlp.cu
  • ci/test_doc_examples.sh
  • cpp/cuopt_cli.cpp
  • cpp/doxygen/Doxyfile
  • cpp/include/cuopt/error.hpp
  • cpp/include/cuopt/linear_programming/cuopt_c.h
  • cpp/include/cuopt/mathematical_optimization/backend_selection.hpp
  • cpp/include/cuopt/mathematical_optimization/constants.h
  • cpp/include/cuopt/mathematical_optimization/cpu_optimization_problem.hpp
  • cpp/include/cuopt/mathematical_optimization/cpu_optimization_problem_solution.hpp
  • cpp/include/cuopt/mathematical_optimization/cpu_pdlp_warm_start_data.hpp
  • cpp/include/cuopt/mathematical_optimization/csr_matrix_utils.hpp
  • cpp/include/cuopt/mathematical_optimization/cuopt_c.h
  • cpp/include/cuopt/mathematical_optimization/io/data_model_view.hpp
  • cpp/include/cuopt/mathematical_optimization/io/mps_data_model.hpp
  • cpp/include/cuopt/mathematical_optimization/io/mps_writer.hpp
  • cpp/include/cuopt/mathematical_optimization/io/parser.hpp
  • cpp/include/cuopt/mathematical_optimization/io/utilities/cython_parser.hpp
  • cpp/include/cuopt/mathematical_optimization/io/writer.hpp
  • cpp/include/cuopt/mathematical_optimization/mip/diving_hyper_params.hpp
  • cpp/include/cuopt/mathematical_optimization/mip/heuristics_hyper_params.hpp
  • cpp/include/cuopt/mathematical_optimization/mip/solver_settings.hpp
  • cpp/include/cuopt/mathematical_optimization/mip/solver_solution.hpp
  • cpp/include/cuopt/mathematical_optimization/mip/solver_stats.hpp
  • cpp/include/cuopt/mathematical_optimization/optimization_problem.hpp
  • cpp/include/cuopt/mathematical_optimization/optimization_problem_interface.hpp
  • cpp/include/cuopt/mathematical_optimization/optimization_problem_solution.hpp
  • cpp/include/cuopt/mathematical_optimization/optimization_problem_solution_interface.hpp
  • cpp/include/cuopt/mathematical_optimization/optimization_problem_utils.hpp
  • cpp/include/cuopt/mathematical_optimization/pdlp/pdlp_hyper_params.cuh
  • cpp/include/cuopt/mathematical_optimization/pdlp/pdlp_warm_start_data.hpp
  • cpp/include/cuopt/mathematical_optimization/pdlp/solver_settings.hpp
  • cpp/include/cuopt/mathematical_optimization/pdlp/solver_solution.hpp
  • cpp/include/cuopt/mathematical_optimization/solve.hpp
  • cpp/include/cuopt/mathematical_optimization/solve_remote.hpp
  • cpp/include/cuopt/mathematical_optimization/solver_settings.hpp
  • cpp/include/cuopt/mathematical_optimization/utilities/callbacks_implems.hpp
  • cpp/include/cuopt/mathematical_optimization/utilities/cython_solve.hpp
  • cpp/include/cuopt/mathematical_optimization/utilities/cython_types.hpp
  • cpp/include/cuopt/mathematical_optimization/utilities/internals.hpp
  • cpp/include/cuopt/mathematical_optimization/utilities/segmented_sum_handler.cuh
  • cpp/src/barrier/barrier.cu
  • cpp/src/barrier/barrier.hpp
  • cpp/src/barrier/conjugate_gradient.hpp
  • cpp/src/barrier/cusparse_info.hpp
  • cpp/src/barrier/cusparse_view.cu
  • cpp/src/barrier/cusparse_view.hpp
  • cpp/src/barrier/dense_matrix.hpp
  • cpp/src/barrier/dense_vector.hpp
  • cpp/src/barrier/device_sparse_matrix.cu
  • cpp/src/barrier/device_sparse_matrix.cuh
  • cpp/src/barrier/iterative_refinement.hpp
  • cpp/src/barrier/pinned_host_allocator.cu
  • cpp/src/barrier/pinned_host_allocator.hpp
  • cpp/src/barrier/second_order_cone_kernels.cuh
  • cpp/src/barrier/second_order_cone_reduction.cuh
  • cpp/src/barrier/sparse_cholesky.cuh
  • cpp/src/barrier/sparse_matrix_kernels.cuh
  • cpp/src/barrier/translate_soc.hpp
  • cpp/src/branch_and_bound/bb_event.hpp
  • cpp/src/branch_and_bound/branch_and_bound.cpp
  • cpp/src/branch_and_bound/branch_and_bound.hpp
  • cpp/src/branch_and_bound/constants.hpp
  • cpp/src/branch_and_bound/deterministic_workers.hpp
  • cpp/src/branch_and_bound/diving_heuristics.cpp
  • cpp/src/branch_and_bound/diving_heuristics.hpp
  • cpp/src/branch_and_bound/mip_node.hpp
  • cpp/src/branch_and_bound/node_queue.hpp
  • cpp/src/branch_and_bound/pseudo_costs.cpp
  • cpp/src/branch_and_bound/pseudo_costs.hpp
  • cpp/src/branch_and_bound/shared_strong_branching_context.hpp
  • cpp/src/branch_and_bound/symmetry.hpp
  • cpp/src/branch_and_bound/worker.hpp
  • cpp/src/branch_and_bound/worker_pool.hpp
  • cpp/src/cuts/cuts.cpp
  • cpp/src/cuts/cuts.hpp
  • cpp/src/cuts/objective_step.cpp
  • cpp/src/cuts/objective_step.hpp
  • cpp/src/cuts/rational.hpp
  • cpp/src/dual_simplex/basis_solves.cpp
  • cpp/src/dual_simplex/basis_solves.hpp
  • cpp/src/dual_simplex/basis_updates.cpp
  • cpp/src/dual_simplex/basis_updates.hpp
  • cpp/src/dual_simplex/bound_flipping_ratio_test.cpp
  • cpp/src/dual_simplex/bound_flipping_ratio_test.hpp
  • cpp/src/dual_simplex/bounds_strengthening.cpp
  • cpp/src/dual_simplex/bounds_strengthening.hpp
  • cpp/src/dual_simplex/crossover.cpp
  • cpp/src/dual_simplex/crossover.hpp
  • cpp/src/dual_simplex/folding.cpp
  • cpp/src/dual_simplex/folding.hpp
  • cpp/src/dual_simplex/initial_basis.cpp
  • cpp/src/dual_simplex/initial_basis.hpp
  • cpp/src/dual_simplex/logger.hpp
  • cpp/src/dual_simplex/phase1.cpp
  • cpp/src/dual_simplex/phase1.hpp
  • cpp/src/dual_simplex/phase2.cpp
  • cpp/src/dual_simplex/phase2.hpp
  • cpp/src/dual_simplex/presolve.cpp
  • cpp/src/dual_simplex/presolve.hpp
  • cpp/src/dual_simplex/primal.cpp
  • cpp/src/dual_simplex/primal.hpp
  • cpp/src/dual_simplex/random.hpp
  • cpp/src/dual_simplex/right_looking_lu.cpp
  • cpp/src/dual_simplex/right_looking_lu.hpp
  • cpp/src/dual_simplex/scaling.cpp
  • cpp/src/dual_simplex/scaling.hpp
  • cpp/src/dual_simplex/simplex_solver_settings.hpp
  • cpp/src/dual_simplex/singletons.cpp
  • cpp/src/dual_simplex/singletons.hpp
  • cpp/src/dual_simplex/solution.hpp
  • cpp/src/dual_simplex/solve.cpp
  • cpp/src/dual_simplex/solve.hpp
  • cpp/src/dual_simplex/sparse_matrix.cpp
  • cpp/src/dual_simplex/sparse_matrix.hpp
  • cpp/src/dual_simplex/sparse_vector.cpp
  • cpp/src/dual_simplex/sparse_vector.hpp
  • cpp/src/dual_simplex/tic_toc.cpp
  • cpp/src/dual_simplex/tic_toc.hpp
  • cpp/src/dual_simplex/triangle_solve.cpp
  • cpp/src/dual_simplex/triangle_solve.hpp
  • cpp/src/dual_simplex/types.hpp
  • cpp/src/dual_simplex/user_problem.hpp
  • cpp/src/dual_simplex/vector_math.cpp
  • cpp/src/dual_simplex/vector_math.cuh
  • cpp/src/dual_simplex/vector_math.hpp
  • cpp/src/grpc/client/grpc_client.cpp
  • cpp/src/grpc/client/grpc_client.hpp
  • cpp/src/grpc/client/solve_remote.cpp
  • cpp/src/grpc/codegen/field_registry.yaml
  • cpp/src/grpc/grpc_chunk_key.hpp
  • cpp/src/grpc/grpc_problem_mapper.cpp
  • cpp/src/grpc/grpc_problem_mapper.hpp
  • cpp/src/grpc/grpc_service_mapper.cpp
  • cpp/src/grpc/grpc_service_mapper.hpp
  • cpp/src/grpc/grpc_settings_mapper.cpp
  • cpp/src/grpc/grpc_settings_mapper.hpp
  • cpp/src/grpc/grpc_solution_mapper.cpp
  • cpp/src/grpc/grpc_solution_mapper.hpp
  • cpp/src/grpc/server/grpc_pipe_serialization.hpp
  • cpp/src/grpc/server/grpc_server_types.hpp
  • cpp/src/grpc/server/grpc_service_impl.cpp
  • cpp/src/grpc/server/grpc_worker.cpp
  • cpp/src/io/data_model_view.cpp
  • cpp/src/io/file_to_string.cpp
  • cpp/src/io/file_to_string.hpp
  • cpp/src/io/lp_parser.cpp
  • cpp/src/io/lp_parser.hpp
  • cpp/src/io/mps_data_model.cpp
  • cpp/src/io/mps_parser.cpp
  • cpp/src/io/mps_parser_internal.hpp
  • cpp/src/io/mps_writer.cpp
  • cpp/src/io/parser.cpp
  • cpp/src/io/utilities/cython_parser.cpp
  • cpp/src/io/utilities/error.hpp
  • cpp/src/io/writer.cpp
  • cpp/src/math_optimization/solution_reader.cu
  • cpp/src/math_optimization/solution_reader.hpp
  • cpp/src/math_optimization/solution_writer.cu
  • cpp/src/math_optimization/solution_writer.hpp
  • cpp/src/math_optimization/solver_settings.cu
  • cpp/src/mip_heuristics/diversity/assignment_hash_map.cu
  • cpp/src/mip_heuristics/diversity/assignment_hash_map.cuh
  • cpp/src/mip_heuristics/diversity/diversity_config.hpp
  • cpp/src/mip_heuristics/diversity/diversity_manager.cu
  • cpp/src/mip_heuristics/diversity/diversity_manager.cuh
  • cpp/src/mip_heuristics/diversity/lns/rins.cu
  • cpp/src/mip_heuristics/diversity/lns/rins.cuh
  • cpp/src/mip_heuristics/diversity/multi_armed_bandit.cu
  • cpp/src/mip_heuristics/diversity/multi_armed_bandit.cuh
  • cpp/src/mip_heuristics/diversity/population.cu
  • cpp/src/mip_heuristics/diversity/population.cuh
  • cpp/src/mip_heuristics/diversity/recombiners/bound_prop_recombiner.cuh
  • cpp/src/mip_heuristics/diversity/recombiners/fp_recombiner.cuh
  • cpp/src/mip_heuristics/diversity/recombiners/line_segment_recombiner.cuh
  • cpp/src/mip_heuristics/diversity/recombiners/recombiner.cuh
  • cpp/src/mip_heuristics/diversity/recombiners/recombiner_configs.hpp
  • cpp/src/mip_heuristics/diversity/recombiners/recombiner_stats.hpp
  • cpp/src/mip_heuristics/diversity/recombiners/sub_mip.cuh
  • cpp/src/mip_heuristics/diversity/weights.cuh
  • cpp/src/mip_heuristics/early_heuristic.cuh
  • cpp/src/mip_heuristics/feasibility_jump/cpu_fj_thread.cuh
  • cpp/src/mip_heuristics/feasibility_jump/early_cpufj.cu
  • cpp/src/mip_heuristics/feasibility_jump/early_cpufj.cuh
  • cpp/src/mip_heuristics/feasibility_jump/early_gpufj.cu
  • cpp/src/mip_heuristics/feasibility_jump/early_gpufj.cuh
  • cpp/src/mip_heuristics/feasibility_jump/feasibility_jump.cu
  • cpp/src/mip_heuristics/feasibility_jump/feasibility_jump.cuh
  • cpp/src/mip_heuristics/feasibility_jump/feasibility_jump_impl_common.cuh
  • cpp/src/mip_heuristics/feasibility_jump/feasibility_jump_kernels.cu
  • cpp/src/mip_heuristics/feasibility_jump/feasibility_jump_kernels.cuh
  • cpp/src/mip_heuristics/feasibility_jump/fj_cpu.cu
  • cpp/src/mip_heuristics/feasibility_jump/fj_cpu.cuh
  • cpp/src/mip_heuristics/feasibility_jump/utils.cuh
  • cpp/src/mip_heuristics/local_search/feasibility_pump/feasibility_pump.cu
  • cpp/src/mip_heuristics/local_search/feasibility_pump/feasibility_pump.cuh
  • cpp/src/mip_heuristics/local_search/lagrangian.cuh
  • cpp/src/mip_heuristics/local_search/line_segment_search/line_segment_search.cu
  • cpp/src/mip_heuristics/local_search/line_segment_search/line_segment_search.cuh
  • cpp/src/mip_heuristics/local_search/local_search.cu
  • cpp/src/mip_heuristics/local_search/local_search.cuh
  • cpp/src/mip_heuristics/local_search/local_search_config.hpp
  • cpp/src/mip_heuristics/local_search/rounding/bounds_repair.cu
  • cpp/src/mip_heuristics/local_search/rounding/bounds_repair.cuh
  • cpp/src/mip_heuristics/local_search/rounding/constraint_prop.cu
  • cpp/src/mip_heuristics/local_search/rounding/constraint_prop.cuh
  • cpp/src/mip_heuristics/local_search/rounding/lb_bounds_repair.cu
  • cpp/src/mip_heuristics/local_search/rounding/lb_bounds_repair.cuh
  • cpp/src/mip_heuristics/local_search/rounding/lb_constraint_prop.cu
  • cpp/src/mip_heuristics/local_search/rounding/lb_constraint_prop.cuh
  • cpp/src/mip_heuristics/local_search/rounding/simple_rounding.cu
  • cpp/src/mip_heuristics/local_search/rounding/simple_rounding.cuh
  • cpp/src/mip_heuristics/local_search/rounding/simple_rounding_kernels.cuh
  • cpp/src/mip_heuristics/logger.cuh
  • cpp/src/mip_heuristics/mip_constants.hpp
  • cpp/src/mip_heuristics/mip_scaling_strategy.cu
  • cpp/src/mip_heuristics/mip_scaling_strategy.cuh
  • cpp/src/mip_heuristics/presolve/bounds_presolve.cu
  • cpp/src/mip_heuristics/presolve/bounds_presolve.cuh
  • cpp/src/mip_heuristics/presolve/bounds_presolve_helpers.cuh
  • cpp/src/mip_heuristics/presolve/bounds_update_data.cu
  • cpp/src/mip_heuristics/presolve/bounds_update_data.cuh
  • cpp/src/mip_heuristics/presolve/bounds_update_helpers.cuh
  • cpp/src/mip_heuristics/presolve/conditional_bound_strengthening.cu
  • cpp/src/mip_heuristics/presolve/conditional_bound_strengthening.cuh
  • cpp/src/mip_heuristics/presolve/conflict_graph/clique_table.cu
  • cpp/src/mip_heuristics/presolve/conflict_graph/clique_table.cuh
  • cpp/src/mip_heuristics/presolve/gf2_presolve.cpp
  • cpp/src/mip_heuristics/presolve/gf2_presolve.hpp
  • cpp/src/mip_heuristics/presolve/lb_probing_cache.cu
  • cpp/src/mip_heuristics/presolve/load_balanced_bounds_presolve.cu
  • cpp/src/mip_heuristics/presolve/load_balanced_bounds_presolve.cuh
  • cpp/src/mip_heuristics/presolve/load_balanced_bounds_presolve_helpers.cuh
  • cpp/src/mip_heuristics/presolve/load_balanced_bounds_presolve_kernels.cuh
  • cpp/src/mip_heuristics/presolve/load_balanced_partition_helpers.cuh
  • cpp/src/mip_heuristics/presolve/multi_probe.cu
  • cpp/src/mip_heuristics/presolve/multi_probe.cuh
  • cpp/src/mip_heuristics/presolve/probing_cache.cu
  • cpp/src/mip_heuristics/presolve/probing_cache.cuh
  • cpp/src/mip_heuristics/presolve/semi_continuous.cu
  • cpp/src/mip_heuristics/presolve/semi_continuous.cuh
  • cpp/src/mip_heuristics/presolve/third_party_presolve.cpp
  • cpp/src/mip_heuristics/presolve/third_party_presolve.hpp
  • cpp/src/mip_heuristics/presolve/trivial_presolve.cu
  • cpp/src/mip_heuristics/presolve/trivial_presolve.cuh
  • cpp/src/mip_heuristics/presolve/trivial_presolve_helpers.cuh
  • cpp/src/mip_heuristics/presolve/utils.cuh
  • cpp/src/mip_heuristics/problem/host_helper.cuh
  • cpp/src/mip_heuristics/problem/load_balanced_problem.cu
  • cpp/src/mip_heuristics/problem/load_balanced_problem.cuh
  • cpp/src/mip_heuristics/problem/presolve_data.cu
  • cpp/src/mip_heuristics/problem/presolve_data.cuh
  • cpp/src/mip_heuristics/problem/problem.cu
  • cpp/src/mip_heuristics/problem/problem.cuh
  • cpp/src/mip_heuristics/problem/problem_fixing.cuh
  • cpp/src/mip_heuristics/problem/problem_helpers.cuh
  • cpp/src/mip_heuristics/problem/problem_kernels.cuh
  • cpp/src/mip_heuristics/problem/write_mps.cu
  • cpp/src/mip_heuristics/relaxed_lp/lp_state.cuh
  • cpp/src/mip_heuristics/relaxed_lp/relaxed_lp.cu
  • cpp/src/mip_heuristics/relaxed_lp/relaxed_lp.cuh
  • cpp/src/mip_heuristics/solution/feasibility_test.cuh
  • cpp/src/mip_heuristics/solution/solution.cu
  • cpp/src/mip_heuristics/solution/solution.cuh
  • cpp/src/mip_heuristics/solution/solution_kernels.cuh
  • cpp/src/mip_heuristics/solve.cu
  • cpp/src/mip_heuristics/solver.cu
  • cpp/src/mip_heuristics/solver.cuh
  • cpp/src/mip_heuristics/solver_context.cuh
  • cpp/src/mip_heuristics/solver_settings.cu
  • cpp/src/mip_heuristics/solver_solution.cu
  • cpp/src/mip_heuristics/utilities/sort_csr.cuh
  • cpp/src/mip_heuristics/utils.cuh
  • cpp/src/pdlp/backend_selection.cpp
  • cpp/src/pdlp/cpu_optimization_problem.cpp
  • cpp/src/pdlp/cpu_pdlp_warm_start_data.cu
  • cpp/src/pdlp/cuopt_c.cpp
  • cpp/src/pdlp/cuopt_c_internal.hpp
  • cpp/src/pdlp/cusparse_view.cu
  • cpp/src/pdlp/cusparse_view.hpp
  • cpp/src/pdlp/initial_scaling_strategy/initial_scaling.cu
  • cpp/src/pdlp/initial_scaling_strategy/initial_scaling.cuh
  • cpp/src/pdlp/optimal_batch_size_handler/optimal_batch_size_handler.cu
  • cpp/src/pdlp/optimal_batch_size_handler/optimal_batch_size_handler.hpp
  • cpp/src/pdlp/optimization_problem.cu
  • cpp/src/pdlp/pdhg.cu
  • cpp/src/pdlp/pdhg.hpp
  • cpp/src/pdlp/pdlp.cu
  • cpp/src/pdlp/pdlp.cuh
  • cpp/src/pdlp/pdlp_constants.hpp
  • cpp/src/pdlp/pdlp_warm_start_data.cu
  • cpp/src/pdlp/restart_strategy/localized_duality_gap_container.cu
  • cpp/src/pdlp/restart_strategy/localized_duality_gap_container.hpp
  • cpp/src/pdlp/restart_strategy/pdlp_restart_strategy.cu
  • cpp/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

@mlubin mlubin changed the title Refactor: math_optimization namespace Refactor: mathematical_optimization namespace Jun 22, 2026
@mlubin

mlubin commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

/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>
@mlubin

mlubin commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 342ec39

@chris-maes chris-maes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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?

mlubin and others added 3 commits June 25, 2026 14:46
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
@mlubin

mlubin commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

/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>
@mlubin

mlubin commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test e5fe2a0

@mlubin

mlubin commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

Inside MIP (branch and bound / cuts) things are now quite verbose.

using namespace was actually against the repo style guide; I removed this. I added using for specific types at the top of each file to address your concern about the verbosity of the code.

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?

I restored the phase2 namespace; it should be the same as before.

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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

using simplex::matrix_vector_multiply
using simplex::vector_norm_inf
?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

using simplex::mip_solution_t;

using simplex::simplex_solver_settings_t;
using simplex::tic;
using simplex::toc;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Comment thread cpp/src/barrier/sparse_cholesky.cuh
Comment thread cpp/src/branch_and_bound/pseudo_costs.cpp
Comment thread cpp/src/cuts/cuts.cpp

@chris-maes chris-maes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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>
@mlubin

mlubin commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test ab50cfe

@mlubin

mlubin commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 2a531c3

@nguidotti nguidotti left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes to MIP solver looks good to me. Thanks @mlubin! It may have some places that I think we can drop the mip namespace before the type, but we can address this separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improves an existing functionality non-breaking Introduces a non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants