Fix race condition in RINS and lost nodes in branch and bound#1138
Fix race condition in RINS and lost nodes in branch and bound#1138hlinsen wants to merge 4 commits intoNVIDIA:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughBranch-and-bound plunge loop now marks and requeues pending nodes when LP returns concurrency/iteration limits. RINS gains a destructor, an incumbent-solution snapshot, and tightened thread synchronization: node callbacks, enable/stop, and run logic are reworked to use mutex-protected state and snapshots. ChangesBranch-and-bound LP limit handling
RINS thread lifecycle & snapshotting
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
cpp/src/branch_and_bound/branch_and_bound.cpp (1)
1485-1492: Optional cleanup: merge identical limit branches.Both status branches perform the same operations; collapsing them reduces maintenance drift.
♻️ Proposed simplification
- } else if (lp_status == dual::status_t::CONCURRENT_LIMIT) { - stack.push_front(node_ptr); - requeue_pending_nodes = true; - break; - } else if (lp_status == dual::status_t::ITERATION_LIMIT) { + } else if (lp_status == dual::status_t::CONCURRENT_LIMIT || + lp_status == dual::status_t::ITERATION_LIMIT) { stack.push_front(node_ptr); requeue_pending_nodes = true; break; }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@cpp/src/branch_and_bound/branch_and_bound.cpp` around lines 1485 - 1492, The two consecutive branches checking lp_status == dual::status_t::CONCURRENT_LIMIT and lp_status == dual::status_t::ITERATION_LIMIT perform identical actions; collapse them into a single condition to avoid duplication. Replace the two else-if blocks with a single branch that checks if lp_status is either dual::status_t::CONCURRENT_LIMIT or dual::status_t::ITERATION_LIMIT, then call stack.push_front(node_ptr), set requeue_pending_nodes = true, and break; referencing the existing lp_status variable and the stack.push_front(node_ptr)/requeue_pending_nodes/break sequence.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@cpp/src/branch_and_bound/branch_and_bound.cpp`:
- Around line 1485-1492: The two consecutive branches checking lp_status ==
dual::status_t::CONCURRENT_LIMIT and lp_status ==
dual::status_t::ITERATION_LIMIT perform identical actions; collapse them into a
single condition to avoid duplication. Replace the two else-if blocks with a
single branch that checks if lp_status is either
dual::status_t::CONCURRENT_LIMIT or dual::status_t::ITERATION_LIMIT, then call
stack.push_front(node_ptr), set requeue_pending_nodes = true, and break;
referencing the existing lp_status variable and the
stack.push_front(node_ptr)/requeue_pending_nodes/break sequence.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: a1bddad0-abbf-4409-901c-017c5fabffd6
📒 Files selected for processing (3)
cpp/src/branch_and_bound/branch_and_bound.cppcpp/src/mip_heuristics/diversity/lns/rins.cucpp/src/mip_heuristics/diversity/lns/rins.cuh
nguidotti
left a comment
There was a problem hiding this comment.
Looks good to me! Thanks for the fix, Hugo.
Attempt at fixing a rare benchmark bug on H100.
Fixes:
rins::node_callbackandrins::stop