Skip to content

Fix adj_list check bug and improve clique cuts - #1386

Merged
rapids-bot[bot] merged 37 commits into
NVIDIA:mainfrom
akifcorduk:main_baselin
Jun 9, 2026
Merged

Fix adj_list check bug and improve clique cuts#1386
rapids-bot[bot] merged 37 commits into
NVIDIA:mainfrom
akifcorduk:main_baselin

Conversation

@akifcorduk

Copy link
Copy Markdown
Contributor

Improve clique cut generation by simplifing the conflict-graph clique table and fix complement-pair handling in clique cut construction drop the paired variable to form a valid fixing cut; detect contradictory variable/complement cliques as infeasible.

Fixes a bug of skipping the small adjacency-list cliques, now we use clique_table_t::empty() function to check all clique data structures.

The mip gap or gap glosed doesn't change significantly but we add on average 1.5 optimal solutions. Tested on 2 batches for main and this PR.

PR_1 -> total_instances: 240, total_feasible: 228, average_error_gap: 10.75, total_optimal: 77, avg_mip_gap: 0.3136, geomean_mip_gap: 0.1990, n_low_error: 129, average_gap_closed: 0.29
PR_2 -> total_instances: 240, total_feasible: 225, average_error_gap: 12.49, total_optimal: 78, avg_mip_gap: 0.3116, geomean_mip_gap: 0.1958, n_low_error: 126, average_gap_closed: 0.29

main_1 -> total_instances: 240, total_feasible: 224, average_error_gap: 13.29, total_optimal: 76, avg_mip_gap: 0.3054, geomean_mip_gap: 0.1938, n_low_error: 124, average_gap_closed: 0.29
main_2 -> total_instances: 240, total_feasible: 228, average_error_gap: 11.04, total_optimal: 76, avg_mip_gap: 0.3243, geomean_mip_gap: 0.2001, n_low_error: 124, average_gap_closed: 0.30

Brings in upstream's unified OpenMP threading model (PR NVIDIA#1099) and other
fixes (NVIDIA#1206 concurrent LP exception cleanup, NVIDIA#1214/NVIDIA#1216 destruction/
capture fixes) while preserving local work on the cut and clique stack.

Conflict resolution highlights:
- Drop std::future/std::async clique flow; adopt upstream's omp task +
  omp_atomic_t<bool> signal_extend pattern.
- Drop modify_problem parameter from find_initial_cliques (we already
  removed the code that consumed it); adapt the omp-task call site in
  branch_and_bound::solve accordingly.
- Take upstream's [this, &population] capture for the root-LP CPUFJ
  improvement callback; the new omp taskwait-before-destruction guarantee
  makes the prior context-lifetime fix unnecessary.
- Take upstream's do_cut_pass refactor of the per-pass LP resolve loop;
  move our per-pass root_lp_with_cuts publish into do_cut_pass so the
  benchmark metric is still updated on early exits.
- Keep our out-of-line omp_mutex_t definitions in omp_helpers.cpp; the
  enhanced omp_atomic_t with std::memory_order is taken from upstream.
generate_clique_cuts() used a hand-rolled emptiness test on only
first + addtl_cliques, so it early-exited and skipped separation when
only small_clique_adj (the small/adjacency-list cliques) was populated.
Use the canonical clique_table_t::empty(), which also accounts for
small_clique_adj, so those smaller clique cuts are generated.

Signed-off-by: akif <akifcorduk@gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented Jun 3, 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.

@akifcorduk

Copy link
Copy Markdown
Contributor Author

/ok to test 98b1ee2

f_t cut_generation_start_time = tic();
i_t cut_pool_size = 0;
f_t cut_generation_start_time = tic();
auto publish_cut_generation_time = [&](bool force_time_limit_value = false) {

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.

I think it is useful to be able to track cut generation time, but i am commenting on this to discuss.

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.

Couldn't we get away with just storing the starting time and ending time of cuts? If anyone queries the current cut time while we're in the middle of the cut loop, it's just a matter of doing return toc(start_time) instead of return end_time

But agreed, definitely useful!

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.

Most of these information is available in the logs, no? You only need the benchmark_info struct to pass to the run_mip file, right?

@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds MIPLIB gap-statistic reporting with root-LP benchmarking instrumentation and refactors clique adjacency from hash-based to CSR-backed storage. The solver now tracks root LP objectives before and after cut generation; branch-and-bound publishes these metrics alongside cut-generation timing. A new MIPLIB header provides instance lookup, optimum catalogs, and formatted gap-stat output. The clique table switches to compact CSR maps for adjacency, refactors extension as a work-budget-driven scheduler, and updates cut generation to handle complement pairs in a dedicated first pass. Branch-and-bound signatures are updated to match.

Changes

Root LP benchmark metrics and MIPLIB reporting

Layer / File(s) Summary
Benchmark metric contracts and solver wiring
cpp/include/cuopt/linear_programming/mip/solver_settings.hpp, cpp/src/dual_simplex/simplex_solver_settings.hpp, cpp/src/mip_heuristics/solver.cu
benchmark_info_t adds three root LP metric fields (root_lp_no_cuts, root_lp_with_cuts, cut_generation_time_sec); simplex_solver_settings_t and branch-and-bound settings forward a non-owning benchmark_info_ptr.
Branch-and-bound root LP and timing publication
cpp/src/branch_and_bound/branch_and_bound.cpp
Root LP objectives are published before and after the cut loop; cut-generation elapsed time is recorded on all exit paths (root integer, cut-loop early return, post-loop completion).
MIPLIB optimum catalog and gap-stat printer
benchmarks/linear_programming/cuopt/miplib2017_bks.hpp
New header supplies instance name normalization, MIPLIB 2017 best-known-solution and infeasible-set lookups, and print_miplib_gap_stat template for formatted per-instance gap reporting with conditional metrics based on optimum availability.
run_mip benchmark reporting and execution path
benchmarks/linear_programming/cuopt/run_mip.cpp
Integrates MIPLIB gap-stat printing after each solve; refactors the single-run invocation path through a run_single lambda to unify GPU/RMM device-resource configuration.

Clique table storage and cut-generation refactor

Layer / File(s) Summary
CSR clique storage contracts and configuration
cpp/src/mip_heuristics/presolve/conflict_graph/clique_table.cuh
clique_config_t adds extension work budgets (min_extend_work, max_extend_work); new csr_var_map_t<i_t> template provides CSR-backed per-variable slice maps with finalization, binary-search, and sizing; clique_table_t refactors to CSR adjacency members and updates const-correctness and copy/move semantics.
Clique build and extension implementation
cpp/src/mip_heuristics/presolve/conflict_graph/clique_table.cu
Knapsack normalization drops external set-packing bookkeeping; remove_small_cliques accumulates and finalizes edge-based CSR; get_adj_set_of_var and check_adjacency become const methods probing CSR slices; extend_clique uses work accounting; extend_cliques refactored to work-budget scheduling with signal_extend gating; find_initial_cliques always generates base cliques and gates extension via the new budget model.
Clique cut construction and generation validation
cpp/src/cuts/cuts.cpp, cpp/src/cuts/cuts.hpp, cpp/tests/mip/cuts_test.cu
build_clique_cut switches to two-pass complement-pair detection with distinct infeasibility and fixing-cut logic; work estimates account for adjacency scan cost; clique generation uses clique_table_->empty() and relaxes assertions to allow complement neighbors; test updates align vertex counting with CSR storage.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Suggested reviewers

  • yuwenchen95
  • nguidotti
  • rgsl888prabhu
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 15.00% 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 changes: fixing an adjacency-list bug and improving clique cut generation, which align with the key improvements described in the PR objectives.
Description check ✅ Passed The description is directly related to the changeset, detailing the bug fix for adjacency-list checking, improvements to clique cut construction, and providing benchmark evidence of the changes' impact.
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

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Infer (1.2.0)
cpp/src/branch_and_bound/branch_and_bound.cpp

cpp/src/branch_and_bound/branch_and_bound.cpp:8:10: fatal error: 'branch_and_bound/branch_and_bound.hpp' file not found
8 | #include <branch_and_bound/branch_and_bound.hpp>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Error: the following clang command did not run successfully:
/opt/infer-linux-x86_64-v1.2.0/lib/infer/facebook-clang-plugins/clang/install/bin/clang-18
@/tmp/coderabbit-infer/dd694852d8b25cf32475bd89f4c50fcd4cd009f3-df26eec8343bec84/tmp/clang_command_.tmp.b598df.txt
++Contents of '/tmp/coderabbit-infer/dd694852d8b25cf32475bd89f4c50fcd4cd009f3-df26eec8343bec84/tmp/clang_command_.tmp.b598df.txt':
"-cc1" "-load"
"/opt/infer-linux-x86_64-v1.2.0/lib/infer/infer/bin/../../facebook-clang-plugins/libtooling/build/FacebookClangPlugin.dylib"
"-add-plugin" "BiniouASTExporter" "-plugin-arg-BiniouASTExporter" "-"
"-plugin-arg-BiniouASTExporter" "PREPEND_CURRENT_DIR=1"
"-plugin-arg-BiniouASTExporter" "MAX_STRING_SIZE=6553

... [truncated 1187 characters] ...

nclude"
"-internal-isystem" "/usr/local/include" "-internal-isystem"
"/usr/lib/gcc/x86_64-linux-gnu/12/../../../../x86_64-linux-gnu/include"
"-internal-externc-isystem" "/usr/include/x86_64-linux-gnu"
"-internal-externc-isystem" "/include" "-internal-externc-isystem"
"/usr/include" "-Wno-ignored-optimization-argument" "-Wno-everything"
"-fdeprecated-macro" "-ferror-limit" "19" "-fgnuc-version=4.2.1"
"-fskip-odr-check-in-gmf" "-fcxx-exceptions" "-fexceptions"
"-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-o"
"/tmp/coderabbit-infer/df26eec8343bec84/file.o" "-x" "c++"
"cpp/src/branch_and_bound/branch_and_bound.cpp" "-O0" "-fno-builtin"
"-include"
"/opt/infer-linux-x86_64-v1.2.0/lib/infer/infer/bin/../lib/clang_wrappers/global_defines.h"
"-Wno-everything"

cpp/src/cuts/cuts.cpp

cpp/src/cuts/cuts.cpp:8:10: fatal error: 'cuts/cuts.hpp' file not found
8 | #include <cuts/cuts.hpp>
| ^~~~~~~~~~~~~~~
1 error generated.
Error: the following clang command did not run successfully:
/opt/infer-linux-x86_64-v1.2.0/lib/infer/facebook-clang-plugins/clang/install/bin/clang-18
@/tmp/coderabbit-infer/dd694852d8b25cf32475bd89f4c50fcd4cd009f3-db36d002eda10a2d/tmp/clang_command_.tmp.8bdb87.txt
++Contents of '/tmp/coderabbit-infer/dd694852d8b25cf32475bd89f4c50fcd4cd009f3-db36d002eda10a2d/tmp/clang_command_.tmp.8bdb87.txt':
"-cc1" "-load"
"/opt/infer-linux-x86_64-v1.2.0/lib/infer/infer/bin/../../facebook-clang-plugins/libtooling/build/FacebookClangPlugin.dylib"
"-add-plugin" "BiniouASTExporter" "-plugin-arg-BiniouASTExporter" "-"
"-plugin-arg-BiniouASTExporter" "PREPEND_CURRENT_DIR=1"
"-plugin-arg-BiniouASTExporter" "MAX_STRING_SIZE=65535" "-cc1" "-triple"
"x86_64-unknown-linux-gnu" "-emit-obj" "-mrelax-all" "-disable-free"

... [truncated 1047 characters] ...

clang/install/lib/clang/18/include"
"-internal-isystem" "/usr/local/include" "-internal-isystem"
"/usr/lib/gcc/x86_64-linux-gnu/12/../../../../x86_64-linux-gnu/include"
"-internal-externc-isystem" "/usr/include/x86_64-linux-gnu"
"-internal-externc-isystem" "/include" "-internal-externc-isystem"
"/usr/include" "-Wno-ignored-optimization-argument" "-Wno-everything"
"-fdeprecated-macro" "-ferror-limit" "19" "-fgnuc-version=4.2.1"
"-fskip-odr-check-in-gmf" "-fcxx-exceptions" "-fexceptions"
"-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-o"
"/tmp/coderabbit-infer/db36d002eda10a2d/file.o" "-x" "c++"
"cpp/src/cuts/cuts.cpp" "-O0" "-fno-builtin" "-include"
"/opt/infer-linux-x86_64-v1.2.0/lib/infer/infer/bin/../lib/clang_wrappers/global_defines.h"
"-Wno-everything"

benchmarks/linear_programming/cuopt/run_mip.cpp

In file included from benchmarks/linear_programming/cuopt/run_mip.cpp:9:
benchmarks/linear_programming/cuopt/miplib2017_bks.hpp:31:10: fatal error: 'format' file not found
31 | #include
| ^~~~~~~~
1 error generated.
benchmarks/linear_programming/cuopt/run_mip.cpp:294:3-10: ERROR translating statement 'ReturnStmt'
Aborting translation of method 'run_single_file' in file 'benchmarks/linear_programming/cuopt/run_mip.cpp': "Assert_failure src/clang/cAst_utils.ml:249:53"
Uncaught Internal Error: "Assert_failure src/clang/cAst_utils.ml:249:53"
Error backtrace:
Raised at ClangFrontend__CAst_utils.get_decl_from_typ_ptr in file "src/clang/cAst_utils.ml", line 249, characters 53-65
Called from ClangFrontend__CTrans.CTrans_funct.get_destructor_decl_ref in file "src/clang/cTrans.ml", line 658, characters 12-59
Called from ClangFrontend__CTrans.CTrans_funct.destructor_calls.(fun) in file "src/clang/cTrans.ml", line 2048, characters 12-69
Called from Base__List.rev_filter_

... [truncated 2200 characters] ...

-50
Called from ClangFrontend__CTrans.CTrans_funct.instruction_log.(fun) in file "src/clang/cTrans.ml", line 4784, characters 10-1023
Called from ClangFrontend__CTrans.CTrans_funct.instruction in file "src/clang/cTrans.ml" (inlined), line 4765, characters 38-71
Called from ClangFrontend__CTrans.CTrans_funct.exec_with_node_creation in file "src/clang/cTrans.ml" (inlined), line 104, characters 20-38
Called from ClangFrontend__CTrans.CTrans_funct.get_clang_stmt_trans in file "src/clang/cTrans.ml" (inlined), line 5395, characters 4-69
Called from ClangFrontend__CTrans.CTrans_funct.get_custom_stmt_trans in file "src/clang/cTrans.ml", line 5401, characters 8-55
Called from ClangFrontend__CTrans.CTrans_funct.exec_trans_instrs.exec_trans_instrs_rev in file "src/clang/cTrans.ml" (inlined), line 536


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

@akifcorduk

Copy link
Copy Markdown
Contributor Author

@coderabbitai help

@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

CodeRabbit commands

These commands are invoked using PR/Issue comments.

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai rate limit to show your current review rate limit status.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai evaluate custom pre-merge check --instructions <custom-checks-instructions> --name <custom-checks-title> [--mode <error|warning>] to validate the custom pre-merge checks instructions. Defaults to error when --mode is omitted.
  • @coderabbitai ignore pre-merge checks to override pre-merge checks and get an approval on PR.
  • @coderabbitai run pre-merge checks to run pre-merge checks on the pull request.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai emit path instructions to emit generated path-specific review instructions for this repository.
  • @coderabbitai resolve merge conflict to automatically resolve merge conflicts.
  • @coderabbitai autofix to automatically fix issues identified in unresolved review comments.
  • @coderabbitai resolve to resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai generate configuration to create a PR that adds the current resolved configuration as .coderabbit.yaml (or show it if already present).
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, support, documentation and community

  • Visit our status page to check the current availability of CodeRabbit.
  • Create a ticket on our support page for assistance with any issues or questions.
  • Visit our documentation site for detailed information on how to use CodeRabbit.
  • Join our Discord community to connect with other users and get help from the community.
  • Follow us on X/Twitter for updates and announcements.

@akifcorduk

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@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: 4

🤖 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 `@benchmarks/linear_programming/cuopt/miplib2017_optima.hpp`:
- Line 25: Replace the lone "`#pragma` once" in the header with a traditional
include guard: remove "`#pragma` once", add an `#ifndef` / `#define` pair using a
unique uppercase macro (e.g.
BENCHMARKS_LINEAR_PROGRAMMING_CUOPT_MIPLIB2017_OPTIMA_HPP) at the top of the
file and close with a matching `#endif` with a trailing comment at the end of the
file; ensure the macro name matches the header (miplib2017_optima.hpp) and is
unique across the repo.

In `@cpp/include/cuopt/linear_programming/mip/solver_settings.hpp`:
- Around line 33-40: The comment incorrectly says the stored LP values are in
the "solver objective sense" which encourages mixing objective spaces; update
the text to state that root_lp_no_cuts and root_lp_with_cuts are published via
compute_user_objective(...) (see branch_and_bound.cpp) and therefore represent
user-space/objective values compatible with MIPLIB comparisons; replace the
phrase "in B&B's solver objective sense" with wording that they are user-space
objectives (or already converted by compute_user_objective) and clarify
quiet_NaN() meaning remains the same.

In `@cpp/src/mip_heuristics/presolve/conflict_graph/clique_table.cuh`:
- Around line 83-95: csr_var_map_t's slice helpers can compute pointers into an
empty indices vector causing UB; change slice_begin(i_t v) and slice_end(i_t v)
to first check if indices.empty() and return nullptr when empty, and update
slice_contains(i_t v, i_t value) to treat a nullptr range as empty (return
false) before calling std::binary_search; keep avg_slice_size() as-is. Also
ensure callers like fill_var_clique_maps / finalize_from_unsorted_pairs /
get_adj_set_of_var / check_adjacency rely on slice_contains or handle a nullptr
range as an empty slice.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 9be46e1d-b244-43be-ae7b-4ad7221fb149

📥 Commits

Reviewing files that changed from the base of the PR and between d6d6f9e and 98b1ee2.

📒 Files selected for processing (12)
  • benchmarks/linear_programming/cuopt/miplib2017_optima.hpp
  • benchmarks/linear_programming/cuopt/run_mip.cpp
  • cpp/include/cuopt/linear_programming/mip/solver_settings.hpp
  • cpp/src/branch_and_bound/branch_and_bound.cpp
  • cpp/src/cuts/cuts.cpp
  • cpp/src/cuts/cuts.hpp
  • cpp/src/dual_simplex/simplex_solver_settings.hpp
  • cpp/src/mip_heuristics/presolve/conflict_graph/clique_table.cu
  • cpp/src/mip_heuristics/presolve/conflict_graph/clique_table.cuh
  • cpp/src/mip_heuristics/solver.cu
  • cpp/src/utilities/omp_helpers.hpp
  • cpp/tests/mip/cuts_test.cu

Comment thread benchmarks/linear_programming/cuopt/miplib2017_optima.hpp Outdated
Comment thread cpp/include/cuopt/linear_programming/mip/solver_settings.hpp
Comment thread cpp/src/mip_heuristics/presolve/conflict_graph/clique_table.cuh Outdated

@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: 1

🧹 Nitpick comments (1)
cpp/src/utilities/omp_helpers.hpp (1)

31-31: ⚡ Quick win

Remove redundant include.

<utility> is already included unconditionally at line 11, so the guarded include here is redundant.

♻️ Proposed fix
 `#include` <omp.h>
 `#include` <memory>
-#include <utility>
 
 namespace cuopt {
🤖 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/utilities/omp_helpers.hpp` at line 31, Remove the redundant guarded
include of <utility> in omp_helpers.hpp — the header is already included
unconditionally earlier (the "`#include` <utility>" at the top), so delete the
second "`#include` <utility>" occurrence to avoid duplication and keep includes
clean.
🤖 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/src/branch_and_bound/branch_and_bound.cpp`:
- Around line 2680-2692: The current lambda publish_cut_generation_time
overwrites the measured cut_generation_time with settings_.time_limit whenever
the measured time exceeds the global solver time limit, which overreports
because cut_generation_start_time is taken after earlier solver work; change the
logic so you only force-set cut_generation_time to settings_.time_limit when
force_time_limit_value is true (remove or tighten the condition "||
cut_generation_time > settings_.time_limit"), leaving the actual measured
cut_generation_time otherwise; apply the same change to the analogous code at
the other location (the block around the lines referenced 2743-2745) and keep
references to publish_cut_generation_time, cut_generation_start_time,
force_time_limit_value, and settings_.time_limit.

---

Nitpick comments:
In `@cpp/src/utilities/omp_helpers.hpp`:
- Line 31: Remove the redundant guarded include of <utility> in omp_helpers.hpp
— the header is already included unconditionally earlier (the "`#include`
<utility>" at the top), so delete the second "`#include` <utility>" occurrence to
avoid duplication and keep includes clean.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 7f53375c-0094-41f7-8499-7263553edbda

📥 Commits

Reviewing files that changed from the base of the PR and between d6d6f9e and 98b1ee2.

📒 Files selected for processing (12)
  • benchmarks/linear_programming/cuopt/miplib2017_optima.hpp
  • benchmarks/linear_programming/cuopt/run_mip.cpp
  • cpp/include/cuopt/linear_programming/mip/solver_settings.hpp
  • cpp/src/branch_and_bound/branch_and_bound.cpp
  • cpp/src/cuts/cuts.cpp
  • cpp/src/cuts/cuts.hpp
  • cpp/src/dual_simplex/simplex_solver_settings.hpp
  • cpp/src/mip_heuristics/presolve/conflict_graph/clique_table.cu
  • cpp/src/mip_heuristics/presolve/conflict_graph/clique_table.cuh
  • cpp/src/mip_heuristics/solver.cu
  • cpp/src/utilities/omp_helpers.hpp
  • cpp/tests/mip/cuts_test.cu

Comment thread cpp/src/branch_and_bound/branch_and_bound.cpp Outdated
@ramakrishnap-nv
ramakrishnap-nv removed request for a team and ramakrishnap-nv June 4, 2026 14:51
@akifcorduk

Copy link
Copy Markdown
Contributor Author

/ok to test

@copy-pr-bot

copy-pr-bot Bot commented Jun 5, 2026

Copy link
Copy Markdown

/ok to test

@akifcorduk, there was an error processing your request: E1

See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/1/

@akifcorduk

Copy link
Copy Markdown
Contributor Author

/ok to test b3e0eef

@akifcorduk

Copy link
Copy Markdown
Contributor Author

/ok to test bd4228d

@aliceb-nv aliceb-nv 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.

LGTM, thanks a ton Akif! Only minor nits :)

f_t cut_generation_start_time = tic();
i_t cut_pool_size = 0;
f_t cut_generation_start_time = tic();
auto publish_cut_generation_time = [&](bool force_time_limit_value = false) {

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.

Couldn't we get away with just storing the starting time and ending time of cuts? If anyone queries the current cut time while we're in the middle of the cut loop, it's just a matter of doing return toc(start_time) instead of return end_time

But agreed, definitely useful!

Comment on lines +2697 to +2700
if (settings_.benchmark_info_ptr != nullptr) {
settings_.benchmark_info_ptr->root_lp_with_cuts =
static_cast<double>(compute_user_objective(original_lp_, root_objective_));
}

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.

Is there any scenario where benchmark_info_ptr != nullptr? We're just computing simple scalars, I think it'd make the code easier to read if it was just a regular reference / non-null ptr

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.

Also nit but I tend to prefer implicit casts / C-style casts for non-critical things :) static_cast(...) is kinda harder to read

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.

The lambda encapsulates the logic of cut time and writing to benchmark info together. But okay let me remove the lambda and handle it on return blocks.

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.

In production code, it benchmark_info_ptr != nullptr doesn't happen but it happens when we run benchmark with run_mip. I think it is irrelevant to the user and I wanted to separate it from the rest of the user settings.

For the cast, AI did the cast, I also prefer C style casts for simple static casts. Will corrrect it.

Comment thread cpp/src/cuts/cuts.cpp Outdated
Comment on lines +313 to +314
for (const i_t* it = var_clique_first.slice_begin(var_idx);
it != var_clique_first.slice_end(var_idx);

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.

Very minor nit: maybe we could have the returned slice be represented as std::span<> (or a custom type with begin() and end()0, so that we can use range-for loops directly

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.

Good idea thanks!

Comment thread benchmarks/linear_programming/cuopt/miplib2017_optima.hpp Outdated
Comment thread cpp/src/utilities/omp_helpers.hpp
Comment thread benchmarks/linear_programming/cuopt/miplib2017_optima.hpp Outdated
f_t cut_generation_start_time = tic();
i_t cut_pool_size = 0;
f_t cut_generation_start_time = tic();
auto publish_cut_generation_time = [&](bool force_time_limit_value = false) {

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.

Most of these information is available in the logs, no? You only need the benchmark_info struct to pass to the run_mip file, right?

@nguidotti

Copy link
Copy Markdown
Contributor

Mostly nitpicks. Thanks, Akif!

@akifcorduk

Copy link
Copy Markdown
Contributor Author

Most of these information is available in the logs, no? You only need the benchmark_info struct to pass to the run_mip file, right?
@nguidotti
I run with debug logs to debug heuristics and size become huge. So I can't download/process logs easily. That's why for much repeated stats, I implemented the benchmark_info struct.

@akifcorduk

Copy link
Copy Markdown
Contributor Author

/ok to test dd69485

@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: 1

🤖 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 `@benchmarks/linear_programming/cuopt/miplib2017_bks.hpp`:
- Line 25: Replace the single-line "`#pragma` once" with a traditional include
guard: remove the pragma, add a unique macro guard name (e.g., use
BENCHMARKS_LINEAR_PROGRAMMING_CUOPT_MIPLIB2017_BKS_HPP or MIPLIB2017_BKS_HPP)
with an `#ifndef` / `#define` pair at the top of the header and a matching `#endif`
comment at the end of the file to close the guard; ensure the macro name is
all-caps and matches exactly in both places.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 8529a91c-32fb-483d-bb7c-5baf24f770e8

📥 Commits

Reviewing files that changed from the base of the PR and between bd4228d and dd69485.

📒 Files selected for processing (7)
  • benchmarks/linear_programming/cuopt/miplib2017_bks.hpp
  • benchmarks/linear_programming/cuopt/run_mip.cpp
  • cpp/src/branch_and_bound/branch_and_bound.cpp
  • cpp/src/cuts/cuts.cpp
  • cpp/src/mip_heuristics/presolve/conflict_graph/clique_table.cu
  • cpp/src/mip_heuristics/presolve/conflict_graph/clique_table.cuh
  • cpp/src/utilities/omp_helpers.hpp
🚧 Files skipped from review as they are similar to previous changes (5)
  • benchmarks/linear_programming/cuopt/run_mip.cpp
  • cpp/src/utilities/omp_helpers.hpp
  • cpp/src/cuts/cuts.cpp
  • cpp/src/mip_heuristics/presolve/conflict_graph/clique_table.cuh
  • cpp/src/mip_heuristics/presolve/conflict_graph/clique_table.cu

Comment thread benchmarks/linear_programming/cuopt/miplib2017_bks.hpp
@akifcorduk

Copy link
Copy Markdown
Contributor Author

/merge

@rapids-bot
rapids-bot Bot merged commit ef55301 into NVIDIA:main Jun 9, 2026
98 checks passed
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.

3 participants