Skip to content

Fix by-reference capture of local variable in solve.cu#1214

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

Fix by-reference capture of local variable in solve.cu#1214
rapids-bot[bot] merged 1 commit into
mainfrom
mlubin-patch-1

Conversation

@mlubin
Copy link
Copy Markdown
Contributor

@mlubin mlubin commented May 14, 2026

early_fj_start is a local variable and should be captured by value since the callback outlives the local scope.

early_fj_start is a local variable and should be captured by value since the callback outlives the local scope.
@mlubin mlubin requested a review from hlinsen May 14, 2026 01:07
@mlubin mlubin requested a review from a team as a code owner May 14, 2026 01:07
@mlubin mlubin added the bug Something isn't working label May 14, 2026
@mlubin mlubin requested a review from aliceb-nv May 14, 2026 01:07
@mlubin mlubin added the non-breaking Introduces a non-breaking change label 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: 1a1f6739-5795-4c81-8a3b-803e707ce5bc

📥 Commits

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

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

📝 Walkthrough

Walkthrough

The MIP solving helper updates a lambda capture in early_fj_callback to capture early_fj_start by value instead of by reference, preventing potential lifetime issues when the callback executes asynchronously or after the referenced variable scope ends.

Changes

Lambda Capture Mode Update

Layer / File(s) Summary
Early feedback callback variable capture
cpp/src/mip_heuristics/solve.cu
The early_fj_callback lambda's capture of early_fj_start is changed from reference (&early_fj_start) to value (early_fj_start) to ensure safe lifetime handling.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 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 clearly and specifically describes the main change: fixing a by-reference capture issue with a local variable in solve.cu, which matches the actual code modification.
Description check ✅ Passed The description is directly related to the changeset, explaining the rationale for the fix by noting that early_fj_start is a local variable that should be captured by value since the callback outlives the local scope.
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-1

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 9cef2f0 into main May 14, 2026
209 of 211 checks passed
@mlubin mlubin deleted the mlubin-patch-1 branch May 14, 2026 14:30
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