Skip to content

Main merge release/26.06.02#1281

Merged
rgsl888prabhu merged 2 commits into
NVIDIA:mainfrom
rgsl888prabhu:main-merge-release/26.06.02
May 21, 2026
Merged

Main merge release/26.06.02#1281
rgsl888prabhu merged 2 commits into
NVIDIA:mainfrom
rgsl888prabhu:main-merge-release/26.06.02

Conversation

@rgsl888prabhu
Copy link
Copy Markdown
Collaborator

For #1280

rgsl888prabhu and others added 2 commits May 21, 2026 21:49
…ple init (NVIDIA#1235)

Fix two MAJOR SonarQube bugs on `main`.

- `cpp:S6214` in the MPS parser: `fread()` (size_t) was compared to a `long bufsize`. The earlier `bufsize != -1L` guard only rules out the ftell error sentinel, not other negatives. Switched the equality to `std::cmp_equal` (C++20).
- `c:S836` in the C MILP example: `objective_value` was read by `printf` unconditionally despite being assigned only inside `if (has_primal_solution)`. Moved that read — and the related `solution_values[i]` access a few lines down, which had the same problem (latent NULL deref) — inside the guard.

Authors:
  - Ramakrishnap (https://github.com/rgsl888prabhu)

Approvers:
  - Trevor McKay (https://github.com/tmckayus)
  - Rajesh Gandham (https://github.com/rg20)

URL: NVIDIA#1235
@rgsl888prabhu rgsl888prabhu requested review from a team as code owners May 21, 2026 21:52
@rgsl888prabhu rgsl888prabhu merged commit 2cbef3e into NVIDIA:main May 21, 2026
23 of 25 checks passed
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 21, 2026

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 004ff8ba-a86e-4795-a96f-bb086cbd4780

📥 Commits

Reviewing files that changed from the base of the PR and between 88eccc6 and 6da457e.

📒 Files selected for processing (2)
  • cpp/src/io/mps_parser.cpp
  • docs/cuopt/source/cuopt-c/lp-qp-milp/examples/milp_mps_example.c

📝 Walkthrough

Walkthrough

This PR adds a missing header dependency to the MPS parser and improves robustness in the MILP example code by properly gating solution output on primal solution availability and adding explicit out-of-memory error handling.

Changes

Parser and Example Code Fixes

Layer / File(s) Summary
Utility header dependency
cpp/src/io/mps_parser.cpp
Added #include <utility> to the file's includes.
MILP example solution printing and memory handling
docs/cuopt/source/cuopt-c/lp-qp-milp/examples/milp_mps_example.c
Objective value and solution-values allocation/retrieval moved under has_primal_solution conditional; malloc size cast to size_t; explicit CUOPT_OUT_OF_MEMORY status assignment added on allocation failure; solution variable printing indentation adjusted to match updated control flow.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • NVIDIA/cuopt#1235: Both PRs touch the same two files with identical code-level adjustments: cpp/src/io/mps_parser.cpp adding <utility> and milp_mps_example.c gating objective/solution-value printing and retrieval on has_primal_solution.

Suggested labels

non-breaking, improvement

Suggested reviewers

  • tmckayus
  • rg20
  • mlubin
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.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 describes a merge of a release branch into main, which is related to the changeset but not the specific functional improvements being merged.
Description check ✅ Passed The description references issue #1280 and relates to the commit fixes described in PR objectives, connecting to the changeset.
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 and usage tips.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant