Skip to content

Fix objective weight initialization lifetime - #2200

Merged
rapids-bot[bot] merged 1 commit into
NVIDIA:mainfrom
mlubin:fix/objective-weight-lifetime
Oct 23, 2026
Merged

rapids-bot[bot] merged 1 commit into
NVIDIA:mainfrom
mlubin:fix/objective-weight-lifetime

Conversation

@mlubin

@mlubin mlubin commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

one could go out of scope before set_value_async completes.

@mlubin
mlubin requested a review from a team as a code owner October 22, 2026 19:08
@mlubin mlubin added bug Something isn't working non-breaking Introduces a non-breaking change labels Oct 22, 2026
@copy-pr-bot

copy-pr-bot Bot commented Oct 22, 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.

@mlubin

mlubin commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 85e5024

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Source mode: Auto
  • Repository: NVIDIA/cuopt
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: e90d6c6
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: 44c63a2b-a264-4504-a9a8-0cffdb410e05
📥 Commits

Reviewing files that changed from the base of the PR and between 85e5024 and 07b22c2.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: NVIDIA/cuopt
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: 5e98de7
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: 33052df5-8023-4f95-9493-de0b159bfa9c
📥 Commits

Reviewing files that changed from the base of the PR and between 5e98de7 and 85e5024.

📒 Files selected for processing: 1
  • cpp/src/mip_heuristics/diversity/weights.cuh

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

📝 Walkthrough

The weight constructor now initializes objective_weight with cuopt::one_v<f_t>. Constraint weights are still filled with 1.0.

Changes: Weight initialization

Layer / File(s) Summary
Initialize objective weight
cpp/src/mip_heuristics/diversity/weights.cuh
The header includes device_scalar_init.hpp. The constructor initializes objective_weight with cuopt::one_v<f_t> instead of assigning 1.0 asynchronously after default construction. Constraint weight filling is unchanged.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: chris-maes

Merge Risk: ⚪ Minimal · up to 85e50

The objective-weight lifetime issue is fixed, and no merge-blocking defect was identified.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly identifies the main change: fixing the lifetime issue during objective weight initialization.
Description check Passed The description directly explains the lifetime problem addressed by the changeset.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

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

Thanks Miles!

Signed-off-by: Miles Lubin <mlubin@nvidia.com>
@mlubin
mlubin force-pushed the fix/objective-weight-lifetime branch from 85e5024 to 07b22c2 Compare October 22, 2026 20:19
@mlubin

mlubin commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 07b22c2

@github-actions

Copy link
Copy Markdown

CI Test Summary

✅ All 21 test job(s) passed.

@mlubin

mlubin commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

/merge

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

Labels

bug Something isn't working non-breaking Introduces a non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants