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.17% 73.20% +0.02%
==========================================
Files 445 445
Lines 107802 107878 +76
Branches 17258 17277 +19
==========================================
+ Hits 78887 78968 +81
+ Misses 28639 28634 -5
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() |
Description
Moves
HighsMipWorkerdestructor fromHighsMipWorker.htoHighsMipWorker.cpp. Destroying thestd::unique_pointertoHighsSearchapparently needs more than a forward declaration forXcode 26.6.Checklist
latestbranchCloses #3227