Make Xcode 26.6 happy. Move HMW destructor to .cpp - #3228
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## latest #3228 +/- ##
==========================================
- Coverage 73.22% 73.20% -0.02%
==========================================
Files 445 445
Lines 107826 107878 +52
Branches 17262 17277 +15
==========================================
+ Hits 78951 78968 +17
- Misses 28599 28634 +35
Partials 276 276 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Great!
This was undefined behaviour before. From https://en.cppreference.com/cpp/memory/unique_ptr: "unique_ptr may be constructed for an incomplete type T[...]. If the default deleter is used, T must be complete at the point in code where the deleter is invoked, which happens in the [...] reset member function of unique_ptr."
|
@mathgeekcoder If I'm understanding the failing test correctly, then I think HiGHS is solving the instance too quickly and the |
Yeah, unfortunately I believe that's the case. Honestly, it's a bit of a hacky test (not my proudest work). We can either hack it (by increasing N to make the problem harder) or add forced delay via a callback handler (e.g., simplexInterrupt). e.g., something like def test_solver_running_state(self):
# build model as before (removed for brevity)
entered = threading.Event() # solver thread reached the callback
release = threading.Event() # test tells solver it may continue
def hold(e, data):
entered.set()
release.wait(timeout=30) # bounded delay, don't hang CI
h.HandleUserInterrupt = True
h.cbSimplexInterrupt.subscribe(hold)
h.startSolve()
self.assertTrue(entered.wait(timeout=30), "solver never reached callback")
self.assertTrue(h.is_solver_running()) # solver is still inside hold()
release.set() # solver can exit hold()
h.cancelSolve()
h.wait() |
|
@mathgeekcoder I'm happy with that suggested change! I like it more than just increasing |
Wonderful. I'm happy either way! Though, earliest I can get to this will be next week. If you choose to add it here, I can likely help review before then. |
|
@mathgeekcoder we do a separate PR. No stress on the timing. I'm still not 100% confident on doing anything more than copying the suggestion for now (need to take the time to get more invested in |
Description
Moves
HighsMipWorkerdestructor fromHighsMipWorker.htoHighsMipWorker.cpp. Destroying thestd::unique_pointertoHighsSearchapparently needs more than a forward declaration forXcode 26.6.Checklist
latestbranchCloses #3227