Skip to content

Make Xcode 26.6 happy. Move HMW destructor to .cpp - #3228

Open
Opt-Mucca wants to merge 1 commit into
latestfrom
move-hmw-destructor-scope
Open

Make Xcode 26.6 happy. Move HMW destructor to .cpp#3228
Opt-Mucca wants to merge 1 commit into
latestfrom
move-hmw-destructor-scope

Conversation

@Opt-Mucca

Copy link
Copy Markdown
Collaborator

Description

Moves HighsMipWorker destructor from HighsMipWorker.h to HighsMipWorker.cpp. Destroying the std::unique_pointer to HighsSearch apparently needs more than a forward declaration for Xcode 26.6.

Checklist

  • I have read the contributing guidelines
  • This PR targets the latest branch
  • Tests are passing
  • Documentation was updated where relevant
  • This PR is not primarily AI-generated (per the AI contributions policy in CONTRIBUTING.md)

Closes #3227

@Opt-Mucca
Opt-Mucca requested a review from filikat August 24, 2026 12:35
@Opt-Mucca Opt-Mucca self-assigned this Aug 24, 2026
@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.20%. Comparing base (1945ea8) to head (a555cb6).
⚠️ Report is 19 commits behind head on latest.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@filikat filikat left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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."

@Opt-Mucca

Copy link
Copy Markdown
Collaborator Author

@mathgeekcoder If I'm understanding the failing test correctly, then I think HiGHS is solving the instance too quickly and the isRunning check is against an already solved instance?

@mathgeekcoder

Copy link
Copy Markdown
Collaborator

@mathgeekcoder If I'm understanding the failing test correctly, then I think HiGHS is solving the instance too quickly and the isRunning check is against an already solved instance?

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()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants