Skip to content

Fix destruction order in solve.cu#1216

Merged
rapids-bot[bot] merged 1 commit into
mainfrom
mlubin-patch-2
May 14, 2026
Merged

Fix destruction order in solve.cu#1216
rapids-bot[bot] merged 1 commit into
mainfrom
mlubin-patch-2

Conversation

@mlubin
Copy link
Copy Markdown
Contributor

@mlubin mlubin commented May 14, 2026

early_cpufj and early_gpufj capture early_best_objective, early_best_user_obj, early_best_user_assignment, and early_callback_mutex by reference via the callbacks. They should be destructed before the values they capture by reference for safety.

early_cpufj and early_gpufj capture early_best_objective, early_best_user_obj, early_best_user_assignment, and early_callback_mutex by reference via the callbacks. They should be destructed before the values they capture by reference for safety.
@mlubin mlubin requested a review from hlinsen May 14, 2026 01:21
@mlubin mlubin requested a review from a team as a code owner May 14, 2026 01:21
@mlubin mlubin requested a review from kaatish May 14, 2026 01:21
@mlubin mlubin added bug Something isn't working non-breaking Introduces a non-breaking change labels May 14, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

Review Change Stack

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: aedc8a16-b0b8-4a99-a241-167bf58e8075

📥 Commits

Reviewing files that changed from the base of the PR and between 20e15cd and e541184.

📒 Files selected for processing (1)
  • cpp/src/mip_heuristics/solve.cu

📝 Walkthrough

Walkthrough

The PR relocates declarations of early_cpufj and early_gpufj in solve_mip_helper within the presolve flow to occur after shared early-incumbent tracking state is initialized. No functional logic changes; variable scope and initialization order are adjusted for improved code organization.

Changes

Early FJ Variable Scope Adjustment

Layer / File(s) Summary
Early FJ object declarations moved after shared state initialization
cpp/src/mip_heuristics/solve.cu
Shared early-incumbent tracking variables (atomic best objective, user-space objective, assignment storage, and mutex) are initialized in the presolve "Start early FJ" section, followed by relocation of early_cpufj_t and early_gpufj_t unique_ptr declarations to a later point in the function, maintaining their use in subsequent run_early_fj logic.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Suggested reviewers

  • hlinsen
🚥 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 'Fix destruction order in solve.cu' is directly related to the main change: relocating variable declarations to ensure proper destruction order of callbacks before their captured references.
Description check ✅ Passed The description clearly explains the rationale for the change: callbacks capture variables by reference and must be destructed before those variables to ensure safety.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch mlubin-patch-2

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

@mlubin
Copy link
Copy Markdown
Contributor Author

mlubin commented May 14, 2026

/merge

@rapids-bot rapids-bot Bot merged commit 64c8e31 into main May 14, 2026
108 checks passed
@mlubin mlubin deleted the mlubin-patch-2 branch May 14, 2026 14:29
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