Skip to content

Expose various additional HiGHS features#33

Merged
lovasoa merged 6 commits intorust-or:mainfrom
chrjabs:scuttle
Dec 14, 2025
Merged

Expose various additional HiGHS features#33
lovasoa merged 6 commits intorust-or:mainfrom
chrjabs:scuttle

Conversation

@chrjabs
Copy link
Contributor

@chrjabs chrjabs commented Dec 12, 2025

I've been using this crate in a project I'm working on, and I ran into some functionality I required from HiGHS that this crate was not exposing yet. This is a random collection of different things, but the commits should be reasonably logically split, I think. Let me know if you want me to break this out into separate PRs.

Copy link
Contributor

@lovasoa lovasoa left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution ! Could you add tests, including for edge cases/concurrency scenarios, and safety comments above the unsafe blocks explaining the reasoning of why they are safe ?

I'm a little bit scared of merging potential undefined behavior

src/callback.rs Outdated
_ctx: CbCtxMipDefineLazyConstraints,
})
}
_ => unreachable!(),
Copy link
Contributor

Choose a reason for hiding this comment

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

can we add an explicit message about what went wrong here ?

src/callback.rs Outdated
Comment on lines +5 to +9
/// User callbacks while solving
pub trait Callback {
/// The main callback routine
fn callback(&mut self, context: CallbackOuterContext<'_>) -> CallbackReturn;
}
Copy link
Contributor

@lovasoa lovasoa Dec 12, 2025

Choose a reason for hiding this comment

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

Could we handle the state saving and passing logic internally so that the rust user can just pass an Fn() (or even an FnMut if that's safe in highs) ?

@chrjabs
Copy link
Contributor Author

chrjabs commented Dec 12, 2025

Thanks for the feedback. Your comments seem to mainly be about the callback commit. Would it make sense to split that change out into a separate PR, since it's the biggest change with the most design decisions?
For the other smaller things I can add a couple of basic test cases and then this could probably get merged faster.

@lovasoa
Copy link
Contributor

lovasoa commented Dec 12, 2025

Yes, good, let's do that !

@chrjabs
Copy link
Contributor Author

chrjabs commented Dec 12, 2025

Alright, tests are done, I'll open another draft PR for the callbacks.

@lovasoa lovasoa merged commit 6de4748 into rust-or:main Dec 14, 2025
2 checks passed
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.

2 participants